From 547708f59edd73d98edcbe84e95b41f7b3321f3b Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Fri, 29 Nov 2013 18:57:06 +0100 Subject: bus: do not fail if cgroup information cannot be retrieved from /proc --- src/libsystemd-bus/bus-creds.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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; -- cgit v1.2.3-54-g00ecf