Skip to content

Commit

Permalink
cgroups: update terminology
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Jul 3, 2020
1 parent ffa6884 commit 29a01c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/lxc/cgroups/cgfsng.c
Expand Up @@ -2562,8 +2562,8 @@ static int device_cgroup_rule_parse(struct device_item *device, const char *key,
device->major = -1;
device->minor = -1;
device->global_rule = device->allow
? LXC_BPF_DEVICE_CGROUP_BLACKLIST
: LXC_BPF_DEVICE_CGROUP_WHITELIST;
? LXC_BPF_DEVICE_CGROUP_DENYLIST
: LXC_BPF_DEVICE_CGROUP_ALLOWLIST;
device->allow = -1;
return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions src/lxc/cgroups/cgroup2_devices.c
Expand Up @@ -176,7 +176,7 @@ struct bpf_program *bpf_program_new(uint32_t prog_type)
/*
* By default a whitelist is used unless the user tells us otherwise.
*/
prog->device_list_type = LXC_BPF_DEVICE_CGROUP_WHITELIST;
prog->device_list_type = LXC_BPF_DEVICE_CGROUP_ALLOWLIST;

return move_ptr(prog);
}
Expand Down Expand Up @@ -298,7 +298,7 @@ int bpf_program_finalize(struct bpf_program *prog)
return ret_set_errno(-1, EINVAL);

TRACE("Implementing %s bpf device cgroup program",
prog->device_list_type == LXC_BPF_DEVICE_CGROUP_BLACKLIST
prog->device_list_type == LXC_BPF_DEVICE_CGROUP_DENYLIST
? "blacklist"
: "whitelist");

Expand Down Expand Up @@ -450,10 +450,10 @@ int bpf_list_add_device(struct lxc_conf *conf, struct device_item *device)
if (cur->global_rule > LXC_BPF_DEVICE_CGROUP_LOCAL_RULE &&
device->global_rule > LXC_BPF_DEVICE_CGROUP_LOCAL_RULE) {
TRACE("Switched from %s to %s",
cur->global_rule == LXC_BPF_DEVICE_CGROUP_WHITELIST
cur->global_rule == LXC_BPF_DEVICE_CGROUP_ALLOWLIST
? "whitelist"
: "blacklist",
device->global_rule == LXC_BPF_DEVICE_CGROUP_WHITELIST
device->global_rule == LXC_BPF_DEVICE_CGROUP_ALLOWLIST
? "whitelist"
: "blacklist");
cur->global_rule = device->global_rule;
Expand Down
8 changes: 4 additions & 4 deletions src/lxc/conf.h
Expand Up @@ -215,8 +215,8 @@ struct lxc_state_client {

enum {
LXC_BPF_DEVICE_CGROUP_LOCAL_RULE = -1,
LXC_BPF_DEVICE_CGROUP_WHITELIST = 0,
LXC_BPF_DEVICE_CGROUP_BLACKLIST = 1,
LXC_BPF_DEVICE_CGROUP_ALLOWLIST = 0,
LXC_BPF_DEVICE_CGROUP_DENYLIST = 1,
};

struct device_item {
Expand All @@ -227,8 +227,8 @@ struct device_item {
int allow;
/*
* LXC_BPF_DEVICE_CGROUP_LOCAL_RULE -> no global rule
* LXC_BPF_DEVICE_CGROUP_WHITELIST -> whitelist (deny all)
* LXC_BPF_DEVICE_CGROUP_BLACKLIST -> blacklist (allow all)
* LXC_BPF_DEVICE_CGROUP_ALLOWLIST -> allowlist (deny all)
* LXC_BPF_DEVICE_CGROUP_DENYLIST -> denylist (allow all)
*/
int global_rule;
};
Expand Down

0 comments on commit 29a01c3

Please sign in to comment.