Commit Graph
86604 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 4a991af017 cryptenroll: split out parser for --wipe-slot= 2026-02-11 11:47:52 +01:00
Zbigniew Jędrzejewski-Szmek ff12bcd4fb path: simplify run()
No functional change, just less indents.
2026-02-11 11:47:18 +01:00
Zbigniew Jędrzejewski-Szmek e4c6ee2ce5 mount-tool: fix confusion in --help
See grandparent commit for explanation.
2026-02-11 11:46:44 +01:00
Zbigniew Jędrzejewski-Szmek 84f6967558 importctl: fix confusion in --help
See parent commit for explanation.
2026-02-11 11:46:38 +01:00
Zbigniew Jędrzejewski-Szmek cb406988ac cgtop: fix confusion in --help
When we say '-n --iterations=N' in --help, this means that the program
can be invoked with '-n N' or '--iterations=N' or '--iterations N'.
(The short option is specified without the argument.)

Here we tried to use '-p --order=path' to mean that the program can be
invoked with '-p' or '--order=path', but that is incompatible with the
established convention.

Also, indicate that the arg to --cpu is optional.
2026-02-11 11:46:12 +01:00
Zbigniew Jędrzejewski-Szmek efb7717224 NEWS: add entry about non-system accounts 2026-02-11 11:24:37 +01:00
Zbigniew Jędrzejewski-Szmek f6c8c89ff7 networkd: downgrade error for non-system users/groups to a warning
This reverts (in spirit) "network/tuntap: deny from owning Tun/Tap interfaces",
commit 940441b44c.

Justification similar as in the previous commit. The check is only
partially connected to the intended purpose and breaks backwards compat
without a sufficient reason.

Alternative fix for #37279.
2026-02-11 11:24:37 +01:00
Zbigniew Jędrzejewski-Szmek 5c05a339c6 udev-rules: downgrade error about non-system user/group in OWNER=/GROUP=
This reverts (in sprit) commit f5cdf9515a,
"udev-rules: ignore non-system user/group in OWNER=/GROUP=".

The original change was done to clean up a situation where we added a
new group, but the group could already have been used for some other
purposes, and now the some unexpected entity would own the device.
Unfortunately, this check doesn't really address the issue, since the
existing account might as well be a system account, which might be
equally bad. In addition, this change is a big compatiblity break,
causing existing rules to stop working. Since quite a lot of systems
have local configuration to assign devices to users for various
purposes, this is very noticable to users. In a way, the original change
to add a new group was the compat break, and follow-up patch to cahnge
the rule parsing evolved a small compat break into a much bigger one.
There is merit to the change though, since device nodes shouldn't be
owned by users and groups and different mechanisms should be used
instead. To avoid breaking users systems, and since the original goal
cannot be achieved by this patch, let's downgrade this to a warning
to guide users towards different solutions.
2026-02-11 11:24:37 +01:00
Mike Yuan 4153a2a6f4 ask-password-api: several modernizations for ask_password_agent()
* Replace goto cleanup with block_signals_reset + CLEANUP_TMPFILE_AT
* Use RENAME_NOREPLACE to make sure we don't overwrite any ongoing request
* Reword log messages a bit
2026-02-11 02:39:26 +01:00
Mike Yuan 41615d59fa various: port manual goto cleanup to CLEANUP_TMPFILE_AT 2026-02-11 02:39:26 +01:00
Mike Yuan 0132a02bd6 tmpfile-util: do not skip CLEANUP_TMPFILE_AT for AT_FDCWD
Preparation for later commits.
2026-02-11 02:39:25 +01:00
Mike Yuan 5b501abfc2 terminal-util: handle the case where no system console is active (#40630)
/dev/console might have no backing driver, in which case
/sys/class/tty/console/active is empty. Unlike get_kernel_consoles()
resolve_dev_console() currently proceeds with empty devnode, resulting
in setup_input() -> acquire_terminal() emitting -EISDIR as we're trying
to open /dev/. Let's catch this and report -ENXIO.
2026-02-10 23:59:07 +01:00
Mike Yuan 7d551b00e3 TEST-54-CREDS: add test cases for credential refreshing 2026-02-10 23:21:11 +01:00
Mike Yuan 48c1393bfb terminal-util: also protect from empty /sys/class/tty/tty0/active 2026-02-10 22:21:53 +01:00
Mike Yuan a01cf5b2e0 terminal-util: handle the case where no system console is active
/dev/console might have no backing driver, in which case
/sys/class/tty/console/active is empty. Unlike get_kernel_consoles()
resolve_dev_console() currently proceeds with empty devnode,
resulting in setup_input() -> acquire_terminal() emitting -EISDIR
as we're trying to open /dev/. Let's catch this and report -ENXIO.
2026-02-10 22:04:02 +01:00
Mike Yuan d83f9cc112 test-load-fragment: add unit test for RefreshOnReload= parser 2026-02-10 21:54:13 +01:00
Mike Yuan 24f458da81 man: document RefreshOnReload= 2026-02-10 21:54:13 +01:00
Mike Yuan 21292677f6 core/service: if RefreshOnReload= is explicitly enabled, allow reload even without exec/notify-reload
This was originally brought up by @poettering. If the process
loads stuff on demand and flushes them out after each use,
or actively monitors file changes, they can be reloaded
by merely refreshing the resources.
2026-02-10 21:54:13 +01:00
Mike Yuan f385b3f3dd core/service: pass credentials to ExecReload*= if refreshed
Closes #35227
2026-02-10 21:54:13 +01:00
Mike Yuan fff07be411 core/service: support credential refreshing on reload
Closes #21099
2026-02-10 21:54:12 +01:00
Mike Yuan cb5c6dc599 macro: add 22nd case for IN_SET
Dejavu moment ;)
2026-02-10 21:54:12 +01:00
Mike Yuan a43bc1aed8 core/service: introduce RefreshOnReload= setting
This allows controlling resources to be refreshed before performing
reload, with one extra benefit that in the future we can permit
"seemless reload"s, i.e. no active signaling is done to the main process
after refreshing get updated. This could come in handy for programs
that loads stuff on demand or watches changes via inotify.
2026-02-10 21:54:12 +01:00
Mike Yuan 65ea71ead7 core/exec-credential: introduce unit_refresh_credentials() 2026-02-10 21:54:12 +01:00
Mike Yuan 8f89ed439d process-util: teach namespace_fork() to optionally use namespace_enter_delegated() 2026-02-10 21:54:12 +01:00
Mike Yuan 1a1c5ab758 namespace-util: introduce namespace_enter_delegated()
Typically when entering a namespace the userns is handled last,
because we assume our process is more privileged than the userns.
However, that assumption no longer holds for user managers, which
have no privilege over initial userns and all other namespaces
are actually owned by the userns unshared first (in executor).
Hence, let's add another flavor namespace_enter_delegated() to
accommodate that use case.
2026-02-10 21:54:11 +01:00
Mike Yuan bae58ceff7 core/exec-credential: only pass needed bits of ExecParameters down in exec_setup_credentials()
No functional change, preparation for credential reloading support,
where we'd operate on Unit rather than ExecParameters.
2026-02-10 21:54:11 +01:00
Mike Yuan 7c358751a4 core/exec-credential: avoid duplicate call to hashmap_contains() 2026-02-10 21:54:11 +01:00
Mike Yuan 482fb9ae40 core/exec-credential: stop removing empty credentials dir
Starting from cfbf7538d8 we'd always
install the credentials dir regardless of whether it's empty,
with the correct permissions. Hence the problem stated in the comment
should no longer be a concern. Moreover, this ensures later in
setup_namespace() the mountpoint would be in-place. This is important
for credential reloading as it saves the trouble of remounting
the upper tmpfs as rw again and create the mountpoint.
2026-02-10 21:54:11 +01:00
Mike Yuan de65956bdb core/exec-credential: treat credentials dir as populated if it's mounted
We should only fall back to the dir_is_empty() check if
it's a plain dir, where we can't reasonably differentiate
populated yet empty vs not set up. Otherwise let's stick
to the existing mount if we're told to reuse it.

Yes, this is a minor compat break, but with the to-be-introduced
credential reloading support it should fulfill the goal of
keeping the passed set of credentials stable better, while
still allowing things to be refreshed when requested.
2026-02-10 21:54:11 +01:00
Mike Yuan f9e0a62392 sd-daemon: escape special characters in notification logging text
Follow-up for 21eb636aaa

Our sd_notify() protocol uses newline as separator, which
is not suitable for direct logging.
2026-02-10 21:53:39 +01:00
Mike Yuan 14af94428a shared-forward: sort definitions 2026-02-10 21:53:39 +01:00
Lennart Poettering 8b736d94cd bootctl: decouple "list", "unlink", "cleanup"
These operations to quite different things, they just share 2 common
funcs. Let's split them out into separate files.

This also splits up verb_list() into separate calls for the three
operations. This actually fixes issues, as for status/list we want
"unpriv" ESP discovery logic, but for the other two we really should
have privileged discovery logic.

This is preparation for adding "bootctl link" later, but this makes
sense either way, I am sure.
2026-02-10 19:43:04 +00:00
Luca Boccassi 6b6d7ccd59 Two mkosi fixes (#40625) 2026-02-10 17:07:11 +00:00
Daan De Meyer 7f33ee8bb4 mkosi: Grow the root partition on boot
Let's make sure the root partition takes up all the allocated space
on boot.
2026-02-10 16:32:05 +01:00
Daan De Meyer 05f50caacb mkosi: Move generic disk partition before root partition
Otherwise we can't grow the root partition.
2026-02-10 16:31:22 +01:00
Christopher Head 8ae4aa26c1 Fix order of class/type in resolve man page
For each RR `ResolveRecord` returns, it returns the class before the
type, not after.
2026-02-10 13:40:13 +00:00
Luca Boccassi 6cf5581af8 sysupdate: Split update into acquire and install verbs (#40236)
Using roughly the approach described in
https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/2004#note_2145880.
Basically, copying in-progress downloads to a file/partition with a
predictable prefix, and then moving to a predictable ‘pending’ prefix
when ready to install.

Helps: https://github.com/systemd/systemd/issues/34814
2026-02-10 13:11:52 +00:00
Luca Boccassi b6defb8f84 bootctl: install tweaks (#40622) 2026-02-10 13:04:48 +00:00
Kai Lüke eefb46c83b repart: Discard only once
The indirect discard in mkfs.btrfs on the loop device mapped to the
region on disk can hang and fail the first-boot creation of the rootfs.
Since there already is a discard done we anyway don't need to do it
twice. This might help for most cases to avoid the failure in
mkfs.btrfs.
Keep track if the direct discard worked and then skip the mkfs.btrfs
discard if it did. This still leaves the case where mkfs.btrfs can hang
when the direct discard couldn't succeed and mkfs.btrfs tries again but
since the conditions are rather the same it might be that this case is
not easy to trigger. If the problem still shows up and the kernel won't
be fixed soon we can still disable the mkfs discard for at least btrfs.
2026-02-10 13:09:33 +01:00
Lennart Poettering 7081618cd9 update TODO 2026-02-10 12:39:23 +01:00
Lennart Poettering 51480b56c8 bootctl: rearrange if branches in vl_method_install() 2026-02-10 11:56:26 +01:00
Lennart Poettering 10268261a8 bootctl: toughen fd validation in Install() handler
Let's also check the fd flags. Just in case.
2026-02-10 11:56:26 +01:00
Lennart Poettering 7f204857e1 bootctl: fix varlink IDL for rootDirectory field 2026-02-10 11:56:26 +01:00
Zbigniew Jędrzejewski-Szmek e4dcf0cbce discover-image: restore compatibility with C9S and overlayfs directories (#40616)
5817c73391 broke compatibility with CentOS
9 and overlayfs directories, the following fails with -EOPTNOTSUPP:

mount -t overlay overlay -o lowerdir=/tmp/app1:/tmp/rootdir /tmp/overlay
portablectl attach --copy=symlink --now --runtime /tmp/overlay app1

name_to_handle_at() fails both with and without AT_HANDLE_MNT_ID_UNIQUE.

Restore the fallback to path_get_mnt_id_at() that was removed. Fixes
TEST-29-PORTABLE.directory

Follow-up for 5817c73391
2026-02-10 07:56:48 +01:00
Zbigniew Jędrzejewski-Szmek 79cf06fae4 catalog: fix grammar 2026-02-09 22:22:05 +01:00
Luca Boccassi 7755127ca5 mkosi: isc-dhcp-server was dropped from debian testing/unstable 2026-02-09 20:03:38 +00:00
Luca Boccassi cd45d803c3 discover-image: restore compatibility with C9S and overlayfs directories
5817c73391 broke compatibility with
CentOS 9 and overlayfs directories, the following fails with -EOPTNOTSUPP:

mount -t overlay overlay -o lowerdir=/tmp/app1:/tmp/rootdir /tmp/overlay
portablectl attach --copy=symlink --now --runtime /tmp/overlay app1

name_to_handle_at() fails both with and without AT_HANDLE_MNT_ID_UNIQUE.

Restore the fallback to path_get_mnt_id_at() that was removed.
Fixes TEST-29-PORTABLE.directory

Follow-up for 5817c73391
2026-02-09 19:39:51 +00:00
nikstur 14519d7dfa meson: guard symlinks in sysconfdir behind install_sysconfidr
Symlinks to files inside sysconfdir are now only installed if
ìnstall_sysconfdir=true (which is the default).

If sshconfdir,sshdconfdir,shellprofiledir are not inside sysconfdir and
install_sysconfidr=false, these symlinks are still installed to the
configured directory.
2026-02-09 16:52:53 +01:00
Philip Withnall 779ed358f2 test: Add basic tests for path_split_prefix_filename()
These aren’t anything comprehensive, but provide some basic assurances
that it’s working correctly. In particular, they test its behaviour when
*both* the prefix and filename components are requested.

Split out from the original version of this function which was part
of #40236.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2026-02-09 16:26:40 +01:00
Luca Boccassi e67b008fa3 journald: set a lower size limit for FDs from unpriv processes
Unprivileged processes can send 768M in a FD-based message to journald,
which will be malloc'ed in one go, likely causing memory issues.
Set the limit for unprivileged users to 24M.

Allow coredumps as an exception, since we always allowed storing
up to the 768M max core files in the journal.

Reported on yeswehack.com as #YWH-PGM9780-48
2026-02-09 13:51:59 +01:00