]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agoNew PAM module: pam_systemd_loadkey 29776/head
Jin Liu [Tue, 31 Oct 2023 04:48:24 +0000 (12:48 +0800)] 
New PAM module: pam_systemd_loadkey

This module reads password from kernel keyring and sets it as PAM authtok.
It's inspired by gdm's pam_gdm, which reads the LUKS password stored by
systemd-cryptsetup, so Gnome Keyring can be automatically unlocked if set
to the same password (when autologin is enabled so the user doesn't enter
a password in gdm).

7 months agotest-network: copy rules from source & build trees if needed
Frantisek Sumsal [Mon, 30 Oct 2023 16:03:19 +0000 (17:03 +0100)] 
test-network: copy rules from source & build trees if needed

When running with --build-dir= we need to copy over udev rules from
$BUILD_DIR/udev.d/ and $SOURCE_TREE/udev.d/ to make stuff work as
expected.

7 months agotest: add one missing cleanup
Frantisek Sumsal [Mon, 30 Oct 2023 10:44:46 +0000 (11:44 +0100)] 
test: add one missing cleanup

So the test doesn't fail when run multiple times with the same image.

7 months agosecure-boot: print just before cold-resetting to help diagnose hangs
Raito Bezarius [Fri, 29 Sep 2023 01:51:54 +0000 (03:51 +0200)] 
secure-boot: print just before cold-resetting to help diagnose hangs

When testing the secureboot enroll feature, it can be hard to distinguish without
using the QMP API of QEMU whether we are in a hang situation of the UEFI firmware.

Making it clear that we reached the `ResetSystem` can be helpful towards that need.

7 months agosleep-config: allow setting empty HibernateMode= (use kernel default)
Mike Yuan [Sun, 29 Oct 2023 16:03:07 +0000 (00:03 +0800)] 
sleep-config: allow setting empty HibernateMode= (use kernel default)

Both sleep_mode_supported and write_mode support this,
but parse_sleep_config currently prohibits this - it always
uses our default value if user specifies HibernateMode=<empty>.

7 months agoUpdate TODO
Lennart Poettering [Mon, 30 Oct 2023 11:28:50 +0000 (12:28 +0100)] 
Update TODO

7 months agodoc: document explicitly when we require specific top-level mounts to be established
Lennart Poettering [Mon, 30 Oct 2023 09:48:58 +0000 (10:48 +0100)] 
doc: document explicitly when we require specific top-level mounts to be established

7 months agonetwork: introduce SendHostname/Hostname DHCPv6 options
Ronan Pigott [Tue, 24 Oct 2023 20:56:22 +0000 (13:56 -0700)] 
network: introduce SendHostname/Hostname DHCPv6 options

These options were previously reused by the DHCPv6 client from the
DHCPv4 client settings. Let's separate them for consistency.

7 months agoupdate TODO
Lennart Poettering [Mon, 30 Oct 2023 09:51:35 +0000 (10:51 +0100)] 
update TODO

7 months agoman: revise wording of cgtop -k and -P
Alex Hudspith [Sat, 28 Oct 2023 14:49:06 +0000 (15:49 +0100)] 
man: revise wording of cgtop -k and -P

Resolves: #29753

7 months agoexec-invoke: don't double-close FDs on error
Luca Boccassi [Fri, 27 Oct 2023 15:33:49 +0000 (16:33 +0100)] 
exec-invoke: don't double-close FDs on error

When a late error occurs in sd-executor, the cleanup-on-close of the
context structs happen, but at that time all FDs might have already
been closed via close_all_fds(), so a double-close happens. This
can be seen when DynamicUser is enabled, with a non-existing
WorkingDirectory.

Invalidate the FDs in the context structs if close_all_fds succeeds.

7 months agomkosi: Use cache and build subdirectories
Daan De Meyer [Sat, 28 Oct 2023 08:37:16 +0000 (10:37 +0200)] 
mkosi: Use cache and build subdirectories

Next release of mkosi will not use subdirectories under the cache
and build directory by default anymore, so let's make sure we already
start creating those ourselves.

7 months agoMerge pull request #29740 from YHNdnzj/sleep-round-four
Mike Yuan [Sat, 28 Oct 2023 09:53:54 +0000 (17:53 +0800)] 
Merge pull request #29740 from YHNdnzj/sleep-round-four

sleep: make sure we clear HibernateLocation on all error paths

7 months agotmpfiles: ignore EINVAL with --graceful
Frantisek Sumsal [Fri, 27 Oct 2023 19:46:18 +0000 (21:46 +0200)] 
tmpfiles: ignore EINVAL with --graceful

Add EINVAL to the list of ignored errnos, since acl_from_text() returns
EINVAL if it can't translate the given string.

~# cat /tmp/tmpfiles-test.conf
a+ /tmp/foo - - - - default:group:foo:rwx
~# build/systemd-tmpfiles /tmp/tmpfiles-test.conf --create --graceful
Failed to parse ACL "default:group:foo:rwx", ignoring: Invalid argument

Resolves: #29742

7 months agotest: io.latency cgroup support might not be available, skip test
Luca Boccassi [Fri, 27 Oct 2023 23:46:40 +0000 (00:46 +0100)] 
test: io.latency cgroup support might not be available, skip test

It doesn't seem to be enabled on Debian stable, and the test fails.

Follow-up for 5efc8183c9cf9b

7 months agonamespace: normalize MountMode type a bit
Lennart Poettering [Thu, 26 Oct 2023 17:22:02 +0000 (19:22 +0200)] 
namespace: normalize MountMode type a bit

Let's prefix it with a common prefix, and make sure the names are all
singular and the string table actually matches the names.

No change in behavour, just some rafactoring to make this enum a bit
less special, and make it follow our usual coding style more closely.

7 months agoMerge pull request #29693 from rpigott/dhcp-rapid-commit
Yu Watanabe [Sat, 28 Oct 2023 01:23:23 +0000 (10:23 +0900)] 
Merge pull request #29693 from rpigott/dhcp-rapid-commit

network: implement RFC4039 DHCP Rapid Commit

7 months agoMerge pull request #29737 from glance-/tpm2-openssl
Luca Boccassi [Fri, 27 Oct 2023 22:21:44 +0000 (23:21 +0100)] 
Merge pull request #29737 from glance-/tpm2-openssl

tpm2: fix build failure without openssl

7 months agoMerge pull request #29734 from YHNdnzj/fstab-filter-options
Luca Boccassi [Fri, 27 Oct 2023 22:20:46 +0000 (23:20 +0100)] 
Merge pull request #29734 from YHNdnzj/fstab-filter-options

fstab-generator: drop ignored mount options from mount unit Options=

7 months agoMerge pull request #29745 from mrc0mmand/more-tests
Luca Boccassi [Fri, 27 Oct 2023 22:20:23 +0000 (23:20 +0100)] 
Merge pull request #29745 from mrc0mmand/more-tests

test: cover more sd-executor related stuff

7 months agotest: cover more sd-executor related stuff 29745/head
Frantisek Sumsal [Fri, 27 Oct 2023 06:42:24 +0000 (08:42 +0200)] 
test: cover more sd-executor related stuff

Let's probe directives that have slightly more "complex" handling in
the serialization/deserialization machinery.

7 months agocore: don't insert an extra space before each SocketBind{Allow,Deny}= item
Frantisek Sumsal [Fri, 27 Oct 2023 16:36:35 +0000 (18:36 +0200)] 
core: don't insert an extra space before each SocketBind{Allow,Deny}= item

The extra space was actually screwing up deserialization:

~# systemd-run --wait --pipe -p SocketBindAllow=any true
Running as unit: run-u167.service
Finished with result: exit-code
Main processes terminated with: code=exited/status=234
Service runtime: 1ms
CPU time consumed: 0
~# journalctl -b -p err
...
Oct 27 16:39:15 arch systemd-executor[5983]: Failed to deserialize: Invalid argument

Let's not do that by default and introduce a simple wrapper which
inserts the space after each item only when necessary.

7 months agotest-network: add dhcp rapid commit test 29693/head
Ronan Pigott [Wed, 25 Oct 2023 00:57:45 +0000 (17:57 -0700)] 
test-network: add dhcp rapid commit test

7 months agocore: actually set the CPU scheduling policy when deserializing it
Frantisek Sumsal [Fri, 27 Oct 2023 15:16:57 +0000 (17:16 +0200)] 
core: actually set the CPU scheduling policy when deserializing it

7 months agosleep: make sure we clear HibernateLocation on all error paths 29740/head
Mike Yuan [Thu, 26 Oct 2023 15:39:32 +0000 (23:39 +0800)] 
sleep: make sure we clear HibernateLocation on all error paths

Also, let's say "sleep operation" rather than "sleep state",
the latter of which creates ambiguity with /sys/power/state.

7 months agofstab-generator: drop unapplicable mount options for / from mount unit Options= 29734/head
Mike Yuan [Thu, 26 Oct 2023 17:29:02 +0000 (01:29 +0800)] 
fstab-generator: drop unapplicable mount options for / from mount unit Options=

Prompted by #29705

Note that x-systemd.wanted-by= and x-systemd.required-by= are not
dropped, since we ignore them because they are unnecessary rather
than unapplicable.

7 months agoCI: add a build job with TPM but without OpenSSL 29737/head
Luca Boccassi [Fri, 27 Oct 2023 10:47:43 +0000 (11:47 +0100)] 
CI: add a build job with TPM but without OpenSSL

We keep introducing build failures with this combination due to the
high amount of changes, add a combination that covers it

7 months agoresolved: fix build failure with gnutls
Luca Boccassi [Fri, 27 Oct 2023 12:52:21 +0000 (13:52 +0100)] 
resolved: fix build failure with gnutls

Follow-up for bd1ae178336a3d9143fe

7 months agotpm2: fix build failure without openssl
Anton Lundin [Fri, 20 Oct 2023 13:46:07 +0000 (15:46 +0200)] 
tpm2: fix build failure without openssl

7 months agosleep: minor modernization for lock_all_homes
Mike Yuan [Thu, 26 Oct 2023 15:50:50 +0000 (23:50 +0800)] 
sleep: minor modernization for lock_all_homes

7 months agosleep: rework write_state and write_mode
Mike Yuan [Thu, 26 Oct 2023 15:22:11 +0000 (23:22 +0800)] 
sleep: rework write_state and write_mode

7 months agosleep: update help text for suspend-then-hibernate
Mike Yuan [Thu, 26 Oct 2023 14:20:36 +0000 (22:20 +0800)] 
sleep: update help text for suspend-then-hibernate

7 months agosleep: log about errno
Mike Yuan [Thu, 26 Oct 2023 14:18:57 +0000 (22:18 +0800)] 
sleep: log about errno

7 months agosleep: drop unneeded includes
Mike Yuan [Thu, 26 Oct 2023 14:17:12 +0000 (22:17 +0800)] 
sleep: drop unneeded includes

7 months agosleep: introduce sleep_operation_is_hibernation
Mike Yuan [Thu, 26 Oct 2023 12:27:12 +0000 (20:27 +0800)] 
sleep: introduce sleep_operation_is_hibernation

7 months agofstab-generator: use RET_GATHER more
Mike Yuan [Thu, 26 Oct 2023 17:19:40 +0000 (01:19 +0800)] 
fstab-generator: use RET_GATHER more

7 months agologind: fix abnormal switching causing the screen to go black
xinpeng wang [Wed, 25 Oct 2023 03:19:58 +0000 (11:19 +0800)] 
logind: fix abnormal switching causing the screen to go black

After logind receives the SIGRTMIN signal from the kernel, it will execute
manager_vt_switch---session_leave_vt---session_device_pause_all,The device
permissions of the session are removed here;under normal circumstances, the
tty value read from /sys/class/tty/tty0/active changes and switchesto a new
session,give the new session resume device permissions.
But under abnormal circumstances (such as switching quickly on a device using
wayland; and sometimes the kernel will suddenly send a SIGRTMIN signal, but
nothing changes),In these cases, logind does not give session resume device
permission, causing the device to have a black screen and suspended animation.

7 months agoudev: fix typo for persistent flag
janana [Fri, 27 Oct 2023 08:19:48 +0000 (16:19 +0800)] 
udev: fix typo for persistent flag

The 'parsistent' adjective is misspelt.

7 months agoMerge pull request #29332 from esposem/ukify_simplify
Luca Boccassi [Thu, 26 Oct 2023 23:10:28 +0000 (00:10 +0100)] 
Merge pull request #29332 from esposem/ukify_simplify

ukify: automatically infer --signtool from the parameters given

7 months agofstab-generator: drop nofail and noauto options for critical mounts
Michal Sekletar [Wed, 25 Oct 2023 11:17:18 +0000 (13:17 +0200)] 
fstab-generator: drop nofail and noauto options for critical mounts

Setting nofail for /usr mount doesn't make sense because without /usr we
can't really boot. However, having the flag set might cause races in
initrd where we could try to switchroot into rootfs before /usr is
actually mounted. Let's just ignore it so that we always have proper
mount unit ordering for /sysroot/usr mount.

7 months agonetwork: implement RFC4039 DHCP Rapid Commit
Ronan Pigott [Tue, 24 Oct 2023 18:01:32 +0000 (11:01 -0700)] 
network: implement RFC4039 DHCP Rapid Commit

This implements the DHCPv4 equivalent of the DHCPv6 Rapid Commit option,
enabling a lease to be selected in an accelerated 2-message exchange
instead of the typical 4-message exchange.

7 months agonetwork: cleanup unreachable condition in dhcp client path
Ronan Pigott [Wed, 25 Oct 2023 23:17:44 +0000 (16:17 -0700)] 
network: cleanup unreachable condition in dhcp client path

The client state is unconditionally set just above, making this
conditional unreachable.

7 months agoeditorconfig: add NEWS whitespace configuration
Ronan Pigott [Thu, 26 Oct 2023 21:32:55 +0000 (14:32 -0700)] 
editorconfig: add NEWS whitespace configuration

7 months agofd-uitl: rename PIPE_EBADF → EBADF_PAIR, and add EBADF_TRIPLET
Lennart Poettering [Thu, 26 Oct 2023 16:45:33 +0000 (18:45 +0200)] 
fd-uitl: rename PIPE_EBADF → EBADF_PAIR, and add EBADF_TRIPLET

We use it for more than just pipe() arrays. For example also for
socketpair(). Hence let's give it a generic name.

Also add EBADF_TRIPLET to mirror this for things like
stdin/stdout/stderr arrays, which we use a bunch of times.

7 months agonspawn: Make parameter provided_mac a const for setup_veth()
Raul Cheleguini [Thu, 26 Oct 2023 17:22:31 +0000 (14:22 -0300)] 
nspawn: Make parameter provided_mac a const for setup_veth()

7 months agoMerge pull request #29711 from berrange/tests-silverblue
Luca Boccassi [Thu, 26 Oct 2023 20:17:03 +0000 (21:17 +0100)] 
Merge pull request #29711 from berrange/tests-silverblue

Fix test suite when developing on Fedora SilverBlue (rpm-ostree) host

7 months agoMerge pull request #29727 from aafeijoo-suse/default-tpm2-public-key-fix
Luca Boccassi [Thu, 26 Oct 2023 20:16:07 +0000 (21:16 +0100)] 
Merge pull request #29727 from aafeijoo-suse/default-tpm2-public-key-fix

tpm2: fixes related to `tpm2-pcr-public-key.pem`

7 months agocore: do not post-process skipped mounts
Luca Boccassi [Thu, 26 Oct 2023 13:56:58 +0000 (14:56 +0100)] 
core: do not post-process skipped mounts

When a mount is gracefully skipped (e.g.: BindReadOnlyPaths=-/nonexistent)
we still post-process it, like making it read-only. Except if nothing
has been mounted, the mount point will be made read-only for no reason.
Track when mounts are skipped and avoid post-processing.

One day we'll switch all of this to the new mount api and do these
operations atomically or not at all.

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

7 months agotest: Skip test-recurse-dir on overlayfs
Richard Maw [Wed, 25 Oct 2023 17:12:58 +0000 (18:12 +0100)] 
test: Skip test-recurse-dir on overlayfs

7 months agomkfs-util: Use actual UID/GID in protofile instead of root
Daan De Meyer [Thu, 26 Oct 2023 14:46:16 +0000 (16:46 +0200)] 
mkfs-util: Use actual UID/GID in protofile instead of root

7 months agorepart: do not ignore `tpm2-pcr-public-key.pem` 29727/head
Antonio Alvarez Feijoo [Thu, 26 Oct 2023 14:51:37 +0000 (16:51 +0200)] 
repart: do not ignore `tpm2-pcr-public-key.pem`

If `--tpm2-public-key=` is not specified, but `tpm2-pcr-public-key.pem` exists
in /{etc,run,usr/lib}/systemd/, it's being ignored.

Fixes 9e437994

7 months agotest-fstab-generator: skip test impacted by /mnt symlink 29711/head
Daniel P. Berrangé [Wed, 25 Oct 2023 16:52:11 +0000 (17:52 +0100)] 
test-fstab-generator: skip test impacted by /mnt symlink

On rpm-ostree distributions such as Fedora SilverBlue /mnt
(and other well known paths) will be a symlink to a location
under /var. The fstab generator emits correct output in this
case, however, the data does not match the expected output
stored in the source tree.

Rather than trying to adapt the test data, just skip this
single test scenario when we see /mnt is a symlink.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agotest-systemd-tmpfiles: skip when /tmp has unexpected ownership
Daniel P. Berrangé [Wed, 25 Oct 2023 16:39:04 +0000 (17:39 +0100)] 
test-systemd-tmpfiles: skip when /tmp has unexpected ownership

The systemd-tmpfiles binary will report a fatal error if /tmp is not owned
either by root, or by the current user:

  Detected unsafe path transition /tmp (owned by nobody) →
    /tmp/test-systemd-tmpfiles.a8qc6n18 (owned by berrange)
    during canonicalization of
    tmp/test-systemd-tmpfiles.a8qc6n18/test-content.7chd7rdi

When doing development inside a 'toolbox' container (which is required
on a Fedora SilverBlue distro), /tmp is owned by 'nobody', because it
has been passed through from the host and host UID 0 gets mapped to
UID 65536 by usernamespaces. This triggers the unsafe path transition
error message.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agotest-blockdev-util: avoid abort when /home is a symlink
Daniel P. Berrangé [Wed, 25 Oct 2023 16:19:35 +0000 (17:19 +0100)] 
test-blockdev-util: avoid abort when /home is a symlink

On rpm-ostree distributions like Fedora SilverBlue /home (and various
other well known locations) are symlinks to somewhere beneath /var.

The path_is_encrypted() method uses O_NOFOLLOW and as a result will
return ELOOP on /home. This causes test-blockdev-util to abort.
Add ELOOP to the ignorable set of errnos for testing.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agologind: introduce CreateSessionWithPIDFD()
Michal Sekletar [Fri, 6 Oct 2023 10:26:44 +0000 (12:26 +0200)] 
logind: introduce CreateSessionWithPIDFD()

This new D-Bus API uses pidfd to refer to the session leader. Also,
pam_systemd will try to make use of it when pidfd support is available.

7 months agoMerge pull request #29720 from poettering/cgls-fix-delegate
Luca Boccassi [Thu, 26 Oct 2023 13:28:28 +0000 (14:28 +0100)] 
Merge pull request #29720 from poettering/cgls-fix-delegate

cgls: fix display of delegation flag

7 months agoMerge pull request #29529 from yuwata/core-namespace-check-priv
Luca Boccassi [Thu, 26 Oct 2023 13:27:56 +0000 (14:27 +0100)] 
Merge pull request #29529 from yuwata/core-namespace-check-priv

core/namespace: check if we have enough privilege

7 months agocryptenroll: fix bind default TPM2 signed policy to PCR 11
Antonio Alvarez Feijoo [Thu, 26 Oct 2023 13:14:52 +0000 (15:14 +0200)] 
cryptenroll: fix bind default TPM2 signed policy to PCR 11

If `--tpm2-public-key=` is not specified, but `tpm2-pcr-public-key.pem` exists
in /{etc,run,usr/lib}/systemd/, the default PCR 11 is not being set.

Fixes 9e437994

7 months agovarlink: make sure 'incomplete' bool is nullable
Lennart Poettering [Thu, 26 Oct 2023 07:19:45 +0000 (09:19 +0200)] 
varlink: make sure 'incomplete' bool is nullable

This field is optional, it only makes sense for user records that
actually have a privileged part to set.

7 months agotest: add a simple test for PrivateNetwork= 29529/head
Yu Watanabe [Wed, 11 Oct 2023 04:02:14 +0000 (13:02 +0900)] 
test: add a simple test for PrivateNetwork=

7 months agocore/namespace: check if we have enough privilege to mount sysfs or procfs
Yu Watanabe [Wed, 11 Oct 2023 05:58:38 +0000 (14:58 +0900)] 
core/namespace: check if we have enough privilege to mount sysfs or procfs

If we do not have enough privilege to mount a new instance of sysfs or
procfs, units e.g. with PrivateNetwork=yes may fail.

Let's first try to mount sysfs or procfs anyway to check if we have enough
privilege.

Fixes #29526.

7 months agocore/namespace: unify logic of mounting /proc and /sys
Yu Watanabe [Wed, 11 Oct 2023 05:57:54 +0000 (14:57 +0900)] 
core/namespace: unify logic of mounting /proc and /sys

No functional change, just refactoring.

7 months agoMerge pull request #29718 from yuwata/networkd-update-state-file-after-dhcp6-informat...
Frantisek Sumsal [Thu, 26 Oct 2023 08:16:57 +0000 (08:16 +0000)] 
Merge pull request #29718 from yuwata/networkd-update-state-file-after-dhcp6-information-request

network: update state file when DHCPv6 reply for INFORMATION-REQUEST is received

7 months agocgroup-show: rework cgroup tree display to operate by fd only 29720/head
Lennart Poettering [Wed, 25 Oct 2023 21:05:24 +0000 (23:05 +0200)] 
cgroup-show: rework cgroup tree display to operate by fd only

This restores display of the "delegate" flag of a cgroup. Previously we
erroneously passed a full fs path where a cgroup path was expected (the
difference being the /sys/fs/cgroup/ prefix), which meant we never read
the xattr properly. Let's fix that by simply operating by fd on the
cgroup and using it for all operations.

7 months agocgroup-util: add cg_is_delegated_fd() helper
Lennart Poettering [Wed, 25 Oct 2023 21:04:15 +0000 (23:04 +0200)] 
cgroup-util: add cg_is_delegated_fd() helper

This is just like cg_is_delegate() but operates on an fd instead of a
cgroup path.

Sooner or later we should access cgroupfs mostly via fds rather than
paths, but we aren't there yet. But let's at least get started.

7 months agotree-wide: port various users over to the new getxattr_at_bool() call
Lennart Poettering [Wed, 25 Oct 2023 21:02:22 +0000 (23:02 +0200)] 
tree-wide: port various users over to the new getxattr_at_bool() call

7 months agoxattr-util: add new getxattr_at_bool() helper
Lennart Poettering [Wed, 25 Oct 2023 20:59:53 +0000 (22:59 +0200)] 
xattr-util: add new getxattr_at_bool() helper

This carefully combines getxattr_at_malloc() and parse_bool(), which is
something we use at multiple places.

7 months agocore/cgroup: ignore NFT sets for other sources
Topi Miettinen [Wed, 25 Oct 2023 18:32:35 +0000 (21:32 +0300)] 
core/cgroup: ignore NFT sets for other sources

Partially fixes: #29678

7 months agocore: do not reset tty if there's no tty configured
Luca Boccassi [Wed, 25 Oct 2023 14:15:02 +0000 (15:15 +0100)] 
core: do not reset tty if there's no tty configured

Otherwise a lock is taken, which can be taken by multiple units at the
same time, depending on each other, causing a deadlock.

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

7 months agoinotify-util: drop to use pointer outside of the buffer
Yu Watanabe [Tue, 24 Oct 2023 18:56:10 +0000 (03:56 +0900)] 
inotify-util: drop to use pointer outside of the buffer

Hopefully fixes many Coverity issues.

7 months agotree-wide: fix typo
Yu Watanabe [Thu, 26 Oct 2023 03:42:49 +0000 (12:42 +0900)] 
tree-wide: fix typo

7 months agotest-network: suppress too much outputs of state file 29718/head
Yu Watanabe [Thu, 26 Oct 2023 03:26:15 +0000 (12:26 +0900)] 
test-network: suppress too much outputs of state file

Follow-up for 0f9efffaeb84964a3ab0f32271fba38f3bee2394.

7 months agonetwork: update state file when DHCPv6 reply for INFORMATION-REQUEST is received
Yu Watanabe [Thu, 26 Oct 2023 03:19:40 +0000 (12:19 +0900)] 
network: update state file when DHCPv6 reply for INFORMATION-REQUEST is received

Otherwise, received information, e.g. DNS servers, may not be saved in
the state file, and will not be propagated to clients like resolved.

Fixes the first issue of #29678.

7 months agodissect: insert missing space
Yu Watanabe [Tue, 24 Oct 2023 10:32:04 +0000 (19:32 +0900)] 
dissect: insert missing space

7 months agoMerge pull request #29708 from DaanDeMeyer/bootctl-always
Daan De Meyer [Wed, 25 Oct 2023 20:59:59 +0000 (22:59 +0200)] 
Merge pull request #29708 from DaanDeMeyer/bootctl-always

Always build bootctl

7 months agoMerge pull request #29710 from mrc0mmand/test-pcrextend
Luca Boccassi [Wed, 25 Oct 2023 20:13:56 +0000 (21:13 +0100)] 
Merge pull request #29710 from mrc0mmand/test-pcrextend

test: TEST-70-TPM2 shenagians

7 months agorandom-seed: terminate the option array
Frantisek Sumsal [Wed, 25 Oct 2023 17:25:38 +0000 (19:25 +0200)] 
random-seed: terminate the option array

So we don't crash on invalid options:

$ build/systemd-random-seed --foo
Segmentation fault (core dumped)

7 months agoman/systemd.unit: add PropagatesStopTo= to reverse property table
Mike Yuan [Wed, 25 Oct 2023 12:54:49 +0000 (20:54 +0800)] 
man/systemd.unit: add PropagatesStopTo= to reverse property table

7 months agotest: slightly extend systemd-tpm2-setup's coverage 29710/head
Frantisek Sumsal [Wed, 25 Oct 2023 15:57:08 +0000 (17:57 +0200)] 
test: slightly extend systemd-tpm2-setup's coverage

7 months agotpm2-setup: drop the COMMAND placeholder from the help
Frantisek Sumsal [Wed, 25 Oct 2023 16:04:26 +0000 (18:04 +0200)] 
tpm2-setup: drop the COMMAND placeholder from the help

Since systemd-tpm2-setup doesn't expect any arguments.

7 months agotpm2-setup: terminate the option array
Frantisek Sumsal [Wed, 25 Oct 2023 15:52:19 +0000 (17:52 +0200)] 
tpm2-setup: terminate the option array

Otherwise bad things happen:

$ build/systemd-tpm2-setup --foo
Segmentation fault (core dumped)

7 months agotest: add a couple more tests for systemd-pcrextend
Frantisek Sumsal [Wed, 25 Oct 2023 15:42:07 +0000 (17:42 +0200)] 
test: add a couple more tests for systemd-pcrextend

7 months agotest: make the TPM event log checking a bit more robust
Frantisek Sumsal [Wed, 25 Oct 2023 15:40:05 +0000 (17:40 +0200)] 
test: make the TPM event log checking a bit more robust

Don't hardcode the event number, so the test works correctly even if
someone wrote to the event log before us. Also, explicitly pick the
sha256 bank when checking digests, as the indexing may vary depending on
current TPM's capabilities.

7 months agomeson: Always build systemd-measure 29708/head
Daan De Meyer [Wed, 25 Oct 2023 14:48:35 +0000 (16:48 +0200)] 
meson: Always build systemd-measure

Same idea as with bootctl, we might be doing image builds from a
system that doesn't boot with UEFI but we still might want to measure
stuff for the image we're building so let's not gate this behind
ENABLE_BOOTLOADER.

7 months agomeson: Always build bootctl
Daan De Meyer [Wed, 25 Oct 2023 14:45:06 +0000 (16:45 +0200)] 
meson: Always build bootctl

bootctl is rather useful to have, even if on a system without UEFI,
as it has a number of verbs that are unrelated to UEFI (e.g kernel-identify),
and more importantly, it supports --root to operate on directory trees
(which could be intended to be deployed on UEFI) so let's make sure we
always build it.

7 months agonspawn: allow user-specified MAC address on container side
Raul Cheleguini [Wed, 4 Oct 2023 02:06:38 +0000 (23:06 -0300)] 
nspawn: allow user-specified MAC address on container side

Introduce the environment variable SYSTEMD_NSPAWN_NETWORK_MAC to allow
user-specified MAC address on container side.

7 months agotest: split TEST-70-TPM2 into subtests
Frantisek Sumsal [Wed, 25 Oct 2023 12:48:30 +0000 (14:48 +0200)] 
test: split TEST-70-TPM2 into subtests

7 months agoMerge pull request #29704 from mrc0mmand/cocci
Luca Boccassi [Wed, 25 Oct 2023 12:42:21 +0000 (13:42 +0100)] 
Merge pull request #29704 from mrc0mmand/cocci

Another round of Coccinelle tweaks

7 months agoMerge pull request #29695 from poettering/repart-reduce-global-vars
Luca Boccassi [Wed, 25 Oct 2023 12:18:38 +0000 (13:18 +0100)] 
Merge pull request #29695 from poettering/repart-reduce-global-vars

repart,cryptenroll: three smaller tweaks

7 months agocryptsetup: remove redundant check
Lennart Poettering [Tue, 24 Oct 2023 16:15:36 +0000 (18:15 +0200)] 
cryptsetup: remove redundant check

The immediately preceeding check already covered that.

This removes and addition made back in aae6eb96117acd54ce5ac572aac6a11b34c4ad99.

cc @williamcroberts

7 months agoMerge pull request #29698 from poettering/tpm2-no-best-pcr
Luca Boccassi [Wed, 25 Oct 2023 12:18:03 +0000 (13:18 +0100)] 
Merge pull request #29698 from poettering/tpm2-no-best-pcr

tpm2: minor tweaks

7 months agoudev: strdupa() → strdupa_safe() 29704/head
Frantisek Sumsal [Wed, 25 Oct 2023 09:29:20 +0000 (11:29 +0200)] 
udev: strdupa() → strdupa_safe()

7 months agonetwork: use timestamp_is_set() in one more place
Frantisek Sumsal [Wed, 25 Oct 2023 09:28:12 +0000 (11:28 +0200)] 
network: use timestamp_is_set() in one more place

7 months agonetwork: ENOTSUP → EOPNOTSUPP
Frantisek Sumsal [Wed, 25 Oct 2023 09:26:19 +0000 (11:26 +0200)] 
network: ENOTSUP → EOPNOTSUPP

7 months agocore,journal: drop unnecessary !! casts
Frantisek Sumsal [Wed, 25 Oct 2023 09:21:40 +0000 (11:21 +0200)] 
core,journal: drop unnecessary !! casts

7 months agococcinelle: don't run iovec-make on iovec_done{,_erase}
Frantisek Sumsal [Wed, 25 Oct 2023 09:16:37 +0000 (11:16 +0200)] 
coccinelle: don't run iovec-make on iovec_done{,_erase}

As the result is a bit funky (but still valid), i.e.:

 static inline void iovec_done_erase(struct iovec *iovec) {
         assert(iovec);

-        iovec->iov_base = erase_and_free(iovec->iov_base);
-        iovec->iov_len = 0;
+        *iovec = IOVEC_MAKE(erase_and_free(iovec->iov_base), 0);
 }

7 months agoMerge pull request #29553 from keszybz/analyze-cat-config-tldr
Luca Boccassi [Wed, 25 Oct 2023 08:53:19 +0000 (09:53 +0100)] 
Merge pull request #29553 from keszybz/analyze-cat-config-tldr

analyze/cat-config: add switch to print only "interesting" parts of conffiles

7 months agotpm2-util: add line breaks in compound struct init, like we usually do
Lennart Poettering [Tue, 24 Oct 2023 21:14:23 +0000 (23:14 +0200)] 
tpm2-util: add line breaks in compound struct init, like we usually do

7 months agoMerge pull request #29687 from yuwata/network-state-file-sync
Frantisek Sumsal [Wed, 25 Oct 2023 08:29:58 +0000 (08:29 +0000)] 
Merge pull request #29687 from yuwata/network-state-file-sync

network: several fixlets for state file

7 months agocryptenroll: validate positional arguments before looking at detail parameters 29695/head
Lennart Poettering [Tue, 24 Oct 2023 20:54:39 +0000 (22:54 +0200)] 
cryptenroll: validate positional arguments before looking at detail parameters

Let's switch the order in which we process positional arguments and
analyze/tweak detail parameters. Let's look at the positional arguments
first (i.e. the "big picture") and then look at the switches (i.e.
"little details").

THis doesn't matter much, but makes for better error messages I think.
At least I was very confused that a completely borked cmdline I passed
to cryptenrolled complained about some detail and let the major fuckup
pass...