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