1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00
Commit Graph

74793 Commits

Author SHA1 Message Date
Zhou Qiankang
963171cf41 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](09b9e83102/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 85d0aff84c)
2024-11-13 19:48:10 +00:00
Mike Yuan
b9ff85ece7 core/service: use log_unit_* where appropriate
(cherry picked from commit 1e8f0beee4)
2024-11-13 19:48:10 +00:00
Yu Watanabe
7455e76221 sd-event: fix memleak when built without assertion
Fixes a bug introduced by baf3fdec27.

This also adds several assertions at the beginning of the function.

Fixes #34899.

(cherry picked from commit 5dc0668802)
2024-11-13 19:48:10 +00:00
Lennart Poettering
3f40451c0b test: add quick test to verify the PAM stack really ran in all run0 modes of operation
(cherry picked from commit f515ea1cd4)
2024-11-13 19:48:10 +00:00
Lennart Poettering
0f7efb0cfc 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 e4b4d9cc7a)
2024-11-13 19:48:10 +00:00
Antonio Alvarez Feijoo
7a369c3971 man/veritysetup-generator: document veritytab kernel command line option
(cherry picked from commit e98e3f856d)
2024-11-13 19:48:10 +00:00
Antonio Alvarez Feijoo
139106140e man: fix links to veritysetup(8)
(cherry picked from commit dcbfc7872e)
2024-11-13 19:48:10 +00:00
Łukasz Stelmach
7408f26538 core: don't forget about fallback_smack_process_label
Call setup_smack() also when only fallback_smack_process_label is set.

Fixes: 75689fb2d4
(cherry picked from commit 20bbf5ee4c)
2024-11-13 19:48:10 +00:00
Luca Boccassi
0852240f92 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 5ff6841c23)
2024-11-13 19:48:10 +00:00
Yu Watanabe
5cd2f61a05 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 aa7507ea4a)
2024-11-13 19:48:10 +00:00
Yu Watanabe
eaab857aba test-execute: update permission of credstore
Follow-up for 40fb9eebbc.

(cherry picked from commit c443f6924f)
2024-11-13 19:48:10 +00:00
Luca Boccassi
4a3fc628a2 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 aa077884c1)
2024-11-13 19:48:10 +00:00
Ronan Pigott
76a73088b0 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 2d9822b634)
2024-11-13 19:48:10 +00:00
Daan De Meyer
206c1a0d5a 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 b53f2d5ed8)
2024-11-13 19:48:10 +00:00
Ronan Pigott
92eca86c15 test: exercise bypass mode on the sd-resolved stub
A basic test will verify that we provide the right flags.

(cherry picked from commit b7b1c50c6a)
2024-11-13 19:48:10 +00:00
Lennart Poettering
cd4e8dd7d3 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 360105f1e7)
2024-11-13 19:48:10 +00:00
Lennart Poettering
edaab82ccd 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 8ed2c62d46)
2024-11-13 19:48:10 +00:00
Ronan Pigott
2a7dbbbfa2 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 fa02d04ee9)
2024-11-13 19:48:10 +00:00
Ronan Pigott
be6c7b7914 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 36074e0149)
2024-11-13 19:48:10 +00:00
Ronan Pigott
8e78fd0f7d resolved: authenticate bypass queries
Following 13e15dae9f, 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: 13e15dae9f (resolved: clear the AD bit for bypass packets)
(cherry picked from commit 008f23b7c5)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
a816075978 man/systemd-nspawn: emphasise that user namespaces are strongly recommended
(cherry picked from commit 9b1a5bc365)
2024-11-13 19:48:10 +00:00
Luca Boccassi
602e12f340 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 2f6fe4e113)
2024-11-13 19:48:10 +00:00
Lennart Poettering
452cfd91fe dissect-image: generate better log message for EUCLEAN dissect error
Fixes: #31799
(cherry picked from commit 2186334e00)
2024-11-13 19:48:10 +00:00
Lennart Poettering
f2833a50bd 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 620a03f669)
2024-11-13 19:48:10 +00:00
Lennart Poettering
7280607377 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 562f7bde88)
2024-11-13 19:48:10 +00:00
Lennart Poettering
dc47ba69fc 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 af7674f4ad)
2024-11-13 19:48:10 +00:00
Adrian Vovk
b3fc902116 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 fafc3c2d5c)
2024-11-13 19:48:10 +00:00
Lennart Poettering
7803507b6e 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 9da582984b)
2024-11-13 19:48:10 +00:00
Yu Watanabe
b0a0156bc9 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 73970cdcd1)
2024-11-13 19:48:10 +00:00
Yu Watanabe
dcae004218 TEST-60-MOUNT-RATEMINIT: split into small test cases
Then, use run_testcases().

(cherry picked from commit 805d0eed0b)
2024-11-13 19:48:10 +00:00
Yu Watanabe
3b171cb7bc TEST-60-MOUNT-RATELIMIT: wait for mount unit being started or stopped
(cherry picked from commit c5928a7684)
2024-11-13 19:48:10 +00:00
Luca Boccassi
2590b77f39 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 5f911aca84)
2024-11-13 19:48:10 +00:00
Yu Watanabe
28f7c958fb 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 d0ad4e88d4)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4042a6a8f6 TEST-55-OOMD: check slice property before stressing slice
(cherry picked from commit a6092b532e)
2024-11-13 19:48:10 +00:00
Yu Watanabe
0dfd4d6996 TEST-55-OOMD: stop test units when unnecessary
Then, sleep becomes not necessary anymore. This greatly improve performance.

(cherry picked from commit 98a0bb8a64)
2024-11-13 19:48:10 +00:00
Yu Watanabe
0932445e1e TEST-55-OOMD: split into small testcases
Then, we can run each small test cases separately.

(cherry picked from commit 6bba058076)
2024-11-13 19:48:10 +00:00
Yu Watanabe
fe5e2af10e 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 23fb9b63cd)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4c9e59ec9a 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 1473836a1e)
2024-11-13 19:48:10 +00:00
Yu Watanabe
04bf8544ba TEST-19-CGROUP: add test cases for IPAddressAllow=/IPAddressDeny=
(cherry picked from commit 5f3cfb9d5e)
2024-11-13 19:48:10 +00:00
Yu Watanabe
a94b2c39f9 core/cgroup: fix IPAddressAllow=/IPAddressDeny= set through DBus
Fixes a regression caused by 84ebe6f013 (v250).
Fixes #34773.

(cherry picked from commit 77bbd9f1bd)
2024-11-13 19:48:10 +00:00
Michael Ferrari
b6d84bff7a 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 28dbee46d5)
2024-11-13 19:48:10 +00:00
Luca Boccassi
d2c8426a59 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 00f546e25e
Follow-up for 5e79dd96a8
Follow-up for 622efc544d

(cherry picked from commit e1efa9d804)
2024-11-13 19:48:10 +00:00
Luca Boccassi
2494dc1961 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 5e79dd96a8
Follow-up for 622efc544d

(cherry picked from commit 00f546e25e)
2024-11-13 19:48:10 +00:00
John A. Leuenhagen
799ae7fa38 TEST-74-AUX-UTILS: add tests for 'run0 -D'
(cherry picked from commit 4ca75488d9)
2024-11-13 19:48:10 +00:00
John A. Leuenhagen
7c965fe62c 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 0054a2acc3)
2024-11-13 19:48:10 +00:00
Yu Watanabe
30cf66855b network/dhcp6: set hostname even if UseAddress=no
Follow-up for f963f8953d and
1536b7b2d0.

(cherry picked from commit 8fead9c9e4)
2024-11-13 19:48:10 +00:00
Yu Watanabe
864a42f309 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 e8df18c9e1)
2024-11-13 19:48:10 +00:00
Gaël PORTAY
6a288cd999 docs: add a missing : character
This adds the missing colon character to the section systemd-sysusers.

(cherry picked from commit 8ef5ea2bf6)
2024-11-13 19:48:10 +00:00
Lennart Poettering
1f0d68c6e9 man: document preference for secure_getenv() in coding style
(cherry picked from commit c9b477415a)
2024-11-13 19:48:10 +00:00
Yu Watanabe
63797be0e9 test: add test for local outbounds with preferred source address
(cherry picked from commit 0343ef9764)
2024-11-13 19:48:10 +00:00