summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle2020-04-19 22:06:51 +0000
committerDaniel Golle2020-04-19 22:13:23 +0000
commitd200b70e5d5b0b3b61e2573f1c2fa22b3fa9d63a (patch)
treeb2da10fcf75a92445edad417b6b34f7ac70beb06
parenta4cc165a9fdcc9d76a0ba58a2e9ccde605e5f40d (diff)
downloadprocd-d200b70e5d5b0b3b61e2573f1c2fa22b3fa9d63a.tar.gz
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 <tobias.waldvogel@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r--jail/jail.c5
1 files changed, 5 insertions, 0 deletions
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);
}