mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-25 23:41:29 +00: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);
|
||||
|
||||
if (!foreground) {
|
||||
do_detach();
|
||||
}
|
||||
|
||||
if (username) {
|
||||
if (setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) {
|
||||
printf("Could not switch to user %s!\n", username);
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (!foreground) {
|
||||
do_detach();
|
||||
}
|
||||
|
||||
tunnel(tun_fd, dns_fd);
|
||||
|
||||
|
|
|
@ -535,10 +535,6 @@ main(int argc, char **argv)
|
|||
printf("Listening to dns for domain %s\n", argv[1]);
|
||||
|
||||
do_chroot(newroot);
|
||||
|
||||
if (!foreground) {
|
||||
do_detach();
|
||||
}
|
||||
|
||||
signal(SIGINT, sigint);
|
||||
if (username) {
|
||||
|
@ -548,6 +544,10 @@ main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
if (!foreground) {
|
||||
do_detach();
|
||||
}
|
||||
|
||||
tunnel(tun_fd, dnsd_fd);
|
||||
|
||||
cleanup2:
|
||||
|
|
Loading…
Reference in a new issue