]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/notifyd: ensure notifyd doesn't return from smbd_notifyd_init
authorRalph Boehme <slow@samba.org>
Fri, 14 Jul 2017 14:38:36 +0000 (16:38 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 24 Jul 2017 00:25:21 +0000 (02:25 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12910

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 7f4e7cfd1b0bd917395c631a1a8195fffd13bbad)

source3/smbd/server.c

index 6d0c66451962453e89e3b8437bed0cf774867408..a9aa796b850c9bd118bac08387099d8b6e762bfa 100644 (file)
@@ -383,6 +383,7 @@ static bool smbd_notifyd_init(struct messaging_context *msg, bool interactive,
        struct tevent_req *req;
        pid_t pid;
        NTSTATUS status;
+       bool ok;
 
        if (interactive) {
                req = notifyd_req(msg, ev);
@@ -424,7 +425,12 @@ static bool smbd_notifyd_init(struct messaging_context *msg, bool interactive,
        messaging_send(msg, pid_to_procid(getppid()), MSG_SMB_NOTIFY_STARTED,
                       NULL);
 
-       return tevent_req_poll(req, ev);
+       ok = tevent_req_poll(req, ev);
+       if (!ok) {
+               DBG_WARNING("tevent_req_poll returned %s\n", strerror(errno));
+               exit(1);
+       }
+       exit(0);
 }
 
 static void notifyd_init_trigger(struct tevent_req *req);