Commit Graph

29703 Commits

Author SHA1 Message Date
Lennart Poettering 04dffc0add user-util: indentation fix 2020-07-21 17:41:57 +02:00
Lennart Poettering 6456dafa12
Merge pull request #16504 from poettering/read-file-ipc
fileio: teach read_full_file() the ability to read data from AF_UNIX stream socket
2020-07-21 14:16:32 +02:00
Lennart Poettering c400d040ce import: always prefer GNU tar, to avoid cmdline incompatibilities
Fixes: #16506
2020-07-21 14:16:02 +02:00
Lennart Poettering 3177b9270c fileio: add brief explanations for flags 2020-07-21 10:32:01 +02:00
Lennart Poettering 49f16281c9 tree-wide: use READ_FULL_FILE_CONNECT_SOCKET at various places
Let's use the new flag wherever we read key material/passphrases/hashes
off disk, so that people can plug in their own IPC service as backend if
they like, easily.

(My main goal was actually to support this for crypttab key files — i.e.
that you can specify AF_UNIX sockets as third column in crypttab — but
that's harder to implement, since the keys are read via libcryptsetup's
API, not ours.)
2020-07-21 10:32:01 +02:00
Lennart Poettering c668aa8b35 fileio: allow to read base64/hex data as strings
There's really no reason to prohibit this, hence don't.
2020-07-21 10:31:50 +02:00
Lennart Poettering b93d3f6b81 fileio: add support for read_full_file() on AF_UNIX stream sockets
Optionally, teach read_full_file() the ability to connect to an AF_UNIX
socket if the specified path points to one.
2020-07-21 10:23:44 +02:00
Lennart Poettering f294470262 fileio: add explicit flag for generating world executable warning when reading file 2020-07-21 09:56:44 +02:00
Zbigniew Jędrzejewski-Szmek 2e3e2750bb
Merge pull request #16519 from yuwata/networkctl-altnames
networkctl: tiny cleanups about alternative names
2020-07-21 09:10:00 +02:00
Zbigniew Jędrzejewski-Szmek 739b9a4354
Merge pull request #16353 from yuwata/network-dns-sni
resolve, network: more SNI and port number support
2020-07-21 08:06:17 +02:00
Hans de Goede 3a978b30cd logind: Fix org.freedesktop.login1.set-reboot-to-boot-loader-menu saving to the wrong file in the non EFI case
According to the docs, and to the
org.freedesktop.login1.get-reboot-to-boot-loader-menu code, the
(oneshot) boot-loader-menu timeout should be stored in
/run/systemd/reboot-to-boot-loader-menu, but the set method was storing it
in /run/systemd/reboot-to-loader-menu.

This commit fixes this. Note that the fixed name also is a better match
for the dbus call names and matches the related
/run/systemd/reboot-to-boot-loader-entry structure, so fixing the set code,
rather then the get code + docs seems like the right thing to do here.
2020-07-21 10:02:34 +09:00
fangxiuning ddbab78f9a bus: use bus_log_connect_error to print error message 2020-07-21 10:02:01 +09:00
Yu Watanabe a574b7d152 resolvectl: use bus_message_read_in_addr_auto() 2020-07-21 04:12:11 +09:00
Yu Watanabe 7695e2cbbe network, resolve: use bus_message_read_ifindex() or friends 2020-07-21 04:08:22 +09:00
Yu Watanabe 3dd95ab6c5 util: introduce bus_message_read_ifindex() 2020-07-21 04:08:22 +09:00
Yu Watanabe 10d4620467 util: introduce bus_mesage_read_dns_servers() 2020-07-21 04:08:22 +09:00
Yu Watanabe 976009897b util: introduce helper functions to read in_addr from bus message 2020-07-21 04:08:22 +09:00
Yu Watanabe e293e755d5 util: drop duplicated inclusion of sd-bus.h 2020-07-21 04:08:22 +09:00
Yu Watanabe a747e71c56 resolvectl: show DNS servers with port and SNI 2020-07-21 04:08:22 +09:00
Yu Watanabe b1881e8320 resolvectl: make DNS servers can be specified with port number and SNI 2020-07-21 04:08:22 +09:00
Yu Watanabe 8e56ea4c88 resolve: add DBus properties which support DNS SNI and port number 2020-07-21 04:08:22 +09:00
Yu Watanabe 95ce1ba87b resolve: add DBus method to set DNS server with port number and SNI 2020-07-21 04:08:22 +09:00
Yu Watanabe 4e11ddfdd3 network: add DBus method to set DNS server with port number and SNI 2020-07-21 04:08:22 +09:00
Yu Watanabe 87d6489776 network: save DNS servers specified by DBus interface
Also, filter out DNS servers which do not match link ifindex.
2020-07-21 04:08:22 +09:00
Yu Watanabe 6458176514 network: do not save DNS= entries not match link ifindex 2020-07-21 04:08:22 +09:00
Yu Watanabe e77bd3fdff network: support port number and SNI in [Network] DNS= 2020-07-21 04:08:22 +09:00
Yu Watanabe 8aa5afd20f resolve: read/save port number and SNI from/into link state file 2020-07-21 04:08:16 +09:00
Yu Watanabe b6af282475 resolve: compare port and SNI in dns_server_hash_ops 2020-07-21 04:04:49 +09:00
Yu Watanabe 1b86009298 resolve: also compare port and SNI in dns_server_find() 2020-07-21 04:04:49 +09:00
Yu Watanabe da9de7385a resolve: support port specifier in DNS= setting 2020-07-21 04:04:42 +09:00
Yu Watanabe 395aa34023 resolve: ignore empty server name
Just for safety.
2020-07-21 03:55:34 +09:00
Yu Watanabe 408f8fbc0f util: introduce 'struct in_addr_full' and its helper functions 2020-07-21 03:55:34 +09:00
Yu Watanabe a723fb85da util: introduce in_addr_port_ifindex_name_from_string_auto() and in_addr_port_ifindex_name_to_string() 2020-07-21 03:55:34 +09:00
Yu Watanabe cbe194b39e resolve: propagate error in link_load_user()
Most error path in link_load_user() are ENOMEM. Hence, it is critical.
2020-07-21 03:55:34 +09:00
Yu Watanabe eced0d2a46
Merge pull request #16518 from yuwata/network-fix-failure-in-updating-mac-address
network: fix failures in updating MAC address
2020-07-21 02:13:24 +09:00
Zbigniew Jędrzejewski-Szmek 7e8279c0a6
Merge pull request #16501 from yuwata/udev-fix-renaming
udev: fix issues in renaming interface vs alternative names
2020-07-20 09:00:02 +02:00
Yu Watanabe 807667f7ac network: stop already running engines before updating MAC address
In NetworkdBridgeTests.test_bridge_configure_without_carrier of
systemd-networkd-tests.py

```
bridge99: MAC address: 2e:3a:ec:4d:d3:62
Assertion 'sd_ipv4ll_is_running(ll) == 0' failed at src/libsystemd-network/sd-ipv4ll.c:110, function int sd_ipv4ll_set_mac(sd_ipv4ll *, const struct ether_addr *)(). Ignoring.
bridge99: Could not update MAC address in IPv4LL client: Device or resource busy
```
2020-07-20 15:29:55 +09:00
Yu Watanabe 96fe813c42 radv: introduce sd_radv_is_running() 2020-07-20 15:29:12 +09:00
Yu Watanabe 48c5398951 networkctl: do not ignore -EOPNOTSUPP when reading netlink message
If the kernel does not support alternative interface names, then
sd_netlink_message_read_strv() should just return -ENODATA.
2020-07-20 15:24:40 +09:00
Yu Watanabe ae5b779252 networkctl: sort alternative names 2020-07-20 15:24:40 +09:00
Franck Bui 0ef1adf512 vconsole-setup: downgrade log message when setting font fails on dummy console
Since commit 883eb9be98, vconsole-setup might be
called again to operate on dummy console where font operations are not
supported but where it's still important to have the correct keymap set [0][1].

vconsole-setup is mainly called by udev but can also be run via a dependency of
an early service. Both cases might end up calling vconsole-setup on the dummy
console.

The first case can happen during early boot even on systems that use (instead
of the dummy console) a "simple" video console driver supporting font
operations (such as vgacon) until a more specific driver (such as i915) takes
the console over. While this is happening vgacon is deactivated and temporarly
replaced by the dummy console [2].

There are also other cases where systemd-vconsole-setup might be called on
dummy console especially during (very) early boot. Indeed
systemd-vconsole-setup.service might be pulled in by early interactive services
such as 'dracut-cmdline-ask.service` which is run before udev.

If that happens on platforms with no grapical HWs (such as embedded ARM) or
with dummy console initially installed until a driver takes over (like Xen and
xen-fbfront) then setting font will fail.

Therefore this patch downgrades the log message emitted when setting font fails
to LOG_DEBUG and when font operations is not implemented like it's the case for
the dummy console.

Fixes: #16406.

[0] https://github.com/systemd/systemd/issues/10826
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1652473
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/vga/vgaarb.c?h=v5.7#n204
2020-07-20 08:15:50 +02:00
Yu Watanabe 628f08b66d sd-netlink: make timeout message sealed
When sd_netlink_call_async() timed out, then we reply the synthetic
error message, but it was not sealed. So, reading the message causes
the following assertion:

```
Assertion 'm->sealed' failed at src/libsystemd/sd-netlink/netlink-message.c:652, function netlink_message_read_internal(). Ignoring.
```
2020-07-20 07:49:55 +02:00
Zbigniew Jędrzejewski-Szmek d735e4f2d6
Merge pull request #16505 from yuwata/network-manage-foreign-routes-cleanups
network: do not enumerate foreign routes when ManageForeignRoutes=no, and tiny cleanups
2020-07-20 07:48:57 +02:00
Luca Boccassi ed4512d009 nspawn: set container_host env vars before user arguments
Allows users on the command line to seamlessly override
$container_host_* just like they can override $container_id and
$container
2020-07-20 07:28:22 +02:00
YmrDtnJu a9c9b18a95 networkd: Use NLM_F_ACK on the netlink message to add a neighbor.
sd_netlink_message_set_flags is called without NLM_F_ACK which results in
a timeout while networkd is waiting for an ACK that the kernel will never send.
2020-07-20 11:30:35 +09:00
Yu Watanabe 4573592ddf
Merge pull request #16512 from keszybz/offline-passwd-altfiles
Support alternate passwd/group locations in tmpfiles
2020-07-19 06:46:05 +09:00
Zbigniew Jędrzejewski-Szmek 241947d1b4 shared/offline-passwd: look at /usr/lib/{passwd,group} too
This changes the code to allow looking at multiple files with different
prefixes, but uses "/etc" and "/usr/lib". rpm-ostree uses
/usr/lib/{passwd,group} with nss-altfiles. I see no harm in simply trying both
paths on all systems.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1857530.

A minor memory leak is fixed: hashmap_put() returns -EEXIST is the key is
present *and* and the value is different. It return 0 if the value is the
same. Thus, we would leak the user/group name if it was specified multiple
times with the same uid/gid. I opted to remove the warning message completely:
with multiple files it is reasonable to have the same name defined more than
once. But even with one file the warning is dubious: all tools that read those
files deal correctly with duplicate entries and we are not writing a linter.
2020-07-18 14:14:19 +02:00
Zbigniew Jędrzejewski-Szmek 3e5d2264b5 Move offline-password.[ch] to shared and add test-offline-passwd
The test binary has two modes: in the default argument-less mode, it
just checks that "root" can be resolved. When invoked manually, a root
prefix and user/group names can be specified.
2020-07-18 14:14:19 +02:00
Yu Watanabe 0119ab3d6c
Merge pull request #16476 from keszybz/qemu-autosuspend-rules
Add autosuspend rules for emulated QEMU devices
2020-07-18 09:10:20 +09:00
Yu Watanabe a8c10331b4 network: replace NDISC -> NDisc in log messages 2020-07-18 05:51:41 +09:00