Luca Boccassi [Tue, 12 Nov 2024 23:35:54 +0000 (23:35 +0000)]
hwdb: update to main@{2024-11-12}
git restore -s origin/main hwdb.d/ test/hwdb.d
Luca Boccassi [Mon, 21 Oct 2024 13:26:05 +0000 (14:26 +0100)]
mkosi: update opensuse commit reference
It was force-pushed again
(cherry picked from commit
3034dc001394bba6d94d16a2a9c7a8cefd53035e)
Luca Boccassi [Fri, 18 Oct 2024 10:35:56 +0000 (11:35 +0100)]
mkosi: update opensuse commit reference and switch branch
'factory' was reset to 8 years ago
(cherry picked from commit
77579c66ef4b8aec1e723f9ed6c63efd10fb2688)
Yu Watanabe [Sun, 13 Oct 2024 16:28:23 +0000 (01:28 +0900)]
TEST-17-UDEV: check if udev database file is removed on remove event
(cherry picked from commit
49c46fbaf15b95a8264d01213539914e15fdc6fe)
Yu Watanabe [Sun, 13 Oct 2024 15:55:43 +0000 (00:55 +0900)]
udev: do not re-create database on remove event
Fixes a bug introduced by
f6bda694f908cc227b002570b893029aa4c9e173 (v256).
With the offending commit, on remove event, database file for a device is once
removed in event_execute_rules_on_remove(), but later re-created here.
This fixes the issue, and makes the database file not re-created on remove event.
(cherry picked from commit
5b2dce150d5eadcd33d620e095c9c1e2de51dd24)
Yu Watanabe [Sat, 19 Oct 2024 05:38:08 +0000 (14:38 +0900)]
core/namespace: honor MountEntry.read_only, .options, and so on in static entries
Otherwise, ProtectHome=tmpfs makes /home/ and friends not read-only.
Also, mount options for /run/ specified in MountAPIVFS=yes are not
applied.
The function append_static_mounts() was introduced in
5327c910d2fc1ae91bd0b891be92b30379c7467b, but at that time, there were
neither .read_only nor .options in the struct. But, when later the
struct is extended, the function was not updated and they were not
copied from the static table.
The fields has been used in static tables since
e4da7d8c796a1fd11ecfa80fb8a48eac9e823f06, and also in
94293d65cd4125347e21b3e423d0e245226b1be2.
Fixes #34825.
(cherry picked from commit
0cc496b2d21f73d0a03414ce40eceb9e3af76e22)
Yu Watanabe [Tue, 29 Oct 2024 17:51:18 +0000 (02:51 +0900)]
network/tunnel: allow Local=/Remote=any for all tunnel types
It seems there is no restriction for local and remote addresses.
Fixes #34930.
(cherry picked from commit
5e48fd0506ed6212c9db2276d5845ab77aa9bce4)
Štěpán Němec [Mon, 11 Nov 2024 19:31:43 +0000 (20:31 +0100)]
man/systemd.special: fix a typo
(cherry picked from commit
62ec4798f28ccf02926c2ae53d2a772b088383ee)
Štěpán Němec [Mon, 11 Nov 2024 19:10:00 +0000 (20:10 +0100)]
man: fix incorrect volume numbers in internal man page references
Some ambiguity (e.g., same-named man pages in multiple volumes)
makes it impossible to fully automate this, but the following
Python snippet (run inside the man/ directory of the systemd repo)
helped to generate the sed command lines (which were subsequently
manually reviewed, run and the false positives reverted):
from pathlib import Path
import lxml
from lxml import etree as ET
man2vol: dict[str, str] = {}
man2citerefs: dict[str, list] = {}
for file in Path(".").glob("*.xml"):
tree = ET.parse(file, lxml.etree.XMLParser(recover=True))
meta = tree.find("refmeta")
if meta is not None:
title = meta.findtext("refentrytitle")
if title is not None:
vol = meta.findtext("manvolnum")
if vol is not None:
man2vol[title] = vol
citerefs = list(tree.iter("citerefentry"))
if citerefs:
man2citerefs[title] = citerefs
for man, refs in man2citerefs.items():
for ref in refs:
title = ref.findtext("refentrytitle")
if title is not None:
has = ref.findtext("manvolnum")
try:
should_have = man2vol[title]
except KeyError: # Non-systemd man page reference? Ignore.
continue
if has != should_have:
print(
f"sed -i '\\|<citerefentry><refentrytitle>{title}"
f"</refentrytitle><manvolnum>{has}</manvolnum>"
f"</citerefentry>|s|<manvolnum>{has}</manvolnum>|"
f"<manvolnum>{should_have}</manvolnum>|' {man}.xml"
)
(cherry picked from commit
597c6cc1195a986e8f89921aa89505b0eacf8181)
12paper [Sun, 10 Nov 2024 02:13:39 +0000 (03:13 +0100)]
login: fix session_kill(..., KILL_LEADER,...) (#35105)
`loginctl kill-session --kill-whom=leader <N>` (or the D-Bus equivalent)
doesn't work because logind ends up calling `KillUnit(..., "main", ...)`
on a scope unit and these don't have a `MainPID` property. Here, I just
make it send a signal to the `Leader` directly.
(cherry picked from commit
8254755091847105c33e473c62cdc7621ed275bc)
Lidong Zhong [Thu, 7 Nov 2024 06:41:11 +0000 (14:41 +0800)]
udev: skipping empty udev rules file while collecting the stats
To keep align with the logic used in udev_rules_parse_file(), we also
should skip the empty udev rules file while collecting the stats during
manager reload. Otherwise all udev rules files will be parsed again whenever
reloading udev manager with an empty udev rules file. It's time consuming
and the following uevents will fail with timeout.
(cherry picked from commit
2ae79a31b7c7947e2c16e18eb85ac5607ebc40b6)
Zbigniew Jędrzejewski-Szmek [Thu, 7 Nov 2024 15:47:48 +0000 (16:47 +0100)]
man: drop whitespace from final <programlisting> lines
In the troff output, this doesn't seem to make any difference. But in the
html output, the whitespace is sometimes preserved, creating an additional
gap before the following content. Drop it everywhere to avoid this.
(cherry picked from commit
fe45f8dc9bf1e9be8de4e14838bc2d7befcf946b)
Luca Boccassi [Wed, 6 Nov 2024 19:21:14 +0000 (19:21 +0000)]
docs: add reminder to run update-man-rules before tagging a release
(cherry picked from commit
088793239ebc9c3a26c562be82dd5f4467162b26)
Luca Boccassi [Wed, 6 Nov 2024 19:20:00 +0000 (19:20 +0000)]
docs: remove 'v' prefix from meson.version
It is actually v-less
(cherry picked from commit
94a46c20dacd8859a6fa3f807b0d134f800a1e90)
Zbigniew Jędrzejewski-Szmek [Sat, 2 Nov 2024 16:07:22 +0000 (17:07 +0100)]
pid1: stop refusing to boot with cgroup v1
Since v256 we completely fail to boot if v1 is configured. Fedora 41 was just
released with v256.7 and this is probably the first major exposure of users to
this code. It turns out not work very well. Fedora switched to v2 as default in
F31 (2019) and at that time some people added configuration to use v1 either
because of Docker or for other reasons. But it's been long enough ago that
people don't remember this and are now very unhappy when the system refuses to
boot after an upgrade.
Refusing to boot is also unnecessarilly punishing to users. For machines that
are used remotely, this could mean somebody needs to physically access the
machine. For other users, the machine might be the only way to access the net
and help, and people might not know how to set kernel parameters without some
docs. And because this is in systemd, after an upgrade all boot choices are
affected, and it's not possible to e.g. select an older kernel for boot. And
crashing the machine doesn't really serve our goal either: we were giving a
hint how to continue using v1 and nothing else.
If the new override is configured, warn and immediately boot to v1.
If v1 is configured w/o the override, warn and wait 30 s and boot to v2.
Also give a hint how to switch to v2.
https://bugzilla.redhat.com/show_bug.cgi?id=
2323323
https://bugzilla.redhat.com/show_bug.cgi?id=
2323345
https://bugzilla.redhat.com/show_bug.cgi?id=
2322467
https://www.reddit.com/r/Fedora/comments/1gfcyw9/refusing_to_run_under_cgroup_01_sy_specified_on/
The advice is to set systemd.unified_cgroup_hierarchy=1 (instead of removing
systemd.unified_cgroup_hierarchy=0). I think this is easier to convey. Users
who are understand what is going on can just remove the option instead.
The caching is dropped in cg_is_legacy_wanted(). It turns out that the
order in which those functions are called during early setup is very fragile.
If cg_is_legacy_wanted() is called before we have set up the v2 hierarchy,
we incorrectly cache a true answer. The function is called just a handful
of times at most, so we don't really need to cache the response.
(cherry picked from commit
d0ab0e5fa5434cac67e51dbeb1d873c6ac6f20cd)
Yu Watanabe [Wed, 6 Nov 2024 10:05:12 +0000 (19:05 +0900)]
Lennart Poettering [Tue, 5 Nov 2024 13:47:32 +0000 (14:47 +0100)]
man: convert multiple left-over "See Also" sections to <simplelist>
These were forgotten during the initial conversion, probably because
most of them consisted only of a single entry.
Fix that.
(cherry picked from commit
df8f9b88bd41320653fe1c51ea515a2d03a349df)
Lennart Poettering [Tue, 5 Nov 2024 13:20:01 +0000 (14:20 +0100)]
man: link up D-Bus API docs from daemon man pages
Let's systematically make sure that we link up the D-Bus interfaces from
the daemon man pages once in prose and once in short form at the bottom
("See Also"), for all daemons.
Also, add reverse links at the bottom of the D-Bus API docs.
Fixes: #34996
(cherry picked from commit
607d2974870e9769f44ee179dcaf26cbec64cb20)
Lennart Poettering [Tue, 5 Nov 2024 13:08:16 +0000 (14:08 +0100)]
man: point people from sd-bus man page to busctl
(cherry picked from commit
2f69ad26ca21d4da7f875bdea77594a115e2deee)
Lennart Poettering [Tue, 5 Nov 2024 12:51:00 +0000 (13:51 +0100)]
man: tone down claims on processes having exited already in ExecStop=
Processes can easily survive the first kill operation we execute, hence
we shouldn't make strong claims about them having exited already. Let's
just say "likely" hence.
Fixes: #15032
(cherry picked from commit
ac804bc2f8d814d2afcdccd88f7469ac320da1c8)
Lennart Poettering [Tue, 5 Nov 2024 12:36:19 +0000 (13:36 +0100)]
man: document that .path units don't care for hidden files
Fixes: #32751
(cherry picked from commit
5adc4337996f561df43c617e37ef4b157073b2e6)
Lennart Poettering [Tue, 5 Nov 2024 12:33:53 +0000 (13:33 +0100)]
man: document that PrivateTmp= is unaffected by ProtectSystem=strict
Fixes: #33130
(cherry picked from commit
b71173709651102081c9d8c6d6e3d2a6ef5cf17e)
Lennart Poettering [Tue, 5 Nov 2024 12:15:36 +0000 (13:15 +0100)]
man: don't claim SELinuxContext= only worked in the system service manager
Fixes: #34840
(cherry picked from commit
ecbe9ae5a0952d968c57e59dda4a42b72e5b5e6d)
Lennart Poettering [Tue, 5 Nov 2024 12:12:20 +0000 (13:12 +0100)]
man: document the timeout applied to /usr/lib/systemd/system-shutdown/ drop-in binaries
Fixes: #34949
(cherry picked from commit
af080967bad2524d2fa2fef6ba5e9fcf18d3017e)
Luca Boccassi [Tue, 5 Nov 2024 18:15:36 +0000 (18:15 +0000)]
test: delete /swapfile after swapoff
[ 23.608342] TEST-55-OOMD.sh[689]: + btrfs filesystem mkswapfile -s 64M /swapfile
[ 23.651930] TEST-55-OOMD.sh[704]: ERROR: cannot create new swapfile: File exists
(cherry picked from commit
78b032d727e8f9e925c10c6617a1e409307ffc24)
Lennart Poettering [Tue, 5 Nov 2024 10:54:14 +0000 (11:54 +0100)]
run: handle gracefully if we can't find binary client-side due to perms
Fixes: #35022
(cherry picked from commit
9810899ef2f28fbb42cf659e6892b1a5074cfc83)
Zbigniew Jędrzejewski-Szmek [Sun, 3 Nov 2024 11:58:12 +0000 (12:58 +0100)]
resolved: log error messages for openssl/gnutls context creation
In https://bugzilla.redhat.com/show_bug.cgi?id=
2322937 we're getting
an error message:
Okt 29 22:21:03 fedora systemd-resolved[29311]: Could not create manager: Cannot allocate memory
I expect that this actually comes from dnstls_manager_init(), the
openssl version. But without real logs it's hard to know for sure.
Use EIO instead of ENOMEM, because the problem is unlikely to be actually
related to memory.
(cherry picked from commit
ee95e86ae163e436384f1b782a77a7e18deba890)
Luca Boccassi [Mon, 4 Nov 2024 19:43:02 +0000 (19:43 +0000)]
ci: add coverage for builds without sd-boot
This should catch compilation issues such as:
https://github.com/systemd/systemd/pull/35014
(cherry picked from commit
8a3ac7afa6be8447061dc6cbd98830bb332fed28)
Luca Boccassi [Mon, 4 Nov 2024 20:26:34 +0000 (20:26 +0000)]
test: set nullglob to avoid failure when building without sd-boot
2024-11-04T20:13:17.3258095Z + for loader in build/src/boot/efi/*{.efi,.efi.stub}
2024-11-04T20:13:17.3258275Z ++ sbverify --list 'build/src/boot/efi/*.efi'
2024-11-04T20:13:17.3258525Z + [[ Error reading file build/src/boot/efi/*.efi: No such file or directory
2024-11-04T20:13:17.3258952Z Can't open image build/src/boot/efi/*.efi != \N\o\ \s\i\g\n\a\t\u\r\e\ \t\a\b\l\e\ \p\r\e\s\e\n\t ]]
(cherry picked from commit
441922336baf4e302e3b88849c5a08c73b602044)
Luca Boccassi [Mon, 4 Nov 2024 20:22:01 +0000 (20:22 +0000)]
test: fix tool name in comment
(cherry picked from commit
c53df275d512a219806a181de3bd57f02dc38dab)
Daan De Meyer [Sun, 3 Nov 2024 20:45:29 +0000 (21:45 +0100)]
pcrlock: Pad pe hash to a multiple of 8 bytes
All other tools (sbsigntools, osslsigncode, sbctl, goblin) do this
as well so let's follow suite.
(cherry picked from commit
e37701a8cd2db1e67d28bcf337467d8efc6de41e)
Colin Foster [Fri, 1 Nov 2024 20:39:11 +0000 (15:39 -0500)]
test-dhcp-client: utilize log_info instead of printf
log_info appears to be the preferred method to convey information from
tests. Convert all the printfs to log_info to follow this standard.
(cherry picked from commit
38557d9ffbc6351b8980faf90d54619790436d43)
Martin Wilck [Wed, 30 Oct 2024 15:57:39 +0000 (16:57 +0100)]
udev-builtin-path_id: SAS wide ports must have num_phys > 1
Some kernel SAS drivers (e.g. smartpqi) expose ports with num_phys = 0. udev
shouldn't treat these ports as wide ports. SAS wide ports always have
num_phys > 1. See comments for sas_port_add_phy() in the kernel sources.
Sample data from a smartpqi system to illustrate the issue below.
Here the phy device is attached to port 0:0, which has no end devices attached
and the SAS end device (where sda is attached) is associated with SAS
port 0:1, which has no associated phy device. Thus num_phys for port-0:1 is 0.
This is arguably wrong, but it's how smartpqi has always set up its devices in
sysfs.
/sys/class/sas_phy/phy-0:0 -> ../../devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/phy-0:0/sas_phy/phy-0:0
/sys/devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/port-0:0/phy-0:0 -> ../phy-0:0
/sys/devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/phy-0:0/port -> ../port-0:0
/sys/class/sas_device/end_device-0:1 -> ../../devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/port-0:1/end_device-0:1/sas_device/end_device-0:1
/sys/class/block/sda -> ../../devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/port-0:1/end_device-0:1/target0:0:0/0:0:0:0/block/sda
Signed-off-by: Martin Wilck <mwilck@suse.com>
(cherry picked from commit
7f6674624eedc95db2a9877edc6ff424f4453531)
Daan De Meyer [Fri, 1 Nov 2024 20:27:52 +0000 (21:27 +0100)]
TEST-64-UDEV-STORAGE: Don't hardcode device name in long-sysfs-path test
There's no guarantee our device will be named /dev/vda, so give it
a serial so we can query for its devname inside the test.
(cherry picked from commit
2ec809dd3baf39b83b8f581e7ea837b9732f9964)
Daan De Meyer [Fri, 1 Nov 2024 20:27:08 +0000 (21:27 +0100)]
TEST-17-UDEV: Don't hardcode root device name
There's no guarantee the root device will be /dev/sda, so let's use
bootctl to get the actual path instead of harcoding it.
(cherry picked from commit
29a8e71d9c0858aef502f091a0ef58d5569b1c70)
Ronan Pigott [Sat, 2 Nov 2024 02:44:18 +0000 (19:44 -0700)]
pam: quiet a spurious debug message
This singular debug message gets printed even if debug is not enabled.
Quiet this message when debug is not enabled for consistency.
(cherry picked from commit
f4092cb9745cc2fc1f889eeaffa5cb5133969d85)
Mike Gilbert [Thu, 24 Oct 2024 16:24:35 +0000 (12:24 -0400)]
posix_spawn_wrapper: do not set POSIX_SPAWN_SETSIGDEF flag
Setting this flag is a noop without a corresponding call to
posix_spawnattr_setsigdefault.
If we call posix_spawnattr_setsigdefault with a full signal set,
it causes glibc's posix_spawn implementation to call sigaction 63 times,
once for each signal. That seems wasteful.
This feature is really only useful for signals which have their
disposition set to SIG_IGN. Otherwise the dispostion gets set to
SIG_DFL automatically, either by clone(CLONE_CLEAR_SIGHAND) or the
subsequent execve.
As far as I can tell, systemd does not have any signals set to SIG_IGN
under normal operating conditions.
(cherry picked from commit
ff94426f8a2d6cd4ea2e370835db152917a1684e)
Łukasz Stelmach [Tue, 29 Oct 2024 14:53:45 +0000 (15:53 +0100)]
core: make mount(8) and swapon(8) inherit SMACK label from systemd
By default mount(8), umount(8), swapon(8) and swapoff(8) should run with
with the SMACK label inherited from systemd rather than the default one
meant for services.
Fixes:
aa5ae9711ef3cd0c69b7fcfbd65bca05fb704a8a
Follow-up-for:
20bbf5ee4c6c80599a91e7a4b7474e931a27db4a
(cherry picked from commit
8144537a81c7a815af3d4c63cd8545ee17b2715d)
Yu Watanabe [Wed, 23 Oct 2024 20:25:41 +0000 (05:25 +0900)]
test-network: add test for DHCPv4 address removal on stop
For issue #34837.
(cherry picked from commit
58a011ba4865d083bffdebe33126637bc5bba511)
Yu Watanabe [Wed, 23 Oct 2024 19:40:45 +0000 (04:40 +0900)]
network: process queued remove requests before networkd is stopped
This makes networkd process all queued remove requests when a
terminating or restarting signal is received. Otherwise, e.g. DHCPv4
address will not be removed on stop, especially when
KeepConfiguration=no.
Fixes a bug introduced by
85a6f300c14d75d161cbfdb3eaf5af9594400ecd and
its subsequent commits.
Fixes #34837.
Co-authored-by: Will Fancher <elvishjerricco@gmail.com>
(cherry picked from commit
db68e990467ffea2b6655e4726856ca7eb32b38d)
Zbigniew Jędrzejewski-Szmek [Wed, 30 Oct 2024 14:19:24 +0000 (15:19 +0100)]
test-sbat: separate the two sbat sections
(cherry picked from commit
07000101eb9529c2d6b5f5402c9fe643c5f98420)
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:59:05 +0000 (13:59 +0100)]
cryptenroll,homectl,journalctl: adjust messages before qrcodes
Users will generally know what a qrcode is, so let's not treat them as dumb and
explain that it can be scanned. OTOH, we should say what the qrcode contains
and it is useful to give a hint why the users would want to scan it. Reword
messages accordingly.
(Also, don't say "to your phone", when somebody might be using a stolen phone,
or something else then a phone.)
(cherry picked from commit
10faa40ba781cf499258a3b37de02dd643822dc6)
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:51:25 +0000 (13:51 +0100)]
bsod: make message for qrcode more useful
People know what a qrcode is. We don't need to tell them to scan it.
Instead, we should say what the code contains.
While at it, rename "stream" to "f" in line with the usual style.
(cherry picked from commit
abf1cae0a75ca07f09afbb4eaa9f11fc429b1d02)
Daan De Meyer [Wed, 30 Oct 2024 10:16:13 +0000 (11:16 +0100)]
docs: Align some comments in HACKING.md
(cherry picked from commit
a33f453702e40f4b52226c6be1a01200aee69470)
hugo303 [Fri, 25 Oct 2024 10:15:02 +0000 (12:15 +0200)]
analyze: Add times in seconds for Activating and Activated in tooltip
Print the times in seconds in the tooltip to remove the need to count
and trying to follow the lines in the svg diagram in order to see at
what times these events happen.
(cherry picked from commit
f172dfddde3379319ee3a02666a7ecf11a5711f4)
Mike Yuan [Tue, 29 Oct 2024 17:35:50 +0000 (18:35 +0100)]
TEST-80-NOTIFYACCESS: don't specify --pid= if MAINPID= is provided explicitly
Otherwise, with recent additions, the MAINPIDFDID= generated by
systemd-notify would mismatch with overridden MAINPID=.
(cherry picked from commit
c3ecb747f1e35f609f15fc94ad4d5e5ca0bda4a2)
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:45:40 +0000 (13:45 +0100)]
qrcode-util: avoid memleak in error path
(cherry picked from commit
439306da8b3962f683f5359c461d1669c070f377)
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:39:36 +0000 (13:39 +0100)]
test-terminal-util: print value of colors_enabled()
This makes it easier to diagnose why colors are disabled.
(cherry picked from commit
b137b2979868e2de5fb5c26e90bacee33597b8e7)
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:38:58 +0000 (13:38 +0100)]
bsod: do not check for color support
When invoked on a running system, bsod would not print the qrcode.
The check for "color support" on stdout is pointless, since we're not
printing to stdout but to a terminal fd that is opened separately.
(cherry picked from commit
5a64c86936477ecea5cc1fb8dbc79faf522cf370)
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:15:32 +0000 (13:15 +0100)]
qrcode-util: add debug message to show why a qrcode wasn't printed
(cherry picked from commit
f0764b98e5c136cb948a8034949064f610acca24)
Zbigniew Jędrzejewski-Szmek [Fri, 18 Oct 2024 17:41:25 +0000 (19:41 +0200)]
sysv-generator: break long message into lines
The journal handles multi-line messages nicely, and they are easier
to read. Drop the recycling symbol, there is no circular process here,
we go from a to b and never back to a again.
(cherry picked from commit
bb56c27fc81da2777cd7064a0b88ca011eced509)
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 08:20:32 +0000 (09:20 +0100)]
sd-id128: mark functions as const, not pure
We would need to use pure if the funtion was getting pointers and
dereferencing them. But sd128_t is a structure and those functions
only access the parameters of the call.
(cherry picked from commit
dc32b09b70c9bb20821df92ac82ace83d8a968e2)
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 08:13:10 +0000 (09:13 +0100)]
sd-common: add __const__
const is stronger than pure, see
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
and
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute.
(cherry picked from commit
955c51c087f1fb6d0b7a0091db943ad05ba3095e)
Zhou Qiankang [Mon, 28 Oct 2024 04:47:20 +0000 (12:47 +0800)]
meson: add loongarch64's definition to cpu_arch_defines
The default definition to add is `-D__loongarch64__`, which is not searched in [bpf_tracing.h](https://github.com/libbpf/libbpf/blob/
09b9e83102eb8ab9e540d36b4559c55f3bcdb95d/src/bpf_tracing.h#L68)
This may avoid `error: Must specify a BPF target arch via __TARGET_ARCH_xxx` in loongarch64
Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com>
(cherry picked from commit
85d0aff84c83182875bc564e295978efd76ab905)
Mike Yuan [Sat, 26 Oct 2024 15:38:06 +0000 (17:38 +0200)]
core/service: use log_unit_* where appropriate
(cherry picked from commit
1e8f0beee4272ddc8b25dfa9af8e54bafc4c061a)
Yu Watanabe [Fri, 25 Oct 2024 18:25:26 +0000 (03:25 +0900)]
sd-event: fix memleak when built without assertion
Fixes a bug introduced by
baf3fdec27f0b3a1f3d39c7def2a778824cbee51.
This also adds several assertions at the beginning of the function.
Fixes #34899.
(cherry picked from commit
5dc0668802cd07cdca2dc5bda52cc1e63b57f145)
Lennart Poettering [Thu, 24 Oct 2024 20:51:49 +0000 (22:51 +0200)]
test: add quick test to verify the PAM stack really ran in all run0 modes of operation
(cherry picked from commit
f515ea1cd4981ceb1a2c85d676f279db2972283f)
Lennart Poettering [Thu, 24 Oct 2024 08:52:56 +0000 (10:52 +0200)]
core: make sure that if PAMName= is set we always do the full user changing even if no user is specified explicitly
When PAMName= is set this should be enough to go through our entire user
changing story, so that PAM is definitely run, and environment variables
definitely pulled in and so on.
Previously, it would happen that under some circumstances we might no do
this when transitioning from root to root itself even though PAM was
enabled.
Fixes: #34682
(cherry picked from commit
e4b4d9cc7adf245950e8676be0e0f4a813069500)
Antonio Alvarez Feijoo [Thu, 24 Oct 2024 08:07:28 +0000 (10:07 +0200)]
man/veritysetup-generator: document veritytab kernel command line option
(cherry picked from commit
e98e3f856d56bfb8dd8883f9e570bb56c4b1e3b2)
Antonio Alvarez Feijoo [Thu, 24 Oct 2024 07:54:48 +0000 (09:54 +0200)]
man: fix links to veritysetup(8)
(cherry picked from commit
dcbfc7872e96c20b4d29b527d3467f547f6971d0)
Łukasz Stelmach [Wed, 23 Oct 2024 10:58:36 +0000 (12:58 +0200)]
core: don't forget about fallback_smack_process_label
Call setup_smack() also when only fallback_smack_process_label is set.
Fixes:
75689fb2d41f
(cherry picked from commit
20bbf5ee4c6c80599a91e7a4b7474e931a27db4a)
Luca Boccassi [Tue, 22 Oct 2024 16:04:41 +0000 (17:04 +0100)]
logind: allow read/write to char-hvc devices
virtio console uses /dev/hvc* so we need access to write wall
messages
(cherry picked from commit
5ff6841c2378ed83e645681cbd4ee145f68d72b7)
Yu Watanabe [Tue, 22 Oct 2024 06:32:12 +0000 (15:32 +0900)]
TEST-02-UNITTESTS: reuse $TEST_MATCH_SUBTEST to specify unit tests to be run
Then, we can easily test specific unit tests in qemu or container.
(cherry picked from commit
aa7507ea4a57508da0f2a7d1ae6e139793c5694a)
Yu Watanabe [Mon, 5 Jun 2023 05:18:47 +0000 (14:18 +0900)]
test-execute: update permission of credstore
Follow-up for
40fb9eebbc075ce1e63100386d2c5f177ad7d738.
(cherry picked from commit
c443f6924fa3b02113da2536dd816a15ee708510)
Luca Boccassi [Mon, 21 Oct 2024 16:31:09 +0000 (17:31 +0100)]
test: CET/EET are deprecated, use Europe/Berlin and Kyiv
The links moved to the legacy dataset so they won't be available by
default, so stop using them and just use the city ones instead
(cherry picked from commit
aa077884c13769ae3bd6aa98978b4ac9e64b5365)
Ronan Pigott [Thu, 25 Jan 2024 00:53:35 +0000 (17:53 -0700)]
test-dhcp6: terminate fqdn option
The encoded fqdn in this option must be properly terminated. We will
soon validate that this field is correctly encoded, so correct it in the
test.
(cherry picked from commit
2d9822b634680f1be1d20920aceddac76de110eb)
Daan De Meyer [Mon, 7 Oct 2024 15:39:27 +0000 (17:39 +0200)]
pcrlock: Take VirtualSize > SizeOfRawData into account
If VirtualSize > SizeOfRawData, measure extra zeros to take into
account the extra zeros also measured by the stub.
(cherry picked from commit
b53f2d5ed8ad0e537e9086daf84f9c2bf69fb72b)
Ronan Pigott [Fri, 11 Oct 2024 05:40:03 +0000 (22:40 -0700)]
test: exercise bypass mode on the sd-resolved stub
A basic test will verify that we provide the right flags.
(cherry picked from commit
b7b1c50c6afd2ab8c2c779df9b73c6dbbc773f70)
Lennart Poettering [Thu, 12 Sep 2024 15:05:24 +0000 (17:05 +0200)]
resolved: when adding names to packet fails, remove them from label compression hash table again
let's make sure we undo any pollution of the label compression hash
table.
Fixes: #33671
(cherry picked from commit
360105f1e748148ba17bdb3f47525f01aba4127f)
Lennart Poettering [Thu, 12 Sep 2024 15:00:04 +0000 (17:00 +0200)]
dns-domain: tweak hash table comparison function for DNS names
Currently, when comparing two DNS names when storing them in a
hashtable, and the DNS names are not actually valid we'll compare the
error codes.
This is not very smart however, since this means two invalid DNS names
that happen to be equally "invalid" will be considered identical, even
if their strings are entirely different.
Let's find a better solution for this niche case: let's simple compare
the domains as strings.
This matters in case of DNS label compression: if we already added added
an invalid DNS name into the label compression hash table, and lookup
any other invalid DNS name, this lookup will likely return what the
earlier one already returned, and that's confusing.
(cherry picked from commit
8ed2c62d46f93c2117d65a908c316a381073af16)
Ronan Pigott [Sat, 12 Oct 2024 17:00:56 +0000 (10:00 -0700)]
resolved: update condition for caching full packets
Previously a full packet was cached only if the CD bit was set, but this
no longer corresponds to the cases where bypass is enabled.
Update the cache to retain a full packet in the cases where it might
actually be useful.
(cherry picked from commit
fa02d04ee9a4787c2c39032185b6fe3e7146b26b)
Ronan Pigott [Sat, 19 Oct 2024 04:10:57 +0000 (21:10 -0700)]
resolved: enable CD bit without DO set
This is useful for a validating resolver to indicate to a non-validating
resolver when checking was disabled for the query. This matches the
behavior of the major public resovlers in response to queries with CD bu
tnot DO set.
(cherry picked from commit
36074e01499ea4fc89a0c642cef83bd650014e5a)
Ronan Pigott [Mon, 7 Oct 2024 18:05:18 +0000 (11:05 -0700)]
resolved: authenticate bypass queries
Following
13e15dae9f0b, resolved does not forward the AD bit for bypass
queries, but resolved also didn't do it's own validation, making these
replies appear to never be authentic. We should enable validation for
bypass queries.
Let's disable our own validation when processing a +cd query, and also
ensure that it skips the cache so that we don't accidentally fail to
return inauthentic replies from upstream.
Previously, when we had a bypass transaction without cd, a cached,
authenticated, reply with cd could be served, leaving the cd bit
erroneously set in the reply. Only reply with a CD bit if the client
requested it.
Fixes:
13e15dae9f0b (resolved: clear the AD bit for bypass packets)
(cherry picked from commit
008f23b7c5f255e48c71c3b4da74a85448667817)
Zbigniew Jędrzejewski-Szmek [Tue, 15 Oct 2024 16:53:00 +0000 (18:53 +0200)]
man/systemd-nspawn: emphasise that user namespaces are strongly recommended
(cherry picked from commit
9b1a5bc365e379b4b13849adacfde3427f55ca38)
Luca Boccassi [Fri, 18 Oct 2024 14:02:03 +0000 (15:02 +0100)]
test: customize /etc/os-release instead of /usr/lib/os-release
As per spec image builders can create a local /etc/os-release
with per-image IDs, so modify that one instead of the original
one in /usr/lib. For example we do this when we build debian
unstable images in mkosi.
(cherry picked from commit
2f6fe4e1131d39fcafa9e00a7902919efb5361e1)
Lennart Poettering [Fri, 18 Oct 2024 12:16:53 +0000 (14:16 +0200)]
dissect-image: generate better log message for EUCLEAN dissect error
Fixes: #31799
(cherry picked from commit
2186334e00acba6e6c1a4564bce60474eecfbf16)
Lennart Poettering [Fri, 18 Oct 2024 12:16:13 +0000 (14:16 +0200)]
dissect-image: uppercase first char of dissect error message systematically
Some of the log message stricts used proper uppercasing, others didn't.
Fix that to make it uniform.
(cherry picked from commit
620a03f669a9075f2d78c2fcf7db45f7046481bc)
Lennart Poettering [Fri, 18 Oct 2024 09:30:12 +0000 (11:30 +0200)]
resolved: refresh resolv.conf files when link goes away
This might have the effect that some DNS server or search domain
disappears, hence rewrite the relevant files.
See: #27543
(cherry picked from commit
562f7bde8872b4fd03db11bf25c9dd294fd2c186)
Lennart Poettering [Fri, 18 Oct 2024 07:19:23 +0000 (09:19 +0200)]
networkd: raise limits on number of address 8x
Limits should be enforced, but not in a way real setups collide with
them.
There have been multiple reports that current limits are too low, hence
raise them 8x.
Fixes: #24852
(cherry picked from commit
af7674f4ad30e83efc84f04c45f01e6eff137702)
Adrian Vovk [Wed, 4 Sep 2024 17:44:26 +0000 (13:44 -0400)]
GREEDY_REALLOC_APPEND: Make more type safe
Previously, GREEDY_REALLOC_APPEND would compile perfectly fine and cause
subtle memory corruption if the caller messes up the type they're passing
in (i.e. by forgetting to pass-by-reference when appending a Type* to an
array of Type*). Now this will lead to compilation failure
(cherry picked from commit
fafc3c2d5c7fae6bad0f6dc51611ae9390589ade)
Lennart Poettering [Thu, 17 Oct 2024 07:57:41 +0000 (09:57 +0200)]
udev: consider serial ports as unconfigured only if both port and iomem_base sysattr is zero
Various archs do not know the "io port" concept, hence check for the
"iomem" configuration, too.
Fixes: #34800
(cherry picked from commit
9da582984b632a75f562a304ff96dd1043281430)
Yu Watanabe [Wed, 16 Oct 2024 13:34:48 +0000 (22:34 +0900)]
TEST-60-MOUNT-RATELIMIT: disable journal ratelimiting
Otherwise, journal check in testcase_mount_ratelimit() may fail and we
need to wait 2 minutes.
(cherry picked from commit
73970cdcd1cebe49a2858ce016c0cd4ce6037b2e)
Yu Watanabe [Wed, 16 Oct 2024 13:32:09 +0000 (22:32 +0900)]
TEST-60-MOUNT-RATEMINIT: split into small test cases
Then, use run_testcases().
(cherry picked from commit
805d0eed0b51e2ef761fc522f092b71dc028f700)
Yu Watanabe [Wed, 16 Oct 2024 12:17:15 +0000 (21:17 +0900)]
TEST-60-MOUNT-RATELIMIT: wait for mount unit being started or stopped
(cherry picked from commit
c5928a768417b298eb2741107fa7492e93d637fc)
Luca Boccassi [Wed, 16 Oct 2024 10:42:06 +0000 (11:42 +0100)]
Fix maybe-uninitialized warnings with gcc 14.2
../src/resolve/resolved-bus.c: In function ‘call_link_method’:
../src/resolve/resolved-bus.c:1769:16: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized]
1769 | return handler(message, l, error);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/resolve/resolved-bus.c:1755:15: note: ‘l’ was declared here
1755 | Link *l;
| ^
../src/resolve/resolved-bus.c: In function ‘bus_method_get_link’:
../src/resolve/resolved-bus.c:1828:13: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized]
1828 | p = link_bus_path(l);
| ^~~~~~~~~~~~~~~~
../src/resolve/resolved-bus.c:1816:15: note: ‘l’ was declared here
1816 | Link *l;
| ^
(cherry picked from commit
5f911aca8434b4163514019fcb4c1c967a50617c)
Yu Watanabe [Wed, 16 Oct 2024 10:27:36 +0000 (19:27 +0900)]
journalctl: erase verify key before free
Even optarg is erased, copied string was not erased.
Let's erase the copied key for safety.
(cherry picked from commit
d0ad4e88d4e6b5e312c359a6505125f7e088f3e3)
Yu Watanabe [Wed, 16 Oct 2024 06:20:08 +0000 (15:20 +0900)]
TEST-55-OOMD: check slice property before stressing slice
(cherry picked from commit
a6092b532e1de0e1f9702f432c0c4c7de495bf4f)
Yu Watanabe [Wed, 16 Oct 2024 06:18:41 +0000 (15:18 +0900)]
TEST-55-OOMD: stop test units when unnecessary
Then, sleep becomes not necessary anymore. This greatly improve performance.
(cherry picked from commit
98a0bb8a6487a1bd0767223f3738525c2b3eae52)
Yu Watanabe [Wed, 16 Oct 2024 06:04:07 +0000 (15:04 +0900)]
TEST-55-OOMD: split into small testcases
Then, we can run each small test cases separately.
(cherry picked from commit
6bba058076cf4ce91fd470841d5ced47c8d32d6a)
Yu Watanabe [Wed, 16 Oct 2024 05:52:49 +0000 (14:52 +0900)]
TEST-55-OOMD: check global config earlier
'Default Memory Pressure Duration' field in oomctl, which can be configured
with DefaultMemoryPressureDurationSec= in oomd.conf, is a global config.
Let's check it earlier.
This also drops unnecessary cleanup at the beginning.
(cherry picked from commit
23fb9b63cd12f2040419dbc846d7a87e5193935c)
Yu Watanabe [Fri, 11 Oct 2024 07:09:11 +0000 (16:09 +0900)]
TEST-55-OOMD: set ManagedOOMMemoryPressure= and friends in a drop-in config
Fedora and friends has a drop-in config for the settings in
/usr/lib/systemd/user/slice.d/ . Hence, settings in the main .slice may be
overridden. Let's set below in a drop-in with higher decimal prefix.
Also, rename override.conf -> 99-managed-oom-preference.conf for the same reason.
(cherry picked from commit
1473836a1e3c528221439e3b0ce90e729b31adb3)
Yu Watanabe [Wed, 16 Oct 2024 05:31:16 +0000 (14:31 +0900)]
TEST-19-CGROUP: add test cases for IPAddressAllow=/IPAddressDeny=
(cherry picked from commit
5f3cfb9d5ee334c53cc407308ba677401a6ba1cd)
Yu Watanabe [Wed, 16 Oct 2024 03:45:34 +0000 (12:45 +0900)]
core/cgroup: fix IPAddressAllow=/IPAddressDeny= set through DBus
Fixes a regression caused by
84ebe6f01381c21b88e37e856956c9c9ee6781d6 (v250).
Fixes #34773.
(cherry picked from commit
77bbd9f1bd2b01bcb2a49ed42c6dc06613532bcf)
Michael Ferrari [Tue, 15 Oct 2024 16:42:20 +0000 (18:42 +0200)]
gpt-auto: remove directory check for ESP mount
Ensure that we always attempt to mount the `ESP` partition to `/boot`
when there is no `XBOOTLDR` partition.
Fixes an issue when booting without a `XBOOTLDR` partition and an empty
root partition, since it would mount the `ESP` partition to `/efi/`
unconditionally causing boot entries to not be under `/boot/` as
recommended by the Boot Loader Specification.
(cherry picked from commit
28dbee46d5bfdcfa601e80e248dbde22b8d65664)
Luca Boccassi [Tue, 15 Oct 2024 13:05:50 +0000 (14:05 +0100)]
core: do not fail if ignorable img.v/ vpick dir is missing
Do not fail if the directory is missing entirely, other than just empty
Follow-up for
00f546e25e8
Follow-up for
5e79dd96a88
Follow-up for
622efc544dc
(cherry picked from commit
e1efa9d8044a7564844b8d599eda4b59eb1152e9)
Luca Boccassi [Thu, 12 Sep 2024 16:46:04 +0000 (18:46 +0200)]
core: do not fail if ignorable img.v/ vpick dir is empty
If the vpick directory is configured to be ignored if missing, do not
fail and just skip ahead.
Follow-up for
5e79dd96a88
Follow-up for
622efc544dc
(cherry picked from commit
00f546e25e8e46e5e289e1f2fc2ed3dcc6999223)
John A. Leuenhagen [Tue, 15 Oct 2024 06:00:18 +0000 (02:00 -0400)]
TEST-74-AUX-UTILS: add tests for 'run0 -D'
(cherry picked from commit
4ca75488d935431e772c25eb6cf060ea85553158)
John A. Leuenhagen [Tue, 15 Oct 2024 04:57:52 +0000 (00:57 -0400)]
run: fix bug causing run0 to ignore `-D /`.
Since the root directory was being suppressed to NULL, the subsequent
check would erroneously think that no working directory was specified.
This caused the default working directory to be applied instead.
(cherry picked from commit
0054a2acc3894e45171806bd64887211820b8eaf)
Yu Watanabe [Sun, 15 Sep 2024 19:45:13 +0000 (04:45 +0900)]
Yu Watanabe [Mon, 14 Oct 2024 21:22:24 +0000 (06:22 +0900)]
udev: do not try to lock whole block device on remove event
As another device may be created with the same device node while udevd
is processing the remove event of the previous owner of the device node.
This also adds comment why we skip watching device node on remove.
(cherry picked from commit
e8df18c9e171c87aebb2df8ac3bdd8f116236892)