[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Wed Apr 26 01:10:02 UTC 2017


The branch, master has been updated
       via  2f1cc56 s4-messaging: Add helpful comments
       via  cd033ae process_standard: clean up messaging for children after exit()
      from  04b2a18 lib: Fix CID 1405493 Error handling issues (CHECKED_RETURN)

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2f1cc560dc6937d0fd7ce485ea091b979d98e53b
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Mar 28 21:55:47 2017 +1300

    s4-messaging: Add helpful comments
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Wed Apr 26 03:09:19 CEST 2017 on sn-devel-144

commit cd033ae583c52ec0d9cd7bdb387cc4558f9930e0
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Mar 28 21:04:23 2017 +1300

    process_standard: clean up messaging for children after exit()
    
    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 at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source4/lib/messaging/messaging.c | 7 +++++++
 source4/smbd/process_standard.c   | 3 +++
 source4/smbd/wscript_build        | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
index 2da0acc..b8d4e50 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -391,6 +391,10 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
 
 	tdb_flags |= lpcfg_tdb_flags(lp_ctx, 0);
 
+	/*
+	 * This context holds a destructor that cleans up any names
+	 * registered on this context on talloc_free()
+	 */
 	msg->names = server_id_db_init(msg, server_id, lock_dir, 0, tdb_flags);
 	if (msg->names == NULL) {
 		goto fail;
@@ -767,6 +771,9 @@ static int irpc_destructor(struct irpc_request *irpc)
 
 /*
   add a string name that this irpc server can be called on
+
+  It will be removed from the DB either via irpc_remove_name or on
+  talloc_free(msg_ctx->names).
 */
 NTSTATUS irpc_add_name(struct imessaging_context *msg_ctx, const char *name)
 {
diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c
index 967b064..8d962d5 100644
--- a/source4/smbd/process_standard.c
+++ b/source4/smbd/process_standard.c
@@ -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);
diff --git a/source4/smbd/wscript_build b/source4/smbd/wscript_build
index ca20396..c28bc1d 100644
--- a/source4/smbd/wscript_build
+++ b/source4/smbd/wscript_build
@@ -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
                  )
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list