nspawn: chown() the legacy hierarchy when it's used in a container

This is a follow-up to 720f0a2f3c.

Closes https://github.com/systemd/systemd/issues/10026
Closes https://github.com/systemd/systemd/issues/9563
This commit is contained in:
Evgeny Vereshchagin 2018-09-17 07:12:38 +00:00 committed by Lennart Poettering
parent c87700a133
commit 89f180201c
1 changed files with 1 additions and 1 deletions

View File

@ -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 */