From: Daniel Golle Date: Sun, 19 Apr 2020 22:06:51 +0000 (+0100) Subject: jail: include /etc/nsswitch.conf in jail for glibc. X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d200b70e5d5b0b3b61e2573f1c2fa22b3fa9d63a;p=oweals%2Fprocd.git jail: include /etc/nsswitch.conf in jail for glibc. /etc/nsswitch.conf is needed to resolve usernames and groups from /etc/passwd and /etc/groups, name resoultion and a bunch of other things when using glibc. Mount /etc/nsswitch.conf in jail when building against glibc. Reported-by: Tobias Waldvogel Signed-off-by: Daniel Golle --- diff --git a/jail/jail.c b/jail/jail.c index ca8b832..5a1c05b 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -790,6 +790,11 @@ int main(int argc, char **argv) add_mount("/etc/group", 0, -1); } +#if defined(__GLIBC__) + if (!opts.extroot) + add_mount("/etc/nsswitch.conf", 0, -1); +#endif + if (!(opts.namespace & CLONE_NEWNET)) { add_mount("/etc/resolv.conf", 0, -1); }