chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
service: remove unneccesary Socket.got_socket_fd
[elogind.git]
/
src
/
core
/
dbus.c
diff --git
a/src/core/dbus.c
b/src/core/dbus.c
index d130e0974e92d30a15dc11d5a81defda8b8a9dd6..7d7c6cbddc8cf96e6101d7df11f16be8119c325a 100644
(file)
--- a/
src/core/dbus.c
+++ b/
src/core/dbus.c
@@
-247,9
+247,14
@@
static int selinux_filter(sd_bus *bus, sd_bus_message *message, void *userdata,
}
if (streq_ptr(path, "/org/freedesktop/systemd1/unit/self")) {
}
if (streq_ptr(path, "/org/freedesktop/systemd1/unit/self")) {
+ _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
pid_t pid;
pid_t pid;
- r = sd_bus_get_owner_pid(bus, sd_bus_message_get_sender(message), &pid);
+ r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds);
+ if (r < 0)
+ return 0;
+
+ r = sd_bus_creds_get_pid(creds, &pid);
if (r < 0)
return 0;
if (r < 0)
return 0;
@@
-300,6
+305,7
@@
static int find_unit(Manager *m, sd_bus *bus, const char *path, Unit **unit, sd_
assert(path);
if (streq_ptr(path, "/org/freedesktop/systemd1/unit/self")) {
assert(path);
if (streq_ptr(path, "/org/freedesktop/systemd1/unit/self")) {
+ _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
sd_bus_message *message;
pid_t pid;
sd_bus_message *message;
pid_t pid;
@@
-307,9
+313,13
@@
static int find_unit(Manager *m, sd_bus *bus, const char *path, Unit **unit, sd_
if (!message)
return 0;
if (!message)
return 0;
- r = sd_bus_
get_owner_pid(bus, sd_bus_message_get_sender(message), &pid
);
+ r = sd_bus_
query_sender_creds(message, SD_BUS_CREDS_PID, &creds
);
if (r < 0)
if (r < 0)
- return 0;
+ return r;
+
+ r = sd_bus_creds_get_pid(creds, &pid);
+ if (r < 0)
+ return r;
u = manager_get_unit_by_pid(m, pid);
} else {
u = manager_get_unit_by_pid(m, pid);
} else {