[systemd-commits] src/libsystemd-bus

Kay Sievers kay at kemper.freedesktop.org
Fri Nov 29 09:58:59 PST 2013


 src/libsystemd-bus/bus-creds.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 547708f59edd73d98edcbe84e95b41f7b3321f3b
Author: Kay Sievers <kay at vrfy.org>
Date:   Fri Nov 29 18:57:06 2013 +0100

    bus: do not fail if cgroup information cannot be retrieved from /proc

diff --git a/src/libsystemd-bus/bus-creds.c b/src/libsystemd-bus/bus-creds.c
index 454aeff..9518f02 100644
--- a/src/libsystemd-bus/bus-creds.c
+++ b/src/libsystemd-bus/bus-creds.c
@@ -652,15 +652,15 @@ int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid) {
         if (missing & (SD_BUS_CREDS_CGROUP|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_USER_UNIT|SD_BUS_CREDS_SLICE|SD_BUS_CREDS_SESSION|SD_BUS_CREDS_OWNER_UID)) {
 
                 r = cg_pid_get_path(NULL, pid, &c->cgroup);
-                if (r < 0)
+                if (r < 0 && r != -ESRCH)
                         return r;
-
-                c->mask |= missing & (SD_BUS_CREDS_CGROUP|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_USER_UNIT|SD_BUS_CREDS_SLICE|SD_BUS_CREDS_SESSION|SD_BUS_CREDS_OWNER_UID);
+                else if (r >= 0)
+                        c->mask |= missing & (SD_BUS_CREDS_CGROUP|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_USER_UNIT|SD_BUS_CREDS_SLICE|SD_BUS_CREDS_SESSION|SD_BUS_CREDS_OWNER_UID);
         }
 
         if (missing & SD_BUS_CREDS_AUDIT_SESSION_ID) {
                 r = audit_session_from_pid(pid, &c->audit_session_id);
-                if (r < 0 && r != -ENOTSUP && r != -ENXIO && r != ENOENT)
+                if (r < 0 && r != -ENOTSUP && r != -ENXIO && r != -ENOENT)
                         return r;
                 else if (r >= 0)
                         c->mask |= SD_BUS_CREDS_AUDIT_SESSION_ID;
@@ -668,7 +668,7 @@ int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid) {
 
         if (missing & SD_BUS_CREDS_AUDIT_LOGIN_UID) {
                 r = audit_loginuid_from_pid(pid, &c->audit_login_uid);
-                if (r < 0 && r != -ENOTSUP && r != -ENXIO && r != ENOENT)
+                if (r < 0 && r != -ENOTSUP && r != -ENXIO && r != -ENOENT)
                         return r;
                 else if (r >= 0)
                         c->mask |= SD_BUS_CREDS_AUDIT_LOGIN_UID;



More information about the systemd-commits mailing list