Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:0.34.x commit in: src/librc/
Date: Mon, 13 Nov 2017 23:56:36
Message-Id: 1510616876.65439ba023195786e71316f6638b52603e102f60.williamh@OpenRC
1 commit: 65439ba023195786e71316f6638b52603e102f60
2 Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
3 AuthorDate: Mon Nov 13 22:54:57 2017 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 13 23:47:56 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=65439ba0
7
8 rc_find_pids: namespace fix
9
10 Ignore namespaces if there are errors reading either the pid namespace
11 for the current process or the process we aare testing.
12
13 This fixes https://github.com/openrc/openrc/issues/180.
14
15 src/librc/librc-daemon.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18 diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
19 index 916cc142..a40150a6 100644
20 --- a/src/librc/librc-daemon.c
21 +++ b/src/librc/librc-daemon.c
22 @@ -155,7 +155,7 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid)
23 if (rc <= 0)
24 proc_ns[0] = '\0';
25 }
26 - if (strcmp(my_ns, proc_ns))
27 + if (strlen(my_ns) && strlen (proc_ns) && strcmp(my_ns, proc_ns))
28 continue;
29 if (uid) {
30 snprintf(buffer, sizeof(buffer), "/proc/%d", p);