]> git.proxmox.com Git - mirror_lxcfs.git/commit - bindings.c
bindings: revert cgroup check
authorChristian Brauner <cbrauner@suse.de>
Thu, 25 Aug 2016 20:33:07 +0000 (22:33 +0200)
committerChristian Brauner <cbrauner@suse.de>
Fri, 26 Aug 2016 13:15:38 +0000 (15:15 +0200)
commit9873c5e858f9628435afa7ff6b6cc50afbb91e06
treebe73a4d33c558a420a52ae3333b480702c1d5a56
parent01b3416d798ce0e547a1efb5a1530c2ab7fc429a
bindings: revert cgroup check

We do not need to check whether mode & W_OK is passed in. Even if the cgroup
root mount is writeable operations like cg_mkdir() et al. will fail with e.g.
EPERM. Basically all operations will fail on the cgroup root mount point because
the first operation they perform is pick_controller_from_path(). That is to say
they try to e.g. pick "blkio" from /var/lib/lxcfs/cgroup/blkio/some/cgroups an
similiar for all other controllers. If pick_controller_from_path() fails they
all return an appropriate errno. For example, cg_mkdir() does:

        controller = pick_controller_from_path(fc, path);
        if (!controller)
                return errno == ENOENT ? -EPERM : -errno;

This means, we do not need to return an errno already in cg_access when
mode & W_OK is passed in. This has the advantage that users are still able to
descend into /var/lib/lxcfs/cgroup via:

        cd /var/lib/lxcfs/cgroup

but are still blocked from doing any write operations.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
bindings.c