diff options
Diffstat (limited to 'src/libsystemd/sd-bus/bus-control.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-control.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c index e7e9ba07b0..5548239426 100644 --- a/src/libsystemd/sd-bus/bus-control.c +++ b/src/libsystemd/sd-bus/bus-control.c @@ -379,9 +379,10 @@ static int bus_get_owner_kdbus( cmd = alloca0(size); strcpy(cmd->name, name); } - cmd->flags = KDBUS_ATTACH_NAMES; cmd->size = size; + kdbus_translate_attach_flags(mask, (uint64_t*) &cmd->flags); + r = ioctl(bus->input_fd, KDBUS_CMD_CONN_INFO, cmd); if (r < 0) return -errno; @@ -553,6 +554,18 @@ static int bus_get_owner_kdbus( c->mask |= SD_BUS_CREDS_WELL_KNOWN_NAMES; } break; + + case KDBUS_ITEM_CONN_NAME: + if ((mask & SD_BUS_CREDS_CONNECTION_NAME)) { + c->conn_name = strdup(item->str); + if (!c->conn_name) { + r = -ENOMEM; + goto fail; + } + + c->mask |= SD_BUS_CREDS_CONNECTION_NAME; + } + break; } } |