The branch, v3-3-test has been updated
       via  2ccc176bf8ab7490eb3be818776c1e20b2f153a9 (commit)
       via  45e6f9c5a4b5d9cdb89f398f1238872251ccbe54 (commit)
      from  51e34b38959115e8a04795837b5c5983dc8d824c (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 2ccc176bf8ab7490eb3be818776c1e20b2f153a9
Merge: 45e6f9c5a4b5d9cdb89f398f1238872251ccbe54 
51e34b38959115e8a04795837b5c5983dc8d824c
Author: Jeremy Allison <[email protected]>
Date:   Thu Jan 15 15:53:23 2009 -0800

    Merge branch 'v3-3-test' of ssh://[email protected]/data/git/samba into 
v3-3-test

commit 45e6f9c5a4b5d9cdb89f398f1238872251ccbe54
Author: Jeremy Allison <[email protected]>
Date:   Thu Jan 15 15:50:50 2009 -0800

    Allow reinit_after_fork to be called safely from within swat and other 
binaries that don't have
    an event context or a msg context. Fixes crash bug in swat.
    Jeremy.

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

Summary of changes:
 source/lib/dummysmbd.c |    7 ++++++-
 source/lib/util.c      |   24 ++++++++++++++----------
 2 files changed, 20 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/dummysmbd.c b/source/lib/dummysmbd.c
index 5c624bd..f0fd18c 100644
--- a/source/lib/dummysmbd.c
+++ b/source/lib/dummysmbd.c
@@ -59,7 +59,12 @@ bool change_to_root_user(void)
 
 struct event_context *smbd_event_context(void)
 {
-       return NULL;
+       static struct event_context *ev;
+
+       if (!ev) {
+               ev = event_context_init(NULL);
+       }
+       return ev;
 }
 
 struct messaging_context *smbd_messaging_context(void)
diff --git a/source/lib/util.c b/source/lib/util.c
index 262d37f..5ec6f26 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -1055,18 +1055,22 @@ bool reinit_after_fork(struct messaging_context 
*msg_ctx,
                return false;
        }
 
-       /*
-        * For clustering, we need to re-init our ctdbd connection after the
-        * fork
-        */
-       status = messaging_reinit(msg_ctx);
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(0,("messaging_reinit() failed: %s\n",
-                        nt_errstr(status)));
-               return false;
+       if (msg_ctx) {
+               /*
+                * For clustering, we need to re-init our ctdbd connection 
after the
+                * fork
+                */
+               status = messaging_reinit(msg_ctx);
+               if (!NT_STATUS_IS_OK(status)) {
+                       DEBUG(0,("messaging_reinit() failed: %s\n",
+                                nt_errstr(status)));
+                       return false;
+               }
        }
 
-       event_context_reinit(ev_ctx);
+       if (ev_ctx) {
+               event_context_reinit(ev_ctx);
+       }
 
        return true;
 }


-- 
Samba Shared Repository

Reply via email to