Commit Graph

30361 Commits

Author SHA1 Message Date
Lennart Poettering
ae0b700a85 hashmap: make sure to initialize shared hash key atomically
if we allocate a bunch of hash tables all at the same time, with none
earlier than the other, there's a good chance we'll initialize the
shared hash key multiple times, so that some threads will see a
different shared hash key than others.

Let's fix that, and make sure really everyone sees the same hash key.

Fixes: #17007
2020-09-12 09:33:33 +02:00
Lennart Poettering
35b4e3c1bc socket: downgrade log warnings about inability to set socket buffer sizes
In containers we might lack the privs to up the socket buffers. Let's
not complain so loudly about that. Let's hence downgrade this to debug
logging if it's a permission problem.

(This wasn't an issue before b92f350789
because back then the failures wouldn't be detected at all.)
2020-09-12 08:14:54 +02:00
Lennart Poettering
e742ec6abc test-acl-util: skip test if /tmp doesn't do ACLs
Fixes: #17013
2020-09-12 08:12:36 +02:00
Lennart Poettering
0306d1598d Merge pull request #17028 from poettering/logind-replace-job
logind: make TerminateSession() count
2020-09-11 22:17:41 +02:00
Yu Watanabe
85b6a8110d network: do not add prefix to RA if radv is not configured
Fixes #17017.
2020-09-11 19:28:46 +02:00
Michal Sekletár
882f5f429e cryptsetup: generate the unit to umount keydev filesystem
Previously we would call umount from ExecStartPost= of
systemd-cryptsetup instance in order to get rid of the keydev
mount (i.e. filesystem containing keyfile). Let's generate unit to
handle umount. Making this symmetrical (both mount and umount of keydev
are handled by units) fixes the problem with lingering keydev mounts.

Motivation for the change is the issue where keydev mount would stay
around even if device was successfully unlocked and mount is no longer
needed. That could happen previously because when generator options are
not prefixed with "rd." we run generators twice (e.g. rd.luks.key=...).

In such case disk is unlocked in initramfs phase of boot (assuming the
initrd image contains the generator and is able to handle unlocking of
LUKS devices). After switchroot we however enqueue start job for
systemd-cryptsetup instance (because units are regenerated second time)
and that pulls in its dependencies into transaction. Later the main
systemd-cryptsetup unit not actually started since it is already active
and has RemainaAfterExit=yes. Nevertheless, dependencies get activated
and keydev mount is attached again. Because previously we called umount
from ExecStartPost= of systemd-cryptsetup instance the umount is not
called second time and keydev filesystem stays lingering.
2020-09-11 19:20:28 +02:00
Lennart Poettering
1a42ce0920 logind: make sure when we are explicitly asked to terminate session/user/seat to use "replace" job mode
Otherwise our request will possibly fail if something else is already
enqeued, but given this is an explicit user request, let's not allow
things to fail.

Fixes: #16702
2020-09-11 18:09:34 +02:00
Lennart Poettering
bda625730d logind: clarify what the second argument of session_stop() means when calling it 2020-09-11 18:09:30 +02:00
Lennart Poettering
40771cf524 logind: minor simplification 2020-09-11 18:09:11 +02:00
Lennart Poettering
f7c87baeca Merge pull request #17020 from yuwata/backlight
backlight: validate sysattr value
2020-09-11 14:23:47 +02:00
Lennart Poettering
2ac4d1d45b hostnamed: add various debugging log messages when we determine chassis type
No actual code flow changes, just a bunch of debug messages.
2020-09-11 13:14:05 +02:00
Yu Watanabe
3bacb7e73b backlight: validate read sysattr value
If actual_brightness is larger than max_brightness, then fall back to
use brightness attribute.

Also, if the saved value is invalid, then this makes remove the file in
/var/lib/systemd/backlight.

Hopefully fixes #17011.
2020-09-11 17:46:11 +09:00
Yu Watanabe
06d98bdc81 backlight: do not claim that ID_BACKLIGHT_CLAMP= property is not set 2020-09-11 17:44:20 +09:00
Yu Watanabe
ea2bc25762 sd-device: introduce sd_device_set_sysattr_valuef() 2020-09-11 17:41:10 +09:00
Lennart Poettering
5d0fe4233b tree-wide: add helper for IPv4/IPv6 sockopts
A variety of sockopts exist both for IPv4 and IPv6 but require a
different pair of sockopt level/option number. Let's add helpers for
these that internally determine the right sockopt to call.

This should shorten code that generically wants to support both ipv4 +
ipv6 and for the first time adds correct support for some cases where we
only called the ipv4 versions, and not the ipv6 options.
2020-09-11 10:33:13 +02:00
Lennart Poettering
00df39a56a timesyncd: don't attempt to call IP_TOS sockopt on IPv6 sockets 2020-09-11 10:16:39 +02:00
lichangze
7c5c59d4b1 hostnamed: map 'all-in-one' DMI chassis type to desktop 2020-09-11 09:55:44 +02:00
Zbigniew Jędrzejewski-Szmek
f8bff7805e Merge pull request #16933 from poettering/copy-hardlinks
copy: optionally recreate hardlinks when copying file trees
2020-09-10 19:04:52 +02:00
Lennart Poettering
6ae05c9b14 Merge pull request #16947 from keszybz/socket-parsing-rework
Socket parsing rework
2020-09-10 16:47:37 +02:00
Zbigniew Jędrzejewski-Szmek
f29d38b7d4 Merge pull request #17003 from yuwata/conf-parser-downgrade-log-level
tree-wide: downgrade log level in conf-parsers
2020-09-10 15:43:29 +02:00
Lennart Poettering
3a17308c2a Merge pull request #16986 from yuwata/network-fix-routing-policy-rule-issue-16784
network: fix routing policy rule issue
2020-09-10 14:50:38 +02:00
Lennart Poettering
dee00c1939 fs-util,tmpfiles: fix error handling of fchmod_opath()
When 4dfaa528d4 was first commited its callers relied on `errno` instead of the
return value for error reporting. Which worked fine, since internally
under all conditions base were set — even if ugly and not inline with
our coding style. Things then got broken in
f8606626ed where suddenly additional
syscalls might end up being done in the function, thus corrupting `errno`.
2020-09-10 12:47:50 +02:00
Lennart Poettering
c1b9708c10 bootctl: don't accidentally propagate errors in "bootctl status"
Fixes: #16989
2020-09-10 12:45:54 +02:00
Yu Watanabe
17d2b2e4ef network: replace FRA_IFNAME -> FRA_IIFNAME
No functional change, as FRA_IFNAME is an alias of FRA_IIFNAME.
2020-09-10 18:57:07 +09:00
Yu Watanabe
2102d33cfb network: also process RTM_NEWRULE or RTM_DELRULE message which does not contain src and dst addresses
Fixes #16784.
2020-09-10 18:57:07 +09:00
Yu Watanabe
bd1000b4a0 network: fix the default mask for FirewallMark=
And always send FRA_FWMASK if FirewallMark= is set.

C.f. b8964ed9fa

Partially fixes #16784.
2020-09-10 18:56:18 +09:00
Yu Watanabe
c2d6fcb147 network: do not assign return value if the parse_fwmark_fwmask() fails
This also removes redundant logs, and makes input string not copied if
it does not contain '/'.
2020-09-10 18:19:03 +09:00
Yu Watanabe
d85b0d69f1 network: add debug log for removing routing policy rules 2020-09-10 18:19:03 +09:00
Yu Watanabe
755dbda355 network: also logs priority of routing policy rules 2020-09-10 18:18:59 +09:00
Yu Watanabe
b6c7c4a87b network: update log message for rtnl messages 2020-09-10 18:14:24 +09:00
Yu Watanabe
323dda7806 core: downgrade error level and ignore several non-critical errors 2020-09-10 16:24:31 +09:00
Yu Watanabe
144fb165fd homed: downgrade log level 2020-09-10 15:21:43 +09:00
Yu Watanabe
adb5848706 journal: downgrade log level 2020-09-10 15:20:35 +09:00
Yu Watanabe
196d41bcde login: downgrade log level if the error will be ignored 2020-09-10 15:18:26 +09:00
Yu Watanabe
a864170745 nspawn: downgrade log level if the error will be ignored 2020-09-10 15:16:14 +09:00
Yu Watanabe
e459258f19 repart: downgrade log level 2020-09-10 15:08:13 +09:00
Yu Watanabe
94069bef23 resolve: downgrade error level when the error will be ignored 2020-09-10 15:06:29 +09:00
Yu Watanabe
34136e1503 resolve: check DNSSD service name template before assigning it 2020-09-10 15:05:19 +09:00
Yu Watanabe
7a602af041 conf-parser: logs about OOM error 2020-09-10 14:14:19 +09:00
Yu Watanabe
3de39a1ad4 conf-parser: use SYNTHETIC_ERRNO() at one more place 2020-09-10 14:13:56 +09:00
Yu Watanabe
c56566530b timesync: downgrade error level when the error will be ignored 2020-09-10 14:13:26 +09:00
Yu Watanabe
40f04cde5b xdg-autostart-generator: downgrade error level when the error will be ignored 2020-09-10 14:07:56 +09:00
Yu Watanabe
8add8b508d vlan: downgrade error level if the error will be ignored 2020-09-10 13:59:04 +09:00
Yu Watanabe
4c382a8772 ethtool: downgrade log level when the error will be ignored 2020-09-10 13:59:04 +09:00
Yu Watanabe
e3489e96b3 network: slightly update log message 2020-09-10 13:59:04 +09:00
Yu Watanabe
2ca601d8cb network do not ignore OOM error in config_parse_macsec_key_id() 2020-09-10 13:59:04 +09:00
Yu Watanabe
696c0832e2 network: use _cleanup_ attribute at one more place 2020-09-10 13:59:04 +09:00
Yu Watanabe
a8a50f4fb7 network: do not ignore OOM error in wireguard_decode_key_and_warn() 2020-09-10 13:59:04 +09:00
Yu Watanabe
02241e4339 network: unify config_parse_wireguard_public_key() and config_parse_wireguard_preshared_key() 2020-09-10 13:57:39 +09:00
Yu Watanabe
c799c93c62 udev: fix indentation
Follow-up for 90e30d767a.
2020-09-10 13:11:43 +09:00