diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-11-24 17:42:19 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2016-12-14 10:13:52 +0100 |
commit | 295ee9845c801300298d01256eb5a9e3ff117ae0 (patch) | |
tree | e46946b349906d7ac5148a718c14bd135c684004 /src/udev/udev-builtin-kmod.c | |
parent | 4014818d530ad3f6f5e4b94b79a9336376feface (diff) |
util: Fine tune running_in_chroot() a bit
Let's be a bit more careful when detecting chroot() environments, so that we
can discern them from namespaced environments.
Previously this would simply check if the root directory of PID 1 matches our
own root directory. With this commit, we also check whether the namespaces of
PID 1 and ourselves are the same. If not we assume we are running inside of a
namespaced environment instead of a chroot() environment.
This has the benefit that systemctl (which uses running_in_chroot()) will work
as usual when invoked in a namespaced service.
Diffstat (limited to 'src/udev/udev-builtin-kmod.c')
0 files changed, 0 insertions, 0 deletions