diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/messages.c | 7 | ||||
-rw-r--r-- | source3/lib/util.c | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 642caafac4..b745cbaf8b 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -144,6 +144,9 @@ static TDB_DATA message_key_pid(pid_t pid) static BOOL message_notify(pid_t pid) { + /* Doing kill with a non-positive pid causes messages to be + * sent to places we don't want. */ + SMB_ASSERT(pid > 0); if (kill(pid, SIGUSR1) == -1) { if (errno == ESRCH) { DEBUG(2,("pid %d doesn't exist - deleting messages record\n", (int)pid)); @@ -174,6 +177,10 @@ BOOL message_send_pid(pid_t pid, int msg_type, const void *buf, size_t len, rec.src = sys_getpid(); rec.len = len; + /* Doing kill with a non-positive pid causes messages to be + * sent to places we don't want. */ + SMB_ASSERT(pid > 0); + kbuf = message_key_pid(pid); /* lock the record for the destination */ diff --git a/source3/lib/util.c b/source3/lib/util.c index 8867d37d57..a2f8c086e8 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1034,6 +1034,9 @@ check if a process exists. Does this work on all unixes? BOOL process_exists(pid_t pid) { + /* Doing kill with a non-positive pid causes messages to be + * sent to places we don't want. */ + SMB_ASSERT(pid > 0); return(kill(pid,0) == 0 || errno != ESRCH); } |