STRV_FOREACH(i, l) {
_cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
- _cleanup_free_ char *owner = NULL;
sd_id128_t mid;
if (arg_no_unique && (*i)[0] == ':')
printf("%-*s", (int) max_i, *i);
- r = sd_bus_get_owner(bus, *i, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_COMM, &owner, &creds);
+ r = sd_bus_get_owner(bus, *i, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_COMM|SD_BUS_CREDS_UNIQUE_NAME, &creds);
if (r >= 0) {
+ const char *unique;
pid_t pid;
uid_t uid;
} else
fputs(" - ", stdout);
- if (owner)
- printf(" %-20s", owner);
+ r = sd_bus_creds_get_unique_name(creds, &unique);
+ if (r >= 0)
+ printf(" %-20s", unique);
else
fputs(" - ", stdout);
" -M --machine=CONTAINER Operate on local container\n"
" --address=ADDRESS Connect to bus specified by address\n"
" --no-unique Only show well-known names\n"
- " --no-machine Don't show machine ID column in list\n\n"
- " --match=MATCH Only show matching messages\n"
+ " --no-machine Don't show machine ID column in list\n"
+ " --match=MATCH Only show matching messages\n\n"
"Commands:\n"
" list List bus names\n"
" monitor [SERVICE...] Show bus traffic\n",