mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-26 01:59:19 +02:00
do detaching after user switch
This commit is contained in:
parent
264a5227de
commit
6a4dfb8cbd
|
@ -569,16 +569,16 @@ 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);
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!foreground) {
|
||||||
|
do_detach();
|
||||||
|
}
|
||||||
|
|
||||||
tunnel(tun_fd, dns_fd);
|
tunnel(tun_fd, dns_fd);
|
||||||
|
|
||||||
|
|
|
@ -535,10 +535,6 @@ main(int argc, char **argv)
|
||||||
printf("Listening to dns for domain %s\n", argv[1]);
|
printf("Listening to dns for domain %s\n", argv[1]);
|
||||||
|
|
||||||
do_chroot(newroot);
|
do_chroot(newroot);
|
||||||
|
|
||||||
if (!foreground) {
|
|
||||||
do_detach();
|
|
||||||
}
|
|
||||||
|
|
||||||
signal(SIGINT, sigint);
|
signal(SIGINT, sigint);
|
||||||
if (username) {
|
if (username) {
|
||||||
|
@ -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