]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/audit.c
sd-bus: properly handle creds that are known but undefined for a process
authorLennart Poettering <lennart@poettering.net>
Wed, 29 Apr 2015 19:40:54 +0000 (21:40 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 29 Apr 2015 19:45:58 +0000 (21:45 +0200)
commitcfeaa44a09756a93a881f786678973d9b1e382db
treec86172a848d4ca1716e1b2b82427e819f025e51c
parentcfa9677bd164574600d29a9bf99f9d1f28a7a170
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.
src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-bus/bus-creds.c
src/libsystemd/sd-bus/bus-dump.c
src/libsystemd/sd-bus/bus-kernel.c
src/shared/audit.c
src/shared/audit.h
src/shared/cgroup-util.c
src/shared/terminal-util.c
src/test/test-cgroup-util.c
src/test/test-process-util.c