Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 499594 Details for
Bug 634634
sys-apps/openrc-0.32.1 fails to start sshd on the host when LXC container contains running sshd
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0001-rc_find_pids-skip-pids-in-different-pid-namespaces.patch
0001-rc_find_pids-skip-pids-in-different-pid-namespaces.patch (text/plain), 1.71 KB, created by
William Hubbs
on 2017-10-21 22:25:03 UTC
(
hide
)
Description:
0001-rc_find_pids-skip-pids-in-different-pid-namespaces.patch
Filename:
MIME Type:
Creator:
William Hubbs
Created:
2017-10-21 22:25:03 UTC
Size:
1.71 KB
patch
obsolete
>From 6fb41f977c9465a0d72ec083986863bc39f4e3f4 Mon Sep 17 00:00:00 2001 >From: William Hubbs <w.d.hubbs@gmail.com> >Date: Sat, 21 Oct 2017 17:01:48 -0500 >Subject: [PATCH] rc_find_pids: skip pids in different pid namespaces > >--- > src/librc/librc-daemon.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > >diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c >index 56aaa91b..916cc142 100644 >--- a/src/librc/librc-daemon.c >+++ b/src/librc/librc-daemon.c >@@ -80,9 +80,12 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid) > DIR *procdir; > struct dirent *entry; > FILE *fp; >+ int rc; > bool container_pid = false; > bool openvz_host = false; > char *line = NULL; >+ char my_ns[30]; >+ char proc_ns[30]; > size_t len = 0; > pid_t p; > char buffer[PATH_MAX]; >@@ -131,6 +134,14 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid) > } > } > >+ memset(my_ns, 0, sizeof(my_ns)); >+ memset(proc_ns, 0, sizeof(proc_ns)); >+ if (exists("/proc/self/ns/pid")) { >+ rc = readlink("/proc/self/ns/pid", my_ns, sizeof(my_ns)); >+ if (rc <= 0) >+ my_ns[0] = '\0'; >+ } >+ > while ((entry = readdir(procdir)) != NULL) { > if (sscanf(entry->d_name, "%d", &p) != 1) > continue; >@@ -138,6 +149,14 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid) > continue; > if (pid != 0 && pid != p) > continue; >+ snprintf(buffer, sizeof(buffer), "/proc/%d/ns/pid", p); >+ if (exists(buffer)) { >+ rc = readlink(buffer, proc_ns, sizeof(proc_ns)); >+ if (rc <= 0) >+ proc_ns[0] = '\0'; >+ } >+ if (strcmp(my_ns, proc_ns)) >+ continue; > if (uid) { > snprintf(buffer, sizeof(buffer), "/proc/%d", p); > if (stat(buffer, &sb) != 0 || sb.st_uid != uid) >-- >2.13.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 634634
: 499594