summaryrefslogtreecommitdiffstats
path: root/src/nspawn
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2018-09-17 09:12:38 +0200
committerLennart Poettering <lennart@poettering.net>2018-09-26 17:29:17 +0200
commit89f180201cd8c0f3ce5cb6e8dd7e2b3cbcf71527 (patch)
treee6ff107f397322e49d006b9abc5f6663037bce3e /src/nspawn
parentMake Watchdog Signal Configurable (diff)
downloadsystemd-89f180201cd8c0f3ce5cb6e8dd7e2b3cbcf71527.tar.xz
systemd-89f180201cd8c0f3ce5cb6e8dd7e2b3cbcf71527.zip
nspawn: chown() the legacy hierarchy when it's used in a container
This is a follow-up to 720f0a2f3c928cc9379501a52146be9fbb4d9be2. Closes https://github.com/systemd/systemd/issues/10026 Closes https://github.com/systemd/systemd/issues/9563
Diffstat (limited to 'src/nspawn')
-rw-r--r--src/nspawn/nspawn-cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nspawn/nspawn-cgroup.c b/src/nspawn/nspawn-cgroup.c
index f7ec077f7b..8732c9e2aa 100644
--- a/src/nspawn/nspawn-cgroup.c
+++ b/src/nspawn/nspawn-cgroup.c
@@ -59,7 +59,7 @@ int chown_cgroup(pid_t pid, CGroupUnified unified_requested, uid_t uid_shift) {
if (r < 0)
return log_error_errno(r, "Failed to chown() cgroup %s: %m", fs);
- if (unified_requested == CGROUP_UNIFIED_SYSTEMD) {
+ if (unified_requested == CGROUP_UNIFIED_SYSTEMD || (unified_requested == CGROUP_UNIFIED_NONE && cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER) > 0)) {
_cleanup_free_ char *lfs = NULL;
/* Always propagate access rights from unified to legacy controller */