]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: tweak bpf_device_cgroup_prepare()
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 19 Feb 2021 10:31:20 +0000 (11:31 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 19 Feb 2021 14:23:26 +0000 (15:23 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 14155924f1658f46753c0af963f7d98a4a63def0..4a44e3eba3da594be95f3ba93af9360e507bdd4f 100644 (file)
@@ -3088,12 +3088,12 @@ static int bpf_device_cgroup_prepare(struct cgroup_ops *ops,
        struct device_item device_item = {};
        int ret;
 
-       if (strequal("devices.allow", key) && *val == '/')
+       if (strequal("devices.allow", key) && abspath(val))
                ret = device_cgroup_rule_parse_devpath(&device_item, val);
        else
                ret = device_cgroup_rule_parse(&device_item, key, val);
        if (ret < 0)
-               return log_error_errno(-1, EINVAL, "Failed to parse device string %s=%s", key, val);
+               return syserrno_set(EINVAL, "Failed to parse device rule %s=%s", key, val);
 
        /*
         * Note that bpf_list_add_device() returns 1 if it altered the device