mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 22:35:10 +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:
|
case -1:
|
||||||
error(1, "can't fork");
|
error(1, "can't fork");
|
||||||
case 0:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
/* tracee, sleep until the tracer process wakes us up. */
|
/* tracee, sleep until the tracer process wakes us up. */
|
||||||
|
Reference in New Issue
Block a user