]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
10 months agotest: add more coverage for extensions and verity 35577/head
Luca Boccassi [Thu, 12 Dec 2024 00:50:45 +0000 (00:50 +0000)] 
test: add more coverage for extensions and verity

10 months agocore: fix loading verity settings for MountImages=
Luca Boccassi [Thu, 12 Dec 2024 00:24:05 +0000 (00:24 +0000)] 
core: fix loading verity settings for MountImages=

The MountEntry logic was refactored to store the verity
settings, and updated for ExtensionImages=, but not for
MountImages=.

Follow-up for a1a40297dbfa5bcd926d1a19320deb73c033c6f5

10 months agoshell completion: add systemd-creds
Luca Boccassi [Tue, 10 Dec 2024 22:19:09 +0000 (22:19 +0000)] 
shell completion: add systemd-creds

10 months agosemaphore: skip some tests
Luca Boccassi [Wed, 11 Dec 2024 20:44:25 +0000 (20:44 +0000)] 
semaphore: skip some tests

semaphore CI runs are always very close to the limit of 1hr, and often
time out when it's particularly oversubscribed.
Skip some low-value test cases to shorten the runtime.

10 months agosystemd-cryptenroll.xml: fix typo
Carlo Teubner [Wed, 11 Dec 2024 22:40:07 +0000 (22:40 +0000)] 
systemd-cryptenroll.xml: fix typo

10 months agoformat-table: trivial cleanups (#35572)
Yu Watanabe [Wed, 11 Dec 2024 21:12:07 +0000 (06:12 +0900)] 
format-table: trivial cleanups (#35572)

10 months agoman: update example in systemd-measure.xml (#35506)
cvlc12 [Wed, 11 Dec 2024 21:09:11 +0000 (22:09 +0100)] 
man: update example in systemd-measure.xml (#35506)

In the example from systemd-measure(1), do not bind to PCR 7 in
addition to the PCR policy.

As long as this is still done by default, see #35280.

10 months agoRevert "run: disable --expand-environment by default for --scope"
Mike Yuan [Wed, 10 Jul 2024 19:58:12 +0000 (21:58 +0200)] 
Revert "run: disable --expand-environment by default for --scope"

This reverts commit 8167c56bfa97525a7b12e7c5685576657364e3cf.

We've announced the breaking change during v254-v257. Let's actually
apply it for v258.

10 months agopretty-print: don't use OSC 8 for incompatible URLs (#35223)
Yu Watanabe [Wed, 11 Dec 2024 20:43:36 +0000 (05:43 +0900)] 
pretty-print: don't use OSC 8 for incompatible URLs (#35223)

10 months agocgroup-util: introduce cg_get_cgroupid_at()
Mike Yuan [Fri, 29 Nov 2024 12:43:02 +0000 (13:43 +0100)] 
cgroup-util: introduce cg_get_cgroupid_at()

Suggested in https://github.com/systemd/systemd/pull/35242#discussion_r1862658163

10 months agonsresourced: drop unneeded REMOVE_PHYSICAL flag for rm_rf()
Mike Yuan [Wed, 11 Dec 2024 14:00:03 +0000 (15:00 +0100)] 
nsresourced: drop unneeded REMOVE_PHYSICAL flag for rm_rf()

Even without REMOVE_PHYSICAL, rm_rf() permits cgroupfs.

10 months agoprocess-util: modernize is_main_thread(); make sure get_process_ppid() won't return...
Yu Watanabe [Wed, 11 Dec 2024 20:16:04 +0000 (05:16 +0900)] 
process-util: modernize is_main_thread(); make sure get_process_ppid() won't return ppid == 0 (#35561)

Split out from #35242

10 months agosd-varlink: properly export sd_varlink_reset_fds()
Lennart Poettering [Wed, 11 Dec 2024 12:06:03 +0000 (13:06 +0100)] 
sd-varlink: properly export sd_varlink_reset_fds()

This function was listed in the public sd-varlink.h header, but not
actually made public. Fix that. It's quite useful, the comment in it
describes the usecase nicely.

Fixes: #35554
10 months agolibfido2-util: show also verity features when listing FIDO2 devices (#35295)
Yu Watanabe [Wed, 11 Dec 2024 20:11:46 +0000 (05:11 +0900)] 
libfido2-util: show also verity features when listing FIDO2 devices (#35295)

This way, users don't have to check those features using an external
program, or wait for later failure when trying to enroll using an
unsupported feature.

E.g.:

```
# systemd-cryptenroll --fido2-device list
PATH         MANUFACTURER PRODUCT               RK  CLIENTPIN UP  UV
/dev/hidraw2 Yubico       YubiKey OTP+FIDO+CCID yes no        yes no
```

10 months agoAdd credential support for mount units (#34732)
Yu Watanabe [Wed, 11 Dec 2024 20:07:35 +0000 (05:07 +0900)] 
Add credential support for mount units (#34732)

Add `EXEC_SETUP_CREDENTIALS` flag to allow using credentials with mount units.
Fixes: #23535
10 months agotest-bpf-restrict-fs: Migrate to new assertion macros
Daan De Meyer [Wed, 11 Dec 2024 12:44:26 +0000 (12:44 +0000)] 
test-bpf-restrict-fs: Migrate to new assertion macros

10 months agocondition: add new ConditionKernelModuleLoaded=
Lennart Poettering [Thu, 28 Nov 2024 12:00:34 +0000 (13:00 +0100)] 
condition: add new ConditionKernelModuleLoaded=

This introduces a new unit condition check: that matches if a specific
kmod module is allowed. This should be generally useful, but there's one
usecase in particular: we can optimize modprobe@.service with this and
avoid forking out a bunch of modprobe requests during boot for the same
kmods.

Checking if a kernel module is loaded is more complicated than just
checking if /sys/module/$MODULE/ exists, since kernel modules typically
take a while to initialize and we must check that this is complete (by
checking if the sysfs attr "initstate" is "live").

10 months agojournalctl: also mangle unit name when --invocation= or --list-invocations is specifi...
Yu Watanabe [Wed, 11 Dec 2024 20:01:54 +0000 (05:01 +0900)] 
journalctl: also mangle unit name when --invocation= or --list-invocations is specified (#35542)

Fixes #35538.

10 months agoFixing VLAN ranges in man systemd.network.
andrejpodzimek [Wed, 11 Dec 2024 12:46:43 +0000 (12:46 +0000)] 
Fixing VLAN ranges in man systemd.network.

Otherwise it doesn't hold that VLANs 100-400 are allowed (because 201-299 are disallowed).

10 months agoprofile.d: don't bail if $SHELL_* variables are unset
Tobias Klauser [Wed, 11 Dec 2024 14:10:39 +0000 (15:10 +0100)] 
profile.d: don't bail if $SHELL_* variables are unset

If - for whatever reason - a script uses set -u (nounset) and includes
/etc/profile.d/70-systemd-shell-extra.sh (e.g. transitively via
/etc/profile) the script would fail with:

    /etc/profile.d/70-systemd-shell-extra.sh: line 15: SHELL_PROMPT_PREFIX: unbound variable

For example:

    $ cat > foo.sh <<EOF
    #!/bin/sh
    set -u

    source /etc/profile
    EOF
    $ chmod 700 foo.sh
    $ ./foo.sh
    /etc/profile.d/70-systemd-shell-extra.sh: line 15: SHELL_PROMPT_PREFIX: unbound variable

Fix this by using shell parameter substitution[^1] (which is a POSIX
shell concept) to set the $SHELL_* variables to the empty string if
undefined.

[^1]: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/V3_chap02.html

10 months agovirt: drop userns detection heuristic
Lennart Poettering [Wed, 27 Nov 2024 13:54:36 +0000 (14:54 +0100)] 
virt: drop userns detection heuristic

Now that we have an explicit userns check we can drop the heuristic for
it, given that it's kinda wrong (because mapping the full host UID range
into a userns is actually a thing people do).

Hence, just delete the code and only keep the userns inode check in
place.

10 months agovirt: dont check for cgroupns anymore
Lennart Poettering [Wed, 27 Nov 2024 13:50:01 +0000 (14:50 +0100)] 
virt: dont check for cgroupns anymore

Now that we have a reliable pidns check I don't think we really should
look for cgroupns anymore, it's too weak a check. I mean, if I myself
would implement a desktop app sandbox (like flatpak) I'd always enable
cgroupns, simply to hide the host cgroup hierarchy.

Hence drop the check.

I suggested adding this 4 years ago here:

https://github.com/systemd/systemd/pull/17902#issuecomment-745548306

10 months agouserdbctl: use ansi_highlight_green_red() where appropriate 35572/head
Mike Yuan [Tue, 10 Dec 2024 18:24:05 +0000 (19:24 +0100)] 
userdbctl: use ansi_highlight_green_red() where appropriate

10 months agoformat-table: drop pointless table_data_rgap_color() func
Mike Yuan [Wed, 11 Dec 2024 18:18:32 +0000 (19:18 +0100)] 
format-table: drop pointless table_data_rgap_color() func

Follow-up for aab79f52784b4778ae0534452757d9fbf608076a

10 months agoformat-table: minor modernization
Mike Yuan [Tue, 10 Dec 2024 17:50:30 +0000 (18:50 +0100)] 
format-table: minor modernization

10 months agoman: document unprivileged is not for reading properties
Katariina Lounento [Mon, 9 Dec 2024 14:09:13 +0000 (16:09 +0200)] 
man: document unprivileged is not for reading properties

Document the fact that read-only properties may not have the flag
SD_BUS_VTABLE_UNPRIVILEGED as that is not obvious especially given the
flag is accepted for writable properties.

Based on the check in `add_object_vtable_internal` called by
`sd_bus_add_object_vtable` (as of the current tip of the main branch
f7f5ba019206cacd486b0892fec76f70f525e04d):

    case _SD_BUS_VTABLE_PROPERTY: {
            [...]
            if ([...] ||
                [...]
                (v->flags & SD_BUS_VTABLE_UNPRIVILEGED && v->type == _SD_BUS_VTABLE_PROPERTY)) {
                    r = -EINVAL;
                    goto fail;
            }

(where `_SD_BUS_VTABLE_PROPERTY` means read-only property whereas
`_SD_BUS_VTABLE_WRITABLE_PROPERTY` maps to writable property).

This was implemented in the commit
adacb9575a09981fcf11279f2f661e3fc21e58ff ("bus: introduce "trusted" bus
concept and encode access control in object vtables") where
`SD_BUS_VTABLE_UNPRIVILEGED` was introduced:

    Writable properties are also subject to SD_BUS_VTABLE_UNPRIVILEGED
    and SD_BUS_VTABLE_CAPABILITY() for controlling write access to them.
    Note however that read access is unrestricted, as PropertiesChanged
    messages might send out the values anyway as an unrestricted
    broadcast.

10 months agojournalctl: make --invocation and --list-invocations accept unit name with glob 35542/head
Yu Watanabe [Wed, 11 Dec 2024 00:35:32 +0000 (09:35 +0900)] 
journalctl: make --invocation and --list-invocations accept unit name with glob

Previously, journalctl -I -u GLOB was not supported, while
journalctl -u GLOB works fine. Let's make them consistent.

10 months agojournalctl: move get_possible_units() to journalctl-util.c
Yu Watanabe [Wed, 11 Dec 2024 00:04:06 +0000 (09:04 +0900)] 
journalctl: move get_possible_units() to journalctl-util.c

No functional change. Preparation for the next commit.

10 months agojournalctl: make --invocation and --list-invocations accept unit name without suffix
Yu Watanabe [Wed, 11 Dec 2024 00:05:34 +0000 (09:05 +0900)] 
journalctl: make --invocation and --list-invocations accept unit name without suffix

Fixes #35538.

10 months agolibfido2-util: show also verity features when listing FIDO2 devices 35295/head
Antonio Alvarez Feijoo [Wed, 11 Dec 2024 16:28:30 +0000 (17:28 +0100)] 
libfido2-util: show also verity features when listing FIDO2 devices

This way, users don't have to check those features using an external program, or
wait for later failure when trying to enroll using an unsupported feature.

10 months agoFix unit tests in unprivileged docker container (#35556)
Luca Boccassi [Wed, 11 Dec 2024 16:28:30 +0000 (16:28 +0000)] 
Fix unit tests in unprivileged docker container (#35556)

10 months agomkosi: use inetutils package instead of hostname for Archlinux
Luca Boccassi [Wed, 11 Dec 2024 11:48:09 +0000 (11:48 +0000)] 
mkosi: use inetutils package instead of hostname for Archlinux

In Arch the hostname binary is in a different package

Follow-up for cf48bde7aea52b18ac3fa218d3f60fd3d533ef66

10 months agomailmap: fix entries for Tobias Klauser
Tobias Klauser [Wed, 11 Dec 2024 13:50:16 +0000 (14:50 +0100)] 
mailmap: fix entries for Tobias Klauser

Map all previous, no longer used e-mail addresses to my current e-mail
address.

10 months agoanalyze: add --mask to --help text (#35548)
Luca Boccassi [Wed, 11 Dec 2024 13:45:30 +0000 (13:45 +0000)] 
analyze: add --mask to --help text (#35548)

10 months agoprocess-util: make sure we don't report ppid == 0 35561/head
Mike Yuan [Wed, 27 Nov 2024 23:40:11 +0000 (00:40 +0100)] 
process-util: make sure we don't report ppid == 0

Previously, if pid == 0 and we're PID 1, get_process_ppid()
would set ret to getppid(), i.e. 0, which is inconsistent
when pid is explicitly set to 1. Ensure we always handle
such case by returning -EADDRNOTAVAIL.

10 months agoprocess-util: use our usual tristate semantics for is_main_thread()
Mike Yuan [Wed, 20 Nov 2024 14:12:25 +0000 (15:12 +0100)] 
process-util: use our usual tristate semantics for is_main_thread()

While at it, _unlikely_ is dropped, as requested in
https://github.com/systemd/systemd/pull/35242#discussion_r1880096233

10 months agotest-fd-util: compare FDs to /bin/sh instead of /dev/null 35556/head
Luca Boccassi [Wed, 11 Dec 2024 13:40:10 +0000 (13:40 +0000)] 
test-fd-util: compare FDs to /bin/sh instead of /dev/null

/dev/null is a character device, so same_fd() in the fallback path
that compares fstat will fail, as that bails out if the fd refers
to a char device. This happens on kernels without F_DUPFD_QUERY and
without kcmp.

/* test_same_fd */
Assertion 'same_fd(d, e) > 0' failed at src/test/test-fd-util.c:111, function test_same_fd(). Aborting.

Fixes #35552

10 months agotest-fd-util: skip test when lacking privileges to create a new namespace
Luca Boccassi [Wed, 11 Dec 2024 12:01:18 +0000 (12:01 +0000)] 
test-fd-util: skip test when lacking privileges to create a new namespace

To reproduce, as an unprivileged user start a docker container and build
and run the unit tests inside it:

$ docker run --rm -ti debian:bookworm bash
...
/* test_close_all_fds */
Successfully forked off '(caf-plain)' as PID 10496.
Skipping PR_SET_MM, as we don't have privileges.
(caf-plain) succeeded.
Failed to fork off '(caf-noproc)': Operation not permitted
Assertion 'r >= 0' failed at src/test/test-fd-util.c:392, function test_close_all_fds(). Aborting.

Partially fixes #35552

10 months agotest-capability: CAP_LINUX_IMMUTABLE is not available in unprivileged containers
Luca Boccassi [Wed, 11 Dec 2024 12:10:13 +0000 (12:10 +0000)] 
test-capability: CAP_LINUX_IMMUTABLE is not available in unprivileged containers

have ambient caps: yes
Capabilities:cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_net_bind_service,cap_net_raw,cap_sys_chroot,cap_mknod,cap_audit_write,cap_setfcap=ep
Failed to drop auxiliary groups list: Operation not permitted
Failed to change group ID: Operation not permitted
Capabilities:cap_dac_override,cap_net_raw=ep
Capabilities:cap_dac_override=ep
Successfully forked off '(getambient)' as PID 12505.
Skipping PR_SET_MM, as we don't have privileges.
Ambient capability cap_linux_immutable requested but missing from bounding set, suppressing automatically.
Assertion 'x < 0 || FLAGS_SET(c, UINT64_C(1) << CAP_LINUX_IMMUTABLE)' failed at src/test/test-capability.c:273, function test_capability_get_ambient(). Aborting.
(getambient) terminated by signal ABRT.
src/test/test-capability.c:258: Assertion failed: expected "r" to succeed, but got error: Protocol error

Partially fixes #35552

10 months agoDefine flags for manager_is_inhibited() (#35253)
Luca Boccassi [Wed, 11 Dec 2024 13:08:29 +0000 (13:08 +0000)] 
Define flags for manager_is_inhibited() (#35253)

10 months agotest: set nsec3-salt-length=8 in knot.conf
Nick Rosbrook [Tue, 10 Dec 2024 21:48:59 +0000 (16:48 -0500)] 
test: set nsec3-salt-length=8 in knot.conf

TEST-75-RESOLVED fails on Ubuntu autopkgtest due to this warning from
knot:

 notice: config, policy 'auto_rollover_nsec3' depends on default nsec3-salt-length=8, since version 3.5 the default becomes 0

Explicitly set nsec3-salt-length=8 to silence.

10 months agobasic/user-util: modernize getgroups_alloc() a bit (#35226)
Mike Yuan [Wed, 11 Dec 2024 12:50:50 +0000 (13:50 +0100)] 
basic/user-util: modernize getgroups_alloc() a bit (#35226)

Split out from #35219 for inclusion in v258

10 months agologind: define flags enum for manager_is_inhibited() 35253/head
Zbigniew Jędrzejewski-Szmek [Wed, 20 Nov 2024 12:15:06 +0000 (13:15 +0100)] 
logind: define flags enum for manager_is_inhibited()

The most common case of block=true, ignore_inactive=false is mapped to flags=0.

For https://github.com/systemd/systemd/issues/34091.

10 months agologind: drop one duplicate param in manager_is_inhibited()
Zbigniew Jędrzejewski-Szmek [Wed, 20 Nov 2024 08:38:52 +0000 (09:38 +0100)] 
logind: drop one duplicate param in manager_is_inhibited()

In the review in https://github.com/systemd/systemd/pull/30307#pullrequestreview-2255002732
removal of the excessive boolean parameters was requested. We don't need
a separate boolean param here, since we always pass true with a uid and
false otherwise.

10 months agopretty-print: don't use OSC 8 for incompatible URLs 35223/head
Lennart Poettering [Mon, 18 Nov 2024 11:34:17 +0000 (12:34 +0100)] 
pretty-print: don't use OSC 8 for incompatible URLs

10 months agostring-util: split out EOT check in strip_tab_ansi()
Lennart Poettering [Tue, 19 Nov 2024 09:49:36 +0000 (10:49 +0100)] 
string-util: split out EOT check in strip_tab_ansi()

Let's unify the eot check in one place in order to make things more
readable.

10 months agoanalyze: add missing --mask option to --help text 35548/head
Lennart Poettering [Wed, 11 Dec 2024 09:31:58 +0000 (10:31 +0100)] 
analyze: add missing --mask option to --help text

Follow-up for: 3e7a029c2856e7814b930443cc2d4fb089377592

10 months agoanalyze: tab fix
Lennart Poettering [Wed, 11 Dec 2024 09:31:41 +0000 (10:31 +0100)] 
analyze: tab fix

10 months agonetwork: optionally bring up interface before joining bridge (#34438)
Yu Watanabe [Wed, 11 Dec 2024 09:16:34 +0000 (18:16 +0900)] 
network: optionally bring up interface before joining bridge (#34438)

Closes #34247.

10 months agojournalctl: do not override explicitly specified -b or -n with -e or -k
Yu Watanabe [Wed, 20 Nov 2024 10:28:20 +0000 (19:28 +0900)] 
journalctl: do not override explicitly specified -b or -n with -e or -k

Fixes #35248.

10 months agosystemctl: downgrade log level of ECONNREFUSED from system dbus.service
Yu Watanabe [Fri, 29 Nov 2024 17:56:06 +0000 (02:56 +0900)] 
systemctl: downgrade log level of ECONNREFUSED from system dbus.service

To suppress log message when 'systemctl poweroff' or friends invoked in
rescue shell, which does not have dbus.service.

10 months agolibfido2-util: reorder dl symbols alphabetically
Antonio Alvarez Feijoo [Fri, 22 Nov 2024 08:10:03 +0000 (09:10 +0100)] 
libfido2-util: reorder dl symbols alphabetically

10 months agoman/systemd-cryptenroll: sort --fido2-credential-algorithm after --fido2-device
Antonio Alvarez Feijoo [Wed, 11 Dec 2024 06:32:04 +0000 (07:32 +0100)] 
man/systemd-cryptenroll: sort --fido2-credential-algorithm after --fido2-device

And also fix a typo.

10 months agonetwork: optionally bring up interface before joining bridge 34438/head
Yu Watanabe [Sun, 15 Sep 2024 17:36:13 +0000 (02:36 +0900)] 
network: optionally bring up interface before joining bridge

Closes #34247.

10 months agonetwork: introduce link_up_now()
Yu Watanabe [Sun, 15 Sep 2024 17:36:13 +0000 (02:36 +0900)] 
network: introduce link_up_now()

This is currently not used. Preparation for later commit.

10 months agoRevert "coredumpctl: Don't treat no coredumps as failure"
Yu Watanabe [Wed, 11 Dec 2024 01:54:20 +0000 (10:54 +0900)] 
Revert "coredumpctl: Don't treat no coredumps as failure"

This reverts commit dfe79b9ed21b0feeb5a120e8b994f46cff7cf5b0.

10 months agobus-creds/time-util: use first_word() and skip_leading_chars() more (#35421)
Yu Watanabe [Wed, 11 Dec 2024 01:42:34 +0000 (10:42 +0900)] 
bus-creds/time-util: use first_word() and skip_leading_chars() more (#35421)

Prompted by
https://github.com/systemd/systemd/pull/35403#discussion_r1863855098

10 months agocore: Add ProtectHostname=private (#35447)
Yu Watanabe [Wed, 11 Dec 2024 01:17:25 +0000 (10:17 +0900)] 
core: Add ProtectHostname=private (#35447)

This PR allows an option for systemd exec units to enable UTS namespaces
but not restrict changing hostname via seccomp. Thus, units can change
hostname without affecting the host. This is useful for OS-like
containers running as units where they should have freedom to change
their container hostname if they want, but not the host's hostname.

Fixes: #30348
10 months agotree-wide: replace ANSI_XYZ with ansi_xyz()
Yu Watanabe [Tue, 10 Dec 2024 14:45:59 +0000 (23:45 +0900)] 
tree-wide: replace ANSI_XYZ with ansi_xyz()

Continuation of f0484e096c9cfc22ae99f7452a366e2545255e30.

10 months agocoredumpctl: Don't treat no coredumps as failure
Daan De Meyer [Sat, 23 Nov 2024 11:14:06 +0000 (12:14 +0100)] 
coredumpctl: Don't treat no coredumps as failure

Having to deal with a process that fails or doesn't fail depending on
whether there are coredumps or not is incredibly annoying for users.

10 months agoboot: Fix typo in looking_for_dtbauto
Samuel Dionne-Riel [Fri, 29 Nov 2024 20:18:45 +0000 (15:18 -0500)] 
boot: Fix typo in looking_for_dtbauto

Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
10 months agotest: mount unit with credential 34732/head
davjav [Sun, 27 Oct 2024 20:42:57 +0000 (13:42 -0700)] 
test: mount unit with credential

Verify mount unit credential file is present.

10 months agoAdd credential support for mount units
davjav [Tue, 8 Oct 2024 02:35:22 +0000 (19:35 -0700)] 
Add credential support for mount units

Add EXEC_SETUP_CREDENTIALS flag to allow using credentials with mount units.
Fixes: https://github.com/systemd/systemd/issues/23535
10 months agocore: Fix time namespace in RestrictNamespaces=
Ryan Wilson [Mon, 2 Dec 2024 23:38:46 +0000 (15:38 -0800)] 
core: Fix time namespace in RestrictNamespaces=

RestrictNamespaces= would accept "time" but would not actually apply
seccomp filters e.g. systemd-run -p RestrictNamespaces=time unshare -T true
should fail but it succeeded.

This commit actually enables time namespace seccomp filtering.

10 months agodiscover-image: extend r/o check on images via path
Lennart Poettering [Mon, 9 Dec 2024 11:48:54 +0000 (12:48 +0100)] 
discover-image: extend r/o check on images via path

If we have no path, let's check the parent's path.

10 months agobasic/user-util: modernize getgroups_alloc() a bit 35226/head
Mike Yuan [Mon, 18 Nov 2024 17:57:53 +0000 (18:57 +0100)] 
basic/user-util: modernize getgroups_alloc() a bit

- Make sure ret is initialized if we return >= 0
- Reduce variable scope

10 months agobasic/user-util: use FOREACH_ARRAY at one more place
Mike Yuan [Thu, 21 Nov 2024 14:21:49 +0000 (15:21 +0100)] 
basic/user-util: use FOREACH_ARRAY at one more place

10 months agobasic/time-util: modernize parse_time() a bit 35421/head
Mike Yuan [Fri, 29 Nov 2024 18:30:47 +0000 (19:30 +0100)] 
basic/time-util: modernize parse_time() a bit

10 months agosd-bus/bus-creds: use first_word() where appropriate
Mike Yuan [Fri, 29 Nov 2024 18:55:15 +0000 (19:55 +0100)] 
sd-bus/bus-creds: use first_word() where appropriate

10 months agosd-bus/bus-creds: use proper NULL instead of 0
Mike Yuan [Fri, 29 Nov 2024 18:35:12 +0000 (19:35 +0100)] 
sd-bus/bus-creds: use proper NULL instead of 0

10 months agounits/initrd-parse-etc.service: replace systemctl start with OnSuccess=
Mike Yuan [Mon, 18 Nov 2024 20:59:22 +0000 (21:59 +0100)] 
units/initrd-parse-etc.service: replace systemctl start with OnSuccess=

10 months agojournald: extend STDOUT_STREAMS_MAX to 64k
Yu Watanabe [Sun, 1 Dec 2024 05:46:40 +0000 (14:46 +0900)] 
journald: extend STDOUT_STREAMS_MAX to 64k

Closes #35390.

10 months agocore: improve finding OnSuccess=/OnFailure= dependent (#35468)
Nils K [Tue, 10 Dec 2024 19:48:09 +0000 (20:48 +0100)] 
core: improve finding OnSuccess=/OnFailure= dependent (#35468)

Previously if one service specified the same unit as their
success and failure handler we bailed out of resolving the triggering unit
even though it is still unique.

10 months agotree-wide: fd_get_path() already understands AT_FDCWD natively
Lennart Poettering [Mon, 9 Dec 2024 11:48:07 +0000 (12:48 +0100)] 
tree-wide: fd_get_path() already understands AT_FDCWD natively

10 months agoRevert "test: skip TEST-13-NSPAWN.nspawn/machined, TEST-86-MULTI-PROFILE-UKI and...
Luca Boccassi [Tue, 10 Dec 2024 19:31:18 +0000 (19:31 +0000)] 
Revert "test: skip TEST-13-NSPAWN.nspawn/machined, TEST-86-MULTI-PROFILE-UKI and TEST-07-PID1.private-pids.sh"

The release is done, re-enable the skipped flaky tests for main.

This reverts commit ab828def6de85c93eef3b4c07b04fddf41d3a44c.

10 months agoNEWS: add placeholder for v258
Luca Boccassi [Tue, 10 Dec 2024 19:31:07 +0000 (19:31 +0000)] 
NEWS: add placeholder for v258

10 months agomeson: update version to 258~devel
Luca Boccassi [Tue, 10 Dec 2024 19:30:06 +0000 (19:30 +0000)] 
meson: update version to 258~devel

10 months agoFinalize NEWS and meson.version for v257 v257
Luca Boccassi [Tue, 10 Dec 2024 19:22:47 +0000 (19:22 +0000)] 
Finalize NEWS and meson.version for v257

10 months agoChores for v257 (#35525)
Luca Boccassi [Tue, 10 Dec 2024 19:21:43 +0000 (19:21 +0000)] 
Chores for v257 (#35525)

10 months agocopy: do not try to copy zero size data
Yu Watanabe [Tue, 10 Dec 2024 15:47:26 +0000 (00:47 +0900)] 
copy: do not try to copy zero size data

Hopefully fixes the following sanitizer issue:
===
[ 3754.797377] systemd-journald[776]: ../src/src/shared/copy.c:463:37: runtime error: variable length array bound evaluates to non-positive value 0
[ 3755.101713] systemd-journald[776]: Received SIGTERM from PID 1 (systemd).
[ 3755.124580] systemd-journald[776]: Journal stopped
Found 1 sanitizer issues (0 internal, 0 asan, 0 ubsan, 0 msan).
===

10 months agoTEST-07-PID: wait for sleep command being executed by sd-executor
Yu Watanabe [Tue, 10 Dec 2024 15:28:45 +0000 (00:28 +0900)] 
TEST-07-PID: wait for sleep command being executed by sd-executor

Hopefully fixes #35528.

10 months agosd-varlink: add function to configure server object info (#35519)
Luca Boccassi [Tue, 10 Dec 2024 15:26:24 +0000 (15:26 +0000)] 
sd-varlink: add function to configure server object info (#35519)

10 months agoNEWS: update list of contributors 35525/head
Luca Boccassi [Tue, 10 Dec 2024 11:31:25 +0000 (11:31 +0000)] 
NEWS: update list of contributors

10 months agoUpdate hwdb
Luca Boccassi [Tue, 10 Dec 2024 11:27:41 +0000 (11:27 +0000)] 
Update hwdb

ninja -C build update-hwdb

10 months agotest: skip TEST-13-NSPAWN.nspawn/machined, TEST-86-MULTI-PROFILE-UKI and TEST-07...
Luca Boccassi [Tue, 10 Dec 2024 12:13:06 +0000 (12:13 +0000)] 
test: skip TEST-13-NSPAWN.nspawn/machined, TEST-86-MULTI-PROFILE-UKI and TEST-07-PID1.private-pids.sh

These new tests are flaky, so disable them temporarily, until after
the release, to avoid pushing out new flakiness to consumers. They
will be re-enabled immediately after.

10 months agotest: add TEST_SKIP_SUBTESTS/TEST_SKIP_TESTCASES
Luca Boccassi [Tue, 10 Dec 2024 11:56:04 +0000 (11:56 +0000)] 
test: add TEST_SKIP_SUBTESTS/TEST_SKIP_TESTCASES

Inverse of the TEST_MATCH_SUBTEST/TEST_MATCH_TESTCASE variables

10 months agoCryptenroll pager and tweaks (#35517)
Luca Boccassi [Tue, 10 Dec 2024 14:07:26 +0000 (14:07 +0000)] 
Cryptenroll pager and tweaks (#35517)

10 months agotest: use mkdir -p in TEST-25-IMPORT
Luca Boccassi [Tue, 10 Dec 2024 10:51:44 +0000 (10:51 +0000)] 
test: use mkdir -p in TEST-25-IMPORT

[   15.896174] TEST-25-IMPORT.sh[473]: + mkdir /var/tmp/scratch
[   15.902524] TEST-25-IMPORT.sh[519]: mkdir: cannot create directory ‘/var/tmp/scratch’: File exists

https://github.com/systemd/systemd/actions/runs/12248114409/job/34167155679?pr=35520

10 months agoUpdate syscall tables (#35520)
Zbigniew Jędrzejewski-Szmek [Tue, 10 Dec 2024 11:21:01 +0000 (12:21 +0100)] 
Update syscall tables (#35520)

10 months agohostnamectl: respect SYSTEMD_COLORS
Sebastian Gross [Tue, 10 Dec 2024 08:09:41 +0000 (09:09 +0100)] 
hostnamectl: respect SYSTEMD_COLORS

Instead of the wrapper functions the color defines where used directly.
This was especially a problem for ANSI_HIGHLIGHT_YELLOW which is not
legible at all for light themes such as solarized. The 16 color palette
fallback can be set to a sane yellow or orange on that matter but it was
not used though `SYSTEMD_COLORS=16` was set.

Use the proper wrapper functions and let the right color be selected the
way other components do it already.

10 months agocryptsetup: add debug message 35517/head
Zbigniew Jędrzejewski-Szmek [Mon, 9 Dec 2024 17:05:11 +0000 (18:05 +0100)] 
cryptsetup: add debug message

10 months agocryptenroll: show which devices support "hmac secret"
Zbigniew Jędrzejewski-Szmek [Mon, 9 Dec 2024 15:30:04 +0000 (16:30 +0100)] 
cryptenroll: show which devices support "hmac secret"

We'd silently skip devices which don't have the feature in the list.
This looked wrong esp. if no devices were suitable. Instead, list them
and show which ones are usable.

$ build/systemd-cryptenroll --fido2-device=list
PATH          MANUFACTURER PRODUCT                HMAC SECRET
/dev/hidraw7  Yubico       YubiKey OTP+FIDO+CCID  ✓
/dev/hidraw10 Yubico       Security Key by Yubico ✗
/dev/hidraw5  Yubico       Security Key by Yubico ✗
/dev/hidraw9  Yubico       Yubikey 4 OTP+U2F+CCID ✗

10 months agosd-varlink: modernize pointer style in function signatures 35519/head
Zbigniew Jędrzejewski-Szmek [Mon, 9 Dec 2024 19:54:08 +0000 (20:54 +0100)] 
sd-varlink: modernize pointer style in function signatures

10 months agovarious: set info on varlink server object
Zbigniew Jędrzejewski-Szmek [Mon, 9 Dec 2024 19:23:29 +0000 (20:23 +0100)] 
various: set info on varlink server object

The values that were previously hardcoded in sd-varlink.c are now defined
in new varlink_set_info_systemd() and that function is called everywhere
where we create a server.

10 months agosd-varlink: add sd_varlink_server_set_info
Zbigniew Jędrzejewski-Szmek [Mon, 9 Dec 2024 19:08:33 +0000 (20:08 +0100)] 
sd-varlink: add sd_varlink_server_set_info

Fixes https://github.com/systemd/systemd/issues/35508.

As reported in the bug, the values were hardcoded for the systemd project.
https://varlink.org/Service lists vendor, product, version, url, and interfaces
as the mandatory parameters, so add an interface to set the first four. The
last field is set automatically based on the registered interfaces as before.

If the values are not filled in, we return empty strings. With NULL,
'varlinkctl info' would say:
  (string):1:25: Object field 'vendor' has wrong type null, expected string.

10 months agomkosi: several improvements for running with sanitizers (#35480)
Yu Watanabe [Tue, 10 Dec 2024 04:35:22 +0000 (13:35 +0900)] 
mkosi: several improvements for running with sanitizers (#35480)

10 months agoseccomp-util: add getxattrat and friends 35520/head
Yu Watanabe [Tue, 10 Dec 2024 02:16:40 +0000 (11:16 +0900)] 
seccomp-util: add getxattrat and friends

The new syscalls are added in kernel-6.13:
https://github.com/torvalds/linux/commit/6140be90ec70c39fa844741ca3cc807dd0866394

10 months agobasic: update syscall tables
Yu Watanabe [Tue, 10 Dec 2024 02:15:48 +0000 (11:15 +0900)] 
basic: update syscall tables

10 months agotest: use systemd-asan-env environment file at more places 35480/head
Yu Watanabe [Sat, 7 Dec 2024 19:01:48 +0000 (04:01 +0900)] 
test: use systemd-asan-env environment file at more places

10 months agotest-network: check status of networkd after everything cleared on tear down
Yu Watanabe [Thu, 5 Dec 2024 23:42:41 +0000 (08:42 +0900)] 
test-network: check status of networkd after everything cleared on tear down

Otherwise, if networkd is failed, e.g. .network files that triggered the
failure will remain, and the next test case will start with previous
.network files. So, most subsequent test will fail.