chiark / gitweb /
sd-bus: remove ucred parameter from bus_message_from_header() since we don't use...
authorLennart Poettering <lennart@poettering.net>
Wed, 10 Jun 2015 13:52:14 +0000 (15:52 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:01:49 +0000 (10:01 +0100)
src/libelogind/sd-bus/bus-kernel.c
src/libelogind/sd-bus/bus-message.c
src/libelogind/sd-bus/bus-message.h
src/libelogind/sd-bus/bus-socket.c
src/libelogind/sd-bus/test-bus-gvariant.c
src/libelogind/sd-bus/test-bus-marshal.c

index 572a9c6..3aaaabf 100644 (file)
@@ -498,7 +498,6 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
                         footer, footer_size,
                         n_bytes,
                         fds, n_fds,
-                        NULL,
                         seclabel, 0, &m);
         if (r < 0)
                 return r;
index 6ee209d..c38b2a5 100644 (file)
@@ -435,7 +435,6 @@ int bus_message_from_header(
                 size_t message_size,
                 int *fds,
                 unsigned n_fds,
-                const struct ucred *ucred,
                 const char *label,
                 size_t extra,
                 sd_bus_message **ret) {
@@ -528,23 +527,6 @@ int bus_message_from_header(
         m->fds = fds;
         m->n_fds = n_fds;
 
-        if (ucred) {
-                m->creds.pid = ucred->pid;
-                m->creds.euid = ucred->uid;
-                m->creds.egid = ucred->gid;
-
-                /* Due to namespace translations some data might be
-                 * missing from this ucred record. */
-                if (m->creds.pid > 0)
-                        m->creds.mask |= SD_BUS_CREDS_PID;
-
-                if (m->creds.euid != UID_INVALID)
-                        m->creds.mask |= SD_BUS_CREDS_EUID;
-
-                if (m->creds.egid != GID_INVALID)
-                        m->creds.mask |= SD_BUS_CREDS_EGID;
-        }
-
         if (label) {
                 m->creds.label = (char*) m + ALIGN(sizeof(sd_bus_message)) + ALIGN(extra);
                 memcpy(m->creds.label, label, label_sz + 1);
@@ -565,7 +547,6 @@ int bus_message_from_malloc(
                 size_t length,
                 int *fds,
                 unsigned n_fds,
-                const struct ucred *ucred,
                 const char *label,
                 sd_bus_message **ret) {
 
@@ -579,7 +560,7 @@ int bus_message_from_malloc(
                         buffer, length,
                         length,
                         fds, n_fds,
-                        ucred, label,
+                        label,
                         0, &m);
         if (r < 0)
                 return r;
index d784e60..088d5b1 100644 (file)
@@ -205,7 +205,6 @@ int bus_message_from_header(
                 size_t message_size,
                 int *fds,
                 unsigned n_fds,
-                const struct ucred *ucred,
                 const char *label,
                 size_t extra,
                 sd_bus_message **ret);
@@ -216,7 +215,6 @@ int bus_message_from_malloc(
                 size_t length,
                 int *fds,
                 unsigned n_fds,
-                const struct ucred *ucred,
                 const char *label,
                 sd_bus_message **ret);
 
index e182cfa..9f3756f 100644 (file)
@@ -888,7 +888,6 @@ static int bus_socket_make_message(sd_bus *bus, size_t size) {
                                     bus->rbuffer, size,
                                     bus->fds, bus->n_fds,
                                     NULL,
-                                    NULL,
                                     &t);
         if (r < 0) {
                 free(b);
index 992edac..22ea00c 100644 (file)
@@ -198,7 +198,7 @@ static void test_marshal(void) {
         }
 #endif
 
-        assert_se(bus_message_from_malloc(bus, blob, sz, NULL, 0, NULL, NULL, &n) >= 0);
+        assert_se(bus_message_from_malloc(bus, blob, sz, NULL, 0, NULL, &n) >= 0);
         blob = NULL;
 
         assert_se(bus_message_dump(n, NULL, BUS_MESSAGE_DUMP_WITH_HEADER) >= 0);
index f8ecadf..a866a56 100644 (file)
@@ -212,7 +212,7 @@ int main(int argc, char *argv[]) {
 
         m = sd_bus_message_unref(m);
 
-        r = bus_message_from_malloc(bus, buffer, sz, NULL, 0, NULL, NULL, &m);
+        r = bus_message_from_malloc(bus, buffer, sz, NULL, 0, NULL, &m);
         assert_se(r >= 0);
 
         bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);