diff options
author | David O'Neill <dmo@samba.org> | 2001-01-25 16:36:42 +0000 |
---|---|---|
committer | David O'Neill <dmo@samba.org> | 2001-01-25 16:36:42 +0000 |
commit | b4c98196fc65e8b3bce928296e854987622eae78 (patch) | |
tree | 0367d63d899543a46e12774a49539c44e3b1464a | |
parent | 09902d2d4a51b134190861fbb3ddaabcae5bc1bb (diff) | |
download | samba-b4c98196fc65e8b3bce928296e854987622eae78.tar.gz samba-b4c98196fc65e8b3bce928296e854987622eae78.tar.xz samba-b4c98196fc65e8b3bce928296e854987622eae78.zip |
Changes from APPLIANCE_HEAD:
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.
-rw-r--r-- | source/nmbd/nmbd.c | 6 | ||||
-rw-r--r-- | source/smbd/server.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c index 5b9a00aad0e..f772788341e 100644 --- a/source/nmbd/nmbd.c +++ b/source/nmbd/nmbd.c @@ -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 ); diff --git a/source/smbd/server.c b/source/smbd/server.c index c895972b0e3..a13f34d5069 100644 --- a/source/smbd/server.c +++ b/source/smbd/server.c @@ -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); |