Commit Graph

31634 Commits

Author SHA1 Message Date
Yu Watanabe 530a715ea9 udev/cdrom: introduce enum for media state 2021-01-08 14:08:38 +00:00
Yu Watanabe 97b2248475 udev/cdrom: move media status to Context 2021-01-08 14:08:38 +00:00
Yu Watanabe 38f3e20883 udev/cdrom: introduce enum for media and drive feature 2021-01-08 14:08:38 +00:00
Yu Watanabe e5aac5cdf1 udev/cdrom: introduce Context 2021-01-08 14:08:38 +00:00
Yu Watanabe 0f0b079135 udev/cdrom: make cd_profiles() return positive value if drive has media 2021-01-08 14:08:38 +00:00
Yu Watanabe 138dd9545a udev/cdrom: make media_lock() return negative errno 2021-01-08 14:08:38 +00:00
Yu Watanabe 4fe9ab406e udev/cdrom: introduce scsi_cmd_run_and_log() 2021-01-08 14:08:38 +00:00
Yu Watanabe 511ff06e99 udev/cdrom: use random_u64() and usleep() 2021-01-08 14:08:38 +00:00
Yu Watanabe 56c1a2977b udev/cdrom: split out parse_argv() and help() 2021-01-08 14:08:38 +00:00
Susant Sahani 007cac09a2 network: route - add support to configure tcp advmss 2021-01-08 14:06:13 +00:00
Jan Tojnar 60bce7c6d9 pkg-config: make prefix overridable again
While we don't support prefix being != /usr, and this is hardcoded
all over the place, variables in pkg-config file are expected
to have overridable base directory.

This is important for at least the following two use cases:

- Installing projects to non-FHS package-specific prefixes for Nix-style
  package managers. Of course, it is then their responsibility
  to ensure systemd can find the service files.
- Installing to local path for development purposes.
  This is a compromise between running a program from a build directory,
  and running it fully installed to system prefix.

You will not want to write to system prefix in either case.

For more information, see also
https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/

Fixes https://github.com/systemd/systemd/issues/18082

Partially reverts 6e65df89c3
2021-01-07 15:28:21 +01:00
Lennart Poettering 15308e5083 stat-util: don't try to open path on path_is_temporary_fs()
I mean, the old code at least used O_PATH, but still, we shouldn't
allocate/close an fd if we don't have to.
2021-01-06 23:26:08 +00:00
Lennart Poettering 8b1ac00fa9
Merge pull request #18150 from poettering/strextend-tweak
tree-wide: beef up strextend() a bit
2021-01-06 19:55:29 +01:00
Luca Boccassi bf3b428f73 systemctl: have is-enabled return success for aliases when calling into pid1 too
commit 15d7ab87c4 introduced the
change to add an 'alias' state, but it was wired to systemctl
only when running in 'client-side' mode. Return success as
expected and documented also when running in 'server-mode'.

Fixes https://github.com/systemd/systemd/issues/18134
2021-01-06 17:39:18 +01:00
Lennart Poettering 2a4e1fd0d4 string-util: use GREEDY_ALLOC_ROUND_UP() in strextend()
This uses GREEDY_ALLOC_ROUND_UP() to grow the allocation size
exponentially. This should speed allocation loops up a bit, given
that we often call strextend() repeatedly in a loop on the same
buffer.
2021-01-06 17:25:12 +01:00
Lennart Poettering c2bc710b24 string-util: imply NULL termination of strextend() argument list
The trailing NULL in the argument list is now implied (similar to
what we already have in place in strjoin()).
2021-01-06 17:24:46 +01:00
Luca Boccassi 3c2c8e62c9 cryptsetup: use crypt_token_max if available
New API added upstream:

8a12f6dc2c
2021-01-05 12:16:07 +00:00
Susant Sahani 0a9fb9bad8 network: Allow to set device's receive queues and transmit queues 2021-01-05 12:46:28 +09:00
Luca Boccassi 68147f9371
Merge pull request #18109 from yuwata/network-routing-policy-rule-family-both-fixes
network: fixes related to Family=both in [RoutingPolicyRule]
2020-12-30 11:27:24 +00:00
Yu Watanabe 2797d945d2
Merge pull request #18105 from yuwata/fuzz-fix-timeout
Fuzz fix timeout
2020-12-30 12:11:23 +09:00
Endre Szabo 9e516e4c05
A typo fix in bootctl.c (#18106) 2020-12-30 12:10:24 +09:00
Yu Watanabe ae45e1a383 resolve: slightly optimize dns_answer_add()
Previously, dns_answer_add() was O(n^2).
With this change dns_packet_extract() becomes ~15 times faster for some
extremal case.

Before:
```
$ time ./fuzz-dns-packet ~/downloads/clusterfuzz-testcase-minimized-fuzz-dns-packet-5631106733047808
/home/watanabe/downloads/clusterfuzz-testcase-minimized-fuzz-dns-packet-5631106733047808... ok

real    0m15.453s
user    0m15.430s
sys     0m0.007s
```

After:
```
$ time ./fuzz-dns-packet ~/downloads/clusterfuzz-testcase-minimized-fuzz-dns-packet-5631106733047808
/home/watanabe/downloads/clusterfuzz-testcase-minimized-fuzz-dns-packet-5631106733047808... ok

real    0m0.831s
user    0m0.824s
sys     0m0.006s
```

Hopefully fixes oss-fuzz#19227.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19227
2020-12-30 04:14:22 +09:00
Yu Watanabe b652cccab9 resolve: field size in dns resource record may be zero 2020-12-30 04:14:22 +09:00
Yu Watanabe 0b71a7e01d siphash: introduce siphash24_compress_safe() 2020-12-30 04:14:18 +09:00
Yu Watanabe a75466ed19 network: drop fib rules configured with Family=both 2020-12-30 03:19:07 +09:00
Yu Watanabe 49de8d5ced network: set RoutingPolicyRule::family based on Family= setting 2020-12-30 03:19:07 +09:00
Yu Watanabe c1934a8f2f network: always re-configure rules even if already exist
routing_policy_rule_get() in link_set_routing_policy_rules() does not
work when [RoutingPolicyRule] section does not have From= or To=.
2020-12-30 03:19:03 +09:00
Yu Watanabe 57fe5a42f0 network: drop unnecessary checks
By the previous commit, the checks are not necessary any more.
2020-12-30 03:17:42 +09:00
Yu Watanabe fdce9324c7 network: fix possible memory leak
When set_put() returns 0, then already stored rule will be unref()ed
from Manager.
2020-12-30 02:11:36 +09:00
Yu Watanabe 3141c81736 network: constify several arguments 2020-12-30 02:03:48 +09:00
Yu Watanabe cd70fc373d resolve: do not compare key twice 2020-12-30 01:22:59 +09:00
Yu Watanabe 600864921b resolve: slightly shorten dns_resource_key_compare_func() 2020-12-30 01:22:59 +09:00
Yu Watanabe e9665ac2a2 resolve: fix typo 2020-12-30 01:22:56 +09:00
Yu Watanabe 57dda0de38 fuzzers: set maximum length for several fuzzers
Hopefully fixes oss-fuzz#19081, oss-fuzz#21731, oss-fuzz#21755.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19081
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21731
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21755
2020-12-30 00:31:17 +09:00
Yu Watanabe a9d240f4bf network: do not serialize/deserialize routing policy rules
We already handle foreign routing policy rules correctly by the previous
commit. So, the serialization/deserialization of rules are not necessary
anymore.
2020-12-29 16:13:54 +09:00
Yu Watanabe 0b81225e57 network: drop unnecessary routing policy rules
networkd already drop foreign address, routes, and nexthops on startup,
except those created by kernel. However, previously, routing policy
rules were not. The logic of serialization/deserialization of rules only
works for rules created by previous invocation of networkd, and does not
work for one created by other tools like `ip rule`.

This makes networkd drop foreign routing policy rules except created by
kernel on startup. Also, remove rules created by networkd when the
corresponding links are dropped or networkd is stopping.
2020-12-29 16:13:54 +09:00
Yu Watanabe e737dce544 network: treat rule which has l3mdev flag as created by kernel 2020-12-29 16:13:39 +09:00
Yu Watanabe 569eeb0c05 network: adjust protocol of rules sent from kernel when kernel does not support FRA_PROTOCOL
Otherwise, each configured rule is treated as foreign.
2020-12-29 16:03:26 +09:00
Yu Watanabe 1e5fd3216a network: set FRA_PROTOCOL to RTPROT_STATIC by default 2020-12-29 16:03:26 +09:00
Luca Boccassi 5def1f11f8 shared/dns: fix dlopen_idn return code check
Fixes https://github.com/systemd/systemd/issues/18078
2020-12-28 15:08:12 +09:00
Thomas Haller 1835a8a105 sd-dhcp-client: avoid "maybe-uninitialized" warning in client_timeout_resend()
When compiling with CFLAGS='-Werror=maybe-uninitialized -Og' we get a
warning about uninitialized "next_timeout" variable.

Avoid the warning by adding an (unreachable) "default" label.

Fixes: c24288d21e ("sd-dhcp-client: correct dhcpv4 renew/rebind retransmit timeouts")
2020-12-26 09:01:01 +09:00
Yu Watanabe 75d2641190 network: introduce RouterAllowList= and RouterDenyList= in [IPv6AcceptRA] 2020-12-24 17:16:15 +09:00
Susant Sahani de6b6ff84c networkd: add support for prefix allow-list and route allow-list 2020-12-24 17:16:13 +09:00
Yu Watanabe 3f0af4a5f9 network: rename DenyList= -> PrefixDenyList= 2020-12-24 17:15:44 +09:00
Yu Watanabe 19e334bd15 network: make RouteDenyList= filter route prefix rather than gateway address
DenyList= filters provided prefixes, not router address.
So, RouteDenyLisy= should so for consistency.

Fixes 16c89e649d.
2020-12-24 17:15:44 +09:00
Yu Watanabe 1cd5267e81 network: fix condition for checking the provided gateway is assigned to link
Fix bug introduced by 221019166f.
2020-12-24 17:15:44 +09:00
Yu Watanabe 0afa4d569d sd-ndisc: fix indentation 2020-12-24 17:15:44 +09:00
Yu Watanabe 8c86196b52 network: drop redundant TAKE_PTR()
Follow-up for 16c89e649d.
2020-12-24 17:15:14 +09:00
Sebastiaan van Stijn 8c62ad1929 Improve instructions for debugging failing service
In situations where a service fails to start, systemd suggests the user to
use "journalctl -xe" to get details about the failure. While running this
command does provide some additional details, most of the information is
similar to what was already printed when the service fails.

often the actual reason for the failure can be found in the logs of the
service that fails to start.

This patch updates the wording to suggest using "-u" to view the service
logs instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-12-24 14:36:55 +09:00
Florian Klink d3ccb1b4ba network: fix IPv6PrivacyExtensions=kernel handling
When set to "kernel", systemd is not supposed to touch that sysctl.

5e0534f1c1, part of
https://github.com/systemd/systemd/pull/17240 forgot to handle that
case.

Fixes https://github.com/systemd/systemd/issues/18003
2020-12-24 08:54:20 +09:00