chiark / gitweb /
bus-proxy: don't pretend everyone is root
authorDavid Herrmann <dh.herrmann@gmail.com>
Sun, 18 Jan 2015 20:34:33 +0000 (21:34 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Sun, 18 Jan 2015 20:34:33 +0000 (21:34 +0100)
While it's a lovely scenario, it's probably not really useful. Fix our
GetConnectionUnixUser() to return the actual 'euid' which we asked for,
not the possible uninitialized 'uid'.

src/bus-proxyd/driver.c

index b2a4456..5287ff1 100644 (file)
@@ -256,7 +256,7 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
                 if (r < 0)
                         return synthetic_reply_method_errno(m, r, &error);
 
-                return synthetic_reply_method_return(m, "u", (uint32_t) creds->uid);
+                return synthetic_reply_method_return(m, "u", (uint32_t) creds->euid);
 
         } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetId")) {
                 sd_id128_t server_id;