cgroups: non-root service cannot create child cgroups

The kernel delegation docs require write access on the directory so
the delegatee can mkdir() children.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2026-08-12 06:53:14 +02:00
parent d2781ef655
commit a35ed8f72e
+4
View File
@@ -339,6 +339,10 @@ static int cgroup_create(const char *group, const char *name, const char *cfg,
NULL
};
/* non-root delegated services needs permission to mkdir() */
if (chown(path, uid, gid))
warn("Failed chown %s to %d:%d", path, uid, gid);
for (int i = 0; files[i]; i++) {
snprintf(filepath, sizeof(filepath), "%s/%s", path, files[i]);
if (chown(filepath, uid, gid))