diff -Nur ax25-tools-0.0.10-rc2/ax25/ax25d.c ax25-tools/ax25/ax25d.c --- ax25-tools-0.0.10-rc2/ax25/ax25d.c 2009-06-21 20:01:55.000000000 +0200 +++ ax25-tools/ax25/ax25d.c 2011-08-18 11:51:08.000000000 +0200 @@ -577,7 +577,7 @@ /* close link */ /* setproctitle("ax25d [%s]: disconnecting", User); */ close(new); - return 0; + exit(0); } login: /* setproctitle("ax25d [%s]: login", User); */ @@ -614,11 +614,15 @@ closelog(); /* Make root secure, before we exec() */ - setgroups(0, grps); /* Strip any supplementary gid's */ - setgid(raxl->gid); - setuid(raxl->uid); + /* Strip any supplementary gid's */ + if (setgroups(0, grps) == -1) + exit(1); + if (setgid(raxl->gid) == -1) + exit(1); + if (setuid(raxl->uid) == -1) + exit(1); execve(raxl->exec, argv, NULL); - return 1; + exit(1); default: close(new); diff -Nur ax25-tools-0.0.10-rc2/ax25/axspawn.c ax25-tools/ax25/axspawn.c --- ax25-tools-0.0.10-rc2/ax25/axspawn.c 2009-06-21 20:01:55.000000000 +0200 +++ ax25-tools/ax25/axspawn.c 2011-08-18 12:43:49.000000000 +0200 @@ -1693,7 +1693,11 @@ pututline(&ut_line); endutent(); - setsid(); + /* become process group leader, if we not already are */ + if (getpid() != getsid(0)) { + if (setsid() == -1) + exit(1); + } chargc = 0; envc = 0;