chiark / gitweb /
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)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 07:19:28 +0000 (08:19 +0100)
commit011da473952eb8c7be67e8238f381fc87d50eb58
tree86cdd1f544155ced166877b0fa054404a61a88b3
parentdb9d657feb727d338d64b9a51cb25de6f20eeae4
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/libelogind/sd-bus/bus-control.c
src/libelogind/sd-bus/bus-creds.c
src/libelogind/sd-bus/bus-dump.c
src/libelogind/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-process-util.c