anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0173-core-service-check-if-mainpid-matches-only-if-it-is-.patch

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