manager: make use of pid_is_valid() where appropriate
authorLennart Poettering <lennart@poettering.net>
Fri, 5 Jan 2018 11:19:22 +0000 (12:19 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 Jan 2018 14:12:16 +0000 (15:12 +0100)
src/core/manager.c

index 6f50b17..35cd9ee 100644 (file)
@@ -1977,7 +1977,7 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
                 }
         }
 
-        if (!ucred || ucred->pid <= 0) {
+        if (!ucred || !pid_is_valid(ucred->pid)) {
                 log_warning("Received notify message without valid credentials. Ignoring.");
                 return 0;
         }