messaging: Don't do self-sends in messaging_send_all
authorVolker Lendecke <vl@samba.org>
Fri, 8 Dec 2017 16:18:33 +0000 (17:18 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 12 Dec 2017 19:37:08 +0000 (20:37 +0100)
This leads to cleanupd doing endless MSG_SMB_UNLOCK calls, as it triggers
itself in the send_all. This worked correctly before the serverid.tdb removal
because cleanupd did not register in serverid.tdb (which was a bug, but it
helped us there).

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/messages.c

index a0a3f9fb1ba386274e5e6b9e2af83b0e3798c5b4..561616df6e44da9c989f90253cf2fc534a22422c 100644 (file)
@@ -857,6 +857,11 @@ static int send_all_fn(pid_t pid, void *private_data)
        struct send_all_state *state = private_data;
        NTSTATUS status;
 
+       if (pid == getpid()) {
+               DBG_DEBUG("Skip ourselves in messaging_send_all\n");
+               return 0;
+       }
+
        status = messaging_send_buf(state->msg_ctx, pid_to_procid(pid),
                                    state->msg_type, state->buf, state->len);
        if (!NT_STATUS_IS_OK(status)) {