Commit Graph
68675 Commits
Author SHA1 Message Date
Frantisek Sumsal 4f3d8def18 test: don't pre-process $KERNEL_APPEND
Let's just rely on the word splitting done by bash instead of messing
with that ourselves, as it's just adding extra complexity to appease one
ShellCheck check. Also, this apparently never worked for the nspawn
stuff anyway, since I forgot to set $IFS to an appropriate value, so it
always put all arguments from $KERNEL_APPEND into a single array item
with an extra newline, which then made systemd sad:

~# readarray arr <<< "foo bar baz"; for i in "${arr[@]}"; do echo "'$i'"; done
'foo bar baz
'
~# make -C test/TEST-45-TIMEDATE/ clean setup run BUILD_DIR=$PWD/build TEST_NO_QEMU=1 KERNEL_APPEND="systemd.log_level=console"
...
~# journalctl -o short-monotonic --no-hostname --file /var/tmp/systemd-tests/systemd-test.XaDX67/system.journal --grep "Failed to parse" -p info --no-pager
[551138.986882] systemd-tmpfiles[21]: Failed to parse log level 'console
[551138.987179] systemd-remount-fs[20]: Failed to parse log level 'console
[551138.993125] systemd-sysusers[23]: Failed to parse log level 'console
[551138.998685] journalctl[29]: Failed to parse log level 'console

Resolves: #29945
2023-11-09 16:31:12 +00:00
Luca Boccassi 2dbfb4f9f2 Merge pull request #29954 from DaanDeMeyer/fix
repart: Fix size round up/round down
2023-11-09 16:30:37 +00:00
Yu Watanabe b5f7d1d550 Merge pull request #29937 from yuwata/network-fix-json-format
network: fix json output
2023-11-09 21:47:37 +09:00
Luca Boccassi 42874983ec Merge pull request #29783 from CodethinkLabs/vmspawn/notify-socket-forward-pr
vmspawn - forward messages to notify socket forward
2023-11-09 12:39:10 +00:00
Antonio Alvarez Feijoo 52c7727f54 bootctl: fix code comment 2023-11-09 12:14:01 +00: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
Lennart Poettering fadc7d8cd7 repart: add missing --tpm2-pcrlock= in --help text
Follow-up for: 404aea7815
2023-11-09 11:36:13 +00:00
Daan De Meyer 6563aede88 repart: Fix size round up/round down
Currently, we round minimum sizes up and maximum size down, whereas
it should be the opposite as the current approach means that if the
same size is used for min and max, the min size will end up bigger
than the max size after rounding.
2023-11-09 12:10:53 +01:00
Daan De Meyer 74b45fe43f Set default value for tools tree
This allows overriding it from CLI or previous config file if
required.
2023-11-09 12:10:11 +01:00
Sam Leonard 6b30cad5e9 vmspawn: update man page to include vsock options 2023-11-09 10:36:26 +00:00
Sam Leonard f72a085641 vmspawn: added vsock functionality
also includes cosmetic fixups from: https://github.com/systemd/systemd/pull/29874
2023-11-09 10:36:25 +00:00
Florian Schmaus 8930285234 core: fix array size in unit_log_resources()
In 0531bded79 ("core: include peak memory in unit_log_resources()") new log
messages where added, however the size of the according arrays to hold the
messages was not adjusted.

Fixes: 0531bded79 ("core: include peak memory in unit_log_resources()")
2023-11-09 09:59:10 +00:00
Lennart Poettering b6be6a6721 man: document explicitly tha ReadWritePaths= cannot undo superblock read-only settings
Fixes: #29266
2023-11-09 09:39:12 +01:00
Yu Watanabe 0bc649d6b0 Merge pull request #29949 from mrc0mmand/even-more-ntp-followups
busctl: send READY=1 when we become a monitor
2023-11-09 15:08:31 +09:00
Yu Watanabe 6900d90877 Merge pull request #29939 from YHNdnzj/fdopen-independent-mode
basic/fileio: drop O_CREAT in flags passed to fd_reopen
2023-11-09 15:07:11 +09:00
Frantisek Sumsal 730ccf9681 test: use Type=notify together with busctl monitor
Let's use the newly gained feature of `busctl` and start is as a
Type=notify unit, which should make sure the unit is started only after
`busctl` is on the bus listening for messages.

This should help with a race spotted in CIs, where we continued too
early after starting `busctl monitor` and miss the emitted signals:

[   10.914831] testsuite-45.sh[694]: + systemd-run --unit busctl-monitor.service --service-type=exec busctl monitor --json=short '--match=type='\''signal'\'',sender=org.freedesktop.timesync1,member='\''PropertiesChanged'\'',path=/org/free>
[   11.064365] systemd[1]: Starting busctl-monitor.service...
[   11.064903] systemd[1]: Started busctl-monitor.service.
[   11.065192] testsuite-45.sh[740]: Running as unit: busctl-monitor.service; invocation ID: ee44a9d713c34b9a97e3e7f6f4fffe77
...
[   11.069255] testsuite-45.sh[694]: + timedatectl ntp-servers ntp99 10.0.0.1
[   11.077140] systemd-timesyncd[728]: Network configuration changed, trying to establish connection.
[   11.077461] testsuite-45.sh[694]: + assert_networkd_ntp ntp99 10.0.0.1
...
[   11.087418] testsuite-45.sh[694]: + assert_timesyncd_signal '2023-11-08 16:28:48.861455' LinkNTPServers 10.0.0.1
...
[   11.095543] testsuite-45.sh[694]: + for _ in {0..9}
[   11.095543] testsuite-45.sh[694]: + journalctl -q '--since=2023-11-08 16:28:48.861455' -p info _SYSTEMD_UNIT=busctl-monitor.service --grep .
[   11.193258] systemd-journald[375]: Received client request to sync journal.
[   11.112424] testsuite-45.sh[694]: + sleep .5
[   11.160318] dbus-daemon[465]: [system] Connection :1.56 (uid=0 pid=741 comm="/usr/bin/busctl monitor --json=short --match=type=") became a monitor.

Resolves: #29923
2023-11-09 00:00:27 +01:00
Frantisek Sumsal c39a6ab789 busctl: send READY=1 when we become a monitor
This is pretty much the same stuff as `resolvectl monitor` does, and
allows us to run `busctl monitor` in a Type=notify unit which ensures
that `busctl` is really listening for messages once the unit is marked
as started.
2023-11-08 23:57:27 +01:00
Frantisek Sumsal 9a42457bae test: drop some unnecessary quotes 2023-11-08 23:38:28 +01:00
Dan Nicholson 9217255427 test-process-util: Handle unprivileged setrlimit success
Currently test_setpriority_closest assumes that setting RLIMIT_NICE to 30 will
fail if the process is unprivileged. If it succeeds, it assumes that the
process is privileged and setresuid and setresgid will succeed.

However, if RLIMIT_NICE is already >= 30, then setrlimit will succeed even if
the process is unprivileged. Guard against that by checking for permission
errors in setresuid and setresgid and skipping the full test if so.

Fixes #22896.
2023-11-08 21:29:16 +00:00
Yu Watanabe 425e8065b7 Merge pull request #29932 from yuwata/default-network-cleanups
network: several cleanups for default .network files
2023-11-09 05:15:13 +09:00
Felix Dörre e375bc5fcc journalctl: verify sealed log epochs are continuous
Currently empty epochs are not sealed. This allows an attacker to truncate
a sealed log and continue it without any problems showing when verifying the
log.

This partially addresses CVE-2023-31438. One way to extend this change to
address CVE-2023-31438 completely, would be to verify that there is exactly
one seal per epoch (and not sealing when the epoch has not ended yet).

the change also adds a journal-file flag: HEADER_COMPATIBLE_SEALED_CONTINUOUS
this flag indicates that a journal file is sealed continuously and decides whether
any missing crypto epochs should trigger a warning or an error.
2023-11-09 05:13:27 +09:00
Luca Boccassi 3e433afac9 Merge pull request #29942 from bluca/executor_no_utmp
core: fix build with -Dutmp=false
2023-11-08 20:01:39 +00:00
Luca Boccassi fe7109fc2e Merge pull request #29927 from yuwata/resolve-mdns-fixlets
resolve: several mdns fixlets
2023-11-08 19:56:31 +00:00
Luca Boccassi 98a10e385d Merge pull request #29931 from dtardon/udev-remove-property
udev-manager: actually remove the property
2023-11-08 19:55:45 +00:00
Mike Yuan 6f9677bc7f basic/fileio: drop O_CREAT before passing flags to fd_reopen
Follow-up for 78c21009bf

Fixes #29938
2023-11-09 03:38:14 +08:00
Mike Yuan 05314c9c87 fd-util: refuse O_CREAT in fd_reopen
O_CREAT doesn't make sense for fd_reopen, since we're
working on an already opened fd. Also, in fd_reopen
we don't handle the mode parameter of open(2), which
means we may get runtime error like #29938.
2023-11-09 03:35:56 +08:00
Luca Boccassi 37f16ef072 ci: add -Dutmp=false coverage 2023-11-08 18:41:47 +00:00
Luca Boccassi de3612dbd7 core: fix build with -Dutmp=false 2023-11-08 18:41:47 +00:00
Michal Sekletar e5883df89f man: document nameserver= option 2023-11-08 17:45:35 +00:00
Luca Boccassi e34435857e core: call mac_init from sd-executor
Before the split the SELinux database was inherited via CoW. Since
the split we need to reopen it.

Follow-up for bb5232b6a3
2023-11-08 17:44:36 +00:00
Lennart Poettering 9f97ca70dd update TODO 2023-11-08 18:18:07 +01:00
Yu Watanabe 3aa47694d1 test-network: verify json format about DHCPv6 client status 2023-11-09 01:31:17 +09:00
Yu Watanabe 37b5051c95 network: fix json generation
When the DHCPv6 client is running in the information requesting mode,
then T1 and T2 are not set.
2023-11-09 01:30:03 +09:00
Yu Watanabe 0fd9bea38e man: fix typo
Follow-up for a9d54de66d.
2023-11-09 00:09:13 +09:00
Yu Watanabe e5188e4f9b network: make 89-ethernet.network match only physical interfaces
For safety. We already add similar condition to a generated one:
c25aa6c8ac
2023-11-08 23:11:45 +09:00
Yu Watanabe f139393dd2 network: use Kind= instead of Driver=
networkd ignores errors in reading driver through ethtool. The kind of
network interface is retrieved through netlink, and networkd checks
checks many failures. So, using Kind= should be safer.

No functional change, just for safety.
2023-11-08 22:59:57 +09:00
David Tardon 25270051cc udev-manager: mark old_key as unused too 2023-11-08 14:52:43 +01:00
Yu Watanabe dd51c4332f resolve/mdns: silently ignore Known-Answers only packets 2023-11-08 22:45:14 +09:00
Yu Watanabe 6f087266e3 resolve/mdns: allow mDNS queries with truncation flag
If the query has many Known-Answers records, then the truncation flag is
set.

Fixes #29168.
2023-11-08 22:45:14 +09:00
Yu Watanabe 614af79cfc resolve: tweak logs about truncation 2023-11-08 22:45:07 +09:00
David Tardon e1593039db udev-manager: actually remove the property
AFAICT there's no reason to keep removed entries in the Hashmap
(although it doesn't break anything either). The only use of this
hashmap is in udev_rule_apply_token_to_event(), which just retrieves the
value using hashmap_get(), hence there's no difference there between an
existing entry with a NULL value and a missing entry.
2023-11-08 14:41:28 +01:00
Lennart Poettering ad3163f1dc Merge pull request #29926 from poettering/man-fixes
Various documentation fixes
2023-11-08 14:32:34 +01:00
Lennart Poettering cff559ec3a update TODO 2023-11-08 14:28:10 +01:00
Lennart Poettering d33121d27d man: document that changing --uid= doesn't work
Fixes: #28982
2023-11-08 14:28:10 +01:00
Lennart Poettering 28e3359fdc man: document that Domains=local bind the domain to unicast DNS, not mDNS
Fixes: #28983
2023-11-08 14:28:10 +01:00
Lennart Poettering 28562194c4 service: say explicitly that people should not use different NonBlocking= settings if they share socket units between multiple service units
Fixes: #29600
2023-11-08 14:28:10 +01:00
Lennart Poettering 244101876c man: explicitly document compat guarantees of cryptenroll vs. cryptsetup
Fixes: #29743
2023-11-08 14:28:10 +01:00
Yu Watanabe 7645e5a813 resolve/mdns: split out mdns_make_dummy_packet()
Then, this fixes the following issues:
- if dns_packet_append_zone() for other transaction is failed with
  EMSGSIZE, the previously added key was not removed,
- if dns_transaction_prepare() for other transaction returns 0, then
  we restated the loop without dropping previously appended keys, which
  might not be necessary any more.
2023-11-08 21:38:54 +09:00
Yu Watanabe 6cfa4fc4ce resolve/mdns: do not append packets without records
Previously, if we have only max_rr cached entries, then an empty packet
is appended.

Prompted by #29168.
2023-11-08 21:38:22 +09:00
Lennart Poettering 7480859a11 man,doc: document some aspects of user record management/homed a bit better
Fixes: #29759
2023-11-08 12:40:08 +01:00