lib/util/run_cmd: prevent zombies in samba_runcmd_send on timeout
authorRalph Boehme <slow@samba.org>
Fri, 29 Sep 2017 10:45:24 +0000 (12:45 +0200)
committerRalph Boehme <slow@samba.org>
Sat, 30 Sep 2017 06:01:24 +0000 (08:01 +0200)
commit9a8eeabd95afca2e88666b3e8f2af954dbf23ba9
treee11b0c993d7e627880163c20227b94c2619c2abe
parentac521c2d7d2db3835f62d92d77c2e8dfc71ea523
lib/util/run_cmd: prevent zombies in samba_runcmd_send on timeout

Ensure the state desctructor calls tfork_destroy to reap the waiter and
worker processes. Otherwise we leave the waiter process as a zombie
behind us as we never call waitpid on it in case of a timeout
or talloc_free() from the caller.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13062

Pair-programmed-with: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
lib/util/util_runcmd.c