Commit Graph
83721 Commits
Author SHA1 Message Date
Yu Watanabe cbdbf68a72 man/repart: fix typo
Follow-up for 49dcc89ddc.
2025-09-19 20:24:09 +09:00
Yu Watanabe 2672108a1e creds-util: fix typo
Follow-up for 9be0a94b98.
2025-09-19 20:23:05 +09:00
Yu Watanabe b0f6d31f6f varlink: flag -> flags
Follow-up for 86fd19af14.
2025-09-19 20:21:22 +09:00
Luca Boccassi 12ef7e0a2c docs: use '_' as separator for OSC page
Make it consistent with other pages

Fixes https://github.com/systemd/systemd/issues/39019
2025-09-19 20:11:46 +09:00
Mike Yuan 01184496a2 virt: revert to detect chroot by comparing with / rather than /proc/PID/root
This partially reverts d6267b9b18

So, arch-chroot currently uses a rather cursed setup:
it sets up a PID namespace, but mounts /proc/ from the outside
into the chroot tree, and then call chroot(2), essentially
making it somewhere between chroot(8) and a full-blown
container. Hence, the PID dirs in /proc/ reveal the outer world.
The offending commit switched chroot detection to compare
/proc/1/root and /proc/OUR_PID/root, exhibiting the faulty behavior
where the mentioned environment now gets deemed to be non-chroot.

Now, this is very much an issue in arch-chroot. However,
if /proc/ is to be properly associated with the pidns,
then we'd treat it as a container and no longer a chroot.
Also, the previous logic feels more readable and more
honestly reported errors in proc_mounted(). Hence I opted
for reverting the change here. Still note that the culprit
(once again :/) lies in the arch-chroot's pidns impl, not
systemd.

Fixes https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/issues/54
2025-09-19 13:09:34 +02:00
Yu Watanabe c3c42b30dd firewall-util: remove iptables/libiptc backend support (#38976)
This removes iptables/libiptc backend support in firewall-util, as
already announced by 5c68c51045.
Then, this drops meaningless `FirewallContext` wrapper.
2025-09-19 19:54:17 +09:00
Lennart Poettering bdd8728c91 various: port remaining users of setmntent() to libmount (#38929) 2025-09-19 09:26:06 +02:00
Yu Watanabe fbbbff01fb various tweaks for systemd-creds & related (#38979) 2025-09-19 16:21:12 +09:00
Yu Watanabe 542552612b chase: tweaks to chase_open()/chase_openat() (#38984) 2025-09-19 16:11:24 +09:00
Yu Watanabe 9a8f2b628d chattr-util/acl-util: add helpers that tells us if an inode type can do chattr/acl (#39003)
Split out of #38728 but I think this makes things more readable in
general and makes sense on its own.
2025-09-19 15:50:18 +09:00
Yu Watanabe 8835034df8 importd: some minor tweaks (#39008) 2025-09-19 15:48:14 +09:00
Lennart Poettering 625c2e10c6 importd: port to PidRef 2025-09-19 15:45:46 +09:00
Lennart Poettering 93dea63fab fileio: modernize xopendirat() a bit 2025-09-19 08:39:32 +02:00
ners 7b7f0983e0 localectl: use XKB path specified from environment variable 2025-09-19 15:37:52 +09:00
Yu Watanabe 56f003d164 firewall-util: rename firewall-util-nft.c to firewall-util.c 2025-09-19 15:33:17 +09:00
Yu Watanabe 7184f8366f firewall-util: drop FirewallContext
After iptables support is dropped, FirewallContext is a trivial
wrapper of sd_netlink. Let's drop it and directly use sd_netlink.
2025-09-19 15:33:17 +09:00
Yu Watanabe 9b75c41cb3 sd-netlink: make netlink_get_reply_callback_count() accept NULL 2025-09-19 15:33:17 +09:00
Yu Watanabe 114c4b95df firewall-util: remove iptables backend
As already announced by 5c68c51045,
let's remove iptables backend of firewall-util through libiptc.
2025-09-19 15:33:15 +09:00
Mike Yuan b6c8f0ec91 userdb: suppress creation of empty userdb dirs 2025-09-18 22:58:16 +02:00
Luca Boccassi defa0148b8 units: add missing Documentation=
The initrd units are described in the graphs in the bootup manpage,
so use that one for them.
2025-09-18 21:54:36 +01:00
Lennart Poettering 7d4b0df9f8 creds-util: don't reference superblocks when decrypting creds 2025-09-18 22:11:57 +02:00
Lennart Poettering 4be269563d core: if we cannot decode a TPM credential skip over it for ImportCredential=
let's skip over credentials we cannot decode when they are found with
ImportCredential=. When installing an OS on some disk and using that
disk on a different machine than assumed we'll otherwise end up with a
broken boot, because the credentials cannot be decoded when starting
systemd-firstboot. Let's handle this somewhat gracefully.

This leaves handling for LoadCredential=/SetCredential= as it is (i.e.
failure to decrypt results in service failure), because it is a lot more
explicit and focussed as opposed to ImportCredentials= which looks
everywhere, uses globs and so on and is hence very vague and unfocussed.

Fixes: #34740
2025-09-18 22:11:57 +02:00
Lennart Poettering ffd4b38096 creds: expose more errors as explicit varlink errors 2025-09-18 22:11:57 +02:00
Lennart Poettering 9be0a94b98 creds-util: tweak error code generation in decrypt_credential_and_warn() a bit, and add a comment listing it
Let's make some specific condition more recognizable via error codes of
their own, and in particular remove confusion between EREMOTE as
returned by tpm2_unseal() and by us.
2025-09-18 22:11:57 +02:00
Lennart Poettering bd610b2253 creds: modernize varlink server setup a bit
Let's make use of the userdata parameter of varlink_server_new(), and
split out the code into its own helper function.
2025-09-18 22:01:25 +02:00
Lennart Poettering c3b1aa6d73 acl-util: add new inode_type_can_acl() helper 2025-09-18 21:58:44 +02:00
Lennart Poettering 134749c1d0 chattr-util: add inode_type_can_chattr() helper 2025-09-18 21:58:00 +02:00
Lennart Poettering 74c10cfbeb sd-varlink: two small additions (#38994) 2025-09-18 21:34:09 +02:00
Lennart Poettering 86fd19af14 mountfsd: add recognizable error if we pass an fd with unexpected flags 2025-09-18 21:33:41 +02:00
Nick Rosbrook 9fe168a92c basic: validate timezones in get_timezones()
Depending on the packaging of tzdata, /usr/share/zoneinfo/tzdata.zi may
reference zones or links that are not actually present on the system.
E.g. on Debian and Ubuntu, there is a tzdata-legacy package that
contains "legacy" zones and links, but they are still referenced in
/usr/share/zoneinfo/tzdata.zi shipped by the main tzdata package.

Right now, get_timezoes() does not validate timezones when building the
list, which makes the following possible:

 $ timedatectl list-timezones | grep "US/Alaska"
 US/Alaska

 $ timedatectl set-timezone US/Alaska
 Failed to set time zone: Invalid or not installed time zone 'US/Alaska'

which feels buggy. Hence, simply validate timezones in get_timezones()
to avoid listing timezones that are not installed.
2025-09-18 21:33:24 +02:00
Lennart Poettering 818bd1dfa1 mountfsd: uncomment CapabilityBoundingSet= line
Since mountfsd was added in 702a52f4b5 the
caps bounding set line was commented. That's an accident. Fix that. (We
need to add a bunch of caps to the list).
2025-09-18 21:30:51 +02:00
Lennart Poettering 1c9500c2b7 units: explicitly reset TTY before running stuff on console
This adds TTYReset=yes to all units which run directly on the TTY. We
already had this in place for the gettys, but this adds it for the rest
that basically has StandardInput=tty + StandardOutput=tty set.

Originally, for these tools it wasn't necessary to reset the TTY,
because we after all already reset /dev/console very very early on once,
during PID1's early initialization, and hence there's no real reason to
do it again for these early boot services. But that's actually not
right, because since #36666 the TTY we reset from PID 1 is typically
/dev/console but the TTY those services are invoked on is typically the
resolved version of that, i.e. wherever that points. Now you might
think: if one is just an alias to the other, why does it matter to reset
this again? Well, because it's only a half-assed alias, and as it turns
out WIOCSWINSZ is not propagated from one to the other, i.e the terminal
dimesions we initialize for /dev/console don't propagate to whatever
that points to.

One option to address that would be to immediately propagate this down
ourselves (or to fix the kernel for it), but it felt safer to simply do
the reset again before the use, after all these one one-off services,
and there's no point in optimizing much here. Moreover, its probably
safer to give the guarantee that when the firstboot stuff (which after
all queries for pws to set) runs it definitely certainly guaranteed has
a properly reset terminal.
2025-09-18 21:30:31 +02:00
Mike Yuan 3b911434d6 TODO: drop completed entry 2025-09-18 20:25:15 +02:00
Mike Yuan 6b8dcb9853 codeql: taint setmntent() and getmntent() 2025-09-18 20:25:15 +02:00
Mike Yuan 873a70d28a mount-util: drop now unused _cleanup_endmntent_ 2025-09-18 20:25:15 +02:00
Mike Yuan 9d05015bb9 remount-fs: port to libmount parser 2025-09-18 20:25:15 +02:00
Mike Yuan 7ebb2b3349 remount-fs: minor coding style cleanups 2025-09-18 20:25:15 +02:00
Mike Yuan 69fa2b6303 cryptsetup: port from setmntent() to libmount parser 2025-09-18 20:25:14 +02:00
Mike Yuan 00074c31b6 fstab-generator: port to libmount parser 2025-09-18 20:25:14 +02:00
Mike Yuan afba4d4387 TEST-81-GENERATORS: libmount disallows omitting fstype
It's not well-formed to begin with. And util-linux's mount(8)
is pretty much ubiquitously employed, hence it will be rejected
elsewhere too. Just stop pretending it is valid just because
glibc parser is sloppy.
2025-09-18 20:22:42 +02:00
Mike Yuan f390e6b708 systemd-boot-update.service & zsh: replace --no-variables with --variables= (#39011) 2025-09-18 19:57:42 +02:00
Lennart Poettering b0d63f6059 Bump required minimum version of libfido2 to 1.5.0 (#38975)
Major distributions already have libfido2 >= 1.12.0. Let's bump the
required minimum version to 1.5.0, which provides FIDO_ERR_UV_BLOCKED.

Note, libfido2 1.5.0 was released on 2020-09-01.

See also #38608.
2025-09-18 17:59:44 +02:00
Lennart Poettering 265b3fbd52 btrfs-util: try unlinkat(AT_REMOVEDIR) before resorting to btrfs ioctls
An empty btrfs subvolume can always be removed without privs, hence try
to use unlinkat() first.
2025-09-18 17:58:56 +02:00
nl6720 fea2518a71 zsh: replace bootctl --no-variables with --variables=
bbeeea4362 replaced the option in bootctl.
2025-09-18 17:00:57 +03:00
nl6720 8ec3e769b5 systemd-boot-update.service: replace --no-variables with --variables=no
bbeeea4362 replaced the option in bootctl,
so systemd-boot-update.service should follow.
2025-09-18 17:00:49 +03:00
Lennart Poettering 2bbfbe4089 man: run update-man-rules 2025-09-18 15:56:11 +02:00
Lennart Poettering cba8c099a9 sd-varlink: optionally handle SIGTERM/SIGINT explicitly in simple varlink event loop 2025-09-18 15:56:11 +02:00
Lennart Poettering 04e2cb8928 sd-varlink: add api for resetting timeout to default
We currently don't expose the literal default time-out as API. Let's at
least provide users with a way to reset the time-out to the default.
2025-09-18 15:56:11 +02:00
Lennart Poettering 07345762c8 meson: downgrade dep on libgcrypt
We don't link against libgcrypt anymore, we use dlopen()
2025-09-18 15:51:01 +02:00
Lennart Poettering f26a805a9f import: always use the same buffer size
Let's synchronize the buffer sizes used when passing around the disk
images, i.e. size both our internal buffers and the pipe buffers the
same (so that we can always write()/read() everything in one gone -
except for the noise compression inserts).

Let's also increase the buffer sizes from 16K to 128K, which made a
difference for me, because it reduces the number of syscalls quite a
bit.
2025-09-18 15:43:13 +02:00