Commit 8d961e28 by Tycho Andersen

cgroups: don't escape if we're not real root

If we're host unpriv but root in our userns, we can't really escape cgroups. Let's switch the cgroup escape test to reflect this. Signed-off-by: 's avatarTycho Andersen <tycho@tycho.ws>
parent e3bc3b86
...@@ -1368,7 +1368,7 @@ static char *cg_unified_get_current_cgroup(void) ...@@ -1368,7 +1368,7 @@ static char *cg_unified_get_current_cgroup(void)
bool will_escape; bool will_escape;
char *copy = NULL; char *copy = NULL;
will_escape = (geteuid() == 0); will_escape = !am_host_unpriv();
if (will_escape) if (will_escape)
basecginfo = read_file("/proc/1/cgroup"); basecginfo = read_file("/proc/1/cgroup");
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment