]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agomeson: do not choke on time epoch when there are no git tags 16557/head
Zbigniew Jędrzejewski-Szmek [Thu, 23 Jul 2020 10:23:58 +0000 (12:23 +0200)] 
meson: do not choke on time epoch when there are no git tags

github ci was failing with:

meson.build:685:16: ERROR: String '' cannot be converted to int

3 years agosemaphore: pull in tree explicitly
Zbigniew Jędrzejewski-Szmek [Thu, 23 Jul 2020 10:17:15 +0000 (12:17 +0200)] 
semaphore: pull in tree explicitly

semaphoreci was failing with:
Can't exec "tree": No such file or directory at /tmp/autopkgtest-lxc.v9oand4g/downtmp/build.TIm/src/test/udev-test.pl line 1752.

https://semaphoreci.com/systemd/systemd/branches/pull-request-16551/builds/1

3 years agoMerge pull request #16496 from DaanDeMeyer/firstboot-shell
Lennart Poettering [Thu, 23 Jul 2020 06:39:45 +0000 (08:39 +0200)] 
Merge pull request #16496 from DaanDeMeyer/firstboot-shell

firstboot: Add --root-shell option and tighten up passwd/shadow handling

3 years agoGet SOURCE_EPOCH from the latest git tag instead of NEWS
Daan De Meyer [Mon, 20 Jul 2020 19:41:48 +0000 (20:41 +0100)] 
Get SOURCE_EPOCH from the latest git tag instead of NEWS

Currently, each change to NEWS triggers a meson reconfigure that
changes SOURCE_EPOCH which causes a full rebuild. Since NEWS changes
relatively often, we have a full rebuild each time we pull from
master even if we pull semi-regularly. This is further compounded
when using branches since NEWS has a relatively high chance to
differ between branches which causes git to update the modification
time, leading to a full rebuild when switching between branches.

We fix this by using the creation time of the latest git tag instead.

3 years agoMerge pull request #16542 from keszybz/make-targets-fail-again
Lennart Poettering [Thu, 23 Jul 2020 06:37:47 +0000 (08:37 +0200)] 
Merge pull request #16542 from keszybz/make-targets-fail-again

Make targets fail again

3 years agoexecute: take ownership of more fields in ExecParameters
Lennart Poettering [Wed, 22 Jul 2020 13:18:43 +0000 (15:18 +0200)] 
execute: take ownership of more fields in ExecParameters

Let's simplify things a bit, and take ownership of more fields in
ExecParameters, so that they are automatically freed when the structure
is released.

3 years agofirstboot: Add --root-shell option 16496/head
Daan De Meyer [Tue, 21 Jul 2020 21:35:21 +0000 (22:35 +0100)] 
firstboot: Add --root-shell option

3 years agofirstboot: Tighten up passwd/shadow handling
Daan De Meyer [Tue, 21 Jul 2020 21:30:16 +0000 (22:30 +0100)] 
firstboot: Tighten up passwd/shadow handling

There are a lot of edge cases that the current implementation
doesn't handle, especially in cases where one of passwd/shadow
exists and the other doesn't exist. For example, if
--root-password is specified, we will write /etc/shadow but
won't add a root entry to /etc/passwd if there is none.

To fix some of these issues, we constrain systemd-firstboot to
only modify /etc/passwd and /etc/shadow if both do not exist
already (or --force) is specified. On top of that, we calculate
all necessary information for both passwd and shadow upfront so
we can take it all into account when writing the actual files.

If no root password options are given --force is specified or both
files do not exist, we lock the root account for security purposes.

3 years agopid1: target units can fail through dependencies 16542/head
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 13:49:29 +0000 (15:49 +0200)] 
pid1: target units can fail through dependencies

Fixes #16401.

c80a9a33d04fb4381327a69ce929c94a9f1d0e6c introduced the .can_fail field,
but didn't set it on .targets. Targets can fail through dependencies.
This leaves .slice and .device units as the types that cannot fail.

$ systemctl cat bad.service bad.target bad-fallback.service
[Service]
Type=oneshot
ExecStart=false

[Unit]
OnFailure=bad-fallback.service

[Service]
Type=oneshot
ExecStart=echo Fixing everythign!

$ sudo systemctl start bad.target
systemd[1]: Starting bad.service...
systemd[1]: bad.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: bad.service: Failed with result 'exit-code'.
systemd[1]: Failed to start bad.service.
systemd[1]: Dependency failed for bad.target.
systemd[1]: bad.target: Job bad.target/start failed with result 'dependency'.
systemd[1]: bad.target: Triggering OnFailure= dependencies.
systemd[1]: Starting bad-fallback.service...
echo[46901]: Fixing everythign!
systemd[1]: bad-fallback.service: Succeeded.
systemd[1]: Finished bad-fallback.service.

3 years agoRevert "units: drop OnFailure= from .target units"
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 10:51:15 +0000 (12:51 +0200)] 
Revert "units: drop OnFailure= from .target units"

This reverts commit c7220ca8025e8dbded36131b23a502d975c45754.

The removal was done as a reaction to the messages from systemd:
initrd-root-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail).
initrd.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail).
initrd-root-device.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail).
initrd-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail).
local-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail).
...
But it seems that the messages themselves are wrong, and the units were OK.

3 years agocore/job: adjust whitespace and comment
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 15:57:23 +0000 (17:57 +0200)] 
core/job: adjust whitespace and comment

3 years agoMerge pull request #16536 from poettering/time-clock-map-fixes
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 11:05:13 +0000 (13:05 +0200)] 
Merge pull request #16536 from poettering/time-clock-map-fixes

time-util: clock mapping improvements

3 years agotest-path: decrease variable scope
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 10:12:54 +0000 (12:12 +0200)] 
test-path: decrease variable scope

3 years agotest: increase timeout for test-path
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 10:12:36 +0000 (12:12 +0200)] 
test: increase timeout for test-path

The CI occasionally fail in test-path with a timeout. test-path loads
units from the filesystem, and this conceivably might take more than
the default limit of 3 s. Increase the timeout substantially to see if
this helps.

3 years agoMerge pull request #16530 from yuwata/udev-fix-race-in-renaming-network-interface
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 09:50:09 +0000 (11:50 +0200)] 
Merge pull request #16530 from yuwata/udev-fix-race-in-renaming-network-interface

udev: fix race in renaming network interface

3 years agoMerge pull request #16407 from bluca/verity_reuse
Lennart Poettering [Wed, 22 Jul 2020 09:36:49 +0000 (11:36 +0200)] 
Merge pull request #16407 from bluca/verity_reuse

verity: re-use already open devices if the hashes match

3 years agoRevert "man: add note about systemd-vconsole-setup.service and tty as input/output"
Zbigniew Jędrzejewski-Szmek [Mon, 20 Jul 2020 06:22:45 +0000 (08:22 +0200)] 
Revert "man: add note about systemd-vconsole-setup.service and tty as input/output"

This reverts commit 0b578036301d7c3f2dab8df1f31f0121552a4e10.

From https://github.com/systemd/systemd/pull/16503#issuecomment-660212813:
systemd-vconsole-setup (the binary) is supposed to run asynchronously by udev
therefore ordering early interactive services after systemd-vconsole-setup.service
has basically no effect.

Let's remove this paragraph. It's better to say nothing than to give pointless
advice.

3 years agotest: adapt test-functions for SUSE
Elisei Roca [Tue, 21 Jul 2020 20:14:53 +0000 (22:14 +0200)] 
test: adapt test-functions for SUSE

3 years agoMerge pull request #16514 from keszybz/zstd-decompress-fix
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 08:40:19 +0000 (10:40 +0200)] 
Merge pull request #16514 from keszybz/zstd-decompress-fix

Fix coredumpctl operation with zstd-compressed journals

3 years agoMerge pull request #16540 from poettering/acl-fix
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 08:34:12 +0000 (10:34 +0200)] 
Merge pull request #16540 from poettering/acl-fix

two ACL handling fixes

3 years agoverity: re-use already open devices if the hashes match 16407/head
Luca Boccassi [Wed, 8 Jul 2020 18:57:31 +0000 (19:57 +0100)] 
verity: re-use already open devices if the hashes match

Opening a verity device is an expensive operation. The kernelspace operations
are mostly sequential with a global lock held regardless of which device
is being opened. In userspace jumps in and out of multiple libraries are
required. When signatures are used, there's the additional cryptographic
checks.

We know when two devices are identical: they have the same root hash.
If libcrypsetup returns EEXIST, double check that the hashes are really
the same, and that either both or none have a signature, and if everything
matches simply remount the already open device. The kernel will do
reference counting for us.

In order to quickly and reliably discover if a device is already open,
change the node naming scheme from '/dev/mapper/major:minor-verity' to
'/dev/mapper/$roothash-verity'.

Unfortunately libdevmapper is not 100% reliable, so in some case it
will say that the device already exists and it is active, but in
reality it is not usable. Fallback to an individually-activated
unique device name in those cases for robustness.

3 years agodm-util: use CRYPT_DEACTIVATE_DEFERRED instead of ioctl
Luca Boccassi [Tue, 14 Jul 2020 14:07:21 +0000 (15:07 +0100)] 
dm-util: use CRYPT_DEACTIVATE_DEFERRED instead of ioctl

3 years agocoredump: port to use common add_acls_for_user() 16540/head
Lennart Poettering [Tue, 21 Jul 2020 20:21:28 +0000 (22:21 +0200)] 
coredump: port to use common add_acls_for_user()

It's line-by-line the same logic, hence use the common implementation.

3 years agoacl-util: fix error handling in add_acls_for_user()
Lennart Poettering [Tue, 21 Jul 2020 20:19:17 +0000 (22:19 +0200)] 
acl-util: fix error handling in add_acls_for_user()

3 years agooffline-passwd: use chase_symlinks()
Lennart Poettering [Tue, 21 Jul 2020 14:25:45 +0000 (16:25 +0200)] 
offline-passwd: use chase_symlinks()

In case the passwd/group file is symlinked, follow things correctly.

Follow-up for: #16512
Addresses: https://github.com/systemd/systemd/pull/16512#discussion_r458073677

3 years agoupdate TODO
Lennart Poettering [Tue, 21 Jul 2020 15:46:14 +0000 (17:46 +0200)] 
update TODO

3 years agoman: update docs with the new functions and other enhancements 16514/head
Zbigniew Jędrzejewski-Szmek [Tue, 21 Jul 2020 15:16:52 +0000 (17:16 +0200)] 
man: update docs with the new functions and other enhancements

3 years agohomectl: fix warning about unused function
Zbigniew Jędrzejewski-Szmek [Sun, 19 Jul 2020 09:05:44 +0000 (11:05 +0200)] 
homectl: fix warning about unused function

../src/home/homectl-pkcs11.c:19:13: warning: ‘pkcs11_callback_data_release’ defined but not used [-Wunused-function]
   19 | static void pkcs11_callback_data_release(struct pkcs11_callback_data *data) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

3 years agoTODO: add entry for XZ
Zbigniew Jędrzejewski-Szmek [Sun, 19 Jul 2020 08:22:21 +0000 (10:22 +0200)] 
TODO: add entry for XZ

The docs for XZ don't seem to answer this at first blush, or maybe
I'm looking in the wrong place... This might make XZ less terribly slow,
but on the other hand, almost nobody uses it, so it doesn't matter that
much.

3 years agojournal/compress: remove loop in decompress_startswith_zstd()
Zbigniew Jędrzejewski-Szmek [Sun, 19 Jul 2020 08:18:46 +0000 (10:18 +0200)] 
journal/compress: remove loop in decompress_startswith_zstd()

This should be more efficient with no downsides. Same considerations as in the
previous commit hold.

3 years agojournal/compress: fix zstd decompression with capped output size
Zbigniew Jędrzejewski-Szmek [Sat, 18 Jul 2020 19:39:03 +0000 (21:39 +0200)] 
journal/compress: fix zstd decompression with capped output size

decompress_blob_zstd() would allocate ever bigger buffers in a loop trying to
get a buffer big enough to decompress the input data. This is wasteful, since
we can just query the size of the decompressed data from the compressed header.
Worse, it doesn't work when the output size is capped, i.e. when dst_max != 0.
If the decompressed blob happened to be bigger than dst_max, decompression
would fail with -ENOBUFS. We need to use "stream decompression" instead, and
only get min(uncompressed size, dst_max) bytes of output.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1856037 in a second way.

3 years agojournal: use -EPROTONOSUPPORT for unknown compression
Zbigniew Jędrzejewski-Szmek [Fri, 17 Jul 2020 19:51:40 +0000 (21:51 +0200)] 
journal: use -EPROTONOSUPPORT for unknown compression

We might add more compression types in the future, and we should treat that
as unsupported, and not a format error.

3 years agosd-journal: when enumerating, continue even after an inaccessible field
Zbigniew Jędrzejewski-Szmek [Fri, 17 Jul 2020 19:00:12 +0000 (21:00 +0200)] 
sd-journal: when enumerating, continue even after an inaccessible field

SD_JOURNAL_FOREACH_DATA() and SD_JOURNAL_FOREACH_UNIQUE() would immediately
terminate when a field couldn't be accessed. This can happen for example when a
field is compressed with an unavailable compression format. But it's likely
that this is the wrong thing to do: the caller for example might want to
iterate over the fields but isn't interested in all of them. coredumpctl is
like this: it uses SD_JOURNAL_FOREACH_DATA() but only uses a subset of the
fields.

Add two new functions sd_journal_enumerate_good_data() and
sd_journal_enumerate_good_unique() that retry sd_journal_enumerate_data() and
sd_journal_enumerate_unique() if the return value is something that applies to
a single field: ENOBUS, E2BIG, EOPNOTSUPP.

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

An alternative would be to make the macros themselves smarter instead of adding
new symbols, and do the looping internally in the macro. I don't like that
approach for two reasons. First, it would embed the logic in the macro, so
recompilation would be required if we decide to update the logic. With the
current version of the patch, recompilation is required to use the new symbols,
but after that, library upgrades are enough. So the current approach is safer
in case further updates are needed. Second, our headers use primitive C, and it
is hard to do the macros without using newer features.

3 years agouser-util: indentation fix
Lennart Poettering [Tue, 21 Jul 2020 07:56:21 +0000 (09:56 +0200)] 
user-util: indentation fix

3 years agocore: don't acquire dual timestamp needlessly if we don't need it in .timer handling 16536/head
Lennart Poettering [Tue, 21 Jul 2020 15:33:19 +0000 (17:33 +0200)] 
core: don't acquire dual timestamp needlessly if we don't need it in .timer handling

Follow-up for: 26698337f3842842af51cd007485f1dcd7c43cf2

3 years agotest: add basic test for clock mapping
Lennart Poettering [Tue, 21 Jul 2020 15:33:36 +0000 (17:33 +0200)] 
test: add basic test for clock mapping

3 years agotime-util: rework clock conversion logic
Lennart Poettering [Tue, 21 Jul 2020 15:30:49 +0000 (17:30 +0200)] 
time-util: rework clock conversion logic

Let's split this out into its own helper function we can reuse at
various places.

Also, let's avoid signed values where we can so that we can cover more
of the available time range.

3 years agoupdate NEWS
Lennart Poettering [Tue, 21 Jul 2020 14:24:41 +0000 (16:24 +0200)] 
update NEWS

3 years agoMerge pull request #16504 from poettering/read-file-ipc
Lennart Poettering [Tue, 21 Jul 2020 12:16:32 +0000 (14:16 +0200)] 
Merge pull request #16504 from poettering/read-file-ipc

fileio: teach read_full_file() the ability to read data from AF_UNIX stream socket

3 years agoimport: always prefer GNU tar, to avoid cmdline incompatibilities
Lennart Poettering [Tue, 21 Jul 2020 09:13:54 +0000 (11:13 +0200)] 
import: always prefer GNU tar, to avoid cmdline incompatibilities

Fixes: #16506
3 years agofileio: add brief explanations for flags 16504/head
Lennart Poettering [Tue, 21 Jul 2020 08:19:34 +0000 (10:19 +0200)] 
fileio: add brief explanations for flags

3 years agotree-wide: use READ_FULL_FILE_CONNECT_SOCKET at various places
Lennart Poettering [Fri, 17 Jul 2020 10:58:19 +0000 (12:58 +0200)] 
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.)

3 years agofileio: allow to read base64/hex data as strings
Lennart Poettering [Fri, 17 Jul 2020 10:57:00 +0000 (12:57 +0200)] 
fileio: allow to read base64/hex data as strings

There's really no reason to prohibit this, hence don't.

3 years agofileio: add support for read_full_file() on AF_UNIX stream sockets
Lennart Poettering [Fri, 17 Jul 2020 10:26:01 +0000 (12:26 +0200)] 
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.

3 years agofileio: add explicit flag for generating world executable warning when reading file
Lennart Poettering [Fri, 17 Jul 2020 09:53:22 +0000 (11:53 +0200)] 
fileio: add explicit flag for generating world executable warning when reading file

3 years agoMerge pull request #16519 from yuwata/networkctl-altnames
Zbigniew Jędrzejewski-Szmek [Tue, 21 Jul 2020 07:10:00 +0000 (09:10 +0200)] 
Merge pull request #16519 from yuwata/networkctl-altnames

networkctl: tiny cleanups about alternative names

3 years agoMerge pull request #16353 from yuwata/network-dns-sni
Zbigniew Jędrzejewski-Szmek [Tue, 21 Jul 2020 06:06:17 +0000 (08:06 +0200)] 
Merge pull request #16353 from yuwata/network-dns-sni

resolve, network: more SNI and port number support

3 years agoudev: drop unnecessary checks 16530/head
Yu Watanabe [Tue, 21 Jul 2020 02:39:44 +0000 (11:39 +0900)] 
udev: drop unnecessary checks

Also, drop one unnecessary sd_device_unref(), as dev_db_clone will be
unref()ed in udev_event_free().

3 years agoudev: save ID_RENAMING= property to database before renaming network interface
Yu Watanabe [Tue, 21 Jul 2020 02:29:06 +0000 (11:29 +0900)] 
udev: save ID_RENAMING= property to database before renaming network interface

3 years agonetwork: update one log message
Yu Watanabe [Tue, 21 Jul 2020 01:33:57 +0000 (10:33 +0900)] 
network: update one log message

3 years agotest: run systemd-dissect and systemd-run with log level debug in TEST-50-DISSECT
Luca Boccassi [Mon, 20 Jul 2020 15:43:18 +0000 (16:43 +0100)] 
test: run systemd-dissect and systemd-run with log level debug in TEST-50-DISSECT

3 years agologind: Fix org.freedesktop.login1.set-reboot-to-boot-loader-menu saving to the wrong...
Hans de Goede [Mon, 20 Jul 2020 13:06:43 +0000 (15:06 +0200)] 
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.

3 years agobus: use bus_log_connect_error to print error message
fangxiuning [Mon, 20 Jul 2020 11:20:52 +0000 (19:20 +0800)] 
bus: use bus_log_connect_error to print error message

3 years agoman: update explanation about the format to specify DNS servers 16353/head
Yu Watanabe [Sun, 19 Jul 2020 04:57:51 +0000 (13:57 +0900)] 
man: update explanation about the format to specify DNS servers

3 years agoresolvectl: use bus_message_read_in_addr_auto()
Yu Watanabe [Sun, 19 Jul 2020 03:43:39 +0000 (12:43 +0900)] 
resolvectl: use bus_message_read_in_addr_auto()

3 years agonetwork, resolve: use bus_message_read_ifindex() or friends
Yu Watanabe [Sun, 19 Jul 2020 03:32:21 +0000 (12:32 +0900)] 
network, resolve: use bus_message_read_ifindex() or friends

3 years agoutil: introduce bus_message_read_ifindex()
Yu Watanabe [Sun, 19 Jul 2020 03:07:27 +0000 (12:07 +0900)] 
util: introduce bus_message_read_ifindex()

3 years agoutil: introduce bus_mesage_read_dns_servers()
Yu Watanabe [Sun, 19 Jul 2020 02:32:18 +0000 (11:32 +0900)] 
util: introduce bus_mesage_read_dns_servers()

3 years agoutil: introduce helper functions to read in_addr from bus message
Yu Watanabe [Sun, 19 Jul 2020 01:57:04 +0000 (10:57 +0900)] 
util: introduce helper functions to read in_addr from bus message

3 years agoutil: drop duplicated inclusion of sd-bus.h
Yu Watanabe [Sun, 19 Jul 2020 01:43:04 +0000 (10:43 +0900)] 
util: drop duplicated inclusion of sd-bus.h

3 years agotest-network: add tests for DNS= with port number and SNI
Yu Watanabe [Fri, 3 Jul 2020 13:16:55 +0000 (22:16 +0900)] 
test-network: add tests for DNS= with port number and SNI

3 years agoresolvectl: show DNS servers with port and SNI
Yu Watanabe [Fri, 3 Jul 2020 12:24:25 +0000 (21:24 +0900)] 
resolvectl: show DNS servers with port and SNI

3 years agoresolvectl: make DNS servers can be specified with port number and SNI
Yu Watanabe [Fri, 3 Jul 2020 12:05:15 +0000 (21:05 +0900)] 
resolvectl: make DNS servers can be specified with port number and SNI

3 years agoresolve: add DBus properties which support DNS SNI and port number
Yu Watanabe [Fri, 3 Jul 2020 12:03:51 +0000 (21:03 +0900)] 
resolve: add DBus properties which support DNS SNI and port number

3 years agoresolve: add DBus method to set DNS server with port number and SNI
Yu Watanabe [Fri, 3 Jul 2020 11:31:15 +0000 (20:31 +0900)] 
resolve: add DBus method to set DNS server with port number and SNI

3 years agonetwork: add DBus method to set DNS server with port number and SNI
Yu Watanabe [Fri, 3 Jul 2020 11:03:00 +0000 (20:03 +0900)] 
network: add DBus method to set DNS server with port number and SNI

3 years agonetwork: save DNS servers specified by DBus interface
Yu Watanabe [Fri, 3 Jul 2020 09:34:37 +0000 (18:34 +0900)] 
network: save DNS servers specified by DBus interface

Also, filter out DNS servers which do not match link ifindex.

3 years agonetwork: do not save DNS= entries not match link ifindex
Yu Watanabe [Fri, 3 Jul 2020 09:29:13 +0000 (18:29 +0900)] 
network: do not save DNS= entries not match link ifindex

3 years agonetwork: support port number and SNI in [Network] DNS=
Yu Watanabe [Fri, 3 Jul 2020 07:48:29 +0000 (16:48 +0900)] 
network: support port number and SNI in [Network] DNS=

3 years agoresolve: read/save port number and SNI from/into link state file
Yu Watanabe [Mon, 13 Jul 2020 00:29:14 +0000 (09:29 +0900)] 
resolve: read/save port number and SNI from/into link state file

3 years agoresolve: compare port and SNI in dns_server_hash_ops
Yu Watanabe [Mon, 13 Jul 2020 00:11:49 +0000 (09:11 +0900)] 
resolve: compare port and SNI in dns_server_hash_ops

3 years agoresolve: also compare port and SNI in dns_server_find()
Yu Watanabe [Mon, 13 Jul 2020 00:05:15 +0000 (09:05 +0900)] 
resolve: also compare port and SNI in dns_server_find()

3 years agoresolve: support port specifier in DNS= setting
Yu Watanabe [Sun, 12 Jul 2020 23:58:02 +0000 (08:58 +0900)] 
resolve: support port specifier in DNS= setting

3 years agoresolve: ignore empty server name
Yu Watanabe [Sun, 12 Jul 2020 23:27:10 +0000 (08:27 +0900)] 
resolve: ignore empty server name

Just for safety.

3 years agoutil: introduce 'struct in_addr_full' and its helper functions
Yu Watanabe [Sun, 12 Jul 2020 22:09:55 +0000 (07:09 +0900)] 
util: introduce 'struct in_addr_full' and its helper functions

3 years agoutil: introduce in_addr_port_ifindex_name_from_string_auto() and in_addr_port_ifindex...
Yu Watanabe [Sun, 12 Jul 2020 21:49:41 +0000 (06:49 +0900)] 
util: introduce in_addr_port_ifindex_name_from_string_auto() and in_addr_port_ifindex_name_to_string()

3 years agoresolve: propagate error in link_load_user()
Yu Watanabe [Thu, 2 Jul 2020 01:25:19 +0000 (10:25 +0900)] 
resolve: propagate error in link_load_user()

Most error path in link_load_user() are ENOMEM. Hence, it is critical.

3 years agoMerge pull request #16518 from yuwata/network-fix-failure-in-updating-mac-address
Yu Watanabe [Mon, 20 Jul 2020 17:13:24 +0000 (02:13 +0900)] 
Merge pull request #16518 from yuwata/network-fix-failure-in-updating-mac-address

network: fix failures in updating MAC address

3 years agotravis: compile with -O1 with clang
Frantisek Sumsal [Mon, 20 Jul 2020 15:51:32 +0000 (17:51 +0200)] 
travis: compile with -O1 with clang

libc in the Debian container got updated to 2.31, which in combination
with clang-9 triggers systemd/systemd#14865.

This has been fixed by https://reviews.llvm.org/D74712 which is (to my
knowledge) included in clang-10. To mitigate this without upgrading to
clang-10 we can compile with -O1 which works around it as well, see
https://bugzilla.redhat.com/show_bug.cgi?id=1803203.

3 years agodocs: Document xdg-autostart parameter X-systemd-skip
David Edmundson [Mon, 20 Jul 2020 11:42:13 +0000 (12:42 +0100)] 
docs: Document xdg-autostart parameter X-systemd-skip

3 years agoMerge pull request #16478 from bluca/dissect_tests
Zbigniew Jędrzejewski-Szmek [Mon, 20 Jul 2020 10:59:56 +0000 (12:59 +0200)] 
Merge pull request #16478 from bluca/dissect_tests

Expand TEST-50-DISSECT to cover dm-verity features

3 years agodocs: Update section about XDG autostart generator
Benjamin Berg [Mon, 20 Jul 2020 08:45:48 +0000 (10:45 +0200)] 
docs: Update section about XDG autostart generator

The generator is already merged. So update the corresponding section to
describe the current status.

3 years agoMerge pull request #16497 from DaanDeMeyer/mkosi
Zbigniew Jędrzejewski-Szmek [Mon, 20 Jul 2020 07:03:51 +0000 (09:03 +0200)] 
Merge pull request #16497 from DaanDeMeyer/mkosi

mkosi: Keep mkosi.default out of the repository

3 years agoMerge pull request #16501 from yuwata/udev-fix-renaming
Zbigniew Jędrzejewski-Szmek [Mon, 20 Jul 2020 07:00:02 +0000 (09:00 +0200)] 
Merge pull request #16501 from yuwata/udev-fix-renaming

udev: fix issues in renaming interface vs alternative names

3 years agonetwork: stop already running engines before updating MAC address 16518/head
Yu Watanabe [Sun, 19 Jul 2020 16:40:21 +0000 (01:40 +0900)] 
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
```

3 years agoradv: introduce sd_radv_is_running()
Yu Watanabe [Sun, 19 Jul 2020 16:46:57 +0000 (01:46 +0900)] 
radv: introduce sd_radv_is_running()

3 years agonetworkctl: do not ignore -EOPNOTSUPP when reading netlink message 16519/head
Yu Watanabe [Mon, 20 Jul 2020 04:43:38 +0000 (13:43 +0900)] 
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.

3 years agonetworkctl: sort alternative names
Yu Watanabe [Mon, 20 Jul 2020 04:42:49 +0000 (13:42 +0900)] 
networkctl: sort alternative names

3 years agovconsole-setup: downgrade log message when setting font fails on dummy console
Franck Bui [Thu, 16 Jul 2020 19:22:37 +0000 (21:22 +0200)] 
vconsole-setup: downgrade log message when setting font fails on dummy console

Since commit 883eb9be985fd86d9cabe967eeeab91cdd396a81, 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

3 years agosd-netlink: make timeout message sealed
Yu Watanabe [Sun, 19 Jul 2020 15:57:40 +0000 (00:57 +0900)] 
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.
```

3 years agoMerge pull request #16505 from yuwata/network-manage-foreign-routes-cleanups
Zbigniew Jędrzejewski-Szmek [Mon, 20 Jul 2020 05:48:57 +0000 (07:48 +0200)] 
Merge pull request #16505 from yuwata/network-manage-foreign-routes-cleanups

network: do not enumerate foreign routes when ManageForeignRoutes=no, and tiny cleanups

3 years agonspawn: set container_host env vars before user arguments
Luca Boccassi [Sun, 19 Jul 2020 12:11:52 +0000 (13:11 +0100)] 
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

3 years agonetworkd: Use NLM_F_ACK on the netlink message to add a neighbor.
YmrDtnJu [Sun, 19 Jul 2020 15:04:46 +0000 (17:04 +0200)] 
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.

3 years agoclang-format: set Break afer enum to false
Norbert Lange [Sat, 18 Jul 2020 23:40:06 +0000 (01:40 +0200)] 
clang-format: set Break afer enum to false

if set to true, the opening bracket will be moved to the next line.

3 years agoMerge pull request #16512 from keszybz/offline-passwd-altfiles
Yu Watanabe [Sat, 18 Jul 2020 21:46:05 +0000 (06:46 +0900)] 
Merge pull request #16512 from keszybz/offline-passwd-altfiles

Support alternate passwd/group locations in tmpfiles

3 years agoshared/offline-passwd: look at /usr/lib/{passwd,group} too 16512/head
Zbigniew Jędrzejewski-Szmek [Sat, 18 Jul 2020 12:06:19 +0000 (14:06 +0200)] 
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.

3 years agoMove offline-password.[ch] to shared and add test-offline-passwd
Zbigniew Jędrzejewski-Szmek [Sat, 18 Jul 2020 12:03:51 +0000 (14:03 +0200)] 
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.

3 years agobuild: skip installation of 2 files if feature is disabled
Norbert Lange [Mon, 13 Jul 2020 22:49:25 +0000 (00:49 +0200)] 
build: skip installation of 2 files if feature is disabled

dont install systemd-update-utmp if utmp is disabled.
dont install systemd-initctl.service if sysv is disabled.

3 years agoMerge pull request #16476 from keszybz/qemu-autosuspend-rules
Yu Watanabe [Sat, 18 Jul 2020 00:10:20 +0000 (09:10 +0900)] 
Merge pull request #16476 from keszybz/qemu-autosuspend-rules

Add autosuspend rules for emulated QEMU devices

3 years agonetwork: replace NDISC -> NDisc in log messages 16505/head
Yu Watanabe [Fri, 17 Jul 2020 20:46:53 +0000 (05:46 +0900)] 
network: replace NDISC -> NDisc in log messages