mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-08 01:13:16 +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)
|
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 a new issue