mirror of
https://github.com/yarrick/iodine.git
synced 2024-09-07 03:27:00 +00:00
Check set[e]uid return code
This commit is contained in:
parent
59dbaf2b50
commit
ac7cbd4435
|
@ -167,8 +167,9 @@ do_chroot(char *newroot)
|
|||
if (chroot(newroot) != 0 || chdir("/") != 0)
|
||||
err(1, "%s", newroot);
|
||||
|
||||
seteuid(geteuid());
|
||||
setuid(getuid());
|
||||
if (seteuid(geteuid()) != 0 || setuid(getuid()) != 0) {
|
||||
err(1, "set[e]uid()");
|
||||
}
|
||||
#else
|
||||
warnx("chroot not available");
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue