diff options
author | Kay Sievers <kay@vrfy.org> | 2013-11-29 18:57:06 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-11-29 18:57:06 +0100 |
commit | 547708f59edd73d98edcbe84e95b41f7b3321f3b (patch) | |
tree | 49a723291458224262aa4d260dfaab2b8378733c /src/libsystemd-bus/bus-creds.c | |
parent | 8bd54e897c2a62866e6b15244e784a07ff2b2af4 (diff) |
bus: do not fail if cgroup information cannot be retrieved from /proc
Diffstat (limited to 'src/libsystemd-bus/bus-creds.c')
-rw-r--r-- | src/libsystemd-bus/bus-creds.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsystemd-bus/bus-creds.c b/src/libsystemd-bus/bus-creds.c index 454aeffb51..9518f02cd9 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; |