Commit Graph

64443 Commits

Author SHA1 Message Date
Frantisek Sumsal
d8d8380a35 test: merge TEST-51-ISSUE-16115 into TEST-07-PID1 2023-05-10 21:26:26 +02:00
Frantisek Sumsal
11562ee585 test: merge TEST-47-ISSUE-14566 into TEST-07-PID1 2023-05-10 21:26:26 +02:00
Frantisek Sumsal
8412cdf4fd test: move TEST-23's units into a dedicated subfolder
To remain consistent with other tests.
2023-05-10 21:26:26 +02:00
Frantisek Sumsal
51b6dbf75a test: merge TEST-12-ISSUE-3171 into TEST-07-PID1 2023-05-10 21:26:26 +02:00
Frantisek Sumsal
33dff897b9 test: merge TEST-11-ISSUE-3166 into TEST-07-PID1 2023-05-10 14:29:38 +02:00
Frantisek Sumsal
a8faac7dae test: merge TEST-10-ISSUE-2467 with TEST-07-PID1 2023-05-10 14:29:38 +02:00
Frantisek Sumsal
4966a31ba3 test: merge TEST-09-ISSUE-2691 into TEST-07-PID1 2023-05-10 14:29:38 +02:00
Frantisek Sumsal
cd62ba42a4 test: merge TEST-08-ISSUE-2730 into TEST-07-PID1 2023-05-10 14:29:38 +02:00
Frantisek Sumsal
09c033a276 test: rename TEST-07-ISSUE-1981 to TEST-07-PID1 2023-05-10 12:38:57 +02:00
Sam James
eb29296937 dirent: conditionalize dirent assert based on dirent64 existence
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native"
functions are already LFS-aware.

Check for dirent64 in meson.build and only assert if it exists.

Bug: https://bugs.gentoo.org/905900
Closes: https://github.com/systemd/systemd/pull/25809
2023-05-10 15:05:18 +09:00
Mike Yuan
8707dcdf3b network/tc: rename settings in log messages too
Follow-up for c03ef420fa
2023-05-10 14:21:28 +09:00
Xi Ruoyao
6723c28f36 sd-bus: bus_message_type_from_string is not pure
GCC document [1] says:

    The pure attribute prohibits a function from modifying the state
    of the program that is observable by means other than inspecting
    the function’s return value.

And there is an example:

    `int hash (char *) __attribute__ ((pure));`
    ... Even though hash takes a non-const pointer argument it must
    not modify the array it points to, ...

But we are modifying the object pointed to by the pointer u, which is
clearly a violation of the semantic of pure.

With -ftrivial-auto-var-init (enabled by -Dmode=release), on some
targets (GCC 12.2 on AArch64 and GCC 13.1 on x86_64) performs an
optimization: as the variable "u" in bus_match_parse has been
zero-initialized (by the -ftrivial-auto-var-init option) and never
modified (because a "pure" bus_message_type_from_string is not allowed
to modify it), "u" will be always 0.

Then 0 is used to initialize .value_u8 field of struct
bus_match_component.  This then causes a infinite event loop, so
"systemctl restart" never stops, and pam_systemd timeouts communicating
with logind, etc.

So we should remove the "pure" attribute here.

Fixes #26395.

[1]:https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
2023-05-10 14:21:01 +09:00
Yu Watanabe
18449960b9 Merge pull request #27597 from mrc0mmand/more-test-shenanigans
test: slightly extend systemd-cryptenroll coverage
2023-05-10 08:16:29 +09:00
Michal Sekletar
aaf7b0e411 core/mount: replace invalid UTF-8 code points in "what" and "options"
Previously, these strings were copied w/o any modification. However, if
mount table contained e.g. remote fs mount like NFS or CIFS that was
mounted from server running with non UTF-8 locale then those strings
might have contained some non UTF-8 characters.

If then client asked about status of such mount unit we tried to forward
these non UTF-8 strings over D-Bus. That is the violation of the
protocol and we ended up kicked from the bus.
2023-05-10 00:01:32 +01:00
Frantisek Sumsal
a9fe7f66e8 test: slightly extend systemd-cryptenroll coverage 2023-05-09 22:47:42 +02:00
Frantisek Sumsal
0e43ab6d24 cryptenroll: fix an assertion with weak passwords
Passing 0 to log_xxx_errno() leads to an assertion, so let's not do that:

$ NEWPASSWORD="" build-san/systemd-cryptenroll --unlock-key-file=/tmp/password --password "$img"
/tmp/password has 0644 mode that is too permissive, please adjust the ownership and access mode.
Assertion '(_error) != 0' failed at src/cryptenroll/cryptenroll-password.c:164, function enroll_password(). Aborting.
Aborted (core dumped)
2023-05-09 22:17:15 +02:00
Frantisek Sumsal
920eb35db9 test: TEST-70-TPM2 cleanup
No functional changes.
2023-05-09 21:18:36 +02:00
Frantisek Sumsal
b6869359e6 test: add coverage for #27533
Issue: https://github.com/systemd/systemd/issues/27533
Fix: https://github.com/systemd/systemd/pull/27553
2023-05-09 19:59:13 +02:00
Frantisek Sumsal
5e8656e101 test: discard kill's output 2023-05-09 19:55:04 +02:00
Frantisek Sumsal
539af5c441 test: merge unit file related tests into TEST-23-UNIT-FILE
Rename TEST-23-TYPE-EXEC to TEST-23-UNIT-FILE and merge it with
following tests:
  - TEST-37-RUNTIMEDIRECTORYPRESERV
  - TEST-40-EXEC-COMMAND-EX
  - TEST-41-ONESHOT-RESTART
  - TEST-42-EXECSTOPPOST
  - TEST-57-ONSUCCESS-UPHOLD
2023-05-10 02:39:12 +09:00
Daan De Meyer
97211510b0 units: Add CAP_NET_ADMIN condition to systemd-networkd-wait-online@.service as well
It was added to CAP_NET_ADMIN but we forgot to add it to the template
service as well.
2023-05-09 17:59:55 +02:00
Yu Watanabe
251ca88230 sd-dhcp-client: client ID always has non-zero data
Follow-up for f04c991a2f.
Fixes CID#1510978.
2023-05-09 14:41:55 +01:00
Yu Watanabe
c093bfe0ad Merge pull request #27534 from keszybz/deperlify
Rewrite udev-test.pl in Python
2023-05-09 18:06:51 +09:00
Zbigniew Jędrzejewski-Szmek
98e2089f1b mkosi,ci: do not install perl 2023-05-09 08:11:10 +02:00
Zbigniew Jędrzejewski-Szmek
711169905e test: use sed and grep instead of perl
This gets rid of the all-but-one remaining uses of perl. I tested the new code
on my machine, so I'm fairly confident that it works as expected.

install_iscsi() has one majestic perl invocation, but we can't get rid of it
easily: it extends the code of tgt-admin to print some list of files. Obviously
this only works because tgt-admin is written in perl, and perl will be installed
if tgt-admin is installed. install_iscsi() is used in TEST-64-UDEV-STORAGE
conditionally if tgtadm is installed, so this can stay as is.
2023-05-09 08:11:10 +02:00