---
 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, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



Reply via email to