]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 days agocore: Add RootDirectoryFileDescriptor= 39480/head
Daan De Meyer [Tue, 28 Oct 2025 22:47:26 +0000 (23:47 +0100)] 
core: Add RootDirectoryFileDescriptor=

RootDirectory= but via a open_tree() file descriptor. This allows
setting up the execution environment for a service by the client in
a mount namespace and then starting a transient unit in that execution
environment using the new property.

We also add --root-directory= and --same-root-dir= to systemd-run to
have it run services within the given root directory. As systemd-run
might be invoked from a different mount namespace than what systemd is
running in, systemd-run opens the given path with open_tree() and then
sends it to systemd using the new RootDirectoryFileDescriptor= property.

7 days agocore: Rename bus_set_transient_std_fd() and remove unused name argument
Daan De Meyer [Tue, 28 Oct 2025 23:11:49 +0000 (00:11 +0100)] 
core: Rename bus_set_transient_std_fd() and remove unused name argument

7 days agoimportd: port export-tar code to use the one systemd-dissect already uses (#39405)
Lennart Poettering [Thu, 30 Oct 2025 21:15:34 +0000 (22:15 +0100)] 
importd: port export-tar code to use the one systemd-dissect already uses (#39405)

Split out of #38728.

(Testcase is part of that PR)

7 days agocore: several cleanups/fixes for fd passing (#39491)
Daan De Meyer [Thu, 30 Oct 2025 18:57:16 +0000 (19:57 +0100)] 
core: several cleanups/fixes for fd passing (#39491)

7 days agocore/exec-invoke: switch keep_fds to heap allocation 39491/head
Mike Yuan [Thu, 30 Oct 2025 14:38:19 +0000 (15:38 +0100)] 
core/exec-invoke: switch keep_fds to heap allocation

Hardcoding total size of the array is error-prone, especially
considering the exeuctable_fd is added far below, so the '4' is
not entirely obvious. Also we seldomly do VLAs.

7 days agocore/exec-invoke: store all stashed fds in ExecParameters, incl. OpenFile= ones
Mike Yuan [Wed, 29 Oct 2025 21:13:35 +0000 (22:13 +0100)] 
core/exec-invoke: store all stashed fds in ExecParameters, incl. OpenFile= ones

Keeping a half-detached counter around brings nothing
but confusion, and leads to fd leak in error paths.

7 days agocore/exec-invoke: do not discard stashed fds when stdio is connected to socket
Mike Yuan [Wed, 29 Oct 2025 20:53:44 +0000 (21:53 +0100)] 
core/exec-invoke: do not discard stashed fds when stdio is connected to socket

This makes zero sense. Not sure how it got introduced...

7 days agocore/service: also pass sockets to control processes when stdio is named fd
Mike Yuan [Wed, 29 Oct 2025 21:03:02 +0000 (22:03 +0100)] 
core/service: also pass sockets to control processes when stdio is named fd

7 days agocore/service: only pass socket fds to control processes
Mike Yuan [Wed, 29 Oct 2025 20:25:42 +0000 (21:25 +0100)] 
core/service: only pass socket fds to control processes

If socket is used as stdio, we'd currently imply EXEC_PASS_FDS
and dump the whole set of fds to the control processes. This is
pretty much unexpected and unnecessary though, instead let's
pass only the socket fds.

Yes, this is a compat break, but a relatively minor one I'd
argue. And we can always revisit things if users do complain.

7 days agocore/execute: merge n_storage_fds and n_extra_fds into stashed_fds
Mike Yuan [Wed, 29 Oct 2025 20:20:26 +0000 (21:20 +0100)] 
core/execute: merge n_storage_fds and n_extra_fds into stashed_fds

The distinction between fdstore and extra fds is only meaningful
to struct Service. As far as executor is concerned they're just
some fds to pass to the service. Let's just merge it hence,
for the sake of simplicity.

7 days agocore/execute: serialize fd_names only if there're fds to pass
Mike Yuan [Thu, 30 Oct 2025 14:20:33 +0000 (15:20 +0100)] 
core/execute: serialize fd_names only if there're fds to pass

7 days agocore/execute: reorder ExecParameters fields
Mike Yuan [Wed, 29 Oct 2025 20:12:41 +0000 (21:12 +0100)] 
core/execute: reorder ExecParameters fields

7 days agocore/exec-invoke: rename process earlier
Mike Yuan [Thu, 30 Oct 2025 15:01:17 +0000 (16:01 +0100)] 
core/exec-invoke: rename process earlier

This is independent of any other setup stages, and should
happen as early as possible to make comm logged by journald
accurate.

7 days agocore/exec-invoke: set exit_status on exec_context_named_iofds() failure
Mike Yuan [Thu, 30 Oct 2025 14:58:19 +0000 (15:58 +0100)] 
core/exec-invoke: set exit_status on exec_context_named_iofds() failure

7 days agocore/exec-invoke: do not attempt to use fdstore/extra fds for stdio
Mike Yuan [Wed, 29 Oct 2025 20:27:46 +0000 (21:27 +0100)] 
core/exec-invoke: do not attempt to use fdstore/extra fds for stdio

According to systemd.exec(5):

> The fd:name option connects standard input to a specific, named
> file descriptor provided *by a socket unit*. ...

Currently however we're looking at the whole fd array passed,
fix it.

7 days agocore/exec-invoke: drop redundant stdio_fdname checks
Mike Yuan [Wed, 29 Oct 2025 18:39:35 +0000 (19:39 +0100)] 
core/exec-invoke: drop redundant stdio_fdname checks

exec_context_fdname() would never return NULL if corresponding
stdio mode is set to named fd.

7 days agocore/execute: mark exec_context_fdname() as pure
Mike Yuan [Wed, 29 Oct 2025 20:33:13 +0000 (21:33 +0100)] 
core/execute: mark exec_context_fdname() as pure

7 days agocore/execute: remove unused ExecParameters.cgroup_supported
Mike Yuan [Wed, 29 Oct 2025 18:05:43 +0000 (19:05 +0100)] 
core/execute: remove unused ExecParameters.cgroup_supported

Follow-up for 188286eec6b3af2a13c2ccd86038f74e3d5da72f

7 days agomkosi: update fedora commit reference to ea1d871ecd6c2fe063523840c1e4cf9bcf200e32...
Daan De Meyer [Thu, 30 Oct 2025 15:07:22 +0000 (16:07 +0100)] 
mkosi: update fedora commit reference to ea1d871ecd6c2fe063523840c1e4cf9bcf200e32 (#39483)

7 days agorun0: Add --empower
Daan De Meyer [Thu, 30 Oct 2025 11:28:19 +0000 (12:28 +0100)] 
run0: Add --empower

--empower gives full privileges to a non-root user. Currently this
includes all capabilities but we leave the option open to add more
privileges via this option in the future.

Why is this useful? When running privileged development or debugging
commands from your home directory (think bpftrace, strace and such),
you want any files written by these tools to be owned by your current
user, and not by the root user. run0 --empower will allow you to run
all privileged operations (assuming the tools check for capabilities
and not UIDs), while any files written by the tools will still be owned
by the current user.

7 days agopcrlock: don't lock PCR 12 by default
Lennart Poettering [Wed, 29 Oct 2025 15:43:31 +0000 (16:43 +0100)] 
pcrlock: don't lock PCR 12 by default

This creates a chicken-and-egg problem: we stuff the pcrlock policy into
a credential in the ESP, but credentials get measured into PCR 12, hence
PCR 12 is both input and output of the pcrlock logic, which makes
impossible to calculate.

Let's drop PCR 12 for now.

(We might want to pass the policy some other way one day, to avoid this,
but that's something for another day.)

Note that this still allows locking to PCR12 if people want to (for
example because they don't need this for the rootfs, and hence need no
cred passing via the ESP), this hence only changes the default, nothing
more.

Fixes: #33546
7 days agoanalyze: Add shell completion for dlopen-metadata
Daan De Meyer [Thu, 30 Oct 2025 13:44:00 +0000 (14:44 +0100)] 
analyze: Add shell completion for dlopen-metadata

7 days agonetwork/sysctl: logs when per-link IPMasquerade= setting changes the global IPv6Forwa...
Yu Watanabe [Thu, 23 Oct 2025 02:19:52 +0000 (11:19 +0900)] 
network/sysctl: logs when per-link IPMasquerade= setting changes the global IPv6Forwarding= setting

All other cases, settings on different interfaces are completely
independent. But IPMasquerade=yes on an interface enables the global
IPv6Forwarding= setting, and hence affects other interfaces.
Let's log about that.

Prompted by https://github.com/systemd/systemd/issues/39304#issuecomment-3430382233.

7 days agomkosi: update fedora commit reference to ea1d871ecd6c2fe063523840c1e4cf9bcf200e32 39483/head
Daan De Meyer [Wed, 29 Oct 2025 11:23:46 +0000 (12:23 +0100)] 
mkosi: update fedora commit reference to ea1d871ecd6c2fe063523840c1e4cf9bcf200e32

ea1d871ecd Add missing networkd socket units
b76b5da2e6 Merge #214 `Drop backwards compat logic from integration tests script`
7208fa2b1b Require systemd-rpm-macros for build
2e1a6c7474 Require python3-zstandard in ELN
79c9db1bc8 Require systemd-libs and systemd-shared to be in the same version
db38445a7e Drop two patches with workaround (selinux, kernel)
593a204189 Version 258.1
a3e9e27982 Change '%{systemd}' to systemd in Conflicts/Provides/Requires/Recommends
88877a4184 Require systemd-networkd and systemd-udev to be in the same version
8a446daec7 Version 258 💝
cceac93491 Pre-create /etc/userdb directory
b442086d5f Version 258~rc4
327e54e421 Add to patch to create userdb root directory with correct label
2289d65726 Fix unit name in scriptlet
5acde9f1fd Add workaround patch to hopefully pass podman CI tests
1f5ed0da1f Version 258~rc3
50936458a7 obs: move recipe files in place
1bdb4efe40 obs: switch to xz for compression
be7a4d0863 Version 258~rc2
2ace9416e8 obs: also use version with tilde for Source0
8d1645af75 Use again %{version} when building in OBS
98cc5fd91a Version 258~rc1
ed7d2f1132 Add "test" that LTO effectively removes unused code from shared lib
40b38a04d2 Build docs on 64-bit architectures only
5d30fd3b26 Version 257.7

7 days agomkosi: Disable lto feature of systemd spec
Daan De Meyer [Wed, 29 Oct 2025 12:56:16 +0000 (13:56 +0100)] 
mkosi: Disable lto feature of systemd spec

This makes sure the systemd spec doesn't check if LTO is working as
expected when it is actually disabled.

8 days agoanalyze: Add dlopen-metadata verb (#39457)
Daan De Meyer [Thu, 30 Oct 2025 12:56:01 +0000 (13:56 +0100)] 
analyze: Add dlopen-metadata verb (#39457)

systemd-analyze dlopen-metadata will show dlopen metadata
in the ELF binary.

8 days agotest-namespace: Migrate to new assertion macros
Daan De Meyer [Wed, 29 Oct 2025 09:00:36 +0000 (10:00 +0100)] 
test-namespace: Migrate to new assertion macros

8 days agohomed: always report that registered users are members of their own groups
Lennart Poettering [Tue, 28 Oct 2025 09:04:40 +0000 (10:04 +0100)] 
homed: always report that registered users are members of their own groups

As per the userdb spec we should report in GetMemberships() that users
are in their own groups. Hence follow the spec.

Fixes: #26061
8 days agohwdb: add support for the Logitech MX Master 4 (#39490)
Marcos Alano [Thu, 30 Oct 2025 11:16:26 +0000 (08:16 -0300)] 
hwdb: add support for the Logitech MX Master 4 (#39490)

8 days agoanalyze: Add dlopen-metadata verb 39457/head
Daan De Meyer [Sun, 26 Oct 2025 18:41:27 +0000 (19:41 +0100)] 
analyze: Add dlopen-metadata verb

systemd-analyze dlopen-metadata will show dlopen metadata
in the ELF binary.

8 days agoTEST-65-ANALYZE: Add missing --no-pager
Daan De Meyer [Tue, 28 Oct 2025 10:19:16 +0000 (11:19 +0100)] 
TEST-65-ANALYZE: Add missing --no-pager

8 days agoelf-util: Add support for parsing dlopen metadata
Daan De Meyer [Sun, 26 Oct 2025 18:33:30 +0000 (19:33 +0100)] 
elf-util: Add support for parsing dlopen metadata

Then we can add support for showing dlopen metadata to systemd-analyze.

8 days agohwdb: gpd micropc2 sensor (#39493)
Moisticules [Thu, 30 Oct 2025 05:44:01 +0000 (05:44 +0000)] 
hwdb: gpd micropc2 sensor (#39493)

This rule calibrates rotation of the screen display by adjusting matrix
of sensor for the GPD MicroPC 2

Co-authored-by: Moisticules <interknet@live.com>
8 days agopo: Translated using Weblate (Portuguese (Brazil))
Rafael Fontenelle [Wed, 29 Oct 2025 18:54:16 +0000 (18:54 +0000)] 
po: Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (264 of 264 strings)

Co-authored-by: Rafael Fontenelle <rafaelff@gnome.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pt_BR/
Translation: systemd/main

9 days agopull: add pretty progress bar to systemd-pull too
Lennart Poettering [Wed, 20 Aug 2025 15:36:48 +0000 (17:36 +0200)] 
pull: add pretty progress bar to systemd-pull too

This already exists in systemd-import, but let's add it for systemd-pull
too.

9 days agomain: switch explicitly to tty1 on soft-reboot
Lennart Poettering [Mon, 27 Oct 2025 17:26:37 +0000 (18:26 +0100)] 
main: switch explicitly to tty1 on soft-reboot

Fixes: #39462
9 days agomount-util: Iterate mountinfo backwards when unmounting
Daan De Meyer [Tue, 28 Oct 2025 21:54:14 +0000 (22:54 +0100)] 
mount-util: Iterate mountinfo backwards when unmounting

Submounts will always be located further in the mountinfo file, so
when we're unmounting, iterating backwards is likely to be more
efficient than iterating forwards. It'll also reduce the amount of
EBUSY debug logging we'll get since we'll stop trying to unmount
parent mounts with submounts which will always fail with EBUSY.

9 days agocore: Don't setup mount propagation tunnel if not required
Daan De Meyer [Tue, 28 Oct 2025 22:00:44 +0000 (23:00 +0100)] 
core: Don't setup mount propagation tunnel if not required

If we know we have mount_setattr(), then we don't need the mount
propagation tunnel, so don't set it up.

9 days agoexport-tar: port to common libarchive tar generation code 39405/head
Lennart Poettering [Thu, 21 Aug 2025 09:26:17 +0000 (11:26 +0200)] 
export-tar: port to common libarchive tar generation code

9 days agodissect: move tar make code into tar-util.[ch] and make it generic
Lennart Poettering [Wed, 20 Aug 2025 16:51:03 +0000 (18:51 +0200)] 
dissect: move tar make code into tar-util.[ch] and make it generic

That way we can later use it for importd's "export" verb

9 days agoudevadm: flush output after each monitor event
Allison Karlitskaya [Tue, 28 Oct 2025 08:41:40 +0000 (09:41 +0100)] 
udevadm: flush output after each monitor event

If you're using `udevadm monitor` from a script, without a tty, then
libc defaults to being fully-buffered, and won't flush stdout after
newlines.  This is fine for tools that dump a bunch of data and then
exit immediately.  It's a problem for tools like `udevadm monitor` which
have long pauses: the buffered data can get stuck in the buffer for an
unbounded amount of time.

In the Cockpit project we've been working around this for some time with
`stdbuf` which is a `LD_PRELOAD` hack to change the libc buffering
behaviour, but we'd like to stop doing that.

Let's make sure we flush the buffer after each event.

9 days agoTEST-07-PID1: wait for systemd-resolved being stopped
Yu Watanabe [Tue, 28 Oct 2025 04:20:58 +0000 (13:20 +0900)] 
TEST-07-PID1: wait for systemd-resolved being stopped

As 'systemctl stop' is called with --no-block, previously systemd-resolved
might not be stopped when 'resolvectl' is called, and the DBus connection
might be closed during the call:
```
TEST-07-PID1.sh[5643]: + systemctl stop --no-block systemd-resolved.service
TEST-07-PID1.sh[5643]: + resolvectl
TEST-07-PID1.sh[5732]: Failed to get global data: Remote peer disconnected
```

Follow-up for 8eefd0f4debc0bcfeea89dd39c43e3318f3f7ae7.
Fixes https://github.com/systemd/systemd/pull/39388#issuecomment-3439277442.

10 days agobasic: Use xopenat_full() in mkdir_p_root_full()
Daan De Meyer [Tue, 28 Oct 2025 07:49:13 +0000 (08:49 +0100)] 
basic: Use xopenat_full() in mkdir_p_root_full()

10 days agoman: handle leading/trailing/repeating whitespaces in anchor links (#39423)
Yu Watanabe [Tue, 28 Oct 2025 06:28:54 +0000 (15:28 +0900)] 
man: handle leading/trailing/repeating whitespaces in anchor links (#39423)

So even if a <term> section contains newlines, we get a reasonable
anchor link to it.

Before:
```
<dt id="
  bind
  UNIT
  PATH
  [PATH]
"><span class="term">
...
<a class="headerlink" title="Permalink to this term" href="#%0A%20%20%20%20%20%20%20%20%20%20%20%20bind%0A%20%20%20%20%20%20%20%20%20%20%20%20UNIT%0A%20%20%20%20%20%20%20%20%20%20%20%20PATH%0A%20%20%20%20%20%20%20%20%20%20%20%20[PATH]%0A%20%20%20%20%20%20%20%20%20%20">¶</a>
```

After:
```
<dt id="bind UNIT PATH [PATH]"><span class="term">
...
<a class="headerlink" title="Permalink to this term" href="#bind%20UNIT%20PATH%20[PATH]">¶</a>
```

Resolves: https://github.com/systemd/systemd/issues/39196

---

The reverts are not strictly necessary here (as already pointed out in
https://github.com/systemd/systemd/pull/39154#issuecomment-3360118164)
but they were helpful in checking if the fix works as expected. I can
drop them if needed.

10 days agologind: support deserializing session leader through pidfdid (#39440)
Yu Watanabe [Tue, 28 Oct 2025 06:28:09 +0000 (15:28 +0900)] 
logind: support deserializing session leader through pidfdid (#39440)

Fixes #39437

10 days agoudev-watch: allow to log from child process
Yu Watanabe [Sun, 26 Oct 2025 01:07:21 +0000 (10:07 +0900)] 
udev-watch: allow to log from child process

Otherwise, it is hard to debug issues in reread_partition_table().

This also drop unnecessary FORK_RLIMIT_NOFILE_SAFE flag.

10 days agomachined: support image clone/rm operations unpriv, and make hidden images always...
Lennart Poettering [Mon, 27 Oct 2025 16:06:26 +0000 (17:06 +0100)] 
machined: support image clone/rm operations unpriv, and make hidden images always read-only (#39408)

11 days agozsh: add completion for dbus bus address
Ronan Pigott [Sun, 26 Oct 2025 04:04:03 +0000 (21:04 -0700)] 
zsh: add completion for dbus bus address

The DBUS_SESSION_BUS_ADDRESS and DBUS_SYSTEM_BUS_ADDRESS parameters have
an interesting syntax thats useful to complete. Let's include a
completion definition for these parameters.

12 days agocore/exec-invoke: use strnpcpy() where appropriate (#39446)
Yu Watanabe [Sun, 26 Oct 2025 00:43:14 +0000 (09:43 +0900)] 
core/exec-invoke: use strnpcpy() where appropriate (#39446)

12 days agosd-varlink: when expecting a type and refusing due to mismatch say what was received
Luca Boccassi [Sat, 25 Oct 2025 18:57:40 +0000 (19:57 +0100)] 
sd-varlink: when expecting a type and refusing due to mismatch say what was received

Sometimes it is not obvious why a message is not accepted,
so explicitly say what type was received in the log message

12 days agopo: Translated using Weblate (Greek)
Jim Spentzos [Sat, 25 Oct 2025 17:21:37 +0000 (17:21 +0000)] 
po: Translated using Weblate (Greek)

Currently translated at 35.2% (93 of 264 strings)

Co-authored-by: Jim Spentzos <jimspentzos2000@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/el/
Translation: systemd/main

12 days agoTEST-35-LOGIN: test coldplug without fdstore on kernels with pidfd id 39440/head
Mike Yuan [Fri, 24 Oct 2025 21:40:12 +0000 (23:40 +0200)] 
TEST-35-LOGIN: test coldplug without fdstore on kernels with pidfd id

12 days agologind: support deserializing session leader through pidfdid
Mike Yuan [Fri, 24 Oct 2025 21:09:50 +0000 (23:09 +0200)] 
logind: support deserializing session leader through pidfdid

People make weird assumptions around state preservation and
expect logind to be stoppable. While this is realistically
not OK we can probably improve things a little.

This complements f01d8658a3a57d05a5156aefd32d8137c3ee3996 and
adds support for deserializing the LEADER_PIDFDID= field.
We still prioritize pidfd if got one from fdstore (as with
service_notify_message_parse_new_pid() in pid1), but otherwise
this should make logind restart more robust when fdstore
gets spuriously cleared.

Fixes #39437

12 days agocore/exec-invoke: use strnpcpy() where appropriate 39446/head
Mike Yuan [Sat, 25 Oct 2025 17:18:34 +0000 (19:18 +0200)] 
core/exec-invoke: use strnpcpy() where appropriate

12 days agostrxcpyx: do not access dest as an array
Mike Yuan [Sat, 25 Oct 2025 17:29:33 +0000 (19:29 +0200)] 
strxcpyx: do not access dest as an array

dest is a pointer to a string, not an array. Accessing
the "first element" just happens to work, but let's
be more careful.

12 days agocore/exec-invoke: relax restriction for process name length
Yu Watanabe [Sun, 27 Jul 2025 17:31:03 +0000 (02:31 +0900)] 
core/exec-invoke: relax restriction for process name length

Previously, we limit the length of process name by 8.
This relax the restriction then at least process comm or
program_invocation_name contains the untrucated process name.

Closes #38367.

12 days agotest: extend start limit interval
Yu Watanabe [Sat, 25 Oct 2025 06:34:44 +0000 (15:34 +0900)] 
test: extend start limit interval

As the modified service requires about ~10 seconds for stopping, the
service never hit the start limit even if we tried to restart the
service more than 5 times.

This also checks that the service is actually triggered by dbus method
call.

Follow-up for 8eefd0f4debc0bcfeea89dd39c43e3318f3f7ae7.

13 days agoSeveral cleanups for dlopen() (#39441)
Daan De Meyer [Sat, 25 Oct 2025 07:19:28 +0000 (09:19 +0200)] 
Several cleanups for dlopen() (#39441)

13 days agotest: sort libraries in test-dlopen-so 39441/head
Yu Watanabe [Sat, 25 Oct 2025 05:02:24 +0000 (14:02 +0900)] 
test: sort libraries in test-dlopen-so

13 days agolocale: use include directory for libxkbcommon
Yu Watanabe [Sat, 25 Oct 2025 04:02:07 +0000 (13:02 +0900)] 
locale: use include directory for libxkbcommon

To support the case the headers are installed at an unusual place.

13 days agomeson: add all 'cflags' dependencies to libshared
Yu Watanabe [Sat, 25 Oct 2025 03:40:32 +0000 (12:40 +0900)] 
meson: add all 'cflags' dependencies to libshared

This should not change any behavior in most common setups.
But, may be useful when headers are installed at non-default places.

13 days agopwquality: drop 'sym_' prefix from cleanup function
Yu Watanabe [Sat, 25 Oct 2025 02:54:07 +0000 (11:54 +0900)] 
pwquality: drop 'sym_' prefix from cleanup function

This also drops unnecessary symbols in header.

13 days agopasswdqc: drop 'sym_' prefix from cleanup function
Yu Watanabe [Sat, 25 Oct 2025 02:50:58 +0000 (11:50 +0900)] 
passwdqc: drop 'sym_' prefix from cleanup function

This also drops unnecessary symbols in header.

13 days agoqrcode-util: drop 'sym_' prefix from cleanup function
Yu Watanabe [Sat, 25 Oct 2025 02:45:20 +0000 (11:45 +0900)] 
qrcode-util: drop 'sym_' prefix from cleanup function

13 days agopcre2-util: drop trivial pattern_free() wrapper
Yu Watanabe [Sat, 25 Oct 2025 02:41:55 +0000 (11:41 +0900)] 
pcre2-util: drop trivial pattern_free() wrapper

13 days agopcre2-util: drop 'sym_' prefix from cleanup functions
Yu Watanabe [Sat, 25 Oct 2025 02:28:30 +0000 (11:28 +0900)] 
pcre2-util: drop 'sym_' prefix from cleanup functions

13 days agoelf-util: drop 'sym_' prefix from cleanup function
Yu Watanabe [Sat, 25 Oct 2025 02:26:39 +0000 (11:26 +0900)] 
elf-util: drop 'sym_' prefix from cleanup function

13 days agoxkbcommon-util: drop 'sym_' prefix from cleanup functions
Yu Watanabe [Sat, 25 Oct 2025 02:25:41 +0000 (11:25 +0900)] 
xkbcommon-util: drop 'sym_' prefix from cleanup functions

13 days agolibarchive-util: drop 'sym_' prefix from cleanup functions
Yu Watanabe [Sat, 25 Oct 2025 02:23:20 +0000 (11:23 +0900)] 
libarchive-util: drop 'sym_' prefix from cleanup functions

13 days agoapparmor-util: drop 'sym_' prefix from cleanup functions
Yu Watanabe [Sat, 25 Oct 2025 02:21:12 +0000 (11:21 +0900)] 
apparmor-util: drop 'sym_' prefix from cleanup functions

13 days agocompress: drop 'sym_' prefix from cleanup functions
Yu Watanabe [Sat, 25 Oct 2025 02:18:52 +0000 (11:18 +0900)] 
compress: drop 'sym_' prefix from cleanup functions

13 days agopkcs11-util: drop 'sym_' prefix from cleanup functions
Yu Watanabe [Sat, 25 Oct 2025 02:15:05 +0000 (11:15 +0900)] 
pkcs11-util: drop 'sym_' prefix from cleanup functions

13 days agomodule-util: drop 'sym_' prefix from cleanup functions
Yu Watanabe [Sat, 25 Oct 2025 02:12:16 +0000 (11:12 +0900)] 
module-util: drop 'sym_' prefix from cleanup functions

13 days agoopenssl-util: fix spurious indent
Yu Watanabe [Sat, 25 Oct 2025 01:40:43 +0000 (10:40 +0900)] 
openssl-util: fix spurious indent

13 days agoopenssl-util: drop unused functions
Yu Watanabe [Sat, 25 Oct 2025 01:26:46 +0000 (10:26 +0900)] 
openssl-util: drop unused functions

They were introduced by 5f163921e9ff6d735798db259c47543822f81b5c, but
never used.

13 days agocleanup: introduce DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_MACRO_RENAME() macro
Yu Watanabe [Sat, 25 Oct 2025 01:21:54 +0000 (10:21 +0900)] 
cleanup: introduce DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_MACRO_RENAME() macro

This is similar to DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(), but for
macro.

13 days agotree-wide: add basic validation of --background argument
Daniel Hast [Fri, 24 Oct 2025 22:47:59 +0000 (18:47 -0400)] 
tree-wide: add basic validation of --background argument

Check whether the argument of the `--background` option of
`systemd-run`, `run0`, `systemd-nspawn`, `systemd-vmspawn`, and
`systemd-pty-forward` is either empty or looks like an ANSI color code,
and reject invalid values when parsing arguments.

We consider a string to look like an ANSI color code if it consists of
one or more sequences of ASCII digits separated by semicolons. This
permits every valid ANSI color code, and should reject anything that
results in garbled output.

13 days agorules: apply loopback block device rule only onto loopback block devices
Lennart Poettering [Fri, 24 Oct 2025 15:03:02 +0000 (17:03 +0200)] 
rules: apply loopback block device rule only onto loopback block devices

Fixes: #39426
Follow-up for: 9422ce83c201ab4154de832331f0b351fc5137f6

13 days agodiscover-image: support clone + rm operation also unpriv 39408/head
Lennart Poettering [Tue, 26 Aug 2025 15:30:13 +0000 (17:30 +0200)] 
discover-image: support clone + rm operation also unpriv

13 days agodiscover-image: imply that hidden images are read-only
Lennart Poettering [Mon, 25 Aug 2025 10:26:53 +0000 (12:26 +0200)] 
discover-image: imply that hidden images are read-only

Marking a whole directory tree OS image as read-only is difficult
privilege-wise, because so far we rely on the FS_IMMUTABLE_FL which is
not accessible to unpriv clients.

One fundamental place where we currently rely on marking images
read-only is for keeping pristine copies of the originally downloaded
image around, which we place in "hidden" image directories. This is
probably the most relevant usecase for the read-only flag. And moreover,
the only usecase for the hidden images are these read-only pristine
copies.

Hence, let's make this work reasonably in the unpriv case, and simply
imply the read-only flag for hidden images. This is strictly speaking a
change in behaviour, but effectively it shouldn't be, because for nspawn
containers that are executed we insist on names that are hostname
compatible, and hidden names aren't (because they start with a dot).

13 days agorm-rf: make sure we can safely remove dirs we have no access to via rm_rf_at()
Lennart Poettering [Wed, 20 Aug 2025 09:39:41 +0000 (11:39 +0200)] 
rm-rf: make sure we can safely remove dirs we have no access to via rm_rf_at()

Previously, we'd first empty a dir, and then remove it. This works fine
as long as we have access to a dir. But in some cases (like for example
a foreign owned container tree) we might not have access to the dir, but
are still able to remove it (because it is empty, and in a dir we own).
Hence let's try that first. If it works, we do not need to enter the dir
(and thus fail).

13 days agocoredump: handle ENOBUFS and EMSGSIZE the same way
Michal Sekletar [Fri, 24 Oct 2025 10:55:20 +0000 (12:55 +0200)] 
coredump: handle ENOBUFS and EMSGSIZE the same way

Depending on the runtime configuration, e.g. sysctls
net.core.wmem_default= and net.core.rmem_default and on the actual
message size, sendmsg() can fail also with ENOBUFS. E.g. alloc_skb()
failure caused by net.core.[rw]mem_default=64MiB and huge fdinfo list
from process that has 90k opened FDs.

We should handle this case in the same way as EMSGSIZE and drop part of
the message.

2 weeks agomkosi: Stop installing devel packages
Daan De Meyer [Fri, 24 Oct 2025 08:13:38 +0000 (10:13 +0200)] 
mkosi: Stop installing devel packages

These aren't required for tests and pull in a bunch of dependencies,
so let's not install them into the final image.

2 weeks agotest: add policy packages for TEST-06-SELINUX in openSUSE
Thomas Blume [Fri, 24 Oct 2025 08:43:58 +0000 (10:43 +0200)] 
test: add policy packages for TEST-06-SELINUX in openSUSE

2 weeks agoTODO: add that libmicrohttpd2 has openssl support (#39433)
Dimitri John Ledkov [Fri, 24 Oct 2025 10:58:19 +0000 (11:58 +0100)] 
TODO: add that libmicrohttpd2 has openssl support (#39433)

For the openssl unification, add note that development release of
libmicrohttpd2 has openssl support.

2 weeks agorpm: Make sure we only match files in the directories in triggers
Daan De Meyer [Wed, 22 Oct 2025 20:13:36 +0000 (22:13 +0200)] 
rpm: Make sure we only match files in the directories in triggers

/usr/lib/systemd/system will match /usr/lib/systemd/systemd-networkd,
which is definitely not the intention.

2 weeks agomountfsd: allow privileged users to mount bare unprotected filesystems (#39411)
Yu Watanabe [Fri, 24 Oct 2025 00:40:52 +0000 (09:40 +0900)] 
mountfsd: allow privileged users to mount bare unprotected filesystems (#39411)

Split from https://github.com/systemd/systemd/pull/39394 as that
requires deeper rework that will take more time

2 weeks agoDrop libcap dependency (#39425)
Yu Watanabe [Fri, 24 Oct 2025 00:40:05 +0000 (09:40 +0900)] 
Drop libcap dependency (#39425)

2 weeks agotree-wide: drop unused libcap dependencies 39425/head
Yu Watanabe [Thu, 23 Oct 2025 14:40:59 +0000 (23:40 +0900)] 
tree-wide: drop unused libcap dependencies

2 weeks agocapability-util: use capability_get() and _apply() in capability_quintet_enforce()
Yu Watanabe [Thu, 23 Oct 2025 14:34:31 +0000 (23:34 +0900)] 
capability-util: use capability_get() and _apply() in capability_quintet_enforce()

2 weeks agocapability-util: use capability_get() and _apply() in change_capability()
Yu Watanabe [Thu, 23 Oct 2025 14:33:04 +0000 (23:33 +0900)] 
capability-util: use capability_get() and _apply() in change_capability()

2 weeks agocapability-util: use capability_apply() in drop_privileges()
Yu Watanabe [Thu, 23 Oct 2025 14:30:27 +0000 (23:30 +0900)] 
capability-util: use capability_apply() in drop_privileges()

2 weeks agocapability-util: rework capability_gain_cap_setpcap() and capability_bounding_set_drop()
Yu Watanabe [Thu, 23 Oct 2025 14:27:34 +0000 (23:27 +0900)] 
capability-util: rework capability_gain_cap_setpcap() and capability_bounding_set_drop()

This makes the functions use CapabilityQuintet, capability_get(), and
capability_apply().

2 weeks agotest: use have_inheritable_cap() in test_apply_ambient_caps()
Yu Watanabe [Thu, 23 Oct 2025 14:19:11 +0000 (23:19 +0900)] 
test: use have_inheritable_cap() in test_apply_ambient_caps()

This also make the test case use ASSERT_XYZ() macros.

2 weeks agotest: replace cap_to_text() with capability_get() and capability_set_to_string()
Yu Watanabe [Thu, 23 Oct 2025 14:17:36 +0000 (23:17 +0900)] 
test: replace cap_to_text() with capability_get() and capability_set_to_string()

2 weeks agocapability-util: introduce capability_apply() and use it in capability_ambient_set_ap...
Yu Watanabe [Thu, 23 Oct 2025 14:16:06 +0000 (23:16 +0900)] 
capability-util: introduce capability_apply() and use it in capability_ambient_set_apply()

2 weeks agocapability-util: introduce capability_get() and use it in have_effective_cap()
Yu Watanabe [Thu, 23 Oct 2025 14:07:13 +0000 (23:07 +0900)] 
capability-util: introduce capability_get() and use it in have_effective_cap()

capability_get() is a wrapper of capget() syscall and converts its
result to CapabilityQuintet.

This also introduce have_inheritable_cap(), which is similar to
have_effective_cap(). It is currently unused, but will be used later.

2 weeks agocapability-util: several coding style updates
Yu Watanabe [Thu, 23 Oct 2025 13:57:29 +0000 (22:57 +0900)] 
capability-util: several coding style updates

- rebreak comments,
- add short comment for constant arguments,
- drop unnecessary {},
- use BIT_SET() macro.

2 weeks agocapability-util: introduce capability_quintet_equal() helper function
Yu Watanabe [Thu, 23 Oct 2025 16:41:53 +0000 (01:41 +0900)] 
capability-util: introduce capability_quintet_equal() helper function

Currently unused, but will be used later.

2 weeks agocapability-util: move several definitions
Yu Watanabe [Thu, 23 Oct 2025 13:42:07 +0000 (22:42 +0900)] 
capability-util: move several definitions