[PATCH v2 1/2] vm/app/systemd-sysupdate: fix mounting overlay

Alyssa Ross
2025-12-08T21:04:55Z

This assumed it would be run as root, so has been broken since we
stopped running application scripts as root inside img/app VMs.

Reported-by: Johannes Süllner <johannes.suellner@mailbox.org>
Link: https://matrix.to/#/!xSysqhzbOZImdvGpix:fairydust.space/$9psDI3BIP00EIzW-qOqzJswkwzgYyQLKpbfDDp0uo6k?via=fairydust.space&via=matrix.org&via=dataaturservice.se
Fixes: 8bfcbf9 ("img/app: run applications as non-root")
Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
v2: remove redundant -U flag
v1: https://spectrum-os.org/lists/archives/spectrum-devel/20251208154738.300709-1-hi@alyssa.is/

vm/app/systemd-sysupdate/download-update | 1 +
1 file changed, 1 insertion(+)

diff --git a/vm/app/systemd-sysupdate/download-update b/vm/app/systemd-sysupdate/download-update
index eada41c..f8f5aed 100755
--- a/vm/app/systemd-sysupdate/download-update
+++ b/vm/app/systemd-sysupdate/download-update
@@ -3,6 +3,7 @@
# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
export LC_ALL C
export LANGUAGE C
+unshare -mr
if { mount -toverlay -olowerdir=/run/virtiofs/virtiofs0/etc:/etc -- overlay /etc }
backtick tmpdir { mktemp -d /tmp/sysupdate-XXXXXX }
# Not a useless use of cat: if there are NUL bytes in the URL

base-commit: 5104fa720ce8b00612c5487fc47124fbf99e58c6
--
2.51.0