aboutsummaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-03-23 11:13:23 +0000
committerRon Yorston <rmy@pobox.com>2012-03-23 11:13:23 +0000
commit40514a0309939f2446f0d4ed9600cad5de396e7f (patch)
tree0f5f4a57d4bb7893418b5bb11d482858eb17ba8b /runit
parent9db164d6e39050d09f38288c6045cd2a2cbf6d63 (diff)
parentc0cae52662ccced9df19f19ec94238d1b1e3bd71 (diff)
downloadbusybox-w32-40514a0309939f2446f0d4ed9600cad5de396e7f.tar.gz
busybox-w32-40514a0309939f2446f0d4ed9600cad5de396e7f.tar.bz2
busybox-w32-40514a0309939f2446f0d4ed9600cad5de396e7f.zip
Merge commit 'c0cae52662ccced9df19f19ec94238d1b1e3bd71' into merge
Conflicts: Makefile.flags scripts/basic/fixdep.c
Diffstat (limited to 'runit')
-rw-r--r--runit/chpst.c14
-rw-r--r--runit/runsvdir.c3
2 files changed, 7 insertions, 10 deletions
diff --git a/runit/chpst.c b/runit/chpst.c
index 185706089..9b8c99bdd 100644
--- a/runit/chpst.c
+++ b/runit/chpst.c
@@ -405,19 +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 // FIXME: chrooted jail must have /etc/passwd if we move this after chroot! 408 if (opt & (OPT_u|OPT_U))
409 // OTOH chroot fails for non-roots! 409 xget_uidgid(&ugid, set_user);
410 // SOLUTION: cache uid/gid before chroot, apply uid/gid after 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.
411 if (opt & OPT_U) { 414 if (opt & OPT_U) {
412 xget_uidgid(&ugid, env_user);
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 if (opt & OPT_u) {
418 xget_uidgid(&ugid, set_user);
419 }
420
421 if (opt & OPT_root) { 419 if (opt & OPT_root) {
422 xchdir(root); 420 xchdir(root);
423 xchroot("."); 421 xchroot(".");
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index 9495a2a4f..32526cf4c 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -75,8 +75,7 @@ struct globals {
75#define logpipe (G.logpipe ) 75#define logpipe (G.logpipe )
76#define pfd (G.pfd ) 76#define pfd (G.pfd )
77#define stamplog (G.stamplog ) 77#define stamplog (G.stamplog )
78#define INIT_G() do { \ 78#define INIT_G() do { } while (0)
79} while (0)
80 79
81static void fatal2_cannot(const char *m1, const char *m2) 80static void fatal2_cannot(const char *m1, const char *m2)
82{ 81{