static PyObject *ucred_sendcreds(PyObject *self, PyObject *args, PyObject *keywds) {
int fd;
int ret;
+ int pid, uid, gid;
struct msghdr msg;
struct iovec iov[1];
struct ucred uc;
unsigned char control[CMSG_SPACE(sizeof(struct ucred))];
struct cmsghdr *cur;
- static char *kwlist[] = {"fd", NULL};
+ static char *kwlist[] = {"fd",
+ "pid",
+ "uid",
+ "gid",
+ NULL};
// kill(0, SIGTRAP);
- if (!PyArg_ParseTupleAndKeywords(args, keywds, "i", kwlist, &fd)) {
+ if (!PyArg_ParseTupleAndKeywords(args, keywds, "iiii", kwlist,
+ &fd,
+ &pid,
+ &uid,
+ &gid)) {
return NULL;
}
// kill(0, SIGTRAP);
- uc.pid = getpid();
- uc.uid = getuid();
- uc.gid = getgid();
+ uc.pid = pid;
+ uc.uid = uid;
+ uc.gid = gid;
iov[0].iov_base="SCM_CREDENTIALS";
iov[0].iov_len=15;