aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2021-03-22 11:34:41 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2021-03-22 11:34:41 -0500
commitef76a663bcc03d4cc9dd1ef05c800f208e26d0ed (patch)
treeb0f75ba4716a66f4cfd1bdd779d6d1b5ea6c7d59 /src
parentfccd37c34cbabe77d701316491b899a0eb529114 (diff)
stop namespaced services with specified pids
The previous fix excludes PIDs of processes running in a different namespace regardless of whether the PID has been explicitly stored in a PID file mentioned in the --pidfile parameter. The correct behavior is to only exclude the pid if it is not stored in a pidfile. X-Gentoo-Bug: 776010 X-Gentoo-Bug-URL: https://bugs.gentoo.org/776010
Diffstat (limited to 'src')
-rw-r--r--src/librc/librc-daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 863e80d1..0a0fbb8f 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -160,7 +160,7 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid)
proc_ns[0] = '\0';
}
free(buffer);
- if (strlen(my_ns) && strlen (proc_ns) && strcmp(my_ns, proc_ns))
+ if (pid == 0 && strlen(my_ns) && strlen (proc_ns) && strcmp(my_ns, proc_ns))
continue;
if (uid) {
xasprintf(&buffer, "/proc/%d", p);