bug#18062: [PATCH] chroot: always change to / if not changing credential
From:
Andreas Schwab
Subject:
bug#18062: [PATCH] chroot: always change to / if not changing credentials
Date:
Sun, 20 Jul 2014 14:05:18 +0200
User-agent:
Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux)
---
src/chroot.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/chroot.c b/src/chroot.c
index 6c2d63f..079759f 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -269,9 +269,10 @@ main (int argc, char **argv)
usage (EXIT_CANCELED);
}
- /* Only do chroot specific actions if actually changing root.
- The main difference here is that we don't change working dir. */
- if (! is_root (argv[optind]))
+ /* Only do chroot specific actions if actually changing root or if not
+ changing credentials. The main difference here is that we don't
+ change working dir. */
+ if (! is_root (argv[optind]) || !(userspec || groups))
{
/* We have to look up users and groups twice.
- First, outside the chroot to load potentially necessary passwd/group
--
2.0.2
--
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."