1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-03 17:47:28 +03:00

1306 Commits

Author SHA1 Message Date
Yu Watanabe
786a337817
Merge pull request #30060 from poettering/analyze-archs
analyze: add "archs" verb that lists all known architectures
2023-12-07 15:47:30 +09:00
Frantisek Sumsal
4207a5577a journalctl: don't skip over messages not matching the cursor
When --after-cursor=/--cursor-file= is used together with a journal
filter, we still skipped over the first matching entry even if it wasn't
the entry the cursor points at, thus missing one "valid" entry
completely. Let's fix this by checking if the entry cursor after seeking
matches the user provided cursor, and skip to the next entry only when
the cursors match.

Resolves: #30288
2023-12-07 13:31:25 +09:00
Zbigniew Jędrzejewski-Szmek
0d08149801
Merge pull request #30316 from mrc0mmand/revert-journal-upload-user
Revert "sysusers.d: create the user for systemd-journal-upload.service"
2023-12-06 22:28:34 +01:00
Zbigniew Jędrzejewski-Szmek
34f4fcb59f
Merge pull request #30302 from keszybz/systemd-edit-stdin
systemctl edit --stdin
2023-12-06 22:28:02 +01:00
Zbigniew Jędrzejewski-Szmek
fd72d1e794
Merge pull request #30085 from YHNdnzj/networkctl-edit-runtime
networkctl: introduce --runtime for editing network config under /run/
2023-12-06 22:27:01 +01:00
Zbigniew Jędrzejewski-Szmek
d1f9a39ef4
Merge pull request #29853 from YHNdnzj/sleep-automated
logind: support Sleep() that automatically choose a sleep operation
2023-12-06 22:25:13 +01:00
Samuel BF
435c372ce5 journal-gatewayd: add since/until parameters for /entries
Request with Range header like 'entries=<cursor>:' (with a colon at the end,
invalid syntax per the doc), is now rejected with error 400 Bad Request.

fix #4883
2023-12-06 22:22:27 +01:00
Lennart Poettering
fb8cc599ed analyze: add "architectures" verb that lists all known architectures 2023-12-06 22:18:14 +01:00
Luca Boccassi
f9a284f02d
Merge pull request #30214 from bluca/wants_mounts_for
Add WantsMountsFor= and use it in the cryptsetup generator
2023-12-06 21:00:37 +00:00
Daan De Meyer
1500fe38b2 test: Add test case for --make-ddi=sysext
Also make sure that the sysext is big enough to not fit in the
minimum partition size so we know Minimize= is being used.
2023-12-06 12:18:32 +01:00
Frantisek Sumsal
1ea27bd79e test: load the io controller before checking if io.latency exists
Otherwise the following test gets always skipped.
2023-12-05 19:58:48 +00:00
Zbigniew Jędrzejewski-Szmek
dd0630277b TEST-26: add test for systemctl edit --stdin 2023-12-05 18:47:19 +01:00
Mike Yuan
cd4dd90b99
logind: introduce Sleep() call and action that automatically choose a sleep operation 2023-12-05 22:18:32 +08:00
Frantisek Sumsal
52c1fb6885 test: set correct group for systemd-journal-upload tests
We can't use the systemd-journal-upload user here, since it's created
dynamically by DynamicUser=yes. However, we can use the group specified
in SupplementaryGroups=, so do exactly that.
2023-12-05 09:07:14 +01:00
Mike Yuan
2b98926f98
networkctl: introduce --runtime for editing network config under /run/ 2023-12-02 17:04:57 +08:00
Yu Watanabe
a93be359ae sd-journal: fix corrupted journal handling of generic_array_bisect()
Let's consider the following case:
- the direction is down,
- no cached entry,
- the array has 5 entry objects,
- the function test_object() reutns TEST_LEFT for the 1st object,
- the 2nd, 3rd, and 4th objects are broken, so generic_array_bisect_step()
  returns TEST_RIGHT for the object.

Then, previously, generic_array_bisect_step() updated the values like the following:
  0th: (m = 5, left = 0, right = 4, i = 4) -> (m = 4, left = 0, right = 3, RIGHT)
  1st: (m = 4, left = 0, right = 3, i = 1) -> (m = 4, left = 2, right = 3, LEFT)
  2nd: (m = 4, left = 2, right = 3, i = 2) -> (m = 2, left = 2, right = 1, RIGHT) <- ouch!!
So, assert(left < right) in generic_array_bisect() was triggered.
See issue #30210.

In such situation, there is no matching entry in the array. By returning
TEST_GOTO_PREVIOUS, generic_array_bisect() handles the result so.

Fixes a bug introduced by ab8f553d1e09088fb1f633e014299e7bf6c30c9e.

Fixes #30210.
2023-12-01 09:56:10 +09:00
Frantisek Sumsal
ee77e0b2de test: ignore gcov errors with RestrictFileSystems=
The errors are valid, since the file system is indeed not writable, but
we don't care about the missing coverage data in this case.

Follow-up to 4a43c2b3a1.
2023-11-29 22:50:37 +00:00
Luca Boccassi
c9be8e420e cryptsetup: use WantsMountsFor= for key/header when nofail is set
The header and keyfile are necessary only for opening the device, not
for closing, so it is not necessary to deactivate the generated
cryptsetup unit when the header or keyfile backing store are removed.

This is especially useful in the case of softreboot, when the new
mount root is setup under /run/nextroot/ but we don't want to close
the cryptsetup devices for encrypted /var/ or so, and we simply
mount it directly on /run/nextroot/var/ before the soft-reboot.
2023-11-29 11:04:59 +00:00
Luca Boccassi
499d32655f
Merge pull request #30203 from yuwata/resolve-dump-cache
resolve: fix varlink message verification
2023-11-28 15:35:11 +00:00
Luca Boccassi
3dfbddf3ee
Merge pull request #30216 from poettering/loginctl-table-tweaks
loginctl: minor tweaks to tabular output
2023-11-28 15:33:35 +00:00
Lennart Poettering
8bfa22f079 loginctl: set appropriate ersatz strings for all tables 2023-11-28 11:33:01 +01:00
Yu Watanabe
5edb35ef7a test: check journal files are not corrupted after soft-reboot 2023-11-28 18:28:18 +09:00
Yu Watanabe
038e455462 test: verify json format passed through varlink
This drops logs of failed unit tests in TEST-02-UNITTESTS from the journal,
as the expected logs from test-varlink-idl makes the post script fail.
Saving logs in journal is simply noisy, and we will output anyway after
qemu or nspawn finished by check_result_{qemu,nspawn}_unittests().
2023-11-28 04:13:44 +09:00
Yu Watanabe
a97d617f18 test: drop remaining console output
Follow-up for fa6f37c04391d0103c95e24813ad345c2d5c4b67.

Partially reverts d5ab23aa54229e9e89427e7d20883bd8c93fd976 and
3540ce8587cbd21ce9c2dbec72ea7fa3d1b38a5f.
2023-11-28 04:10:25 +09:00
Yu Watanabe
24baa46289 test: add simple coverity test for 'resolvectl show-cache' 2023-11-28 04:10:25 +09:00
Luca Boccassi
04fc5b6047
Merge pull request #30170 from bluca/exec_bpf_fd
core: pass bpf_outer_map_fd to sd-executor only if RestrictFileSystems was set
2023-11-27 15:44:50 +00:00
Frantisek Sumsal
7a2d6c2d08 test: drop 'noearly' from crypttab
It's a Debian thing, we don't support it.

[   30.639971] testsuite-64.sh[475]: + systemctl restart cryptsetup.target
[   30.697667] systemd-cryptsetup[3389]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.700529] systemd-cryptsetup[3390]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.700594] systemd-cryptsetup[3391]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.704638] systemd-cryptsetup[3392]: Encountered unknown /etc/crypttab option 'noearly', ignoring
2023-11-25 22:30:01 +01:00
Frantisek Sumsal
d1ac1aa5ca test: drop invalid LogTarget= assignment
It's been there since the test was introduced and I'm not really sure
what was the original intention behind it, but it makes systemd sad:

[    4.909056] systemd[1]: /usr/lib/systemd/tests/testdata/units/testsuite-44.service:13: Unknown key name 'LogTarget' in section 'Service', ignoring.
2023-11-25 21:59:57 +01:00
Frantisek Sumsal
4a43c2b3a1 test: add a couple of tests for RestrictFileSystems= 2023-11-24 17:49:28 +01:00
Frantisek Sumsal
c5035a30e2 test: don't make the final vacuum multiple of 8M
As this would usually mean we'd nuke everything, since there are two
open journals - system and user - both being 8M in size.
2023-11-24 11:51:27 +01:00
Luca Boccassi
31897753fb
Merge pull request #30024 from keszybz/one-doc-thingy
Serialize units ratelimits and document StartLimitIntervalSec=infinity
2023-11-22 17:42:51 +00:00
Zbigniew Jędrzejewski-Szmek
6ef512c0bb core: serialize and deserialize unit start ratelimits
The logic is taken from dump ratelimit: if the config changes, we discard the
counters. This allows the user apply new limits and "start from scratch" in
that case.

This actually makes StartLimitIntervalSec=infinity (or with a large interval)
work as expected, because the counter is maintained even if daemon-reload
operations are interleaved.
2023-11-22 12:12:35 +00:00
Lennart Poettering
5e5d4d36b4 test: make sure pcrlock tests run headless
We want the tests to fail rather than hang if unlock via tpm doesn't
work.
2023-11-21 23:43:23 +00:00
Frantisek Sumsal
7ec22d7d4b bsod: install the signal handler only just before we need it
Otherwise we might get stuck in sd_journal_wait(), since it handles
EINTR internally.

Resolves: #30084
2023-11-21 16:58:33 +00:00
Luca Boccassi
42c1df5e2d test: add simple test case for invalid userspace log records 2023-11-20 14:27:38 +01:00
David Tardon
08d5c74a01 test: read from the right device 2023-11-16 10:16:11 +01:00
Luca Boccassi
e437b28054
Merge pull request #30023 from mrc0mmand/selinux
test: make TEST-06-SELINUX work with the refpolicy and beef it up a bit
2023-11-14 19:04:35 +00:00
Frantisek Sumsal
5ef964f88c test: make TEST-06-SELINUX work with the refpolicy and beef it up a bit
Currently the test works only with policy shipped by Fedora, which makes
it pretty much useless in most of our CIs. Let's drop the custom module
and make the test more generic, so it works with the refpolicy as well,
which should allow us to run it on Arch and probably even in Ubuntu CI.
2023-11-14 18:54:16 +01:00
Zbigniew Jędrzejewski-Szmek
b484c250cc
Merge pull request #29930 from yuwata/meson-default-network-fix-install-path
meson: fix install path of example .network files
2023-11-14 17:33:42 +01:00
Frantisek Sumsal
bbe865b2fe test: switch SELinux to permissive in the config file
The config file has (unfortunately) precedence over the kernel command
line, so let's tweak the config file if necessary.
2023-11-14 12:54:50 +01:00
Luca Boccassi
1029edea3c
Merge pull request #30018 from mrc0mmand/TEST-70
test: skip --tpm2-device-key= tests with older OpenSSL
2023-11-13 20:58:43 +00:00
Frantisek Sumsal
52a09e6230 test: skip --tpm2-device-key= tests with older OpenSSL
--tpm2-device-key= requires OpenSSL >= 3 with KDF-SS, so let's skip the
test if we're running with older OpenSSL.

+ systemd-cryptenroll --tpm2-device-key=/tmp/srk.pub --tpm2-pcrs=12:sha256=F5A5FD42D16A20302798EF6ED309979B43003D2320D9F0E8EA9831A92759FB4B /tmp/systemd-cryptsetup-H8y.IMAGE
Failed to find TPM2 pcrlock policy file 'pcrlock.json': No such file or directory
Allocating context for crypt device /tmp/systemd-cryptsetup-H8y.IMAGE.
Trying to open and read device /tmp/systemd-cryptsetup-H8y.IMAGE with direct-io.
Trying to open device /tmp/systemd-cryptsetup-H8y.IMAGE without direct-io.
Initialising device-mapper backend library.
Trying to load LUKS2 crypt type from device /tmp/systemd-cryptsetup-H8y.IMAGE.
Crypto backend (OpenSSL 1.1.1k  FIPS 25 Mar 2021) initialized in cryptsetup library version 2.3.7.
Detected kernel Linux 4.18.0-521.el8.ppc64le ppc64le.
...
Failed to find TPM PCR public key file 'tpm2-pcr-public-key.pem': No such file or directory
Failed to read TPM2 PCR public key, proceeding without: No such file or directory
Can't find symbol Esys_TR_GetTpmHandle: /lib64/libtss2-esys.so.0: undefined symbol: Esys_TR_GetTpmHandle
libtss2-esys too old, does not include Esys_TR_GetTpmHandle.
Can't find symbol Esys_TR_GetTpmHandle: /lib64/libtss2-esys.so.0: undefined symbol: Esys_TR_GetTpmHandle
libtss2-esys too old, does not include Esys_TR_GetTpmHandle.
PolicyPCR calculated digest: 9a1f511fb94f030eb21d0332ef2739727bf0ead4ec26a204d15b09cdeb4b2555
Calculating sealed object.
Calculating encrypted seed for sealed object.
Calculating encrypted seed for ECC sealed object.
Calculating KDFe().
KDF-SS requires openssl >= 3.
Could not calculate KDFe: Operation not supported
Could not calculate encrypted seed: Operation not supported
Failed to seal to TPM2: Operation not supported
2023-11-13 20:37:36 +01:00
Lennart Poettering
abc19a6ffa storagetm: expose more useful metadata for nvme block devices
don't let the devices to be announced just as model "Linux". Let's instead
propagate the underlying block device's model. Also do something
reasonably smart for the serial and firmware version fields.
2023-11-13 19:32:34 +00:00
David Tardon
9daa7e7454 tests: add test for udevadm control -p
Follow-up for e1593039dbb64e47e3ec81d2c913e7730d94a727 .
2023-11-13 19:19:55 +01:00
Yu Watanabe
7fad66b1a7
Merge pull request #29958 from mrc0mmand/journal-line_max
journal: recalculate line_max when stdout stream state changes
2023-11-11 12:39:57 +09:00
Luca Boccassi
be0916f77c
Merge pull request #29955 from poettering/repart-seal-key
repart: add --tpm2-seal-key= support, matching the recently added support cryptenroll has
2023-11-10 16:52:00 +00:00
Luca Boccassi
d8beda5023
Merge pull request #29947 from poettering/srk-beefup
tpm2: make SRK easily accessible for use with systemd-cryptenroll --tpm2-device-key=
2023-11-10 16:47:46 +00:00
Luca Boccassi
ba8eda568c portablectl: fix detaching when an extension image has been deleted 2023-11-10 12:58:45 +00:00
Frantisek Sumsal
1bc4463351 test: drop the workaround for unexpected newlines 2023-11-09 13:30:53 +01:00
Frantisek Sumsal
a155ef7b65 test: add one missing assertion
This also makes sure the first signal doesn't "spill" over into the
second check.
2023-11-09 12:13:33 +00:00