Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 373606 Details for
Bug 376817
make OpenVZ host to automatically filters out container's processes
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix-openvz.patch
fix-openvz.patch (text/plain), 1.05 KB, created by
William Hubbs
on 2014-03-26 22:46:56 UTC
(
hide
)
Description:
fix-openvz.patch
Filename:
MIME Type:
Creator:
William Hubbs
Created:
2014-03-26 22:46:56 UTC
Size:
1.05 KB
patch
obsolete
>diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c >index e98b02c..3f462bf 100644 >--- a/src/librc/librc-daemon.c >+++ b/src/librc/librc-daemon.c >@@ -90,6 +90,10 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid) > { > DIR *procdir; > struct dirent *entry; >+ FILE *fp; >+ bool host_process = true; >+ char *line = NULL; >+ size_t len = 0; > pid_t p; > char buffer[PATH_MAX]; > struct stat sb; >@@ -134,6 +138,21 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid) > if (argv && > !pid_is_argv(p, (const char *const *)argv)) > continue; >+ snprintf(buffer, sizeof(buffer), "/proc/%d/status", p); >+ if (exists(buffer)) { >+ fp = fopen(buffer, "r"); >+ if (! fp) >+ continue; >+ while (! feof(fp) && host_process) { >+ rc_getline(fp, &line, &len); >+ if (strncmp(line, "envID:", 6) == 0) >+ host_process = (strncmp(line, "envID:\t0", 8) == 0); >+ } >+ free(line); >+ fclose(fp); >+ } >+ if (! host_process) >+ continue; > if (!pids) { > pids = xmalloc(sizeof(*pids)); > LIST_INIT(pids);
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 376817
:
285095
|
373506
|
373606
|
374934
|
379228