The call to setuid(2) subsequently causes setgroups(2) to fail. setgroups(2)
requires super-user access in order to complete successfully. Move setgroups(2) to execute before setuid(2) so that it is successful.
This commit is contained in:
parent
f5298929e3
commit
0c90b4887e
@ -286,9 +286,9 @@ main(int argc, char *argv[])
|
||||
syslog(LOG_ERR, "chroot: %s: %m", chroot_dir);
|
||||
exit(1);
|
||||
}
|
||||
chdir( "/" );
|
||||
setuid(nobody->pw_uid);
|
||||
chdir("/");
|
||||
setgroups(1, &nobody->pw_gid);
|
||||
setuid(nobody->pw_uid);
|
||||
}
|
||||
|
||||
len = sizeof(me);
|
||||
|
Loading…
Reference in New Issue
Block a user