mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-25 14:36:05 +03: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)
|
if (chroot(newroot) != 0 || chdir("/") != 0)
|
||||||
err(1, "%s", newroot);
|
err(1, "%s", newroot);
|
||||||
|
|
||||||
seteuid(geteuid());
|
if (seteuid(geteuid()) != 0 || setuid(getuid()) != 0) {
|
||||||
setuid(getuid());
|
err(1, "set[e]uid()");
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
warnx("chroot not available");
|
warnx("chroot not available");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user