ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
Blob Blame History Raw
From d4466e04783415eee7eec269104e60ab1f6b4b50 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 30 Dec 2013 11:21:56 -0500
Subject: [PATCH] core/service: check if mainpid matches only if it is set

https://bugzilla.redhat.com/show_bug.cgi?id=1047304

Conflicts:
	src/core/service.c
---
 src/core/service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/service.c b/src/core/service.c
index 62ae8f0..f0acda1 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -3400,7 +3400,7 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) {
                 return;
         }
 
-        if (s->notify_access == NOTIFY_MAIN && pid != s->main_pid) {
+        if (s->notify_access == NOTIFY_MAIN && s->main_pid != 0 && pid != s->main_pid) {
                 log_warning_unit(u->id,
                                  "%s: Got notification message from PID %lu, but reception only permitted for PID %lu",
                                  u->id, (unsigned long) pid, (unsigned long) s->main_pid);