1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-18 10:04:04 +03:00

74910 Commits

Author SHA1 Message Date
Yu Watanabe
b3259d795b journalctl: honor --quiet with --setup-keys
Closes #35504.

(cherry picked from commit a5b2973850e5952b9dffdfa3f6a0ef486957cb17)
(cherry picked from commit 644f2a02c8befba986ebbc5d58767807fb2999ee)
2024-12-19 21:58:26 +00:00
Yu Watanabe
43215cfbd3 README: drop CentOS CI badges
CentOS CIs are disabled after ead814a0b0f64c572282b9e27a0a995893f10cf0.

(cherry picked from commit 1fe583861feb5796fa0be937dc7f4c2ce07bcde5)
(cherry picked from commit 3b6b819a289feb76774e7c73654b3f4197181986)
2024-12-19 21:58:26 +00:00
Luca Boccassi
04065a0330 test: add more coverage for extensions and verity
(cherry picked from commit c7fcb08324774c62bd2a786b03a7104a33049db6)
(cherry picked from commit 06467e1dbc0fbf3346a990e6d6a02b1bfc5e8a1c)
2024-12-19 21:58:26 +00:00
Luca Boccassi
4cc7809d01 shell completion: add systemd-creds
(cherry picked from commit 783f794e89996ae7f2ae1872d65c515a672437fa)
(cherry picked from commit b256e149d4eceb9931fa6b727f3523a8d9fd0198)
2024-12-19 21:58:26 +00:00
Luca Boccassi
72f61bff1a 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.

(cherry picked from commit e19cae12ff2e832ce7d79aa483e1aa27ed0ea1f4)
(cherry picked from commit e768cf55b19caec6c8936050b245f398aba8b884)
2024-12-19 21:58:26 +00:00
cvlc12
8f8054f3fe 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.

(cherry picked from commit 693038fce47a819c5eebeb4fce39c9ac991acf84)
(cherry picked from commit 926f5ab6bf0e3541106e6a6f95af4cbdec50582b)
2024-12-19 21:47:52 +00:00
andrejpodzimek
ed1b804b77 Fixing VLAN ranges in man systemd.network.
Otherwise it doesn't hold that VLANs 100-400 are allowed (because 201-299 are disallowed).

(cherry picked from commit ae2f3af63962ba6e2f67cfce07c9fee61722e30e)
(cherry picked from commit 9fad72cc52bdec7f44337b1e48c23ee15fc08d77)
2024-12-19 21:47:49 +00:00
Katariina Lounento
1fd1d05392 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.

(cherry picked from commit 3ca09aa4dd57327989eceb1298754601046ac041)
(cherry picked from commit cd727031a4daafe19f491df360c512433562f469)
2024-12-19 21:47:43 +00:00
Luca Boccassi
abb293e7f1 mkosi: use inetutils package instead of hostname for Archlinux
In Arch the hostname binary is in a different package

Follow-up for cf48bde7aea52b18ac3fa218d3f60fd3d533ef66

(cherry picked from commit 446d737cba3652a9f3dbd07cea9cb4082350b241)
(cherry picked from commit e1659133e79d20799a0841f3099f921957743691)
2024-12-19 21:47:43 +00:00
Luca Boccassi
e3d4a1df2e 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

(cherry picked from commit 630a2e7ee195ca96e102acac8df67a278a879124)
(cherry picked from commit 5573ac7d9c52bed8d38480788b02639ede3881fc)
2024-12-19 21:47:15 +00:00
Luca Boccassi
fd01929305 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

(cherry picked from commit 058a07635f3ff70cc99943dcf4f2a079bc9c28b9)
(cherry picked from commit d80ab6aed678ed89327d86ced9fedd24b5baccd3)
2024-12-19 21:47:15 +00:00
Nick Rosbrook
f707f72865 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.

(cherry picked from commit 59e5108fb4e61957cb40bb15ac7966d085d13af2)
(cherry picked from commit 1b945fb1a727f85be9230e43d2fdaf78d2567946)
2024-12-19 21:47:15 +00:00
Lennart Poettering
5fba8e62bd analyze: tab fix
(cherry picked from commit 7167bee6c672f9a0729631ba1f7459dd5e18f549)
(cherry picked from commit f4215e7909a74e01f3275c8537d9574924aefa4c)
2024-12-19 21:47:13 +00:00
Zbigniew Jędrzejewski-Szmek
f401393ab2 meson: bump version to 256.9
I forgot to do this before tagging. Let's still do this, for two reasons:
- packagers can easily include the patch if they haven't built yet,
- doing the bump reduces the chances of somebody doing an off-by-one bump
  for the next release.
2024-11-30 16:22:22 +01:00
David Tardon
f15fd96efd execute: free syscall_log hashmap when done
Fixes #35394

(cherry picked from commit c3dc460b6c3f062af540e4233c65ac12c01077fa)
v256.9
2024-11-29 14:26:57 +01:00
Luca Boccassi
2d975f64d4 test: mask tmpfiles.d file shipped by selinux policy package in containers
This tmpfiles.d wants to write to sysfs, which is read-only in containers,
so systemd-tmpfiles --create fails in TEST-22-TMPFILES when ran in nspawn
if the selinux policy package is instealled. Mask it, as it's not our
config file, we don't need it in the test.

(cherry picked from commit 6fd3496cfd0d28808b5489ee87f826c2130f5f0b)
2024-11-29 14:26:57 +01:00
Michał Górny
964ced4100 nspawn: Include arm_fadvise64_64 in syscall allow_list
Add the `arm_fadvise64_64` syscall to the allow_list, in addition
to the existing `fadvise64` and `fadvise64_64` syscalls, as this is
the syscall actually defined for `arm` architecture.  Adding it fixes
the syscall being rejected in arm32 containers.

Fixes #35194

(cherry picked from commit 7fd70a532681c0ea4cd6ff04d1a7950dae3efc8c)
2024-11-29 14:26:57 +01:00
Zbigniew Jędrzejewski-Szmek
a70b65863f hwdb: update to main@{2024-11-28}
git restore -s origin/main hwdb.d/ test/hwdb.d test/hwdb-test.sh
2024-11-29 14:26:57 +01:00
Lennart Poettering
7a307c5939 nspawn: make sure --private-users-ownership=no and =off work the same way
We usually want to use "extended booleans" for cases like this, i.e.
that "off", "no" and "0" can be used interchangably for turning
something off.

(cherry picked from commit 62f3e2f84aa3413081fc1c1e1c3074fc9aeedbc9)
2024-11-29 14:26:57 +01:00
Lennart Poettering
b4db0ca753 tests: fix access mode of root inode of throw-away container images
Otherwise the root inode will typically have what mkdtemp sets up, which
is something like 0700, which is weird and somewhat broken when trying
to look into containers from unpriv users.

(cherry picked from commit c18a1024643809c8f28799900af4e6202623f934)
2024-11-29 14:26:57 +01:00
Lennart Poettering
6f346ef756 nspawn: don't try to unregister a machine we never registered
When registering we condition this on "arg_register". Let's do the same
when unregistering, otherwise we might end up trying to unregister a
machine we never registered.

(cherry picked from commit 0790f4e45f2f8c094bf929aa1fcaf4c7e9dbb001)
2024-11-29 14:26:57 +01:00
Yu Watanabe
d51236d833 man: several more assorted fixes
Continuation of 4ebbb5bfe88ac3d793c395472648660c33251546.
Closes #35307.

(cherry picked from commit f29a07f3fce339a18883e6a8949c9181bf0e4e58)
2024-11-29 14:26:57 +01:00
Lennart Poettering
b2751b9ae9 sd-varlink: fix bug when enqueuing messages with fds asynchronously
When determining the poll events to wait for we need to take the queue
of pending messages that carry fds into account. Otherwise we might end
up not waking up if such an fd-carrying message is enqueued
asynchronously (i.e. not from a dispatch callback).

(cherry picked from commit 7b4b3a8f7b76f266438fafb225b7980db68a276e)
2024-11-29 14:26:56 +01:00
Winterhuman
09accdb68c man/systemd-system.conf: Correct "struct" to "strict" (#35364)
(cherry picked from commit 5bed97dd575dd1996638a46cc309c74f43d24e0e)
2024-11-29 14:26:56 +01:00
Yu Watanabe
6f2483eed8 man: use MIT-0 license for example codes in daemon(7)
This page contains many short example codes. I do not think we should
add SPDX-License-Identifier for all codes.

Closes #35356.

(cherry picked from commit 6046cc3660810efcc6fe50b1c850ea642218245b)
2024-11-29 14:26:56 +01:00
Yu Watanabe
8cca30da53 man: update documentation about basic .netdev file handling
Follow-up for #34909 and later PRs.

(cherry picked from commit d07fbf22ed1cde2459bf42f94c5debb9e0278c1a)
2024-11-29 14:26:56 +01:00
Yu Watanabe
95f9307b65 man: asorted fixes
Closes #35307.

(Changes to files with conflicts were dropped.)
(cherry picked from commit 4ebbb5bfe88ac3d793c395472648660c33251546)
2024-11-29 14:26:56 +01:00
Yu Watanabe
d696e5aef1 TEST-17: add reproducer for issue #35329
Without the previous commit, the test case will fail.

(cherry picked from commit 675feaf521316670f85f4de1b7241a9958e79c03)
2024-11-29 14:26:56 +01:00
Yu Watanabe
69a95d442f core/device: ignore ID_PROCESSING udev property on enumerate
This partially reverts the commit 405be62f05d76f1845f347737b5972158c79dd3e
"tree-wide: refuse enumerated device with ID_PROCESSING=1".

Otherwise, when systemd-udev-trigger.service is (re)started just before
daemon-reexec, which can be easily happen on systemd package update, then
udev database files for many devices may have ID_PROCESSING=1 property,
thus devices may not be enumerated on daemon-reexec. That causes many
units especially mount units being deactivated after daemon-reexec.

Fixes #35329.

(cherry picked from commit c4fc22c4defc5983e53f4ce048e15ea7d31e6a75)
2024-11-29 14:26:56 +01:00
Yu Watanabe
ce997e944f curl-util: do not configure new io event source when the event loop is already dead
Similar to c5ecf0949460dd0bf3211db128a385ce6375252e, but for io event source.

Fixes #35322.

(cherry picked from commit 5b2926d9414f4333153ebe0bf169e1dd76129119)
2024-11-29 14:26:56 +01:00
Lennart Poettering
95c20d0b62 nspawn: improve log message on bad incoming sd_notify() message
It's the PID that is wrong, not the UID/GID, be precise.

(cherry picked from commit 95116bdfd5d45cc1a7c6588e6b8bdcb0d0e007a6)
2024-11-29 14:26:56 +01:00
Yu Watanabe
b30364a037 shutdown: close DM block device before issuing DM_DEV_REMOVE ioctl
Otherwise, the ioctl() may fail with EBUSY.

Follow-up for b4b66b26620bfaf5818c95d5cffafd85207694e7.
Hopefully fixes #35243.

(cherry picked from commit b76730f3fe0e824db001b38c8ea848302be786ee)
2024-11-29 14:26:56 +01:00
Zbigniew Jędrzejewski-Szmek
eb841e9b8e Undeprecate commandline params forcequotacheck, fastboot, and forcefsck
Those are historical names, but there is nothing wrong with them. The files on
/ (/fastboot, /forcefsck, and /forcequotacheck) are problematic because they
require a modification of the root file system. But the commandline params work
fine. They have the obvious advantage compared to our "modern" option that they
are much easier to type without looking up the spelling in the docs. Undeprecate
them to avoid unnecessary churn.

(cherry picked from commit 5598454a3f8fc13257e0313d999e6ac9684082e1)
2024-11-29 14:26:56 +01:00
Lennart Poettering
3d85366ab8 userdbctl: fix counting
Fixes: #35294
(cherry picked from commit 7f8a4f12dfea6f644f92788bd9b03983898e9d32)
2024-11-29 14:26:56 +01:00
Lennart Poettering
aed4e90456 userbdctl: show 'mapped' user range only inside of userns
Outside of userns the concept makes no sense, there cannot be users
mapped from further outside.

(cherry picked from commit e412fc5e042b8f642bcba42f5c175124583e05ae)
2024-11-29 14:26:56 +01:00
Lennart Poettering
ddcc0bc151 cryptenroll: it's called PKCS#11, not PKCS11
In the --help text we really should use the official spelling, just like
in the man page.

(cherry picked from commit cc6baba7200bd8171b6beff446b4009dad5c4230)
2024-11-29 14:26:56 +01:00
Yu Watanabe
6dcb53ba0a core/service: service_add_fd_store() consumes passed fd
Without this change, the fd is closed twice on failure.

Fixes a bug introduced by dff9808a628c31b7ecb1f1aba8fdc3be06ce8372.

Fixes #35288.

(cherry picked from commit d99198819caeff6f40a0a520364e59b8a0cbaa4f)
2024-11-29 14:26:56 +01:00
Lennart Poettering
38e0f618ee killall: gracefully handle processes inserted into containers via nsenter -a
"nsenter -a" doesn't migrate the specified process into the target
cgroup (it really should). Thus the cgroup will remain in a cgroup
that is (due to cgroup ns) outside our visibility. The kernel will
report the cgroup path of such cgroups as starting with "/../". Detect
that and print a reasonably error message instead of trying to resolve
that.

(cherry picked from commit f6793bbcf0e3f0a6daa77add96183b88d5ec2117)
2024-11-28 15:11:07 +01:00
Mike Yuan
3808937ff6 core/exec-invoke: suppress placeholder home only in build_environment()
Currently, get_fixed_user() employs USER_CREDS_SUPPRESS_PLACEHOLDER,
meaning home path is set to NULL if it's empty or root. However,
the path is also used for applying WorkingDirectory=~, and we'd
spuriously use the invoking user's home as fallback even if
User= is changed in that case.

Let's instead delegate such suppression to build_environment(),
so that home is proper initialized for usage at other steps.
shell doesn't actually suffer from such problem, but it's changed
too for consistency.

Alternative to #34789

(cherry picked from commit b718b86e1b8477f58461f3c456c944abb1428c0f)
2024-11-28 15:08:36 +01:00
Mike Yuan
e70064370d core/exec-invoke: minor cleanup for apply_working_directory() error handling
Assign exit_status at the same site where error log is emitted,
for readability.

(cherry picked from commit d911778877c18827c64e21cc98e86c31dff9a627)
2024-11-28 15:08:34 +01:00
Mike Yuan
c6721db367 basic/user-util: split out placeholder suppression from USER_CREDS_CLEAN into its own flag
No functional change, preparation for later commits.

(cherry picked from commit eea9d3eb106a91d4479d859603463bdfe3d262eb)
2024-11-28 15:08:33 +01:00
Mike Yuan
3a8d7a83ff basic/user-util: introduce shell_is_placeholder() helper
(cherry picked from commit 579ce77ead476e3d5b9a774ab00ec3ec53933ab2)
2024-11-28 15:08:25 +01:00
Luca Boccassi
fec28cb4f9 units: add initrd directory to list of conditions for systemd-confext
systemd-sysext has the same check, but it was forgotten for confexts.
Needed to activate confexts from the ESP in the initrd.

(cherry picked from commit fe077a1a582a43a6378ff29452a373cc7d393764)
2024-11-28 15:06:21 +01:00
Antonio Alvarez Feijoo
03b993a9bf man/kernel-command-line: fix typo
(cherry picked from commit a04d42821bb5350b0ffa82834e50e9b679279854)
2024-11-28 15:05:52 +01:00
Yu Watanabe
7bb3040cc4 ndisc-option: use memcpy_safe() at one more place
As 'len' may be 8.

Follow-up for a163404cc88914142ef8bbfaab0eb39d1a990c02.

(cherry picked from commit c8ddd5ff72453876b360e7580cc386945b79f5e9)
2024-11-28 15:04:56 +01:00
Antonio Alvarez Feijoo
4a3d55a032 cryptenroll: show better log message if slot to wipe does not exist
```
$ systemd-cryptenroll /dev/vda3
SLOT TYPE
   0 password
$ systemd-cryptenroll --wipe-slot 1 /dev/vda3
Failed to wipe slot 1, continuing: No such file or directory
```

(cherry picked from commit 2b251491debf9cab695f5f34da9908ca46f085fe)
2024-11-28 15:04:47 +01:00
Mantas Mikulėnas
1877797299 ssh-generator: silence "Binding to socket" messages
(cherry picked from commit 2424a67c02913eac30b5d59f1e5ee39a846ca54b)
2024-11-28 15:04:37 +01:00
Lennart Poettering
ff4b66be4a systemctl: grey out tasks limit the same way we grey out the fd store limit in the output
"systemctl status systemd-logind" otherwise looks a bit weird, since the
tasks and the fdstore lines are so close to each other but formatted
quite differently when it comes to coloring.

(cherry picked from commit 54646b1ca95373dfa3ebe5d6e7e27deeed9e77b0)
2024-11-28 15:03:05 +01:00
Lennart Poettering
bdf3f9b8f2 nspawn: --private-users-ownership= value is called 'chown', not 'own'
(cherry picked from commit bae936b418e08063b68c95f4df53c3cd4f70e881)
2024-11-28 15:00:40 +01:00
Lennart Poettering
cf7b3cc182 pid1: make clear that $WATCHDOG_USEC is set for the shutdown binary, noone else
We use the $WATCHDOG_USEC variable for two very closely uses: as part of
the sd_watchdog_enabled() protocol for implementing service watchdogs.
And as part of the protocol between the service manager and
systemd-shutdown across the PID 1 execve() transition during shutdown.

Apparently some exitrds tools got confused by the latter use. Let's
address that by setting $WATCHDOG_PID to 1, in accordance to the
sd_watchdog_enabled() protocol to make clear this is only intended for
PID 1 and nothing else.

Replaces: #35135
(cherry picked from commit 4b20ae9a0e914e61d6bac095e5fc9664510ac03e)
2024-11-28 15:00:30 +01:00