mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-23 00:29:20 +02:00
do detaching after user switch
This commit is contained in:
parent
264a5227de
commit
6a4dfb8cbd
|
@ -569,10 +569,6 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
do_chroot(newroot);
|
do_chroot(newroot);
|
||||||
|
|
||||||
if (!foreground) {
|
|
||||||
do_detach();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (username) {
|
if (username) {
|
||||||
if (setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) {
|
if (setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) {
|
||||||
printf("Could not switch to user %s!\n", username);
|
printf("Could not switch to user %s!\n", username);
|
||||||
|
@ -580,6 +576,10 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!foreground) {
|
||||||
|
do_detach();
|
||||||
|
}
|
||||||
|
|
||||||
tunnel(tun_fd, dns_fd);
|
tunnel(tun_fd, dns_fd);
|
||||||
|
|
||||||
cleanup2:
|
cleanup2:
|
||||||
|
|
|
@ -536,10 +536,6 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
do_chroot(newroot);
|
do_chroot(newroot);
|
||||||
|
|
||||||
if (!foreground) {
|
|
||||||
do_detach();
|
|
||||||
}
|
|
||||||
|
|
||||||
signal(SIGINT, sigint);
|
signal(SIGINT, sigint);
|
||||||
if (username) {
|
if (username) {
|
||||||
if (setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) {
|
if (setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) {
|
||||||
|
@ -548,6 +544,10 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!foreground) {
|
||||||
|
do_detach();
|
||||||
|
}
|
||||||
|
|
||||||
tunnel(tun_fd, dnsd_fd);
|
tunnel(tun_fd, dnsd_fd);
|
||||||
|
|
||||||
cleanup2:
|
cleanup2:
|
||||||
|
|
Loading…
Reference in New Issue