Commit Graph

84378 Commits

Author SHA1 Message Date
Yu Watanabe
19bbcd35d7 strv: introduce strv_extend_joined() and strv_extend_joined_with_size() 2025-11-01 00:59:36 +09:00
Yu Watanabe
69350ee3e3 string-util: introduce strextendv_with_separator() 2025-11-01 00:58:42 +09:00
Yu Watanabe
3c66f40262 strv: introduce strv_extendf_with_size() 2025-11-01 00:58:39 +09:00
Yu Watanabe
0885e4a6e7 Various --bind-user= fixes (#39498) 2025-10-31 20:43:54 +09:00
Yu Watanabe
b1ba55a8a7 network: do not restart DHCPv4 client on stopping/restarting networkd
Follow-up for fc35a9f8d1 (v255).
Fixes #39299.
2025-10-31 17:59:22 +09:00
Lennart Poettering
31c220d8f5 importd: support OS tree "mangling" unpriv too (#39406)
Split out of #38728 

(background: os tree "mangling" is what we do if a tarball with an OS
image inside it if is nested inside an extra top-level dir inside the
tarball, which we need to "mangle" and move everything inside one level
up)
2025-10-31 09:46:36 +01:00
Yu Watanabe
3f9db926e4 network: propagate error in link_carrier_lost()
Follow-up for 07021ed4f5 (v258).
2025-10-31 17:33:58 +09:00
Daan De Meyer
def01c7efe nspawn/vmspawn: Add --bind-user-group= option
Useful to add the bound users to the wheel group.
2025-10-31 08:57:38 +01:00
Daan De Meyer
b430f2bc94 nspawn-bind-user: Write membership records 2025-10-31 08:57:38 +01:00
Daan De Meyer
3fbf4ac24b userdbctl: Write empty JSON object into membership files 2025-10-31 08:57:38 +01:00
Daan De Meyer
cfabf3eb3b TEST-87-AUX-UTILS-VM: Propagate SYSTEMD_PAGER at one more place 2025-10-31 08:57:38 +01:00
Daan De Meyer
472161f368 userdb: Add missing .membership extension to membership files
Follow up for fe0342edf4

This also drops the mkosi testuser from the wheel and systemd-journal
groups as the integration tests rely on the testuser not being to read
the full journal.
2025-10-31 08:57:08 +01:00
Daan De Meyer
097b6d3f66 nspawn: Fix docs 2025-10-31 08:26:04 +01:00
Christoph Anton Mitterer
bfb365d924 man: clarify quoting of $ in command lines (#39494)
When the special executable prefix `:` is used, `$$` yield the literal `$$`.
2025-10-31 15:28:57 +09:00
dgengtek
4207abb6e1 man: clarify requirements for BridgeVLAN to work 2025-10-31 15:26:14 +09:00
Yu Watanabe
404d9bfb62 mount-setup: Add memory_hugetlb_accounting to cgroupfs mount (#39486)
This mount option will count HugeTLB memory usage towards the cgroup’s
overall memory usage for the memory controller.

See
https://lore.kernel.org/all/20231006184629.155543-4-nphamcs@gmail.com/T/#u
for the patch introducing the new mount option.
2025-10-31 15:20:10 +09:00
Lennart Poettering
2348c56367 import: make sure image mangling works unpriv too 2025-10-30 22:57:43 +01:00
Lennart Poettering
7912b1ebe5 import-common: rework import_mangle_os_tree() to operate based on fd to tree 2025-10-30 22:56:19 +01:00
Lennart Poettering
70733160ee os-util: add fd_is_os_tree() which is like path_is_os_tree() but operates on an fd 2025-10-30 22:56:19 +01:00
Daan De Meyer
886c078702 mount-setup: Add memory_hugetlb_accounting to cgroupfs mount
This mount option will count HugeTLB memory usage towards the cgroup’s
overall memory usage for the memory controller.

See https://lore.kernel.org/all/20231006184629.155543-4-nphamcs@gmail.com/T/#u
for the patch introducing the new mount option.
2025-10-30 22:28:41 +01:00
Daan De Meyer
5ce388aec8 mount-setup: Add optional function which provides extra mount options 2025-10-30 22:28:39 +01:00
Lennart Poettering
96d03f8e41 importd: port export-tar code to use the one systemd-dissect already uses (#39405)
Split out of #38728.

(Testcase is part of that PR)
2025-10-30 22:15:34 +01:00
Daan De Meyer
c46344d597 mount-setup: Reformat table
Preparation for the next commit.
2025-10-30 19:59:29 +01:00
Daan De Meyer
056f437487 core: several cleanups/fixes for fd passing (#39491) 2025-10-30 19:57:16 +01:00
Mike Yuan
a274cb0cff 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.
2025-10-30 17:47:30 +01:00
Mike Yuan
f70346fb87 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.
2025-10-30 17:47:30 +01:00
Mike Yuan
f4314f2fbc core/exec-invoke: do not discard stashed fds when stdio is connected to socket
This makes zero sense. Not sure how it got introduced...
2025-10-30 17:47:30 +01:00
Mike Yuan
d93fff5c0c core/service: also pass sockets to control processes when stdio is named fd 2025-10-30 17:47:30 +01:00
Mike Yuan
c954830fa9 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.
2025-10-30 17:47:29 +01:00
Mike Yuan
d85d98f406 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.
2025-10-30 17:47:29 +01:00
Mike Yuan
f78e7ca7da core/execute: serialize fd_names only if there're fds to pass 2025-10-30 17:47:29 +01:00
Mike Yuan
3299fb4ba7 core/execute: reorder ExecParameters fields 2025-10-30 17:47:28 +01:00
Mike Yuan
75e05a9880 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.
2025-10-30 17:45:34 +01:00
Mike Yuan
edb8fcd813 core/exec-invoke: set exit_status on exec_context_named_iofds() failure 2025-10-30 16:12:14 +01:00
Mike Yuan
04072ad9ed 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.
2025-10-30 16:12:14 +01:00
Mike Yuan
234d8f8bc3 core/exec-invoke: drop redundant stdio_fdname checks
exec_context_fdname() would never return NULL if corresponding
stdio mode is set to named fd.
2025-10-30 16:12:14 +01:00
Mike Yuan
e984e2ca26 core/execute: mark exec_context_fdname() as pure 2025-10-30 16:12:13 +01:00
Mike Yuan
2fd2d8d575 core/execute: remove unused ExecParameters.cgroup_supported
Follow-up for 188286eec6
2025-10-30 16:12:13 +01:00
Daan De Meyer
a79d2e47fc mkosi: update fedora commit reference to ea1d871ecd6c2fe063523840c1e4cf9bcf200e32 (#39483) 2025-10-30 16:07:22 +01:00
Daan De Meyer
5cabeed80b 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.
2025-10-30 15:28:36 +01:00
Lennart Poettering
19bf12bff3 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
2025-10-30 14:12:41 +00:00
Daan De Meyer
b1856a6c4a analyze: Add shell completion for dlopen-metadata 2025-10-30 14:11:28 +00:00
Yu Watanabe
b5d63191ca 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.
2025-10-30 14:58:16 +01:00
Daan De Meyer
16f4bc90d2 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
2025-10-30 14:56:41 +01:00
Daan De Meyer
a835537f75 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.
2025-10-30 14:56:04 +01:00
Daan De Meyer
097536a49c analyze: Add dlopen-metadata verb (#39457)
systemd-analyze dlopen-metadata will show dlopen metadata
in the ELF binary.
2025-10-30 13:56:01 +01:00
Daan De Meyer
92ea9584c6 test-namespace: Migrate to new assertion macros 2025-10-30 13:36:05 +01:00
Lennart Poettering
9851382c12 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
2025-10-30 12:12:00 +00:00
Marcos Alano
44ca5b8002 hwdb: add support for the Logitech MX Master 4 (#39490) 2025-10-30 20:16:26 +09:00
Daan De Meyer
0fe29d0672 analyze: Add dlopen-metadata verb
systemd-analyze dlopen-metadata will show dlopen metadata
in the ELF binary.
2025-10-30 11:58:23 +01:00