s4:s3compat Don't mess with signals or reinit anything in s3compat
authorAndrew Bartlett <abartlet@samba.org>
Thu, 13 May 2010 07:11:38 +0000 (17:11 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 3 Jun 2010 01:14:07 +0000 (11:14 +1000)
These event management functions should not be called at this layer.

Andrew Bartlett

source4/s3compat/s3compat_winbindd.c

index 9c3ce32180c688825ecad0c4980cc0adfaebd1d2..85dd81951ede59fa40c52f793bb077551170158d 100644 (file)
 #include "s3compat_wrapper.h"
 #include "source3/winbindd/winbindd.h"
 
-/* Unlike the smbd init functions, this is only run in the winbindd child, because it calls winbind_off() */
+/* Unlike the smbd init functions, this is only run in the winbindd
+ * child, because it calls winbind_off() - and we don't want that in a
+ * process that runs any of the smbd code */
 _PUBLIC_ void s3compat_initialise_winbindd(const char *config_file)
 {
        talloc_stackframe();
 
-       /* glibc (?) likes to print "User defined signal 1" and exit if a
-          SIGUSR[12] is received before a handler is installed */
-
-       CatchSignal(SIGUSR1, SIG_IGN);
-       CatchSignal(SIGUSR2, SIG_IGN);
-
        set_remote_machine_name("winbindd", False);
 
        /* Set environment variable so we don't recursively call ourselves.
@@ -58,35 +54,15 @@ _PUBLIC_ void s3compat_initialise_winbindd(const char *config_file)
                mkdir(lp_lockdir(), 0755);
        }
 
-       /* Unblock all signals we are interested in as they may have been
-          blocked by the parent process. */
-
-       BlockSignals(False, SIGINT);
-       BlockSignals(False, SIGQUIT);
-       BlockSignals(False, SIGTERM);
-       BlockSignals(False, SIGUSR1);
-       BlockSignals(False, SIGUSR2);
-       BlockSignals(False, SIGHUP);
-       BlockSignals(False, SIGCHLD);
-
-       /* 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();
 
        DEBUG(0,("s3compat_winbindd: initialised samba3 version: %s\n",
                 samba_version_string()));
 }
 
+/* Call into the source3/winbindd per-client code here, as we have
+ * already bound to the sockets and accepted the connection at this
+ * point */
 _PUBLIC_ void s3compat_winbindd_accepted_new_connection(int accepted_sock, bool privileged)
 {
        winbindd_accepted_new_connection(accepted_sock, privileged);