horizon-server update: unpack as the user, not the archive's owners

As root in a user namespace (an unprivileged LXC or rootless container), GNU tar
keeps the archive's owners by default and fails on IDs it can't map, so the update
stopped at "tar couldn't unpack". Found driving the launcher's Update now from one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-19 15:31:55 +02:00
parent 43287c18c2
commit a4b7ac4a9b
+4 -1
View File
@@ -301,8 +301,11 @@ pub fn unpack(install: &Install, archive: &Path, tag: &str) -> Result<PathBuf, S
.and_then(|mut z| z.extract(&scratch))
.map_err(|e| format!("{}: {e}", archive.display()))?;
} else if name.ends_with(".tar.gz") || name.ends_with(".tgz") {
// tar is on every Linux and macOS, and on Windows 10 and later.
// tar is on every Linux and macOS, and on Windows 10 and later. The files are the
// user's, not the archive's owners: as root in a user namespace (an unprivileged LXC
// or rootless container) taking those fails, and as plain root they'd be strangers'.
let status = Command::new("tar")
.arg("--no-same-owner")
.arg("-xzf")
.arg(archive)
.arg("-C")