commit:     971e82784cd1ad8f9a286ee792e6417359972976
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon Nov 13 22:54:57 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Nov 13 22:54:57 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=971e8278

rc_find_pids: namespace fix

Ignore namespaces if there are errors reading either the pid namespace
for the current process or the process we aare testing.

This fixes https://github.com/openrc/openrc/issues/180.

 src/librc/librc-daemon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 916cc142..a40150a6 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -155,7 +155,7 @@ rc_find_pids(const char *exec, const char *const *argv, 
uid_t uid, pid_t pid)
                        if (rc <= 0)
                                proc_ns[0] = '\0';
                }
-               if (strcmp(my_ns, proc_ns))
+               if (strlen(my_ns) && strlen (proc_ns) && strcmp(my_ns, proc_ns))
                        continue;
                if (uid) {
                        snprintf(buffer, sizeof(buffer), "/proc/%d", p);

Reply via email to