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

49214 Commits

Author SHA1 Message Date
Ronan Pigott
414a9b8e5e resolved: validate authentic insecure delegation to CNAME
If the parent zone uses a non-opt-out method that provides authenticated
negative DS replies, we still can't expect signatures from the child
zone. sd-resolved was using the authenticated status of the DS reply to
require signatures for CNAMEs, even though it had already proved that no
signature exists.

Fixes: 47690634f1 ("resolved: don't request the SOA for every dns label")
2024-05-01 20:34:08 +02:00
Ronan Pigott
5237ffdf2b resolved: probe for dnssec support in allow-downgrade mode
Previously, sd-resolved unnecessarily requested SOA records for each dns
label in the query, even though they are not needed for the chain of
trust. Since 47690634f1, only the necessary records are queried when
validating.

This is actually a problem in allow-downgrade mode, since we will no
longer attempt a query for a record that we know is signed a priori, and
will therefore never update our belief about the state of dnssec support
in the recursive resolver.

Rectify this by reintroducing a query for the root zone SOA in the
allow-downgrade case, specifically to test that the resolver attaches
the RRSIGs which we know must exist.

Fixes: 47690634f1 ("resolved: don't request the SOA for every dns label")
2024-05-01 20:32:30 +02:00
Daan De Meyer
b7ad477879 reboot-util: Add some basic validation on reboot arguments
Let's only accept valid ASCII and put a size limit on reboot arguments.
2024-05-02 00:52:06 +09:00
Yu Watanabe
8bf27cd010
Merge pull request #32611 from DaanDeMeyer/qdisc
network/tc: Avoid concurrent set modification in tclass_drop()/qdisc_drop()
2024-05-02 00:51:31 +09:00
Daan De Meyer
ee8f605ded network/tc: Avoid concurrent set modification in tclass_drop()/qdisc_drop()
With the current algorithm, we can end up removing entries from the
qdisc/tclass sets while having multiple open iterators over the sets at
various positions which leads to assertion failures in the hashmap logic
as it's only safe to remove the "current" entry.

To avoid the problem, let's split up marking and dropping of tclasses
and qdiscs. First, we recursively iterate tclasses/qdiscs and mark all
that need to be removed. Next, we iterate once over tclasses and qdiscs
and remove all marked entries.

Fixes 632d321050
2024-05-01 16:15:20 +02:00
Mike Yuan
d69cba3bff
core/dbus-manager: mark unit file state as outdated only if
some changes succeeded

Follow-up for a82b8b3dc8

We don't need to invalidate the unit file state
if all operations failed.

Also, emit UnitFilesChanged signal as long as
some operations succeeded.
2024-05-01 18:22:02 +08:00
Mike Yuan
80a3600210
shared/install: use FOREACH_ARRAY for install_changes_have_modification 2024-05-01 18:04:55 +08:00
Mike Yuan
a4d733db9f
shared/install: reduce variable scope 2024-05-01 17:35:20 +08:00
Yu Watanabe
1cca93f7f3 systemctl: fix log message when glob patterns passed to disable command and friends
Fixes #32599.
2024-05-01 17:13:10 +09:00
Daan De Meyer
6be4dab095 systemctl: Implement --wait for kill command
TEST-26-SYSTEMCTL is racy as we call systemctl is-active immediately
after systemctl kill. Let's implement --wait for systemctl kill and
use it in TEST-26-SYSTEMCTL to avoid the race.
2024-05-01 09:40:32 +02:00
Yu Watanabe
9d3d6c1e07 core/exec-credential: update comment 2024-05-01 15:58:20 +09:00
Daan De Meyer
5bcf0881a3 core: Fix file descriptor leak 2024-05-01 11:52:13 +09:00
Yu Watanabe
4e494e6aac tree-wise: several cleanups for logging
- drop unnecessary SYNTHETIC_ERRNO() when the logger does not propagate
  error code,
- drop unnecessary '%m' in error message when the error code is
  specified with SYNTHETIC_ERRNO(),
- add missing full stop at the end of log message,
- use RET_GATHER(),
- add missing ", ignoring.",
- upeercase the first letter, etc., etc...
2024-05-01 04:41:06 +09:00
Luca Boccassi
ba2caa8a38 build-path: fix SIGSEGV on RISC-V and MIPS
On RISC-V and MIPS DT_STRTAB is an offset, not a full address.

Follow-up for 91d149cfb4
2024-04-30 18:11:10 +02:00
Antonio Alvarez Feijoo
1434754430 network-generator: add missing return on error after the logging refactor
Fixes 3cb618084a
2024-04-30 18:09:37 +02:00
Luca Boccassi
da77ea5c63
Merge pull request #32523 from cgzones/inaccessible_label
shared: create inaccessible files with correct security label
2024-04-30 16:20:49 +02:00
Daan De Meyer
123450e58e journal: Add journal.storage credential
In mkosi CI, we want persistent journals when running interactively
and runtime journals when running in CI, so let's add a credential
that allows us to configure which one to use.
2024-04-30 14:19:55 +02:00
Yu Watanabe
8719a65003 test-journal-flush: use archived journal if possible
Workaround for #32436.

The test may fail if the journal is vacuumed or rotated during the test is running.
Let's use the newest archive file for safety.
2024-04-30 10:50:43 +02:00
Daan De Meyer
132f6cfcfe machine: Add PIDFDs= fallback
In some environments, systemd-machined might not be restarted on
downgrade. For safety, let's add the usual PIDFDs= fallback here
as well.
2024-04-29 22:56:49 +02:00
Ronan Pigott
d840783db5 resolved: always progress DS queries
If we request a DS and the resolver offers an unsigned SOA, a new
auxiliary transaction for the DS will be rejected as a loop, and we
might not make any progress toward finding the DS we need. Let's ensure
that we at least always check the parent in this case.

Fixes: 47690634f1 ("resolved: don't request the SOA for every dns label")
2024-04-29 19:04:11 +02:00
Christian Göttsche
b9a05e860c shared: create inaccessible files with correct security label 2024-04-29 18:17:46 +02:00
Christian Göttsche
4be62f821c basic: add open_mkdir_at_full()
Add helper for open_mkdir_at() which accepts xopen flags, e.g. to pass
XO_LABEL to create the target with the correct security context.
2024-04-29 18:16:58 +02:00
Christian Göttsche
22b768d127 basic: add mknodat_label()
Add helper for mknodat(2) which creates the destination with the correct
security label.
2024-04-29 18:14:41 +02:00
Mike Yuan
f193fcbce9
Merge pull request #32547 from YHNdnzj/minor-cleanup
Some cleanups prompted during review
2024-04-29 21:08:06 +08:00
Antonio Alvarez Feijoo
c355b6af19 boot: fix argument name mismatch in two functions 2024-04-29 14:34:37 +02:00
Daan De Meyer
7a66f21556 core: Add systemd.crash_action= kernel command line argument
Required for integration tests to power off on PID 1 crashes. We
deprecate systemd.crash_reboot and related options by removing them
from the documentation but still parsing them.
2024-04-29 14:34:22 +02:00
Mike Yuan
821bf13b6e journalctl: also check arg_file_stdin with other journal location
options

Prompted by #32491
2024-04-29 14:18:38 +02:00
Daan De Meyer
ba4c69a0c6 core: Pass NULL error in dump_impl()
If mac_selinux_access_check() or bus_verify_bypass_dump_ratelimit_async()
fail, we goto "ratelimited" where we set a custom D-BUS error. In
"ratelimited", we call sd_bus_error_setf() which eventually hits an
assert_return(!bus_error_is_dirty()). Avoid hitting this assertion by
passing NULL as the error to mac_selinux_access_check() and
bus_verify_bypass_dump_ratelimit_async() since we will override the error
immediately anyway if either fails.

We modify both functions as well to allow passing a NULL error and fix
the argument name as well while we're at it.
2024-04-29 14:14:40 +02:00
Daan De Meyer
4eae58b3d3 pam: Setup logging to syslog
We already log to syslog using pam_syslog() for logs generated directly
within our pam plugins. However, any logs generated by our generic logging
macros that are invoked within a pam plugin will log to the console. Let's
make sure our generic logging macros are set up to log to syslog as well.
2024-04-29 12:17:18 +02:00
Mike Yuan
f0fb294369
fs-util: modernize touch_file a bit 2024-04-29 16:33:17 +08:00
Mike Yuan
973464ad0e
fs-util: try AT_EMPTY_PATH first for futimens_opath 2024-04-29 16:33:17 +08:00
Mike Yuan
cce82462a1
efivars: drop unneeded UTIME_NOW
futimens(2) defaults to current time if 'times' is NULL.
2024-04-29 16:33:17 +08:00
Mike Yuan
767d817895
pam_systemd_loadkey: add missing PAM_EXTERN 2024-04-29 16:33:17 +08:00
Mike Yuan
39a8ef05cd various: drop unnecessary DISABLE_WARNING_FORMAT_NONLITERAL
We use _printf_ for these functions, so there shouldn't
be a warning in the first place.
2024-04-28 13:33:17 +02:00
Sebastian Pucilowski
e6c4b5dc52 network: DHCP version logging typos
Some DHCP client log messages report "DHCP4" or "DHCP6" instead of
"DHCPv4" or "DHCPv6" as used within the rest of the codebase. Typos
fixed.
2024-04-28 11:47:55 +09:00
Luca Boccassi
ff30e7e3af
Merge pull request #32520 from YHNdnzj/sd-daemon-followup
sd-daemon: minor cleanup and follow-up
2024-04-27 15:22:35 +02:00
Mike Yuan
119bc912a8
Merge pull request #32516 from YHNdnzj/core-cleanup
core: several cleanups
2024-04-27 19:43:27 +08:00
Mike Yuan
3baab23b25
sd-daemon: downgrade log level for library code, use correct errno
Follow-up for 13b67b61b3
2024-04-27 19:38:16 +08:00
Mike Yuan
3e9fcc2163
sd-daemon: minor modernization, use assert_return 2024-04-27 19:26:49 +08:00
Dmitry V. Levin
c309b9e9c3 treewide: fix a few typos in NEWS, docs, comments, and log messages 2024-04-27 12:11:13 +02:00
Mike Yuan
66825795b4
core/namespace: modernize mount_private_dev 2024-04-27 17:23:18 +08:00
Mike Yuan
6117dda8de
core/namespace: modernize clone_device_node 2024-04-27 17:14:03 +08:00
Luca Boccassi
ec361ea9ce Fix spelling errors found by Lintian 2024-04-27 10:58:35 +02:00
Mike Yuan
16871b608e
core/namespace: use FOREACH_ARRAY at one more place 2024-04-27 14:30:29 +08:00
Mike Yuan
0afd4d214f
core/execute: switch mount_apivfs to tristate
No functional change, just refactoring.
2024-04-27 14:30:29 +08:00
Mike Yuan
b0c49dbcd7
core/manager-serialize: deserialize handoff-timestamp fds
Follow-up for 817062e621

Fixes #32512
2024-04-27 14:30:29 +08:00
Mike Yuan
0541d2959a
core: use close_and_replace more when deserializing
Addresses https://github.com/systemd/systemd/pull/32441#discussion_r1579149873
2024-04-27 14:30:28 +08:00
Mike Yuan
00dc018fa6
core/load-fragment: add one missing assertion 2024-04-27 14:28:53 +08:00
Luca Boccassi
89d53001da
Merge pull request #32504 from bluca/test_failure
test: do not fail if mknod() fails in a build system
2024-04-26 19:55:24 +02:00
Luca Boccassi
e86e9ebf60 test: modernize test-dirent-util
Follow-up for 6a57d86bf9
2024-04-26 17:20:04 +01:00