summaryrefslogtreecommitdiff
path: root/src/shared/audit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-29 21:40:54 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-29 21:45:58 +0200
commitcfeaa44a09756a93a881f786678973d9b1e382db (patch)
treec86172a848d4ca1716e1b2b82427e819f025e51c /src/shared/audit.c
parentcfa9677bd164574600d29a9bf99f9d1f28a7a170 (diff)
sd-bus: properly handle creds that are known but undefined for a process
A number of fields do not apply to all processes, including: there a processes without a controlling tty, without parent process, without service, user services or session. To distuingish these cases from the case where we simply don't have the data, always return ENXIO for them, while returning ENODATA for the case where we really lack the information. Also update the credentials dumping code to show this properly. Fields that are known but do not apply are now shown as "n/a". Note that this also changes some of the calls in process-util.c and cgroup-util.c to return ENXIO for these cases.
Diffstat (limited to 'src/shared/audit.c')
-rw-r--r--src/shared/audit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/audit.c b/src/shared/audit.c
index 84181d3321..54148fcf18 100644
--- a/src/shared/audit.c
+++ b/src/shared/audit.c
@@ -46,7 +46,7 @@ int audit_session_from_pid(pid_t pid, uint32_t *id) {
if (r < 0)
return r;
- if (u == (uint32_t) -1 || u <= 0)
+ if (u == AUDIT_SESSION_INVALID || u <= 0)
return -ENXIO;
*id = u;