]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agocore: fix a couple of typos 29786/head
Frantisek Sumsal [Tue, 31 Oct 2023 16:33:29 +0000 (17:33 +0100)] 
core: fix a couple of typos

2 years agotest: exercise more systemd-executor related stuff
Frantisek Sumsal [Tue, 31 Oct 2023 14:17:41 +0000 (15:17 +0100)] 
test: exercise more systemd-executor related stuff

2 years agotest: skip SocketBind*= tests when built without a bpf framework
Frantisek Sumsal [Mon, 30 Oct 2023 18:30:59 +0000 (19:30 +0100)] 
test: skip SocketBind*= tests when built without a bpf framework

The test intentionally checks for -BPF_FRAMEWORK so we run the test case
(and fail) even if we rename the feature flag.

2 years agocore: check if we got a valid personality during deserialization
Frantisek Sumsal [Mon, 30 Oct 2023 16:50:11 +0000 (17:50 +0100)] 
core: check if we got a valid personality during deserialization

2 years agoMerge pull request #29763 from yuwata/vconsole-conf
Lennart Poettering [Tue, 31 Oct 2023 13:37:47 +0000 (14:37 +0100)] 
Merge pull request #29763 from yuwata/vconsole-conf

locale,firstboot: add comments to vconsole.conf

2 years agoudev: fix device name shown in the log message on failure
Yu Watanabe [Tue, 31 Oct 2023 08:31:03 +0000 (17:31 +0900)] 
udev: fix device name shown in the log message on failure

Prompted by #29500.

2 years agoudevadm-trigger: mention --type=all in help
Yu Watanabe [Tue, 31 Oct 2023 08:05:51 +0000 (17:05 +0900)] 
udevadm-trigger: mention --type=all in help

Follow-up for 1baeee5784f1b859d2a1446f6776efe6d7fde7b6.

Fixes #29779.

2 years agoMerge pull request #29769 from poettering/network-generator-ll
Lennart Poettering [Tue, 31 Oct 2023 13:35:49 +0000 (14:35 +0100)] 
Merge pull request #29769 from poettering/network-generator-ll

network-generator: add new mode ip=link-local

2 years agoMerge pull request #29776 from jinliu/pam_kernel_keyring
Lennart Poettering [Tue, 31 Oct 2023 13:34:47 +0000 (14:34 +0100)] 
Merge pull request #29776 from jinliu/pam_kernel_keyring

New PAM module: pam_systemd_loadkey

2 years agodissect: reenable automatic removal before trying again
Yu Watanabe [Tue, 24 Oct 2023 17:32:04 +0000 (02:32 +0900)] 
dissect: reenable automatic removal before trying again

The device node may be different from we want to activate, and we may
try to activate different device in the subsequent loop. In such case,
we should enable the automatic removal for the unexpected device.
Otherwise, it will not be removed even when not necessary anymore.

2 years 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).

2 years agoMerge pull request #29778 from yuwata/log-tests-skipped
Lennart Poettering [Tue, 31 Oct 2023 10:19:10 +0000 (11:19 +0100)] 
Merge pull request #29778 from yuwata/log-tests-skipped

tests: use log_tests_skipped() more

2 years agoupdate TODO 29769/head
Lennart Poettering [Mon, 30 Oct 2023 16:57:00 +0000 (17:57 +0100)] 
update TODO

2 years agoNEWS: mention that ip=off now means ip=off
Lennart Poettering [Tue, 31 Oct 2023 10:01:44 +0000 (11:01 +0100)] 
NEWS: mention that ip=off now means ip=off

2 years agoman: document the new ip=link-local kernel cmdline option
Lennart Poettering [Mon, 30 Oct 2023 17:05:42 +0000 (18:05 +0100)] 
man: document the new ip=link-local kernel cmdline option

2 years agonetwork-generator: add support for ip=link-local
Lennart Poettering [Mon, 30 Oct 2023 16:53:40 +0000 (17:53 +0100)] 
network-generator: add support for ip=link-local

2 years agonetwork-generator: name enum for "ip=dhcp" case same as literal string
Lennart Poettering [Mon, 30 Oct 2023 16:53:58 +0000 (17:53 +0100)] 
network-generator: name enum for "ip=dhcp" case same as literal string

Let's make this less confusing, and use the same string externally as
enum name internally.

2 years agolocale: drop implementation detail from comment in config file 29763/head
Yu Watanabe [Mon, 30 Oct 2023 14:07:59 +0000 (23:07 +0900)] 
locale: drop implementation detail from comment in config file

2 years agolocale,firstboot: add headers to vconsole.conf
Yu Watanabe [Mon, 30 Oct 2023 11:30:12 +0000 (20:30 +0900)] 
locale,firstboot: add headers to vconsole.conf

Closes #29717.
Replaces #29760.

Co-authored-by: cunshunxia <cunshunxia@tencent.com>
2 years agoenv-util: make write_env_file() optionally take headers
Yu Watanabe [Mon, 30 Oct 2023 06:04:18 +0000 (15:04 +0900)] 
env-util: make write_env_file() optionally take headers

This also makes write_env_file() and write_env_file_label() optionally
take dir_fd, and drop write_env_file_at().

Preparation for later commits.

2 years agoMerge pull request #29247 from naraghavan/naraghavan/dhcpv6-vendor-options
Yu Watanabe [Tue, 31 Oct 2023 08:14:20 +0000 (17:14 +0900)] 
Merge pull request #29247 from naraghavan/naraghavan/dhcpv6-vendor-options

networkd: Add DHCP vendor specific sub options to dbus API

2 years agotests: use log_tests_skipped() and friend more 29778/head
Yu Watanabe [Tue, 31 Oct 2023 05:53:10 +0000 (14:53 +0900)] 
tests: use log_tests_skipped() and friend more

2 years agotests: make log_tests_skipped() and friend accept format string
Yu Watanabe [Tue, 31 Oct 2023 05:46:38 +0000 (14:46 +0900)] 
tests: make log_tests_skipped() and friend accept format string

2 years agotree-wide: fix typo
Yu Watanabe [Tue, 31 Oct 2023 05:35:33 +0000 (14:35 +0900)] 
tree-wide: fix typo

2 years agonetwork: free dhcp6_hostname
Ronan Pigott [Tue, 31 Oct 2023 00:24:42 +0000 (17:24 -0700)] 
network: free dhcp6_hostname

Fixes: b90480c80daa ("network: introduce SendHostname/Hostname DHCPv6 options")
2 years agoMerge pull request #29767 from poettering/host-to-host
Yu Watanabe [Tue, 31 Oct 2023 01:59:44 +0000 (10:59 +0900)] 
Merge pull request #29767 from poettering/host-to-host

automatic support for host-to-host networking that only does link-local addressing

2 years 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.

2 years agoupdate TODO 29767/head
Lennart Poettering [Mon, 30 Oct 2023 16:25:18 +0000 (17:25 +0100)] 
update TODO

2 years agonetwork: add default .network file matching ID_NET_AUTO_LINK_LOCAL_ONLY=1
Lennart Poettering [Mon, 30 Oct 2023 16:12:56 +0000 (17:12 +0100)] 
network: add default .network file matching ID_NET_AUTO_LINK_LOCAL_ONLY=1

This is name ".network.example" for now, to match the existing
80-ethernet.network file.

I think it would make sense to actually install this by default if told
so via a meson file (and then hopefully this would happen even on
Fedora, though in a split off RPM or so). However, we aren't there yet,
hence for now, just ship the .network files as example, like the others.

2 years agohwdb,rules: mark host-to-host network devices as only requiring link local addressing
Lennart Poettering [Mon, 30 Oct 2023 15:53:59 +0000 (16:53 +0100)] 
hwdb,rules: mark host-to-host network devices as only requiring link local addressing

This is a generalization of this logic:

https://github.com/NetworkManager/NetworkManager/blob/main/data/90-nm-thunderbolt.rules

It applies not just to thunderbolt, but to any kind of device, even
matched by vendor/product, via hwdb.

I added two entries for Prolific PC-to-PC devices (of which I have one
lying around).

2 years 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.

2 years 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.

2 years 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>.

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

2 years 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

2 years 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.

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

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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

2 years 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

2 years 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.

2 years 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

2 years 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

2 years 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=

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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

2 years 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

2 years agonetworkd: Add DHCP vendor specific options to dbus API 29247/head
Nandakumar Raghavan [Wed, 20 Sep 2023 14:33:38 +0000 (14:33 +0000)] 
networkd: Add DHCP vendor specific options to dbus API

Add DHCP vendor specific options to expose in dbus API.
This will be added to the JSON output when we query
org.freedesktop.network1.Manager object.

2 years 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

2 years 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

2 years 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

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

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

2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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.

2 years 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.

2 years 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.

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

2 years 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.

2 years 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()

2 years 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

2 years 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`

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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.

2 years 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

2 years 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

2 years 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

2 years 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.

2 years 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=

2 years 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.

2 years 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.

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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.

2 years 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

2 years 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

2 years 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.

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