Commit Graph

48267 Commits

Author SHA1 Message Date
Yu Watanabe 5f016e326d network: add debug log about requesting DHCP address
This addresses
https://github.com/systemd/systemd/pull/17474#discussion_r515996491.
2020-12-02 18:50:45 +09:00
Yu Watanabe 240e41372e test-network: confirm that IPv4ll address is dropped after DHCPv4 lease is acquired 2020-12-02 18:50:13 +09:00
Yu Watanabe 878c035a48 sd-ipv4acd: logs current state 2020-12-02 18:42:17 +09:00
Yu Watanabe 3f2c0d8520 sd-ipv4acd,sd-ipv4ll: include interface name in the debug logs 2020-12-02 18:42:13 +09:00
Yu Watanabe 1f1d4d42c1 log-link: introduce log_interface_full_errno() macro 2020-12-02 18:41:01 +09:00
Yu Watanabe 99b06a2f5c sd-ipv4acd,sd-ipv4ll: introduce _get_ifindex() and _get_ifname()
They will be used in later commits.

This also makes sd_ipv4acd_set_ifindex() check the existence of the interface.
2020-12-02 18:40:24 +09:00
Lennart Poettering f3e1f00d03 resolved: don't update resolv.conf snippets unnecessarily
Fixes: #17577
2020-12-02 10:32:17 +01:00
Lennart Poettering 1098142436 fs-util: add conservative_rename() that suppresses unnecessary renames
if the source and destination file match in contents and basic file
attributes, don#t rename, but just remove source.

This is a simple way to suppress inotify events + mtime changes when
atomically updating files.
2020-12-02 10:32:17 +01:00
Lennart Poettering b1b657c48f copy: teach copy_file() that a mode=-1 call means "take mode from original file" 2020-12-02 10:32:17 +01:00
Zbigniew Jędrzejewski-Szmek ebef02dd8f pager: stop disabling urlification under a pager
Less 568 properly shows urlified strings.

Putative NEWS entry:
* Urlification is now enabled by default even when a pager is used.
  Previously it was disabled, because less would not show such markup
  properly. This has been fixed in less 568.
  Please either upgrade less, or use SYSTEMD_URLIFY=0 to disable the
  feature.
2020-12-02 16:50:44 +09:00
Zbigniew Jędrzejewski-Szmek 0a67dd8310
Merge pull request #17692 from yuwata/ipv4ll
network: fold ipv4ll fallback modes into normal ipv4ll addressing
2020-12-01 21:59:30 +01:00
Zbigniew Jędrzejewski-Szmek f319b2b1b0
Merge pull request #17703 from poettering/event-ratelimit
sd-event: add a concept of ratelimiting
2020-12-01 21:47:43 +01:00
Zbigniew Jędrzejewski-Szmek 946f3d868c
Merge pull request #17524 from poettering/fileio-offset
cryptsetup: if keyfile is specified as AF_UNIX socket in the fs, connect to it, and read key data from it
2020-12-01 21:38:52 +01:00
Lennart Poettering a303686fc1 man: document new ratelimiting APIs 2020-12-01 15:15:39 +01:00
Michal Sekletár d586f642fd core: prevent excessive /proc/self/mountinfo parsing 2020-12-01 15:15:39 +01:00
Michal Sekletár 68d8906517 test: add ratelimiting test
(Taken from Michal's #17274 by Lennart, and slightly adjusted)
2020-12-01 15:15:39 +01:00
Lennart Poettering b6d5481b3d sd-event: add ability to ratelimit event sources
Let's a concept of "rate limiting" to event sources: if specific event
sources fire too often in some time interval temporarily take them
offline, and take them back online once the interval passed.

This is a simple scheme of avoiding starvation of event sources if some
event source fires too often.

This introduces the new conceptual states of "offline" and "online" for
event sources: an event source is "online" only when enabled *and* not
ratelimited, and offline in all other cases. An event source that is
online hence has its fds registered in the epoll, its signals in the
signalfd and so on.
2020-12-01 15:11:24 +01:00
Lennart Poettering f41315fceb sd-event: remove earliest_index/latest_index into common part of event source objects
So far we used these fields to organize the earliest/latest timer event
priority queue.  In a follow-up commit we want to introduce ratelimiting
to event sources, at which point we want any kind of event source to be
able to trigger time wakeups, and hence they all need to be included in
the earliest/latest prioqs.  Thus, in preparation let's make this
generic.

No change in behaviour, just some shifting around of struct members from
the type-specific to the generic part.
2020-12-01 15:10:50 +01:00
Lennart Poettering cad143a8f2 sd-event: follow coding style with naming return parameter 2020-12-01 15:10:50 +01:00
Lennart Poettering f814c871e6 sd-event: ref event loop while in sd_event_prepare() ot sd_event_run()
sd_event_prepare() invokes callbacks that might drop the last user ref
on our event loop. Let's make sure we keep an explicit ref around it, so
that we won't end up with an invalid pointer. Similar in sd_event_run().

Basically, any function that is publically callable that might end up
invoking callbacks should ref the relevant objects to be protected
against callbacks destroying these objects while we still want to access
them. We did this correctly in sd_event_dispatch() and sd_event_loop(),
but these are not the only ones which are callable from the outside.
2020-12-01 15:10:50 +01:00
Lennart Poettering e6a7bee538 sd-event: let's suffix last_run/last_log with "_usec"
Otherwise it's a bit confusing what this is about: two timestamps.
2020-12-01 15:10:50 +01:00
Lennart Poettering 1e45e3fecc sd-event: split out code to add/remove timer event sources to earliest/latest prioq
Just some refactoring that makes code prettier, and will come handy
later, because we can reuse these functions at more places.
2020-12-01 15:10:50 +01:00
Lennart Poettering 41c63f36c3 sd-event: split clock data allocation out of sd_event_add_time()
Just some simple refactoring, that will make things easier for us later.
But it looks better this way even without the later function reuse.
2020-12-01 15:10:50 +01:00
Lennart Poettering f80a5d6a86 sd-event: mention that two debug logged events are ignored 2020-12-01 14:36:06 +01:00
Lennart Poettering 8c437318b8 update TODO 2020-12-01 14:27:33 +01:00
Lennart Poettering 59d6f7b097 man: drop comment about ECC vs. RSA and Yubikey
The comment is pointless, ECC systematically doesn't allow
encryption/decryption directly, only RSA does that. If you want to use
ECC for asymmetric encryption/decryption you have to combine it with key
exchange scheme and symmetric scheme. This all is not a limitation of
the Yubikey, hence don't claim so. It's just how ECC is.
2020-12-01 14:27:33 +01:00
Lennart Poettering 96e9a9a4e6 man: document how cryptsetup keys may be acquired via AF_UNIX sockets 2020-12-01 14:27:12 +01:00
Lennart Poettering e060ed32e4 cryptsetup: modify keyfile search logic to use read_file_full() too
Let's move the 3rd way how cryptsetup acquires key files to
read_file_full() too.

Since load_key_file()'s raison d'etre now is just the search path logic,
let's rename the function to find_key_file().
2020-12-01 14:27:01 +01:00
Lennart Poettering e2c2f868b2 cryptsetup: port cryptsetup's main key file logic over to read_full_file_full()
Previously, we'd load the file with libcryptsetup's calls. Let's do that
in our own, so that we can make use of READ_FULL_FILE_CONNECT_SOCKET,
i.e. read in keys via AF_UNIX sockets, so that people can plug key
providers into our logic.

This provides functionality similar to Debian's keyscript= crypttab
option (see → #3007), as it allows key scripts to be run as socket
activated services, that have stdout connected to the activated socket.
In contrast to traditional keyscript= support this logic runs stuff out
of process however, which is beneficial, since it allows sandboxing and
similar.
2020-12-01 14:17:47 +01:00
Lennart Poettering 4d1bb8f397 cryptsetup: port PKCS#11 code to read key file with read_full_file()
Now that we can read from offsets/with size, let's port the cryptsetup
PKCS#11 key file logic over to read_full_file_full().
2020-12-01 14:17:47 +01:00
Lennart Poettering 986311c2da fileio: teach read_full_file_full() to read from offset/with maximum size 2020-12-01 14:17:47 +01:00
Lennart Poettering c61f46fe31 journal-remote: suffix cmdline option that expects arg with = 2020-12-01 14:17:47 +01:00
Lennart Poettering ce82de671f man: mention that --key= is about *secret* keys 2020-12-01 14:17:47 +01:00
Lennart Poettering e5de42e6f2 journal-remote: use READ_FULL_FILE_SECURE|READ_FULL_FILE_WARN_WORLD_READABLE when reading PEM secret key
It's secret data, hence use the appropriate flags.
2020-12-01 14:17:46 +01:00
Lennart Poettering 8b3c3a4973 repart: warn about world writable key files
We have easy support for this, hence use it for privileged key data.
2020-12-01 14:17:46 +01:00
Lennart Poettering ae9cf30b2f dissect-image: use simple version of read_full_file() where we can 2020-12-01 14:17:46 +01:00
Lennart Poettering f362fe731b journal-remote: erase secret PEM key from memory after use 2020-12-01 14:17:46 +01:00
Zbigniew Jędrzejewski-Szmek ce9067697b meson: add missing "S" to SYSTEMD_CGROUPS_AGENT_PATH
Other similar variables use the binary name underscorified and upppercased
(with "_BINARY" appended in some cases to avoid ambiguity). Add "S" to follow
the same pattern for systemd-cgroups-agent.

Based on the discussion in #16715.
2020-12-01 09:34:17 +01:00
Franck Bui e9eec8b5d2 scope: on unified, make sure to unwatch all PIDs once they've been moved to the cgroup scope
Commit 428a9f6f1d freed u->pids which is
problematic since the references to this unit in m->watch_pids were no more
removed when the unit was freed.

This patch makes sure to clean all this refs up before freeing u->pids by
calling unit_unwatch_all_pids().
2020-12-01 09:33:14 +01:00
Vito Caputo cb9d621ebb
sd-event: fix delays assert brain-o (#17790)
s/sizeof/ELEMENTSOF/

Bug introduced in 34b8751774.
2020-12-01 09:26:54 +01:00
Pavel Sapezhko e11ec61d65 mkosi: make ubuntu image bootable by default 2020-11-30 22:14:57 +00:00
igo95862 1edc1f1b62 man: Speicfy exact return values of sd_bus_message_enter_container 2020-11-30 12:21:20 +01:00
Piotr Drąg a75471ced1 po: add units/systemd-journald.service.in to POTFILES.skip 2020-11-30 10:36:31 +01:00
Michał Kopeć e7ab349f64 hwdb: add axis range corrections for Lenovo ThinkPad T14 Gen1 2020-11-30 10:28:16 +01:00
Yu Watanabe 53ec5dd028 network: use IN_SET() macro
Follow-up for 1d370b2c18.
2020-11-30 12:41:41 +09:00
Yu Watanabe 0d0799daf4 network: treat IPv4LL is one of dynamic addressing protocol
This makes an IPv4LL address optional when multiple dynamic
addressing protocols are enabled.
2020-11-30 12:41:41 +09:00
Yu Watanabe 0b4b66cc53 network: simplify the condition about ipv4ll is enabled or not 2020-11-30 12:41:41 +09:00
Yu Watanabe d19b993983 network: shorten link_check_ready() a bit 2020-11-30 12:41:41 +09:00
Yu Watanabe 8ccae2dd2d network: stop IPv4LL engine when DHCPv4 address is successfully acquired 2020-11-30 12:41:30 +09:00
Zbigniew Jędrzejewski-Szmek 0107b769b1 networkd: start ipv4ll when dhcp has trouble getting a lease
Fixes #13316.
2020-11-30 12:37:36 +09:00