From: Christian Brauner Date: Fri, 19 Feb 2021 10:31:20 +0000 (+0100) Subject: cgroups: tweak bpf_device_cgroup_prepare() X-Git-Tag: lxc-5.0.0~275^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30bfbd3ff1638b57949db66060317a0a34d2b838;p=thirdparty%2Flxc.git cgroups: tweak bpf_device_cgroup_prepare() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 14155924f..4a44e3eba 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -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