chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus: add new sd_bus_creds object to encapsulate process credentials
[elogind.git]
/
src
/
core
/
dbus-manager.c
diff --git
a/src/core/dbus-manager.c
b/src/core/dbus-manager.c
index b934624defd07d71abdbf21338bb80651d454437..8f637215713687f381bccb301901500239e42067 100644
(file)
--- a/
src/core/dbus-manager.c
+++ b/
src/core/dbus-manager.c
@@
-338,7
+338,13
@@
static int method_get_unit_by_pid(sd_bus *bus, sd_bus_message *message, void *us
return r;
if (pid == 0) {
return r;
if (pid == 0) {
- r = sd_bus_get_owner_pid(bus, sd_bus_message_get_sender(message), &pid);
+ _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
+
+ r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds);
+ if (r < 0)
+ return r;
+
+ r = sd_bus_creds_get_pid(creds, &pid);
if (r < 0)
return r;
}
if (r < 0)
return r;
}