Permalink
Browse files

chpst: move misplaced comment

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
  • Loading branch information...
1 parent d18ef6c commit c74a79f28824b634d621c572c079614a8c227479 Denys Vlasenko committed Sep 16, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 runit/chpst.c
View
@@ -405,18 +405,17 @@ int chpst_main(int argc UNUSED_PARAM, char **argv)
if (opt & OPT_e)
edir(env_dir);
- if (opt & (OPT_u|OPT_U)) {
+ if (opt & (OPT_u|OPT_U))
xget_uidgid(&ugid, set_user);
- }
+ // chrooted jail must have /etc/passwd if we move this after chroot.
+ // OTOH chroot fails for non-roots.
+ // Solution: cache uid/gid before chroot, apply uid/gid after.
if (opt & OPT_U) {
xsetenv("GID", utoa(ugid.gid));
xsetenv("UID", utoa(ugid.uid));
}
- // chrooted jail must have /etc/passwd if we move this after chroot.
- // OTOH chroot fails for non-roots.
- // Solution: cache uid/gid before chroot, apply uid/gid after.
if (opt & OPT_root) {
xchdir(root);
xchroot(".");

0 comments on commit c74a79f

Please sign in to comment.