mirror of
https://github.com/yarrick/iodine.git
synced 2024-12-22 21:33:33 +02:00
Check set[e]uid return code
This commit is contained in:
parent
59dbaf2b50
commit
ac7cbd4435
1 changed files with 3 additions and 2 deletions
|
@ -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