]> git.ipfire.org Git - thirdparty/systemd.git/commit
discover-image: imply that hidden images are read-only
authorLennart Poettering <lennart@poettering.net>
Mon, 25 Aug 2025 10:26:53 +0000 (12:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 24 Oct 2025 15:51:00 +0000 (17:51 +0200)
commitee327e086e0534645d1c8cb9daa49cd8d7d68d51
treeb1970618afc72cc7989c4d49160ee4f8622b5742
parent502f7a2b804370d32adb373e661831f583565075
discover-image: imply that hidden images are read-only

Marking a whole directory tree OS image as read-only is difficult
privilege-wise, because so far we rely on the FS_IMMUTABLE_FL which is
not accessible to unpriv clients.

One fundamental place where we currently rely on marking images
read-only is for keeping pristine copies of the originally downloaded
image around, which we place in "hidden" image directories. This is
probably the most relevant usecase for the read-only flag. And moreover,
the only usecase for the hidden images are these read-only pristine
copies.

Hence, let's make this work reasonably in the unpriv case, and simply
imply the read-only flag for hidden images. This is strictly speaking a
change in behaviour, but effectively it shouldn't be, because for nspawn
containers that are executed we insist on names that are hostname
compatible, and hidden names aren't (because they start with a dot).
src/dissect/dissect.c
src/import/importd.c
src/machine/image-dbus.c
src/machine/machined-dbus.c
src/machine/machined-varlink.c
src/nspawn/nspawn.c
src/portable/portabled-bus.c
src/portable/portabled-image-bus.c
src/shared/discover-image.c
src/shared/discover-image.h