1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

56055 Commits

Author SHA1 Message Date
Anita Zhang
d83923bdb7
Merge pull request #22355 from yuwata/network-tunnel-external
network: tunnel: support external mode
2022-02-03 14:20:43 -08:00
Jan Janssen
ce5e7872f8 boot: Fix some error messages 2022-02-03 23:05:36 +01:00
Anita Zhang
1f087147ea
Merge pull request #22400 from poettering/resolved-single-invalid-list
resolved: maintain only a single list of "dont-resolve" domain names
2022-02-03 11:54:00 -08:00
Lennart Poettering
ff28d259c0 hostnamed: drop "iteractive" parameter from GetHardwareSerial()
Since a long time the D-Bus spec knows a special bit in its message
header for indicating that "interactive" authentication is OK. The
original hostnamed API is before that was added hence most functions
expose that boolean as explicit argument.

For new added functions let's get rid of it, the message flag is good
enough and replaces it with complete functionality.

No new APIs should carry the "interactive" boolean flag explicitly as
argument anymore.

Follow-up for: 9697662915
2022-02-03 19:52:18 +00:00
Anita Zhang
79decacff0
Merge pull request #22394 from bluca/requires_restart_doc
man: explicitly mention that Requires propagates restarts
2022-02-03 11:50:06 -08:00
Lennart Poettering
f80c3d5c7a systemctl: use STR_IN_SET() where appropriate
Follow-up for: 8e98568165
2022-02-03 18:56:53 +00:00
Lennart Poettering
f4526f82c9 resolved: maintain only a single list of "dont-resolve" domain names
Follow-up for: 46b53e8035
2022-02-03 17:16:11 +01:00
Luca Boccassi
cbfa043149 man: explicitly mention that Requires propagates restarts
It's implicit, but the actions are different, so let's be explicit to
avoid any confusion.
2022-02-03 14:48:27 +00:00
Leviticoh
f83da717d9 fix italian translations to display unit name 2022-02-03 23:05:58 +09:00
Lennart Poettering
0bf78c12b1 boot: fix pretty nasty typo
Note to self: should I ever become a black hat hacker, this is how I'd
hide a vulnerability. ;-)

(No, this one is not a vulnerability)

Follow-up for: 163d1ea5dd
2022-02-03 14:57:35 +01:00
Lennart Poettering
5d04cec867 journal: when copying journal file to undo NOCOW flag, go via fd
We have the journal file open already, hence reference it via the fd
insted of the file name. After all, some other tool might have
renamed/deleted it already.

Let's not actually reuse the fd though, since we want a separate file
offset for the copying, hence just make it simply and reopen via
/proc/self/fd/.

Follow-up for d71ece3f0b
2022-02-03 11:34:24 +01:00
Evgeny Vereshchagin
be496d6a9b tests: pass FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION to fuzzers
to let them use reproducible identifiers, which should make it possible
to really use files copied from OSS-Fuzz to reproduce issues on
GHActions and locally. Prompted by https://github.com/systemd/systemd/pull/22365
2022-02-03 08:56:00 +00:00
Lennart Poettering
362c62296a sd-boot: rename LOADER_STUB → LOADER_UNIFIED_LINUX
No actual code changes, just renaming.

Rationale: the focus here should be on the fact that these are "unified"
images, whether our stub is used or not, or something else doesn't
really matter. Moreover, these are still Linux entries. Hence, emphasize
that these are *unified* images, and *Linux* images, and deemphesize
that our sd-stub is likely used.
2022-02-03 13:44:28 +09:00
Evgeny Vereshchagin
697bb76589 tests: fuzz client_send_message
to make sure outgoing packets based on incoming packets are fine.
It's just another follow-up to
https://github.com/systemd/systemd/pull/10200.
Better late than never :-)
2022-02-03 13:43:49 +09:00
Yu Watanabe
7809cab717 test-network: add testcase for external tunnel 2022-02-03 11:12:34 +09:00
Yu Watanabe
1ae308abb5 network: tunnel: support external mode
Closes #22352.
2022-02-03 11:12:01 +09:00
Yu Watanabe
acd8abb7f9 network: tunnel: reorder setting ip6tnl attributes
Just for improving readability.
2022-02-03 11:10:15 +09:00
Yu Watanabe
a07e07cd9c network: tunnel: reduce indentation in config_parse_encap_limit() 2022-02-03 11:10:15 +09:00
Yu Watanabe
59c8bef008 network: tunnel: reduce indentation in config_parse_ipv6_flowlabel() 2022-02-03 11:10:15 +09:00
Yu Watanabe
396dfe0a14 network: tunnel: use "data" field to assign result 2022-02-03 11:10:15 +09:00
Lennart Poettering
a24e3938e8 udevadm: don't claim a sysattr was write only just because we get EPERM on read
it might be totally inaccessible, hence weaken our language a bit and
just say "not readable", thus making not claim whether it is writable or
not.

Follow-up for 3a90bef55a
2022-02-03 07:32:54 +09:00
Anita Zhang
3a17ffa68e
Merge pull request #22373 from DaanDeMeyer/journald-file-rename
journal: Rename JournaldFile to ManagedJournalFile
2022-02-02 13:53:18 -08:00
Luca Boccassi
5c10b98350
Merge pull request #22358 from yuwata/udevadm-test-support-dev-path-or-device-unit
udevadm: test,test-builtin: support /dev path or device unit
2022-02-02 15:32:20 +00:00
Yu Watanabe
84e8602dfe test: use rm_rf_physical_and_freep cleanup function 2022-02-02 15:31:40 +00:00
Daan De Meyer
d02af6f33b journal: Rename JournaldFile to ManagedJournalFile
JournalFile and JournaldFile are hard to distinguish from each other.
Let's use ManagedJournalFile instead to make the distinction more clear.
2022-02-02 14:39:39 +00:00
Yu Watanabe
613d65d88f network: update operational state when we remove an address 2022-02-02 20:44:47 +09:00
Evgeny Vereshchagin
9216fddc5a dhcp-identifier: always use a fixed machine-id while fuzzing
It's a follow-up to https://github.com/systemd/systemd/pull/10200 where
that fuzzer was introduced. At the time it was run regularly on machines
where machine-id wasn't present so it was kind of reproducible. Now
it's run on CIFuzz and CFLite using GHActions with the public OSS-Fuzz
corpora (based on that particular machine-id) so to fully utilize
those corpora it's necessary to use it always. Other than that
it makes it possible for fuzzers targeting outgoing packets
based on incoming packets like https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1795921
to get past client_parse_message on my machine :-)
2022-02-02 20:44:27 +09:00
Yu Watanabe
4900ae14a5 sd-device: drop device_new_from_synthetic_event() from libsystemd
It is used by only test-udev.c.
2022-02-02 20:34:38 +09:00
Yu Watanabe
043543f1bb udevadm: trigger: drop unnecessary slash 2022-02-02 20:34:38 +09:00
Yu Watanabe
f4f3249539 udevadm: make test and test-builtin command accept /dev path or device unit 2022-02-02 20:34:38 +09:00
Yu Watanabe
2079898088 sd-device: make device_set_action() take sd_device_action_t 2022-02-02 20:34:38 +09:00
Yu Watanabe
7f2e3eea28 sd-device: move device_read_uevent_file() to device-private.h
Then, it can be used by our tools or daemons.
2022-02-02 20:34:38 +09:00
Yu Watanabe
f30943c12f udev: do not generate format dynamically
Prompted by LGTM.
2022-02-02 20:34:31 +09:00
Yu Watanabe
e85fdacc8a test: allow to set NULL to intro or outro
Addresses https://github.com/systemd/systemd/pull/22338#discussion_r796741033.
2022-02-02 11:06:54 +00:00
Luca Boccassi
b0c7e3d0e1
Merge pull request #22359 from yuwata/mkdir-fix
mkdir: allow to create directory whose path contains symlink
2022-02-02 11:03:04 +00:00
Yu Watanabe
6f6b017b9b test: add a test for mkdir_p() 2022-02-02 15:09:45 +09:00
Yu Watanabe
5117059ee9 mkdir: allow to create directory whose path contains symlink
Fixes a regression caused by 3008a6f21c.

Before the commit, when `mkdir_parents_internal()` is called from `mkdir_p()`,
it uses `_mkdir()` as `flag` is zero. But after the commit, `mkdir_safe_internal()`
is always used. Hence, if the path contains a symlink, it fails with -ENOTDIR.

To fix the issue, this makes `mkdir_p()` calls `mkdir_parents_internal()` with
MKDIR_FOLLOW_SYMLINK flag.

Fixes #22334.
2022-02-02 15:09:45 +09:00
Yu Watanabe
e22916e61d mkdir: CHASE_NONEXISTENT cannot used in chase_symlinks_and_stat() 2022-02-02 15:09:45 +09:00
Yu Watanabe
e4de58c823 core/mount: fail early if directory cannot be created
Prompted by #22334.
2022-02-02 15:09:45 +09:00
Yu Watanabe
891c9b36cf
Merge pull request #22350 from poettering/journal-read-object-fix
journal: various fixes to journal_file_read_object()
2022-02-02 13:47:32 +09:00
Lennart Poettering
92b29166e1 systemctl: strings returned by sd_bus_message_read_basic() are immutable
It's totally not OK to write to the strings returned by it, the data is
shared by all code that references the message.

While we are at it, simplify the code via
json_variant_set_field_string().

Follow-up for: 5ef599b324
2022-02-02 13:46:46 +09:00
Lennart Poettering
e6d4a1106c journal-file: don't use pread() when determining where to append, use mmap as before
This partially undoes the effect of
ab6e257b3e.

Originally, we always used the mmap logic to determine the current end
of the file. ab6e257b3e changed this so
that we always used pread().

With this change we'll use pread() from the synchronization thread and
mmap otherwise.
2022-02-02 11:21:44 +09:00
Lennart Poettering
99839c7ebd tests: rework test macros to not take code as parameters
C macros are nasty. We use them, but we try to be conservative with
them. In particular passing literal, complex code blocks as argument is
icky, because of "," handling of C, and also because it's quite a
challange for most code highlighters and similar. Hence, let's avoid
that. Using macros for genreating functions is OK but if so, the
parameters should be simple words, not full code blocks.

hence, rework DEFINE_CUSTOM_TEST_MAIN() to take a function name instead
of code block as argument.

As side-effect this also fixes a bunch of cases where we might end up
returning a negative value from main().

Some uses of DEFINE_CUSTOM_TEST_MAIN() inserted local variables into the
main() functions, these are replaced by static variables, and their
destructors by the static destructor logic.

This doesn't fix any bugs or so, it's just supposed to make the code
easier to work with and improve it easthetically.

Or in other words: let's use macros where it really makes sense, but
let's not go overboard with it.

(And yes, FOREACH_DIRENT() is another one of those macros that take
code, and I dislike that too and regret I ever added that.)
2022-02-02 11:00:16 +09:00
Yu Watanabe
faa1b3c6c4 network: dhcp-server: make empty string to DNS= or friends clear previously specified servers 2022-02-02 10:02:57 +09:00
Yu Watanabe
32f8a613c5 sd-dhcp-lease: store static routes and classless static routes in different arrays
When classless static routes option is provided, then static routes
option should not be used. Hence, let's not mix and store them in one
storage.

This introduce sd_dhcp_lease_get_static_routes() and
sd_dhcp_lease_get_classless_routes().
2022-02-02 10:02:44 +09:00
Yu Watanabe
64a6b5ed21
Merge pull request #22351 from mrc0mmand/TEST-56-cgroupsv1
test: require unified cgroup hierarchy for TEST-56
2022-02-02 10:02:26 +09:00
Lennart Poettering
7ac29d2dab resolve: add missing OOM check 2022-02-02 07:08:03 +09:00
Luca Boccassi
86838bf08b core: warn on ExitType=cgroup with legacy cgroup setup
'cgroup empty' notifications are not reliable on v1, so log a warning.

See: https://github.com/systemd/systemd/issues/22320
2022-02-02 07:07:47 +09:00
Yu Watanabe
6a8ab6dd1e
Merge pull request #22332 from yuwata/network-dhcp-server-dns-server-address
network: dhcp-server: allow to specify server address for DNS= or friends
2022-02-02 07:07:22 +09:00
Yu Watanabe
e0ec975148
Merge pull request #22327 from joanbm/main_resolved_improvements
resolved: misc. small DnsStream refactors and improvements
2022-02-02 07:06:56 +09:00