mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
Use the double fork trick to avoid the monitor process being waited
for by the main program run through sudo.
This commit is contained in:
@@ -125,7 +125,18 @@ systrace_attach(pid)
|
||||
case -1:
|
||||
error(1, "can't fork");
|
||||
case 0:
|
||||
/* tracer */
|
||||
/* tracer, fork again to completely disassociate */
|
||||
switch (fork()) {
|
||||
case -1:
|
||||
warning("can't fork");
|
||||
kill(pid, SIGKILL);
|
||||
_exit(1);
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
/* the main sudo process will wait for us */
|
||||
_exit(0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* tracee, sleep until the tracer process wakes us up. */
|
||||
|
Reference in New Issue
Block a user