]> git.ipfire.org Git - thirdparty/systemd.git/commit
sysext: Create mutable directory with the right mode
authorKai Lueke <kailuke@microsoft.com>
Tue, 2 Dec 2025 15:02:32 +0000 (00:02 +0900)
committerKai Lüke <kailueke@riseup.net>
Tue, 3 Feb 2026 22:55:36 +0000 (23:55 +0100)
commit2e4c2f8df781902db47f31ebe48b1e819955edf9
treea4673426df187135a4d07582f114722bdcdd4fb4
parent503a788332bda768fbcad485f8d51ee46f9e8c2f
sysext: Create mutable directory with the right mode

When the mutable directory didn't exist but gets created with
--mutable=yes then it used to get mode 700 and later it got patched by
a chmod because it is the top layer and must match the target hierarchy.
This meant one could not call the function to resolve the mutable
directory twice before the mount because it has a check for a proper
mode when the directory exists which is the case for the second call.
Also, this resulted in /var/lib/extensions.mutable getting created with
mode 700 which is not really required.

Don't rely on the chmod for the upper dir but directly create the
directory with the right mode by first creating all missing directories
with 755 as a sane default and then changing the mode as needed for the
mutable directory.
src/sysext/sysext.c