diff options
author | Volker Lendecke <vl@samba.org> | 2016-07-19 14:36:07 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2016-07-20 09:03:59 +0200 |
commit | 698f6517866f567e999baf5b63ec7e6f5e9452a8 (patch) | |
tree | 26d2eb1f5546c6bc1f9290522a782e029ec53873 /source3 | |
parent | fa96452f9cde535f3cfe31afe8c54199a940f027 (diff) | |
download | samba-698f6517866f567e999baf5b63ec7e6f5e9452a8.tar.gz |
notifyd: Move BlockSignals calls to server.c
notifyd_send() is called as part of smbd initialization both in normal daemon
mode after a fork, but also in interactive mode. In interactive mode, notifyd
should not modify the global signal state with BlockSignals(). This patch moves
the signal blocking to the place where we know that notifyd is a child daemon.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul 20 09:04:00 CEST 2016 on sn-devel-144
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/notifyd/notifyd.c | 4 | ||||
-rw-r--r-- | source3/smbd/server.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source3/smbd/notifyd/notifyd.c b/source3/smbd/notifyd/notifyd.c index 519109f934c..69d30f79cf0 100644 --- a/source3/smbd/notifyd/notifyd.c +++ b/source3/smbd/notifyd/notifyd.c @@ -258,10 +258,6 @@ struct tevent_req *notifyd_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, return tevent_req_post(req, ev); } - /* Block those signals that we are not handling */ - BlockSignals(True, SIGHUP); - BlockSignals(True, SIGUSR1); - if (ctdbd_conn == NULL) { /* * No cluster around, skip the database replication diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 0d7e43b0811..9e3c652e16e 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -416,6 +416,10 @@ static bool smbd_notifyd_init(struct messaging_context *msg, bool interactive, } tevent_req_set_callback(req, notifyd_stopped, msg); + /* Block those signals that we are not handling */ + BlockSignals(True, SIGHUP); + BlockSignals(True, SIGUSR1); + messaging_send(msg, pid_to_procid(getppid()), MSG_SMB_NOTIFY_STARTED, NULL); |