]> git.pld-linux.org Git - projects/pld-ftp-admin.git/commitdiff
- pid, uid and gid are taken from sendcreds' args
authorMariusz Mazur <mmazur@pld-linux.org>
Sat, 4 Dec 2004 14:16:34 +0000 (14:16 +0000)
committerMariusz Mazur <mmazur@pld-linux.org>
Sat, 4 Dec 2004 14:16:34 +0000 (14:16 +0000)
Changed files:
    ucred/ucred.c -> 1.3

ucred/ucred.c

index 11e0fff67d8bfd8ee2b91541b4f2bcd77d75fe52..59fac3ad7c64321a6e2638c85c86d38bf224a916 100644 (file)
@@ -31,23 +31,32 @@ void initucred(void) {
 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;
This page took 0.029314 seconds and 4 git commands to generate.