← Commit list

c74a79f28

Denys Vlasenko
Denys Vlasenko
2011-09-16
FAILED Duration: 196s

Subject

chpst: move misplaced comment

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

runit/chpst.c+4 -5
@@ -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(".");