mirror of
https://github.com/systemd/systemd.git
synced 2026-08-02 22:20:20 +00:00
use O_PATH when getting cgroup fd
O_PATH mode is enough to attach a bpf program to a cgroup, use it instead of O_RDONLY
This commit is contained in:
@@ -128,7 +128,7 @@ static int restrict_ifaces_install_impl(Unit *u) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
cgroup_fd = open(cgroup_path, O_RDONLY | O_CLOEXEC | O_DIRECTORY, 0);
|
||||
cgroup_fd = open(cgroup_path, O_PATH | O_CLOEXEC | O_DIRECTORY, 0);
|
||||
if (cgroup_fd < 0)
|
||||
return -errno;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user