Skip to content

Commit

Permalink
Merge pull request lxc#57 from tych0/can-see-root-cgroup
Browse files Browse the repository at this point in the history
caller_may_see_dir: correctly handle tasks in /
  • Loading branch information
hallyn committed Dec 7, 2015
2 parents a2de34b + a57cba3 commit 121013f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lxcfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,15 @@ static bool caller_may_see_dir(pid_t pid, const char *contrl, const char *cg)
task_cg = c2 + 1;
target_len = strlen(cg);
task_len = strlen(task_cg);
if (task_len == 0) {
/* Task is in the root cg, it can see everything. This case is
* not handled by the strmcps below, since they test for the
* last /, but that is the first / that we've chopped off
* above.
*/
answer = true;
goto out;
}
if (strcmp(cg, task_cg) == 0) {
answer = true;
goto out;
Expand Down

0 comments on commit 121013f

Please sign in to comment.