lib/util/run_cmd: prevent zombies in samba_runcmd_send on timeout
commit634514a8d431b45a070f1d052b552bcf5f0a3bee
authorRalph Boehme <slow@samba.org>
Fri, 29 Sep 2017 10:45:24 +0000 (29 12:45 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 2 Oct 2017 07:05:22 +0000 (2 09:05 +0200)
tree8d1d22bde1432428640223cbb7df14401b338e56
parent3711ec4dafc098668eb0c1bee9dee62838024a59
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>
(cherry picked from commit 9a8eeabd95afca2e88666b3e8f2af954dbf23ba9)
lib/util/util_runcmd.c