Mask general purpose signals for notifyd.
authorHemanth Thummala <hemanth.thummala@nutanix.com>
Thu, 14 Apr 2016 20:09:37 +0000 (13:09 -0700)
committerStefan Metzmacher <metze@samba.org>
Fri, 15 Apr 2016 13:31:19 +0000 (15:31 +0200)
Currently there is no signal handling available for notify daemon.
Signals like SIGHUP and SIGUSR1 can lead to terminate the notify
daemon. Masking these signals for notifyd as we are not handling them.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11840

Signed-off-by: Hemanth Thummala <hemanth.thummala@nutanix.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Apr 15 15:31:19 CEST 2016 on sn-devel-144

source3/smbd/notifyd/notifyd.c

index 316cdeae67ba5379bf3e0f6d421c909ec29fe6dd..49fb9c954fc95a4e87e0b565bf8d8f6553aa1874 100644 (file)
@@ -256,6 +256,10 @@ 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