| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
with .read_only = true
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
entries
Otherwise, ProtectHome=tmpfs makes /home/ and friends not read-only.
Also, mount options for /run/ specified in MountAPIVFS=yes are not
applied.
The function append_static_mounts() was introduced in
5327c910d2fc1ae91bd0b891be92b30379c7467b, but at that time, there were
neither .read_only nor .options in the struct. But, when later the
struct is extended, the function was not updated and they were not
copied from the static table.
The fields has been used in static tables since
e4da7d8c796a1fd11ecfa80fb8a48eac9e823f06, and also in
94293d65cd4125347e21b3e423d0e245226b1be2.
Fixes #34825.
|
|
|
|
|
|
|
|
| |
Do not fail if the directory is missing entirely, other than just empty
Follow-up for 00f546e25e8
Follow-up for 5e79dd96a88
Follow-up for 622efc544dc
|
|
|
|
|
| |
The function sorts the listed mounts, and that's kinda key, hence
reflect that in the name.
|
|
|
|
|
|
| |
Follow-up for 0e551b04efb911d38b586cca1a6a462c87a2cb1b.
Similar to the previous commit, but for PrivateTmp=.
|
|
|
|
|
|
|
|
| |
Follow-up for fa693fdc7e17618958c505af4b2f39ecd1c3363e.
The documentation says the option takes a boolean or one of the "self"
and "identity". But the parser uses private_users_from_string() which
also accepts "off". Let's drop the implicit support of "off".
|
| |
|
|
|
|
|
|
|
|
| |
If the vpick directory is configured to be ignored if missing, do not
fail and just skip ahead.
Follow-up for 5e79dd96a88
Follow-up for 622efc544dc
|
|
|
|
|
| |
This configures an indentity mapping similar to
systemd-nspawn --private-users=identity.
|
|
|
|
| |
Addresses https://github.com/systemd/systemd/pull/32487#issuecomment-2328465309
|
|
|
|
|
|
|
|
| |
/run/systemd/journal/
Follow-up for 119820f8abf587f96a11fb1f28ef854e84bc3122
Addresses https://github.com/systemd/systemd/pull/32487#discussion_r1743493196
|
|
|
|
| |
Addresses https://github.com/systemd/systemd/pull/32487#discussion_r1743464797
|
| |
|
| |
|
|
|
|
| |
Closes #32478
|
|
|
|
|
|
|
|
|
| |
In apply_one_mount(), in the MOUNT_EXTENSION_DIRECTORY case,
char **extension_release was used as a return pointer twice but only
cleaned up once in the end. Fix it by removing duplicate code that
was causing this issue.
Fixes issue introduced in 55ea4ef096543d2bceea9315868d5aca945d7a57.
|
|
|
|
|
|
|
|
|
|
| |
If the destination mount point is on a shared filesystem and is
missing on the first attempt, we try to create it, but then
fail with -EEXIST if something else created it in the meanwhile.
Enter the retry logic on EEXIST, as we can just use the mount
point if it was already created.
Fixes https://github.com/systemd/systemd/issues/29690
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out OverlayFS doesn't handle gracefully when the same source is
specified multiple times in lowerdir= and it fails with ELOOP:
Failed to mount overlay (type overlay) on /run/systemd/mount-rootfs/opt (MS_RDONLY "lowerdir=/run/systemd/unit-extensions/1/opt:/run/systemd/unit-extensions/0/opt:/run/systemd/mount-rootfs/opt"): Too many levels of symbolic links
This happens even if we mount each image in a different internal mount
path, as OverlayFS will resolve it and look for the backing device, which
will be the same device mapper entity, and return a hard error.
This error does not appear if dm-verity is not used, so it is very
confusing for users, and unnecessary.
When mounting ExtensionImages, check if an image is dm-veritied,
and drop duplicates if the root hashes match, to avoid this user-unfriendly
hard error.
|
|
|
|
|
|
|
|
|
|
|
| |
As discussed in https://github.com/systemd/systemd/pull/32724#discussion_r1638963071
I don't find the opposite reasoning particularly convincing.
We have ProtectHome=tmpfs and friends, and those can be
pretty much trivially implemented through TemporaryFileSystem=
too. The new logic brings many benefits, and is completely generic,
hence I see no reason not to expose it. We can even get more tests
for the code path if we make it public.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
And drop spurious assertion.
Fortunately, the previous logic worked, as /run/systemd/unit-private-tmp
is ordered earlier than /tmp or /var/tmp. But, let's ensure the tmpfs
mounted earlier to make the logic clearer.
Follow-up for 0e551b04efb911d38b586cca1a6a462c87a2cb1b.
|
|\
| |
| | |
core: do not imply PrivateTmp with DynamicUser, create a private tmpfs instead
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
DynamicUser= enables PrivateTmp= implicitly to avoid files owned by reusable uids
leaking into the host. Change it to instead create a fully private tmpfs instance
instead, which also ensures the same result, since it has less impactful semantics
with respect to PrivateTmp=yes, which links the mount namespace to the host's /tmp
instead. If a user specifies PrivateTmp manually, let the existing behaviour
unchanged to ensure backward compatibility is not broken.
|
|/ |
|
|
|
|
| |
Let's make clear what this actually counts (at least initially).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- drop unnecessary SYNTHETIC_ERRNO() when the logger does not propagate
error code,
- drop unnecessary '%m' in error message when the error code is
specified with SYNTHETIC_ERRNO(),
- add missing full stop at the end of log message,
- use RET_GATHER(),
- add missing ", ignoring.",
- upeercase the first letter, etc., etc...
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
checking
let's make userspace verity signature checking optional. This adds a
dissection flag to enable the logic and patches through all our users to
enable it by default, thus effectively not changing anything from the
status quo ante. However, know we have a knob to turn this off in
certain scenarios.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
namespace
It doesn't really make sense to initialize the loopback device if we are
not called for a network namespace.
Follow-up for 54c2459d560283f556e331246f64776cebd6eba6
|
|
|
|
|
| |
Some of these checks before bitwise operations are redundant and compilers
do not always recognize them, so let's simplify the code to make the intentions
clearer.
|
| |
|
|
|
|
|
|
|
|
| |
The read-only bit is flipped after setting up all the mounts, so that
bind mounts can be added. Remove the early config, and add a unit
test.
Fixes https://github.com/systemd/systemd/issues/30372
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before confext was added, hierarchies always existed in extensions. Now
they are optional - i.e., a sysext will not contain /etc/. So mixing a
confext and a sysext fails, as we'll try to create an overlay with /etc/
from the base, the confext and the sysext, but the latter doesn't have
the directory.
After the source images are mounted, check that each hierarchy exists in
each source image before creating the overlay, and drop them if they
don't.
Follow-up for 55ea4ef096543
|
| |
|
|
|
|
|
|
|
|
| |
Let's prefix it with a common prefix, and make sure the names are all
singular and the string table actually matches the names.
No change in behavour, just some rafactoring to make this enum a bit
less special, and make it follow our usual coding style more closely.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a mount is gracefully skipped (e.g.: BindReadOnlyPaths=-/nonexistent)
we still post-process it, like making it read-only. Except if nothing
has been mounted, the mount point will be made read-only for no reason.
Track when mounts are skipped and avoid post-processing.
One day we'll switch all of this to the new mount api and do these
operations atomically or not at all.
Fixes https://github.com/systemd/systemd/issues/29725
|
|\
| |
| | |
core/namespace: check if we have enough privilege
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If we do not have enough privilege to mount a new instance of sysfs or
procfs, units e.g. with PrivateNetwork=yes may fail.
Let's first try to mount sysfs or procfs anyway to check if we have enough
privilege.
Fixes #29526.
|
| |
| |
| |
| | |
No functional change, just refactoring.
|
| |
| |
| |
| | |
No functional change, preparation for later commits.
|
| | |
|