diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-09-16 11:54:13 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-09-16 11:54:13 +0200 |
commit | c74a79f28824b634d621c572c079614a8c227479 (patch) | |
tree | 529cb126b52f0e29c9cf79587792b0485c7a3368 | |
parent | d18ef6c9f6f5c94f2a65a6ab6ae3776711cb2877 (diff) | |
download | busybox-w32-c74a79f28824b634d621c572c079614a8c227479.tar.gz busybox-w32-c74a79f28824b634d621c572c079614a8c227479.tar.bz2 busybox-w32-c74a79f28824b634d621c572c079614a8c227479.zip |
chpst: move misplaced comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | runit/chpst.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/runit/chpst.c b/runit/chpst.c index 44c21a2a4..9b8c99bdd 100644 --- a/runit/chpst.c +++ b/runit/chpst.c | |||
@@ -405,18 +405,17 @@ int chpst_main(int argc UNUSED_PARAM, char **argv) | |||
405 | if (opt & OPT_e) | 405 | if (opt & OPT_e) |
406 | edir(env_dir); | 406 | edir(env_dir); |
407 | 407 | ||
408 | if (opt & (OPT_u|OPT_U)) { | 408 | if (opt & (OPT_u|OPT_U)) |
409 | xget_uidgid(&ugid, set_user); | 409 | xget_uidgid(&ugid, set_user); |
410 | } | ||
411 | 410 | ||
411 | // chrooted jail must have /etc/passwd if we move this after chroot. | ||
412 | // OTOH chroot fails for non-roots. | ||
413 | // Solution: cache uid/gid before chroot, apply uid/gid after. | ||
412 | if (opt & OPT_U) { | 414 | if (opt & OPT_U) { |
413 | xsetenv("GID", utoa(ugid.gid)); | 415 | xsetenv("GID", utoa(ugid.gid)); |
414 | xsetenv("UID", utoa(ugid.uid)); | 416 | xsetenv("UID", utoa(ugid.uid)); |
415 | } | 417 | } |
416 | 418 | ||
417 | // chrooted jail must have /etc/passwd if we move this after chroot. | ||
418 | // OTOH chroot fails for non-roots. | ||
419 | // Solution: cache uid/gid before chroot, apply uid/gid after. | ||
420 | if (opt & OPT_root) { | 419 | if (opt & OPT_root) { |
421 | xchdir(root); | 420 | xchdir(root); |
422 | xchroot("."); | 421 | xchroot("."); |