Lennart Poettering [Mon, 4 Dec 2023 16:57:22 +0000 (17:57 +0100)]
nsresourced: add client-side helpers around nsresourced APIs
This adds simple functions that wrap the Varlink IPC calls.
Lennart Poettering [Thu, 20 Apr 2023 17:07:33 +0000 (19:07 +0200)]
nsresourced: add new daemon for granting clients user namespaces and assigning resources to them
This adds a small, socket-activated Varlink daemon that can delegate UID
ranges for user namespaces to clients asking for it.
The primary call is AllocateUserRange() where the user passes in an
uninitialized userns fd, which is then set up.
There are other calls that allow assigning a mount fd to a userns
allocated that way, to set up permissions for a cgroup subtree, and to
allocate a veth for such a user namespace.
Since the UID assignments are supposed to be transitive, i.e. not
permanent, care is taken to ensure that users cannot create inodes owned
by these UIDs, so that persistancy cannot be acquired. This is
implemented via a BPF-LSM module that ensures that any member of a
userns allocated that way cannot create files unless the mount it
operates on is owned by the userns itself, or is explicitly
allowelisted.
BPF LSM program with contributions from Alexei Starovoitov.
Lennart Poettering [Wed, 6 Dec 2023 17:37:31 +0000 (18:37 +0100)]
build-sys: pick up vmlinux.h from running kernel BTF or user
Lennart Poettering [Tue, 23 Jan 2024 15:19:38 +0000 (16:19 +0100)]
dissect-image: document one more dissected_image_decrypt() error code
Lennart Poettering [Mon, 4 Dec 2023 17:23:31 +0000 (18:23 +0100)]
dissect-image: make dissected_image_acquire_metadata() operate within a userns if possible
This opens the door for making the call work without privileges: if we
pass in a userns fd and DissectedImage that has mount fds then we can
acquire all information without privs.
Lennart Poettering [Mon, 4 Dec 2023 17:12:58 +0000 (18:12 +0100)]
dissect-image: add a new helper that checks if VeritySettings has anything set at all
Lennart Poettering [Tue, 14 Mar 2023 21:46:56 +0000 (22:46 +0100)]
dissect-image: add dissected_image_close() that closes all references to resources
Lennart Poettering [Wed, 26 Apr 2023 19:22:06 +0000 (21:22 +0200)]
discover-image: export search paths array
This way we can use it to validate image paths later.
Lennart Poettering [Tue, 12 Dec 2023 10:02:59 +0000 (11:02 +0100)]
cgroup-setup: add fd-based version of cg_attach()
Lennart Poettering [Tue, 12 Dec 2023 09:44:57 +0000 (10:44 +0100)]
cgroup-util: add helpers for opening cgroup by id
Lennart Poettering [Fri, 8 Dec 2023 09:47:38 +0000 (10:47 +0100)]
lock-util: make global lock return parameter to image_path_lock() optional
When adding unprivileged nspawn support we don't really want a global
lock file, since we cannot even access the dir they are stored in, hence
make the concept optional.
Some minor other modernizations.
Lennart Poettering [Fri, 1 Mar 2024 16:31:06 +0000 (17:31 +0100)]
bpf-dlopen: pick up more symbols from libbpf
Lennart Poettering [Wed, 6 Dec 2023 10:35:04 +0000 (11:35 +0100)]
namespace-util: add new helper is_our_namespace()
Lennart Poettering [Tue, 5 Dec 2023 10:51:26 +0000 (11:51 +0100)]
namespace-util: add namespace_open_by_type() helper
Lennart Poettering [Tue, 14 Mar 2023 21:36:35 +0000 (22:36 +0100)]
namespace-util: add detach_mount_namespace_userns()
Lennart Poettering [Tue, 14 Mar 2023 16:22:18 +0000 (17:22 +0100)]
namespace-util: add helper for allocating an empty userns fd
Lennart Poettering [Mon, 13 Mar 2023 14:23:11 +0000 (15:23 +0100)]
namespace-util: add detach_mount_namespace_harder()
This is just like detach_mount_namespace() but if need be uses unpriv
user namespaces to be able to execute CLONE_NEWNS.
Lennart Poettering [Thu, 20 Apr 2023 16:51:26 +0000 (18:51 +0200)]
uid-range: add some basic operations on UidRange objects
Helpers to compare and get size, and whether the object is empty.
Lennart Poettering [Thu, 20 Apr 2023 16:51:55 +0000 (18:51 +0200)]
uid-range: add new uid_range_load_userns_by_fd() helper
This is similar to uid_range_load_userns() but instead of reading the
uid_map off a process it reads it off a userns fd.
(Of course the kernel has no API for this right now, hence we fork off a
throw-away process which joins the user namespace, and then read off the
data from there.)
Lennart Poettering [Thu, 20 Apr 2023 16:51:03 +0000 (18:51 +0200)]
uid-range: optionally load outside view of UID range from uid_map procfs file
Lennart Poettering [Tue, 14 Mar 2023 09:38:58 +0000 (10:38 +0100)]
uid-range: add uid_range_overlaps() helper
Lennart Poettering [Wed, 26 Apr 2023 19:51:53 +0000 (21:51 +0200)]
image-policy: add a new image_policy_intersect() call
This new call takes two image policy objects and generates an
"intersection" policy, i.e. only allows what is allowed by both. Or in
other words it conceptually implements a binary AND of the policy flags.
(Except that it's a bit harder, due to normalization, and underspecified
flags).
We can use this later for mountfsd: a client can specify a policy, and
mountfsd can specify another policy, and we'll then apply only what both
allow.
Note that a policy generated like this might be invalid. For example, if
one policy says root must exist and be verity or luks protected, and the
other policy says root must be absent, then the intersection is invalid,
since one policy only allows what the other prohibits and vice versa.
We'll return a clear error code in that case (ENAVAIL). (This is because
we simply don't allow encoding such impossible policies in an
ImagePolicy structure, for good reasons.)
Lennart Poettering [Tue, 23 Jan 2024 09:22:27 +0000 (10:22 +0100)]
varlink: add varlink_peek_dup_fd() helper
This new call is like varlink_peek_fd() (i.e. gets an fd out of the
connection but leaving it also in there), and combines ith with
F_DUPFD_CLOEXEC to make a copy of it.
We previously already had varlink_dup_fd() which was a duplicating
version for pushing an fd *into* the connection. To reduce confusion,
let's rename that one varlink_push_dup_fd() to make the symmetry to
valrink_push_fd() clear so that we have no:
varlink_peer_push_fd() → put fd in without dup'ing
varlink_peer_push_dup_fd() → same with F_DUPFD_CLOEXEC
varlink_peer_peek_fd() → get fd out without dup'ing
varlink_peer_peek_dup_fd() → same with F_DUPFD_CLOEXEC
Lennart Poettering [Tue, 19 Dec 2023 12:12:14 +0000 (13:12 +0100)]
varlink: add varlink_get_peer_gid() helper
Frantisek Sumsal [Fri, 5 Apr 2024 19:23:42 +0000 (21:23 +0200)]
test: improve debug-ability of test-execute
Since
e56a8790a0 debugging test-execute fails has been a royal PITA, since
we ditch all potentially useful output from the test units (that, for
the most part, run `sh -x ...`). Let's improve the situation a bit by
setting EXEC_OUTPUT_NULL only when running the single test case that
needs it, and inheriting stdout otherwise.
For example, with a purposefully introduced error we get this output
with this patch:
exec-personality-x86-64.service: About to execute: sh -x -c "c=\$\$(uname -m); test \"\$\$c\" = \"foo_bar\""
Serializing sd-executor-state to memfd.
...
Personality: x86-64
LockPersonality: no
SystemCallErrorNumber: kill
++ uname -m
+ c=x86_64
+ test x86_64 = foo_bar
Received SIGCHLD from PID
1520588 (sh).
Child
1520588 (sh) died (code=exited, status=1/FAILURE)
exec-personality-x86-64.service: Child
1520588 belongs to exec-personality-x86-64.service.
exec-personality-x86-64.service: Main process exited, code=exited, status=1/FAILURE
exec-personality-x86-64.service: Failed with result 'exit-code'.
...
Exit Status: 1
src/test/test-execute.c:456:test_exec_personality: exec-personality-x86-64.service: can_unshare=yes: exit status 1, expected 0
(test-execute-root) terminated by signal ABRT.
Assertion 'r >= 0' failed at src/test/test-execute.c:1433, function prepare_ns(). Aborting.
Aborted
But without it, we'd miss the most important part:
exec-personality-x86-64.service: About to execute: sh -x -c "c=\$\$(uname -m); test \"\$\$c\" = \"foo_bar\""
Serializing sd-executor-state to memfd.
...
Personality: x86-64
LockPersonality: no
SystemCallErrorNumber: kill
Received SIGCHLD from PID
1521365 (sh).
Child
1521365 (sh) died (code=exited, status=1/FAILURE)
exec-personality-x86-64.service: Child
1521365 belongs to exec-personality-x86-64.service.
exec-personality-x86-64.service: Main process exited, code=exited, status=1/FAILURE
exec-personality-x86-64.service: Failed with result 'exit-code'.
...
Exit Status: 1
src/test/test-execute.c:456:test_exec_personality: exec-personality-x86-64.service: can_unshare=yes: exit status 1, expected 0
(test-execute-root) terminated by signal ABRT.
Assertion 'r >= 0' failed at src/test/test-execute.c:1433, function prepare_ns(). Aborting.
Aborted
Luca Boccassi [Sat, 6 Apr 2024 12:19:27 +0000 (13:19 +0100)]
Merge pull request #31131 from poettering/dlopen-kmod
turn libkmod into a dlopen() dependency, too
Vito Caputo [Sat, 6 Apr 2024 04:11:28 +0000 (21:11 -0700)]
man: fix typo s/veno/reno/
Luca Boccassi [Fri, 5 Apr 2024 22:53:13 +0000 (23:53 +0100)]
Merge pull request #32115 from YHNdnzj/service-main-pid-take
core/service: a few improvements for main pid handling
Luca Boccassi [Fri, 5 Apr 2024 21:22:06 +0000 (22:22 +0100)]
Merge pull request #32123 from mrc0mmand/assorted-tweaks
A couple of assorted tweaks
Luca Boccassi [Fri, 5 Apr 2024 21:18:31 +0000 (22:18 +0100)]
Merge pull request #32125 from YHNdnzj/post-merge-stuff
Trivial post merge stuff
Mike Yuan [Fri, 5 Apr 2024 10:41:07 +0000 (18:41 +0800)]
core/service: add a FIXME to use pidfd to monitor foreign processes
Mike Yuan [Fri, 5 Apr 2024 10:28:13 +0000 (18:28 +0800)]
core/service: complain louder if new MAINPID= is refused
Mike Yuan [Fri, 5 Apr 2024 10:21:50 +0000 (18:21 +0800)]
core/service: make service_set_main_pidref consume pidref
Currently, the memory management of service_set_main_pidref
is a bit odd. Normally we either invalidate the original
resource on caller's side after the call succeeds, or
just pass the ownership wholly. But service_set_main_pidref
take a pointer, and calls pidref_done() internally.
Let's just make it consume the passed pidref. This is more
straightforward.
Mike Yuan [Fri, 5 Apr 2024 18:10:17 +0000 (02:10 +0800)]
sleep: rename SleepMemMode= to MemorySleepMode=
Addresses https://github.com/systemd/systemd/pull/31986#discussion_r1554053623
Mike Yuan [Fri, 5 Apr 2024 18:06:38 +0000 (02:06 +0800)]
os-util: use ENDSWITH_SET where appropriate
Addresses https://github.com/systemd/systemd/pull/31435#discussion_r1553969156
Co-authored-by: Lennart Poettering <lennart@poettering.net>
Frantisek Sumsal [Fri, 5 Apr 2024 17:33:28 +0000 (19:33 +0200)]
base-filesystem: check for __s390x__ first
On s390x both __s390__ and __s390x__ are defined, and with the original
order we'd go through the __s390__ branch and emit a warning:
[169/2118] Compiling C object src/shared/libsystemd-shared-256.a.p/base-filesystem.c.o
../src/shared/base-filesystem.c:136:11: note: ‘#pragma message: Please add an entry above specifying whether your architecture uses /lib64/, /lib32/, or no such links.’
136 | # pragma message "Please add an entry above specifying whether your architecture uses /lib64/, /lib32/, or no such links."
| ^~~~~~~
Frantisek Sumsal [Fri, 5 Apr 2024 17:23:12 +0000 (19:23 +0200)]
test: account for build dir being under one of the tmpfs-ed directories
If we're running test-execute from the build directory which is under
one of the tmpfs-ed directories (i.e. /root or /tmp), test-execute might
behave strangely, since in that case manager_new() pins the system
systemd-executor binary instead of the build dir one, which may lead to
a very confusing test fails (if there's enough difference between the
system and built sd-executor binary). Let's account for that and
bind-mount the build dir under the tmpfs-ed directory if necessary.
Frantisek Sumsal [Fri, 5 Apr 2024 10:18:58 +0000 (12:18 +0200)]
test: make test-fd-util more lenient when using fd_move_above_stdio()
On s390x this test fails when the SUT uses the z90crypt kernel module,
as it's an another FD the test doesn't account for:
/* test_rearrange_stdio */
Successfully forked off 'rearrange' as PID 57293.
test_rearrange_stdio: r=0
/proc/57293/fd:
total 0
lrwx------. 1 root root 64 Apr 5 06:18 0 -> /dev/pts/0
lrwx------. 1 root root 64 Apr 5 06:18 1 -> /dev/pts/0
lrwx------. 1 root root 64 Apr 5 06:18 2 -> /dev/pts/0
lrwx------. 1 root root 64 Apr 5 06:18 3 -> /dev/z90crypt
rearrange terminated by signal ABRT.
Debugging this was pain, since the child process didn't log anything
once we closed stdout/stderr (for obvious reasons). Let's fix both
issues by switching logging to kmsg once we close stdin/stdout/stderr,
and also by making the test work fine when there are some extra FDs in
the child's environment.
Zbigniew Jędrzejewski-Szmek [Fri, 5 Apr 2024 15:04:17 +0000 (17:04 +0200)]
Merge pull request #31435 from bluca/portable_fix_versioned
portable: assorted bug fixes
Antonio Alvarez Feijoo [Fri, 5 Apr 2024 06:27:36 +0000 (08:27 +0200)]
sd-journal: fix check in `journal_file_verify_header()`
Fixes
6ea51363c8e39fb0924dda972a212936456a2b4f
Frantisek Sumsal [Fri, 5 Apr 2024 10:14:18 +0000 (12:14 +0200)]
log: fix comment
Daan De Meyer [Wed, 3 Apr 2024 14:06:14 +0000 (16:06 +0200)]
core: Serialize both pid and pidfd to keep downgrades working
Currently, when downgrading from a version with pidfd support to a
version without pidfd support, all information about running processes
is lost as the newer systemd will serialized pidfds which are not recognized
by the older systemd when deserializing.
To improve the situation, let's serialize both the pid and the pidfd.
This is safe because existing versions will either replace the first
deserialized pidref with the second one or discard the second one in
favor of the first one depending on the unit and field. Older versions
that don't support pidfd's will silently discard any fields that contain
a pidfd as those will try to parse the field as a pid and since a pidfd
field will start with '@', those versions will debug error log and ignore
the value.
To make sure we reuse the existing pidfd as much as possible, the pidfd
is serialized first. Both for scopes and service main pids, if the same
pid is seen multiple times, the first pidref is kept. So by serializing
the pidfd first we make sure the original pidfd is used instead of the
new one which is opened when deserializing the first pid field.
For other control units, older versions with pidfd support will discard
the first pidfd and replace it with a new pidfd from the second pid field.
This is a slight regression on downgrades, but we make sure it doesn't
happen for future versions (and older versions when this commit is
backported) by modifying the logic to only use the first successfully
deserialized pidref so that the raw pid without pidfd is discarded instead
of it replacing the existing pidfd.
Luca Boccassi [Thu, 4 Apr 2024 22:42:45 +0000 (23:42 +0100)]
meson: set -fno-ssa-phiopt when building bpf with gcc
There are bugs in the kernel verifier that cause legitimate code
to be rejected, disabling this optimization makes bpf programs
built with a new enough gcc work again.
Fixes https://github.com/systemd/systemd/issues/31888
Kirk [Fri, 5 Apr 2024 01:18:59 +0000 (20:18 -0500)]
hwdb: fix missing colon (#32108)
Missing colon prevents this from working correctly on the Chuwi UBook X and UBook X Pro.
Luca Boccassi [Thu, 4 Apr 2024 22:46:26 +0000 (23:46 +0100)]
Merge pull request #32085 from yuwata/udev-check-processing
udev: check ID_PROCESSING udev property more
Yu Watanabe [Thu, 4 Apr 2024 20:54:12 +0000 (05:54 +0900)]
Merge pull request #31373 from yuwata/network-neighbor-advertisement
network: add basic support of neighbor advertisement
Yu Watanabe [Wed, 3 Apr 2024 20:06:39 +0000 (05:06 +0900)]
udevadm-test: also show security labels if specified
Follow-up for
03b6879f4d45c49264708aef872fd05af30ddcf0.
Yu Watanabe [Wed, 3 Apr 2024 20:45:11 +0000 (05:45 +0900)]
backlight: fix detection of multiple graphic cards
Follow-up for
e0504dd011189d97a1ea813aabfe1e696742bcf5.
Hopefully, devices in PCI subsystem have some properties, thus have
their udev database file. But, that may not be true. Here, we only read
sysattrs of enumerated devices, hence it is not necessary to check if
the device is initialized or not.
Yu Watanabe [Wed, 3 Apr 2024 19:58:25 +0000 (04:58 +0900)]
udev: do not update sysattr and sysctl value on testing
Follow-up for
089bef66316e5bdc91b9984148e5a6455449c1da.
Luca Boccassi [Thu, 4 Apr 2024 20:21:10 +0000 (21:21 +0100)]
Merge pull request #32102 from YHNdnzj/efi-var-consistent
Trivial follow-up for hibernate-resume
Mike Yuan [Thu, 4 Apr 2024 19:02:00 +0000 (03:02 +0800)]
man/kernel-command-line: document resume_offset= too
Mike Yuan [Thu, 4 Apr 2024 18:59:59 +0000 (02:59 +0800)]
hibernate-util: say "HibernateLocation EFI variable" consistently
Yu Watanabe [Thu, 4 Apr 2024 17:03:27 +0000 (02:03 +0900)]
udevadm-test: insert missing line break
Addresses post-merge comment:
https://github.com/systemd/systemd/commit/
03b6879f4d45c49264708aef872fd05af30ddcf0#r140587790
Zbigniew Jędrzejewski-Szmek [Thu, 4 Apr 2024 11:25:41 +0000 (13:25 +0200)]
TEST-50: add tests for riscv{32,64}
Requested for the testing of F40 riscv bringup. Numbers copied from
https://uapi-group.org/specifications/specs/discoverable_partitions_specification/.
It'd be nice to do the same in TEST-58, but the code there is rather involved
and I don't have a system to test on. We can probably try that later on when F40
is available.
mkubiak [Thu, 4 Apr 2024 12:25:15 +0000 (14:25 +0200)]
Fixed resolution for pen and touchpad
Yu Watanabe [Wed, 14 Feb 2024 12:32:56 +0000 (21:32 +0900)]
netowrk/ndisc: drop NDisc configurations when received NA without Router flag
Closes #28421.
Yu Watanabe [Wed, 14 Feb 2024 12:17:00 +0000 (21:17 +0900)]
test-ndisc: add basic tests for Neighbor Advertisement handling
Yu Watanabe [Wed, 14 Feb 2024 11:39:50 +0000 (20:39 +0900)]
sd-ndisc: add basic support of Neighbor Advertisement message
This adds basic support of receiving and parsing Neighbor Advertisement
message defined in RFC 4861.
Antonio Alvarez Feijoo [Thu, 4 Apr 2024 15:44:52 +0000 (17:44 +0200)]
cryptsetup-tokens: fix argument order mismatch in function
The order of the arguments of the function `acquire_luks2_key()` in
`luks2-tpm2.h` is wrong, `pcrlock_path` and `pin` are swapped.
Fixes
404aea7815595c1324947ed7f2a7502b17d3cc01
Yu Watanabe [Wed, 3 Apr 2024 20:53:55 +0000 (05:53 +0900)]
tree-wide: refuse enumerated device with ID_PROCESSING=1
When enumerated devices are being processed by udevd, we will receive
corresponding uevents later. So, we should not process devices in that
case.
Yu Watanabe [Wed, 3 Apr 2024 20:40:52 +0000 (05:40 +0900)]
tree-wide: use device_is_processed() more
Yu Watanabe [Wed, 3 Apr 2024 20:39:25 +0000 (05:39 +0900)]
udev-util: rename device_is_processing() -> device_is_processed()
And make it also check the existence of the udev database.
Luca Boccassi [Thu, 4 Apr 2024 16:44:12 +0000 (17:44 +0100)]
Merge pull request #32097 from keszybz/sd-notify-cleanups
Small cleanups to sd_notify docs
Daan De Meyer [Thu, 4 Apr 2024 16:27:20 +0000 (18:27 +0200)]
Merge pull request #32033 from DaanDeMeyer/unit-creds
debug-generator: Add unit and drop-in credentials
Lennart Poettering [Tue, 30 Jan 2024 13:58:47 +0000 (14:58 +0100)]
update TODO
Lennart Poettering [Tue, 30 Jan 2024 13:50:35 +0000 (14:50 +0100)]
libkmod: turn into dlopen() dependency
As it turns out libkmod has quite a bunch of deps, including various
compressing libs and similar. By turning this into a dlopen()
dependency, we can make our depchain during install time quite a bit
smaller. In particular as inside of containers kmod doesn't help anyway
as CAP_SYS_MODULE is not available anyway.
While we are at it, also share the code that sets up logging/kmod
context.
After:
$ lddtree ./build/systemd
systemd => ./build/systemd (interpreter => /lib64/ld-linux-x86-64.so.2)
libsystemd-core-255.so => ./build/src/core/libsystemd-core-255.so
libaudit.so.1 => /lib64/libaudit.so.1
libcap-ng.so.0 => /lib64/libcap-ng.so.0
ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
libm.so.6 => /lib64/libm.so.6
libmount.so.1 => /lib64/libmount.so.1
libblkid.so.1 => /lib64/libblkid.so.1
libseccomp.so.2 => /lib64/libseccomp.so.2
libselinux.so.1 => /lib64/libselinux.so.1
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0
libsystemd-shared-255.so => /home/lennart/projects/systemd/build/src/shared/libsystemd-shared-255.so
libacl.so.1 => /lib64/libacl.so.1
libattr.so.1 => /lib64/libattr.so.1
libcap.so.2 => /lib64/libcap.so.2
libcrypt.so.2 => /lib64/libcrypt.so.2
libgcrypt.so.20 => /lib64/libgcrypt.so.20
libgpg-error.so.0 => /lib64/libgpg-error.so.0
liblz4.so.1 => /lib64/liblz4.so.1
libcrypto.so.3 => /lib64/libcrypto.so.3
libz.so.1 => /lib64/libz.so.1
libpam.so.0 => /lib64/libpam.so.0
libeconf.so.0 => /lib64/libeconf.so.0
liblzma.so.5 => /lib64/liblzma.so.5
libzstd.so.1 => /lib64/libzstd.so.1
libc.so.6 => /lib64/libc.so.6
Before:
$ lddtree ./build/systemd
systemd => ./build/systemd (interpreter => /lib64/ld-linux-x86-64.so.2)
libsystemd-core-255.so => ./build/src/core/libsystemd-core-255.so
libaudit.so.1 => /lib64/libaudit.so.1
libcap-ng.so.0 => /lib64/libcap-ng.so.0
ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
libkmod.so.2 => /lib64/libkmod.so.2
libzstd.so.1 => /lib64/libzstd.so.1
liblzma.so.5 => /lib64/liblzma.so.5
libz.so.1 => /lib64/libz.so.1
libcrypto.so.3 => /lib64/libcrypto.so.3
libgcc_s.so.1 => /lib64/libgcc_s.so.1
libm.so.6 => /lib64/libm.so.6
libmount.so.1 => /lib64/libmount.so.1
libblkid.so.1 => /lib64/libblkid.so.1
libseccomp.so.2 => /lib64/libseccomp.so.2
libselinux.so.1 => /lib64/libselinux.so.1
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0
libsystemd-shared-255.so => /home/lennart/projects/systemd/build/src/shared/libsystemd-shared-255.so
libacl.so.1 => /lib64/libacl.so.1
libattr.so.1 => /lib64/libattr.so.1
libcap.so.2 => /lib64/libcap.so.2
libcrypt.so.2 => /lib64/libcrypt.so.2
libgcrypt.so.20 => /lib64/libgcrypt.so.20
libgpg-error.so.0 => /lib64/libgpg-error.so.0
liblz4.so.1 => /lib64/liblz4.so.1
libpam.so.0 => /lib64/libpam.so.0
libeconf.so.0 => /lib64/libeconf.so.0
libc.so.6 => /lib64/libc.so.6
Lennart Poettering [Thu, 4 Apr 2024 07:59:00 +0000 (09:59 +0200)]
watchdog: clarify that we set the *watchdog* timeout
This makes sure we mention the word "watchdog" in every log message
related to the watchdog.
Also, this uses the expression "hardware timeout" when referring to the
primary timeout of the watchdog, as opposed to the "pretimeout".
(Not ideal wording I know, but it's preexisting to some point, I just
continued it. I think it's OK though, in particular to underline the
difference to the software watchdog logic we implement via WATCHDOG= in
sd_notify().)
Fixes: #31662
Daan De Meyer [Sun, 31 Mar 2024 20:18:19 +0000 (22:18 +0200)]
debug-generator: Add unit and drop-in credentials
These allow adding extra units and drop-ins via credentials.
Daan De Meyer [Tue, 2 Apr 2024 20:52:02 +0000 (22:52 +0200)]
network-generator: Add logging
We stick to debug logging because in some cases network-generator
will fall back to trying another parsing function if one fails, so
if we return an error it's not necessarily a failure.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Apr 2024 10:17:43 +0000 (12:17 +0200)]
man: align strings in sd_notify() examples
I think this way it's easier to see that they are part of the same argument.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Apr 2024 08:57:30 +0000 (10:57 +0200)]
man/notify-selfcontained-example: check argument first
This is just good style. In this particular case, if the argument is incorrect and
the function is not tested with $NOTIFY_SOCKET set, the user could not get the
proper error until running for real.
Also, remove mention of systemd. The protocol is fully generic on purpose.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Apr 2024 10:12:25 +0000 (12:12 +0200)]
Zbigniew Jędrzejewski-Szmek [Thu, 4 Apr 2024 07:28:55 +0000 (09:28 +0200)]
man: update fedora example to F40
F40 will be out soon, so we can update the man page already. The example should
already work.
The cloud link was dropped in
fd571c9df0ba86636401582c4ea0a8cb608e1216, so
drop the unused variable too.
Julius Alexandre [Wed, 3 Apr 2024 21:44:51 +0000 (21:44 +0000)]
core/exec-invoke: replace basename() with path_extract_filename() (#32076)
Yu Watanabe [Wed, 3 Apr 2024 18:20:28 +0000 (03:20 +0900)]
vmspawn: fix error code
Daan De Meyer [Wed, 3 Apr 2024 18:48:05 +0000 (20:48 +0200)]
mkosi: More package updates
- Install individual asan libraries instead of gcc
- Drop duplicate qrencode package from arch config
- Install dbus-user-session which provides default-dbus-session-bus
- Explicitly install dbus-broker on Arch Linux
Lennart Poettering [Wed, 3 Apr 2024 16:48:40 +0000 (18:48 +0200)]
sysupdate: use log_syntax() when logging about a configuration file
All code around this does this too, hence do it here as well.
Also fix plural verb form.
Follow-up for: #32018
Yu Watanabe [Wed, 3 Apr 2024 17:25:57 +0000 (02:25 +0900)]
man/example: also build example code with C90
Unfortunately, sd-bus-vtable.h, sd-journal.h, and sd-id128.h
have variadic macro and inline initialization of sub-object, these are
not supported in C90. So, we need to silence some errors.
Daan De Meyer [Wed, 3 Apr 2024 17:44:26 +0000 (19:44 +0200)]
mkosi: Install selinux tools in main image instead of initramfs
Also install setools-console and policycoreutils instead of setools
which pulls in the kitchen sink. Also install selinux-policy-targeted
to make sure the right policy is installed.
Daan De Meyer [Wed, 3 Apr 2024 17:38:16 +0000 (19:38 +0200)]
mkosi: Install git-core where possible
This avoids pulling in the perl kitchen sink.
Lennart Poettering [Wed, 3 Apr 2024 16:00:04 +0000 (18:00 +0200)]
Revert "kernel-install: Add kernel version to title (#31581)"
This reverts commit
85b774de49caff8be819f021740dd680ba76ab77.
Yu Watanabe [Wed, 3 Apr 2024 17:44:59 +0000 (02:44 +0900)]
Merge pull request #32072 from YHNdnzj/no-ellipsize
core/manager: use cellescape and don't be too aggressive
Lennart Poettering [Wed, 3 Apr 2024 14:46:09 +0000 (16:46 +0200)]
resolved: return ExpectedMore error if we require "more" varlink flag on method call
Fixes: #32066
Yu Watanabe [Wed, 3 Apr 2024 17:43:00 +0000 (02:43 +0900)]
Merge pull request #32043 from YHNdnzj/resume-clear-efi
units: introduce systemd-hibernate-clear.service that clears stale HibernateLocation EFI variable
Evgeny Vereshchagin [Wed, 3 Apr 2024 13:55:31 +0000 (13:55 +0000)]
fuzz: check that ND options are parsed sucessfully
At that point the options have been parsed, sent and received again so
`ndisc_parse_options` should never fail there (unless ndisc_send corrupts
them somehow).
It's a follow-up to https://github.com/systemd/systemd/pull/31807
Yu Watanabe [Wed, 3 Apr 2024 16:29:41 +0000 (01:29 +0900)]
man/examples: set _GNU_SOURCE in source, rather than by compile option
Addresses https://github.com/systemd/systemd/pull/32057#issuecomment-
2034408569.
Lennart Poettering [Fri, 1 Mar 2024 10:25:52 +0000 (11:25 +0100)]
ssh-generator: create privsep dir via tmpfiles.d/ if we are told to
To make it easy to have a workable ssh-generator on various distros,
let's optionally generate the ssh privsep dir via tmpfiles.d/ drop-in.
This enables the concept with a path of /run/sshd/ as default. This is
the path Debian/Ubuntu uses, and means that we just work on those
distros. Debian/Ubuntu is the only distro (apparently?) that puts the
privsep dir under /run/, hence always needs the dir to be created
manually. Other distros don't need it that much, because they place the
dir in /usr/ (fedora, best choice!) or /var/ (others, not ideal, because
still mutable).
Also adds a longer explanation about this in NEWS, in the hope that
distro maintaines read that and maybe start cleaning this up.
Alternative to: #31543
Mike Yuan [Wed, 3 Apr 2024 14:54:48 +0000 (22:54 +0800)]
core/manager: use cellescape and don't be too aggressive
Addresses https://github.com/systemd/systemd/pull/32068#issuecomment-
2034799862
Mike Yuan [Wed, 3 Apr 2024 15:00:55 +0000 (23:00 +0800)]
string-util: add missing assertion in cellescape
Luca Boccassi [Wed, 3 Apr 2024 15:36:35 +0000 (16:36 +0100)]
Merge pull request #32065 from bluca/dlopen_debug
dlopen: fix bpf symbol loading check and log at debug level when loading a library
Luca Boccassi [Wed, 3 Apr 2024 15:10:00 +0000 (16:10 +0100)]
Merge pull request #32019 from bluca/gcrypt_dlopen
gcrypt: dlopenify for libsystemd
Lennart Poettering [Wed, 3 Apr 2024 13:54:49 +0000 (15:54 +0200)]
notify-example: also send STOPPING=1 at exit
I think the example should reflect the full set of lifecycle messages,
including STOPPING=1, which tells the service manager that the service
is already terminating. This is useful for reporting this information
back to the user and to suppress repeated shutdown requests.
It's not as important as the READY=1 and RELOADING=1 messages, since we
actively wait for those from the service message if the right Type= is
set. But it's still very valuable information, easy to do, and completes
the state engine.
Mike Yuan [Tue, 2 Apr 2024 21:38:51 +0000 (05:38 +0800)]
man/kernel-command-line: be clear that resumeflags= is about timeout opts only
Mike Yuan [Sun, 31 Mar 2024 12:52:39 +0000 (20:52 +0800)]
units: introduce systemd-hibernate-clear.service that clears
stale HibernateLocation EFI variable
Currently, if the HibernateLocation EFI variable exists,
but we failed to resume from it, the boot carries on
without clearing the stale variable. Therefore, the subsequent
boots would still be waiting for the device timeout,
unless the variable is purged manually.
There's no point to keep trying to resume after a successful
switch-root, because the hibernation image state
would have been invalidated by then. OTOH, we don't
want to clear the variable prematurely either,
i.e. in initrd, since if the resume device is the same
as root one, the boot won't succeed and the user might
be able to try resuming again. So, let's introduce a
unit that only runs after switch-root and clears the var.
Fixes #32021
Mike Yuan [Sun, 31 Mar 2024 12:30:50 +0000 (20:30 +0800)]
hibernate-resume: introduce --clear for clearing hibernate storage var
Mike Yuan [Sun, 31 Mar 2024 11:47:34 +0000 (19:47 +0800)]
hibernate-resume: add options handling
Mike Yuan [Wed, 3 Apr 2024 01:42:59 +0000 (09:42 +0800)]
hibernate-resume-config: expose get_efi_hibernate_location
Mike Yuan [Tue, 2 Apr 2024 16:51:37 +0000 (00:51 +0800)]
hibernate-resume: EINVAL -> ENOTBLK where appropriate
Mike Yuan [Sun, 31 Mar 2024 12:17:14 +0000 (20:17 +0800)]
hibernate-util: make clear_efi_hibernate_location_and_warn return 1 if
actually cleared the variable
Luca Boccassi [Wed, 3 Apr 2024 11:07:43 +0000 (12:07 +0100)]
dlopen: log debug message when a library is dlopened
Useful to track what is being used and when