a52f674
From d252d0b50d37bffd19b71572115447fc67f2acf5 Mon Sep 17 00:00:00 2001
b12ff75
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
b12ff75
Date: Mon, 30 Dec 2013 11:21:56 -0500
b12ff75
Subject: [PATCH] core/service: check if mainpid matches only if it is set
b12ff75
b12ff75
https://bugzilla.redhat.com/show_bug.cgi?id=1047304
a52f674
(cherry picked from commit da13d4d20f8ca12e86863abbae5ed47bca936828)
b12ff75
b12ff75
Conflicts:
b12ff75
	src/core/service.c
b12ff75
---
b12ff75
 src/core/service.c | 2 +-
b12ff75
 1 file changed, 1 insertion(+), 1 deletion(-)
b12ff75
b12ff75
diff --git a/src/core/service.c b/src/core/service.c
b12ff75
index 62ae8f0..f0acda1 100644
b12ff75
--- a/src/core/service.c
b12ff75
+++ b/src/core/service.c
b12ff75
@@ -3400,7 +3400,7 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) {
b12ff75
                 return;
b12ff75
         }
b12ff75
 
b12ff75
-        if (s->notify_access == NOTIFY_MAIN && pid != s->main_pid) {
b12ff75
+        if (s->notify_access == NOTIFY_MAIN && s->main_pid != 0 && pid != s->main_pid) {
b12ff75
                 log_warning_unit(u->id,
b12ff75
                                  "%s: Got notification message from PID %lu, but reception only permitted for PID %lu",
b12ff75
                                  u->id, (unsigned long) pid, (unsigned long) s->main_pid);