Changes from APPLIANCE_HEAD:
authorDavid O'Neill <dmo@samba.org>
Thu, 25 Jan 2001 16:36:42 +0000 (16:36 +0000)
committerDavid O'Neill <dmo@samba.org>
Thu, 25 Jan 2001 16:36:42 +0000 (16:36 +0000)
    source/smbd/server.c
    source/nmbd/nmbd.c
        - Fixed a very subtle bug with signals. Seems that POSIX requires
          that the signal mask be inhereted. So, if you happen to kick off
          smbd/nmbd from code that has the mask set on SIGUSR1, you lose
          messages.

source/nmbd/nmbd.c
source/smbd/server.c

index 5b9a00aad0ea2cedcba0c1ba2c2784c8148649b5..f772788341e283152c954f199e0af10da7061db5 100644 (file)
@@ -686,6 +686,12 @@ static void usage(char *pname)
 
   fault_setup((void (*)(void *))fault_continue );
 
+  /* POSIX demands that signals are inherited. If the invoking process has
+   * these signals masked, we will have problems, as we won't recieve them. */
+  BlockSignals(False, SIGHUP);
+  BlockSignals(False, SIGUSR1);
+  BlockSignals(False, SIGTERM);
+
   CatchSignal( SIGHUP,  SIGNAL_CAST sig_hup );
   CatchSignal( SIGTERM, SIGNAL_CAST sig_term );
 
index c895972b0e3ea4832a62829ff501b1295b421f1d..a13f34d50698b5877e5afcb33c33dcc04bab6bbd 100644 (file)
@@ -651,6 +651,11 @@ static void usage(char *pname)
        BlockSignals(True,SIGUSR2);
 #endif
 
+       /* POSIX demands that signals are inherited. If the invoking process has
+        * these signals masked, we will have problems, as we won't recieve them. */
+       BlockSignals(False, SIGHUP);
+       BlockSignals(False, SIGUSR1);
+
        /* we want total control over the permissions on created files,
           so set our umask to 0 */
        umask(0);