Blame SOURCES/005-security-code.patch
|
 |
a125f5 |
From d9b0269d59a00329feb19b6e65b10a233a3dd414 Mon Sep 17 00:00:00 2001
|
|
 |
a125f5 |
From: Ken Gaillot <kgaillot@redhat.com>
|
|
 |
a125f5 |
Date: Mon, 29 Apr 2019 14:34:32 -0500
|
|
 |
a125f5 |
Subject: [PATCH] Low: libcrmcommon: return proper code if testing pid is
|
|
 |
a125f5 |
denied
|
|
 |
a125f5 |
|
|
 |
a125f5 |
7dda20d avoided a use-of-NULL in an unlikely corner case, but returned the
|
|
 |
a125f5 |
wrong code in that case.
|
|
 |
a125f5 |
---
|
|
 |
a125f5 |
lib/common/pid.c | 2 +-
|
|
 |
a125f5 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
 |
a125f5 |
|
|
 |
a125f5 |
diff --git a/lib/common/pid.c b/lib/common/pid.c
|
|
 |
a125f5 |
index 4fbf2dd..ccee03f 100644
|
|
 |
a125f5 |
--- a/lib/common/pid.c
|
|
 |
a125f5 |
+++ b/lib/common/pid.c
|
|
 |
a125f5 |
@@ -47,7 +47,7 @@ crm_pid_active(long pid, const char *daemon)
|
|
 |
a125f5 |
} else if ((rc = kill(pid, 0)) < 0 && errno == ESRCH) {
|
|
 |
a125f5 |
return 0; /* no such PID detected */
|
|
 |
a125f5 |
|
|
 |
a125f5 |
- } else if (rc < 0 && have_proc_pid == -1) {
|
|
 |
a125f5 |
+ } else if (rc < 0 && (daemon == NULL || have_proc_pid == -1)) {
|
|
 |
a125f5 |
if (last_asked_pid != pid) {
|
|
 |
a125f5 |
crm_info("Cannot examine PID %ld: %s", pid, strerror(errno));
|
|
 |
a125f5 |
last_asked_pid = pid;
|
|
 |
a125f5 |
--
|
|
 |
a125f5 |
1.8.3.1
|
|
 |
a125f5 |
|