1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-13 00:58:27 +03:00

74859 Commits

Author SHA1 Message Date
Łukasz Stelmach
9d060fb7eb 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)
2024-11-13 19:48:10 +00:00
Yu Watanabe
c54a5fa6a8 test-network: add test for DHCPv4 address removal on stop
For issue #34837.

(cherry picked from commit 58a011ba4865d083bffdebe33126637bc5bba511)
2024-11-13 19:48:10 +00:00
Yu Watanabe
96147d0104 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)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
bf681fcdf4 test-sbat: separate the two sbat sections
(cherry picked from commit 07000101eb9529c2d6b5f5402c9fe643c5f98420)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
fefd60bf7a 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)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
0ec7854d44 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)
2024-11-13 19:48:10 +00:00
Daan De Meyer
e22d571f6b docs: Align some comments in HACKING.md
(cherry picked from commit a33f453702e40f4b52226c6be1a01200aee69470)
2024-11-13 19:48:10 +00:00
hugo303
40cab4a387 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)
2024-11-13 19:48:10 +00:00
Mike Yuan
b2496d151a 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)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
bbda54c671 qrcode-util: avoid memleak in error path
(cherry picked from commit 439306da8b3962f683f5359c461d1669c070f377)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
bbdb5f97a9 test-terminal-util: print value of colors_enabled()
This makes it easier to diagnose why colors are disabled.

(cherry picked from commit b137b2979868e2de5fb5c26e90bacee33597b8e7)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
f23efaf96d 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)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
b3fd2104bc qrcode-util: add debug message to show why a qrcode wasn't printed
(cherry picked from commit f0764b98e5c136cb948a8034949064f610acca24)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
6a4ff7a5c1 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)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
3190a427b9 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)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
a5e128ca26 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)
2024-11-13 19:48:10 +00:00
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 85d0aff84c83182875bc564e295978efd76ab905)
2024-11-13 19:48:10 +00:00
Mike Yuan
b9ff85ece7 core/service: use log_unit_* where appropriate
(cherry picked from commit 1e8f0beee4272ddc8b25dfa9af8e54bafc4c061a)
2024-11-13 19:48:10 +00:00
Yu Watanabe
7455e76221 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)
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 f515ea1cd4981ceb1a2c85d676f279db2972283f)
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 e4b4d9cc7adf245950e8676be0e0f4a813069500)
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 e98e3f856d56bfb8dd8883f9e570bb56c4b1e3b2)
2024-11-13 19:48:10 +00:00
Antonio Alvarez Feijoo
139106140e man: fix links to veritysetup(8)
(cherry picked from commit dcbfc7872e96c20b4d29b527d3467f547f6971d0)
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: 75689fb2d41f
(cherry picked from commit 20bbf5ee4c6c80599a91e7a4b7474e931a27db4a)
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 5ff6841c2378ed83e645681cbd4ee145f68d72b7)
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 aa7507ea4a57508da0f2a7d1ae6e139793c5694a)
2024-11-13 19:48:10 +00:00
Yu Watanabe
eaab857aba test-execute: update permission of credstore
Follow-up for 40fb9eebbc075ce1e63100386d2c5f177ad7d738.

(cherry picked from commit c443f6924fa3b02113da2536dd816a15ee708510)
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 aa077884c13769ae3bd6aa98978b4ac9e64b5365)
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 2d9822b634680f1be1d20920aceddac76de110eb)
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 b53f2d5ed8ad0e537e9086daf84f9c2bf69fb72b)
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 b7b1c50c6afd2ab8c2c779df9b73c6dbbc773f70)
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 360105f1e748148ba17bdb3f47525f01aba4127f)
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 8ed2c62d46f93c2117d65a908c316a381073af16)
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 fa02d04ee9a4787c2c39032185b6fe3e7146b26b)
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 36074e01499ea4fc89a0c642cef83bd650014e5a)
2024-11-13 19:48:10 +00:00
Ronan Pigott
8e78fd0f7d 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)
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 9b1a5bc365e379b4b13849adacfde3427f55ca38)
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 2f6fe4e1131d39fcafa9e00a7902919efb5361e1)
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 2186334e00acba6e6c1a4564bce60474eecfbf16)
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 620a03f669a9075f2d78c2fcf7db45f7046481bc)
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 562f7bde8872b4fd03db11bf25c9dd294fd2c186)
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 af7674f4ad30e83efc84f04c45f01e6eff137702)
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 fafc3c2d5c7fae6bad0f6dc51611ae9390589ade)
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 9da582984b632a75f562a304ff96dd1043281430)
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 73970cdcd1cebe49a2858ce016c0cd4ce6037b2e)
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 805d0eed0b51e2ef761fc522f092b71dc028f700)
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 c5928a768417b298eb2741107fa7492e93d637fc)
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 5f911aca8434b4163514019fcb4c1c967a50617c)
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 d0ad4e88d4e6b5e312c359a6505125f7e088f3e3)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4042a6a8f6 TEST-55-OOMD: check slice property before stressing slice
(cherry picked from commit a6092b532e1de0e1f9702f432c0c4c7de495bf4f)
2024-11-13 19:48:10 +00:00