1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-25 10:04:04 +03:00

56425 Commits

Author SHA1 Message Date
Lennart Poettering
fdc5c04299 bootspec: parse/show devicetree-overlay field too
It has been defined in the boot loader spec, and is the only field we
currently don't parse, hence fix that.
2022-02-14 15:44:07 +01:00
Lennart Poettering
4cddc18d0a update TODO 2022-02-14 15:44:07 +01:00
Lennart Poettering
736783d420 bootspec: port one more use of basename() to path_extract_filename() 2022-02-14 15:44:07 +01:00
Lennart Poettering
9951736b7f Revert "bootctl: Ignore boot entries (continue #22041)" 2022-02-14 15:44:07 +01:00
Lennart Poettering
93e0d3204c veritysetup: whitespace fix 2022-02-14 15:14:17 +01:00
Lennart Poettering
fe9bd5ad36 homed: use SD_ID128_TO_UUID_STRING() at one more place 2022-02-14 15:14:14 +01:00
Lennart Poettering
e46433bb92 tree-wide: use id128_equal_string() at various places 2022-02-14 15:14:11 +01:00
Lennart Poettering
75a505c600 id128-util: add new helper id128_equal_string()
Quite often we compare uuids/id128 formatted as strings with specific
values. So far we usually used streq() for that. let's add a new
explicit helper for this in id128_equal_string() that compares a string
with an sd_id128_t and is more robust than a simple string comparison.
Moreover, we can mroe easily reuse the various defines we have for
specific UUIDs, for example those from gpt.h.
2022-02-14 15:14:03 +01:00
Lennart Poettering
b74163607b sd128: export sd_id128_to_uuid_string()
We expose various other forms of UUID helpers already, i.e.
SD_ID128_UUID_FORMAT_STR and SD_ID128_MAKE_UUID_STR(), and we parse
UUIDs, hence add a high-level helper for formatting UUIDs too.

This doesn't add any new code, it just moves some helpers
id128-util.[ch] → sd-id128.[ch], to make them public.
2022-02-14 15:13:23 +01:00
Frantisek Sumsal
fdf9de694f
Merge pull request #22505 from mrc0mmand/more-coverage-tweaks
A couple of coverage-related tweaks
2022-02-14 13:51:08 +00:00
Yu Watanabe
42672c80dc test: check if running in container earlier 2022-02-14 13:46:17 +00:00
Luca Boccassi
d0ebe2a835
Merge pull request #22496 from yuwata/network-cleanups-keep-configuration
network: cleanups for KeepConfiguration= setting
2022-02-14 13:17:23 +00:00
Lennart Poettering
d5cb053cd9 gpt-auto: properly handle case where we can't determine devno of /usr/ fs
get_block_device_harder() returns == 0 if the fs is valid, but it is not
backed by a single devno. (As opposed to returning > 0 if the devno is
valid). Let's catch this case and log a clear message, and don't bother
open the device in that case.

This is mostly cosmetical, as either way, systemd-gpt-auto-generator
doesn't work in scenarios like that.

Prompted-by: #22504
2022-02-14 13:40:59 +01:00
Lennart Poettering
f1ad2c9238 sd-device: refuse opening device mit major/minor of zero early
device nodes with 0 dev_t are not real (and for that reason such inodes
are used as whiteouts in overlayfs, for example), hence refuse them
early. It seems wrong going to sysfs for something we know can't exist
anyway.
2022-02-14 13:40:56 +01:00
Frantisek Sumsal
d282e57e2a test: check for (possibly) missing test coverage
If the test logs contain lines like:

```
...systemd-resolved[735885]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-250.a.p/base-filesystem.c.gcda:Cannot open
```

it means we're possibly missing some coverage since gcov can't write the stats,
usually due to the sandbox being too restrictive (e.g. ProtectSystem=yes,
ProtectHome=yes) or the $BUILD_DIR being inaccessible to non-root users.
2022-02-14 12:20:02 +01:00
Frantisek Sumsal
e4c822e9ac test: set ACLs for the build dir when built with coverage
Otherwise unprivileged processes (like systemd-resolved) can't write
coverage data.
2022-02-14 11:58:54 +01:00
Matija Skala
1b46eb23bc do not call __register_atfork directly
this way it is cleaner and more portable and systemd links against libpthread anyway
2022-02-14 10:49:43 +01:00
Ludwig Nussel
2a3a5288cb systemctl: fix halt -f
Commit adefc8789b always asks logind for shutdown first. So I broke halt
-f which is supposed to issue a direct syscall in that case.
2022-02-14 09:35:12 +01:00
Ludwig Nussel
54141d8ddd logind: more verbose struct initialization 2022-02-14 09:35:12 +01:00
Ludwig Nussel
1831759a70 logind: increase max wall message length to 4096 2022-02-14 09:35:12 +01:00
Ludwig Nussel
d2fc0ecf9a logind: style fixes 2022-02-14 09:35:12 +01:00
Ludwig Nussel
138224fc80 logind: add handle enum to struct
Avoid pointer arithmetic at the expense of repeating the enum value
in the struct.
2022-02-14 09:35:12 +01:00
Yu Watanabe
119c00c1fa test-dhcp6-client: add test for rapid commit 2022-02-14 15:09:37 +09:00
Yu Watanabe
1f28019113 test-dhcp6-client: cleanups
This does many cleanups. Most prominently,
- check the sents packet more strictly,
- make the packets used in the test more readable,
- unify callbacks.
2022-02-14 15:09:28 +09:00
Yu Watanabe
bccb8fc61a fuzz-dhcp6-client: add prefix hint and vendor option to sent message 2022-02-14 15:02:33 +09:00
Yu Watanabe
7b53d3ead3 fuzz-dhcp6-client: merge with fuzz-dhcp6-client-send 2022-02-14 15:02:33 +09:00
Yu Watanabe
013c6904fa fuzz-dhcp6-client: test multiple states
Then, now all three paths client_process_information(),
client_process_reply(), and client_process_advertise_or_rapid_commit_reply()
in client_receive_message() are fuzzed.
2022-02-14 15:02:33 +09:00
Yu Watanabe
bbe3f62a16 sd-dhcp6-client: append extra options before elapsed time option
The value of elapsed time option is determined in runtime and not
deterministic. It is hard to test the sent packets if it is located
in the intermidiate of the packet.
2022-02-14 15:02:33 +09:00
Yu Watanabe
e261d31557 sd-dhcp6-client: logs invalid NTP option
Returning negative errno triggers to produce debugging log in
dhcp6_lease_parse_message().
2022-02-14 15:02:33 +09:00
Yu Watanabe
3f09d563f4 sd-dhcp6-client: split dhcp6-internal.h into two
Also, this moves string tables to dhcp6-protocol.c.
2022-02-14 15:02:33 +09:00
Yu Watanabe
8b1cfab962 network: do not restart DHCPv6 client when it is already running in managed mode
Otherwise, if a network has two router and one provides M flag and the
other provides O flag, then the DHCPv6 client switches the running mode
repeatedly. That makes the IPv6 network configuration of the host
unstable.
2022-02-14 15:02:33 +09:00
Yu Watanabe
dd73db7850 sd-dhcp6-client: reset Information Refresh Time on stop 2022-02-14 15:02:30 +09:00
Yu Watanabe
e1774086a7 sd-dhcp6-client: add log about Information Refresh Time
And store IRT only when the client is running in information
requesting mode.
2022-02-14 15:01:02 +09:00
Yu Watanabe
9c9fee8002 sd-dhcp6-client: use memcmp_nn() at one more place 2022-02-14 15:01:02 +09:00
Yu Watanabe
ac680f766d dhcp-identifier: generate static and constant DUID-EN when the client is running in test mode
Follow-up for 9216fddc5a8ac2742e6cfa7660f95c20ca4f2193.
2022-02-14 15:00:59 +09:00
Yu Watanabe
5e1618fafa dhcp-identifier: introduce dhcp_identifier_set_duid() 2022-02-14 14:58:49 +09:00
Yu Watanabe
f9971018eb dhcp-identifier: introduce duid_type_to_string() 2022-02-14 14:58:49 +09:00
Yu Watanabe
6f3fc86131 sd-dhcp6-client: do not expose set_transaction_id()
This is mostly for tests or fuzzers. Hence, this makes the function
requires that the client is running in the test mode.

Also, now the function mask the value for message type.
2022-02-14 14:58:49 +09:00
Yu Watanabe
9e4dee4cec sd-dhcp6-client: use OrderedSet for vendor option
This also fixes memleak.
2022-02-14 14:58:49 +09:00
Yu Watanabe
885ea2ab1c ordered-set: introduce ordered_set_clear() 2022-02-14 14:58:49 +09:00
Yu Watanabe
1978efb9a5 sd-dhcp6-client: use struct hw_addr_data 2022-02-14 14:58:49 +09:00
Yu Watanabe
6f8ff34218 sd-dhcp6-client: stop IO event source when client entered bound state
Also when the client receives a reply when running in information
requesting mode.
2022-02-14 14:58:49 +09:00
Yu Watanabe
6f4490bb0c sd-dhcp6-client: adjust assertions 2022-02-14 14:58:46 +09:00
Yu Watanabe
65b85f2340 sd-dhcp6-client: log state transition 2022-02-14 14:57:35 +09:00
Yu Watanabe
e5d69be216 sd-dhcp6-client: rename client_set_state() -> client_start_transaction()
Previously, it obeys state transition, but now it is only used when
(re-)starting transaction. Let's rename again in more explanative name.
2022-02-14 14:57:35 +09:00
Yu Watanabe
fa78d165bb sd-dhcp6-client: use proper type for string table lookup funcs 2022-02-14 14:57:35 +09:00
Yu Watanabe
a8d1012f30 sd-dhcp6-client: voidify client_set_state() 2022-02-14 14:57:34 +09:00
Yu Watanabe
cfcc85bbca sd-dhcp6-client: log message is processed before state is changed 2022-02-14 14:57:34 +09:00
Yu Watanabe
c50c9e509f sd-dhcp6-client: move client_timeout_resend() and client_set_state()
These are deeply related to client_message_send(). Hence, move them near
the function.
2022-02-14 14:57:34 +09:00
Yu Watanabe
0eca25ba00 sd-dhcp6-client: move client_ensure_iaid()
No functional change.
2022-02-14 14:57:34 +09:00