s3:winbindd move reinit_after_fork() back out of winbindd_register_handlers
authorAndrew Bartlett <abartlet@samba.org>
Thu, 13 May 2010 07:07:15 +0000 (17:07 +1000)
committerStefan Metzmacher <metze@samba.org>
Mon, 31 May 2010 19:36:56 +0000 (21:36 +0200)
This particular init function needs to be done in a native Samba3
build, but it turns out to be difficult for s3compat, which has other
code listening on the sockets.

Andrew Bartlett

source3/winbindd/winbindd.c

index 1cb4e216595f9a03eececb0b6ed9ff99b3a38904..fcd3145931b478e32cdaf88512787b9a54ec174b 100644 (file)
@@ -1022,18 +1022,6 @@ bool winbindd_use_cache(void)
 void winbindd_register_handlers(void)
 {
        struct tevent_timer *te;
-       /* Don't use winbindd_reinit_after_fork here as
-        * we're just starting up and haven't created any
-        * winbindd-specific resources we must free yet. JRA.
-        */
-
-       if (!NT_STATUS_IS_OK(reinit_after_fork(winbind_messaging_context(),
-                                              winbind_event_context(),
-                                              false))) {
-               DEBUG(0,("reinit_after_fork() failed\n"));
-               exit(1);
-       }
-
        /* Setup signal handlers */
 
        if (!winbindd_setup_sig_term_handler(true))
@@ -1298,6 +1286,18 @@ int main(int argc, char **argv, char **envp)
 
        TimeInit();
 
+       /* Don't use winbindd_reinit_after_fork here as
+        * we're just starting up and haven't created any
+        * winbindd-specific resources we must free yet. JRA.
+        */
+
+       if (!NT_STATUS_IS_OK(reinit_after_fork(winbind_messaging_context(),
+                                              winbind_event_context(),
+                                              false))) {
+               DEBUG(0,("reinit_after_fork() failed\n"));
+               exit(1);
+       }
+
        winbindd_register_handlers();
 
        /* setup listen sockets */