process_standard: clean up messaging for children after exit()
authorAndrew Bartlett <abartlet@samba.org>
Tue, 28 Mar 2017 08:04:23 +0000 (21:04 +1300)
committerStefan Metzmacher <metze@samba.org>
Tue, 25 Apr 2017 21:08:11 +0000 (23:08 +0200)
This makes sure we remove any messaging sockets if a child dies or calls exit()
without running the talloc destructor for messaging

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/smbd/process_standard.c
source4/smbd/wscript_build

index 967b064..8d962d5 100644 (file)
@@ -30,6 +30,7 @@
 #include "ldb_wrap.h"
 #include "lib/messaging/messaging.h"
 #include "lib/util/debug.h"
+#include "source3/lib/messages_dgm.h"
 
 struct standard_child_state {
        const char *name;
@@ -115,6 +116,8 @@ static void standard_child_pipe_handler(struct tevent_context *ev,
        int status = 0;
        pid_t pid;
 
+       messaging_dgm_cleanup(state->pid);
+
        /* the child has closed the pipe, assume its dead */
        errno = 0;
        pid = waitpid(state->pid, &status, 0);
index ca20396..c28bc1d 100644 (file)
@@ -40,7 +40,7 @@ bld.SAMBA_MODULE('process_model_standard',
                  source='process_standard.c',
                  subsystem='process_model',
                  init_function='process_model_standard_init',
-                 deps='MESSAGING events ldbsamba process_model samba-sockets cluster',
+                 deps='MESSAGING events ldbsamba process_model samba-sockets cluster messages_dgm',
                  internal_module=False
                  )