Commit Graph
46055 Commits
Author SHA1 Message Date
Yu Watanabe 4314abf6d4 sd-netlink: res_id is 16bit but serial is 32bit
The explicit value here is not so important.
Let's chop off the higher bits.

Fixes the issue reported at
https://github.com/systemd/systemd/pull/29802#issuecomment-1788637950.
2023-11-01 14:02:49 +00:00
Luca Boccassi 070243ecda Merge pull request #29803 from poettering/coredump-message-tweaks
coredump: tweaks to log message & more
2023-11-01 13:20:11 +00:00
Yu Watanabe 498a6de596 dhcp6: enterprise ID is 32bit
Follow-up for 6b44099b3b.

Fixes #29800.
2023-11-01 13:19:59 +00:00
David Tardon 1263055121 varlink: add generic impl. of io.systemd.service.SetLogLevel() 2023-11-01 12:50:52 +01:00
Yu Watanabe 7ec5ce5673 udev: update devlink with the newer device node even when priority is equivalent
Several udev rules depends on the previous behavior, i.e. that udev
replaces the devlink with the newer device node when the priority is
equivalent. Let's relax the optimization done by
331aa7aa15.

Follow-up for 331aa7aa15.

Note, the offending commit drops O(N) of file reads per uevent, and this
commit does not change the computational order. So, hopefully the
performance impact of this change is small enough.

Fixes #28141.
2023-11-01 19:46:03 +09:00
Peter Hutterer 4f7a629e6c analyze: handle CAP_BPF support 2023-11-01 10:25:59 +00:00
Yu Watanabe ba87a61d05 network: support ID_NET_MANAGED_BY udev property
If the property is set, networkd manages the interface only when its
value is "io.systemd.Network".

Closes #29768.
2023-11-01 10:14:27 +01:00
Lennart Poettering c8e9476386 coredump: let's always drop privileges
Let's unconditionally drop privileges before submitting the coredump log
message.

Let's make the codepaths where we acquired a coredump and where we
didn't more alike: let's drop privs in both cases.

This is not only safer, but means that the coredump messages are always
accessible by the owner of the aborted process.
2023-11-01 10:02:04 +01:00
Lennart Poettering 6fea39bacc coredump: tweak coredump log message
Let's not claim a process dumped core if that was disabled via resource
limits.

While we are at it, switch from stack to heap allocation for the log
message, as it includes a stack trace which can be arbitrarily large.

Fixes: #28559
2023-11-01 10:02:04 +01:00
Yu Watanabe 7122bd12fd Merge pull request #29786 from mrc0mmand/more-executor-stuff
test: exercise more systemd-executor related stuff
2023-11-01 12:51:08 +09:00
Marc Pervaz Boocha abca74cb48 Fixed a typo in kernel-install/60-ukify.install.in for globing microcode
searches in a non-existent micocode/* dir instead of micocode* due a typo in #28592
2023-11-01 12:44:52 +09:00
Luca Boccassi fba173ff6a core: rename and add comment to ExecParameters cleanup functions 2023-11-01 12:43:22 +09:00
Lennart Poettering dba4fa8910 nspawn: make sure idmapped logic works if DDI contains only /usr/ tree
If we have a DDI that contains only a /usr/ tree (and which is thus
combined with a tmpfs for root on boot) we previously would try to apply
idmapping to the tmpfs, but not the /usr/ mount. That's broken of
course.

Fix this by applying it to both trees.
2023-11-01 00:50:43 +00:00
Frantisek Sumsal 6634e66ded core: fix a couple of typos 2023-10-31 18:52:00 +01:00
Lennart Poettering 30e68bbba6 barrier: use EBADF where appropriate 2023-10-31 18:32:13 +01:00
Frantisek Sumsal 6f93eb159a core: check if we got a valid personality during deserialization 2023-10-31 17:34:37 +01:00
Lennart Poettering 1a8d781495 nspawn: fix barriers when wiping fully visible procfs/sysfs
Let's wait until the child is fully done with mounting it's own
instances of procfs/sysfs before we destroy our fully visible copies of
it.

This borrows heavily from Christian Brauners fix #29521, but splits the
place + sync into two steps so that the child payload is not started
before the parent has destroyed the procfs instance.

Alternative to: #29521
Fixes: #28157
2023-10-31 15:33:49 +01:00
Lennart Poettering 553a596ad9 Merge pull request #29763 from yuwata/vconsole-conf
locale,firstboot: add comments to vconsole.conf
2023-10-31 14:37:47 +01:00
Yu Watanabe 2b43c5cb7a udev: fix device name shown in the log message on failure
Prompted by #29500.
2023-10-31 14:37:10 +01:00
Yu Watanabe b1cfc95ff9 udevadm-trigger: mention --type=all in help
Follow-up for 1baeee5784.

Fixes #29779.
2023-10-31 14:36:22 +01:00
Lennart Poettering d6d9bc01cb Merge pull request #29769 from poettering/network-generator-ll
network-generator: add new mode ip=link-local
2023-10-31 14:35:49 +01:00
Lennart Poettering db8618ee82 Merge pull request #29776 from jinliu/pam_kernel_keyring
New PAM module: pam_systemd_loadkey
2023-10-31 14:34:47 +01:00
David Tardon ca46756cd8 varlink: add generic impl. of io.systemd.varlink.Ping() 2023-10-31 12:49:17 +01:00
David Tardon 4ffe0aedf9 varlink: define interface io.systemd.service 2023-10-31 12:49:16 +01:00
Yu Watanabe 758a3aeb4c 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.
2023-10-31 10:30:30 +00:00
Jin Liu a28b7310ee 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).
2023-10-31 18:20:23 +08:00
Lennart Poettering 7e472fc984 Merge pull request #29778 from yuwata/log-tests-skipped
tests: use log_tests_skipped() more
2023-10-31 11:19:10 +01:00
Lennart Poettering b3634c45d7 network-generator: add support for ip=link-local 2023-10-31 11:03:49 +01:00
Lennart Poettering ce3e9428ac 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.
2023-10-31 10:56:31 +01:00
Yu Watanabe 2bd4959028 locale: drop implementation detail from comment in config file 2023-10-31 17:15:21 +09:00
Yu Watanabeandcunshunxia 0e7a7cd4e9 locale,firstboot: add headers to vconsole.conf
Closes #29717.
Replaces #29760.

Co-authored-by: cunshunxia <cunshunxia@tencent.com>
2023-10-31 17:15:21 +09:00
Yu Watanabe f155cb6d75 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.
2023-10-31 17:15:21 +09:00
Yu Watanabe 78101ca9cc Merge pull request #29247 from naraghavan/naraghavan/dhcpv6-vendor-options
networkd: Add DHCP vendor specific sub options to dbus API
2023-10-31 17:14:20 +09:00
Yu Watanabe 84a594f4b3 tests: use log_tests_skipped() and friend more 2023-10-31 14:54:27 +09:00
Yu Watanabe 678fbf7eef tests: make log_tests_skipped() and friend accept format string 2023-10-31 14:46:38 +09:00
Yu Watanabe d19434fbf8 tree-wide: fix typo 2023-10-31 14:35:33 +09:00
Ronan Pigott 9968ca32cf network: free dhcp6_hostname
Fixes: b90480c80d ("network: introduce SendHostname/Hostname DHCPv6 options")
2023-10-31 14:26:44 +09:00
Raito Bezarius b9a0a13f7a 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.
2023-10-30 13:20:48 +00:00
Mike Yuan 77bd39385e 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>.
2023-10-30 11:34:21 +00:00
Ronan Pigott b90480c80d 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.
2023-10-30 11:04:10 +00:00
Luca Boccassi 7b6d3dcdd2 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.
2023-10-28 16:56:25 +02:00
Mike Yuan 6d468648b9 Merge pull request #29740 from YHNdnzj/sleep-round-four
sleep: make sure we clear HibernateLocation on all error paths
2023-10-28 17:53:54 +08:00
Frantisek Sumsal f939a403ca 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
2023-10-28 10:14:07 +01:00
Lennart Poettering a868e43772 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.
2023-10-28 10:27:56 +09:00
Yu Watanabe 2aa246e88f Merge pull request #29693 from rpigott/dhcp-rapid-commit
network: implement RFC4039 DHCP Rapid Commit
2023-10-28 10:23:23 +09:00
Luca Boccassi f456fa23b7 Merge pull request #29737 from glance-/tpm2-openssl
tpm2: fix build failure without openssl
2023-10-27 23:21:44 +01:00
Luca Boccassi 8a505d3b6b Merge pull request #29734 from YHNdnzj/fstab-filter-options
fstab-generator: drop ignored mount options from mount unit Options=
2023-10-27 23:20:46 +01:00
Frantisek Sumsal b0bb3be130 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.
2023-10-27 20:08:47 +02:00
Frantisek Sumsal a4b156bb24 core: actually set the CPU scheduling policy when deserializing it 2023-10-27 19:50:06 +02:00
Mike Yuan cc1c8d129f 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.
2023-10-28 00:17:15 +08:00