fix(switcher): control plane is libreportal in BOTH modes (root was never intended)

Correction from the maintainer: /docker was always libreportal:libreportal;
root:root only ever appeared as an artifact of un-de-sudo'd sudo commands, not
by design. reconcileDockerOwnership now always assigns the control plane to the
manager user regardless of mode (was wrongly root:root for rooted). The deeper
implication — that the de-sudo helpers' rooted=sudo path also re-creates
root-owned files — is being confirmed before realigning.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
librelad 2026-05-24 01:36:29 +01:00
parent 9ec95657b7
commit 3f7622d9e3

View File

@ -22,8 +22,10 @@ reconcileDockerOwnership()
local mode="${1:-$CFG_DOCKER_INSTALL_TYPE}"
[[ -d "$docker_dir" ]] || return 0
local owner="root"
[[ "$mode" == "rootless" ]] && owner="$sudo_user_name"
# The control plane is owned by the MANAGER user in BOTH modes. root:root was
# never the intended model — it only ever showed up as an artifact of
# un-de-sudo'd commands (sudo creating files as root instead of libreportal).
local owner="$sudo_user_name"
# Swap ONLY the owner on our own control-plane files; never reset mode bits
# (so nothing that validates its permissions gets surprised). The only two