chiark / gitweb /
bus-proxy: fake all UIDs/GIDs, not just the real UID/GID
authorDavid Herrmann <dh.herrmann@gmail.com>
Sun, 18 Jan 2015 12:54:46 +0000 (13:54 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Sun, 18 Jan 2015 12:54:46 +0000 (13:54 +0100)
Make sure we tell the kernel to fake all UIDs/GIDs. Otherwise, the remote
side has no chance of querying our effective UID (which is usually what
they're interested in).

src/bus-proxyd/proxy.c

index f7daec68fd7feae920343fd1436699137c9272cc..329188ecf8ef2362126ff33cd527453dff504b01 100644 (file)
@@ -82,13 +82,13 @@ static int proxy_create_dest(Proxy *p, const char *dest, const char *local_sec,
                 b->fake_pids_valid = true;
 
                 b->fake_creds.uid = p->local_creds.uid;
                 b->fake_pids_valid = true;
 
                 b->fake_creds.uid = p->local_creds.uid;
-                b->fake_creds.euid = UID_INVALID;
-                b->fake_creds.suid = UID_INVALID;
-                b->fake_creds.fsuid = UID_INVALID;
+                b->fake_creds.euid = p->local_creds.uid;
+                b->fake_creds.suid = p->local_creds.uid;
+                b->fake_creds.fsuid = p->local_creds.uid;
                 b->fake_creds.gid = p->local_creds.gid;
                 b->fake_creds.gid = p->local_creds.gid;
-                b->fake_creds.egid = GID_INVALID;
-                b->fake_creds.sgid = GID_INVALID;
-                b->fake_creds.fsgid = GID_INVALID;
+                b->fake_creds.egid = p->local_creds.gid;
+                b->fake_creds.sgid = p->local_creds.gid;
+                b->fake_creds.fsgid = p->local_creds.gid;
                 b->fake_creds_valid = true;
         }
 
                 b->fake_creds_valid = true;
         }