]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
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 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 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

3 years agonetwork: introduce address_exists() helper function
Yu Watanabe [Fri, 17 Jul 2020 20:42:59 +0000 (05:42 +0900)] 
network: introduce address_exists() helper function

3 years agonetwork: update debug log when foreign routes are received with ManageForeignRoutes=no
Yu Watanabe [Fri, 17 Jul 2020 20:17:31 +0000 (05:17 +0900)] 
network: update debug log when foreign routes are received with ManageForeignRoutes=no

3 years agonetwork: do not enumerate routes if ManageForeignRoutes=no
Yu Watanabe [Fri, 17 Jul 2020 20:12:33 +0000 (05:12 +0900)] 
network: do not enumerate routes if ManageForeignRoutes=no

3 years agoudev: do not try to reassign alternative names 16501/head
Yu Watanabe [Fri, 17 Jul 2020 12:36:05 +0000 (21:36 +0900)] 
udev: do not try to reassign alternative names

Setting alternative names may fail if some of them are already assigned.

3 years agonetlink: do not fail when new interface name is already used as an alternative name
Yu Watanabe [Fri, 17 Jul 2020 12:31:24 +0000 (21:31 +0900)] 
netlink: do not fail when new interface name is already used as an alternative name

When renaming a network interface, the new name may be used as an
alternative name. In that case, let's swap the current name and the
alternative name. That is, first drop the new name from the list of
alternative names, then rename the interface, finally set the old name
as an alternative name.

3 years agonetlink: introduce rtnl_get/delete_link_alternative_names()
Yu Watanabe [Fri, 17 Jul 2020 12:29:13 +0000 (21:29 +0900)] 
netlink: introduce rtnl_get/delete_link_alternative_names()

3 years agohwdb: check that uppercase digits are used in modalias patterns 16476/head
Zbigniew Jędrzejewski-Szmek [Fri, 17 Jul 2020 09:09:31 +0000 (11:09 +0200)] 
hwdb: check that uppercase digits are used in modalias patterns

This is all confusing as hell, becuase in some places lowercase hexadecimal
digits are used, and in other places uppercase. This adds a check for the
most common case that we and others got wrong.

I tried to extend the general grammar in hwdb_grammar() to include this check,
but it quickly became very complicated and didn't seem to work properly. Doing
initial parsing with more general rules is easier and also seems to give better
error messages:

/home/zbyszek/src/systemd-work/build/../hwdb.d/60-autosuspend.hwdb: 3 match groups, 5 matches, 3 properties
Pattern 'v058fp9540*' is invalid: Expected W:(0123...), found 'f'  (at char 4), (line:1, col:5)

3 years agoMerge pull request #16490 from yuwata/network-radv-ndisc-cleanups
Yu Watanabe [Fri, 17 Jul 2020 06:12:53 +0000 (15:12 +0900)] 
Merge pull request #16490 from yuwata/network-radv-ndisc-cleanups

network: cleanups for radv and ndisc

3 years agohwdb: allow spaces in usb: matches and similar patterns
Zbigniew Jędrzejewski-Szmek [Fri, 17 Jul 2020 05:44:10 +0000 (07:44 +0200)] 
hwdb: allow spaces in usb: matches and similar patterns

In the past we didn't have any matches like that, so the parser was stricter
than necessary, but now we have, so allow that.

3 years agoMerge pull request #16491 from keszybz/udev-logging
Zbigniew Jędrzejewski-Szmek [Fri, 17 Jul 2020 05:12:58 +0000 (07:12 +0200)] 
Merge pull request #16491 from keszybz/udev-logging

Improvements to udev logging and related code

3 years agomkosi: Update help comment in settings files 16497/head
Daan De Meyer [Thu, 16 Jul 2020 20:41:11 +0000 (21:41 +0100)] 
mkosi: Update help comment in settings files

3 years agomkosi: Keep mkosi.default out of the repository.
Daan De Meyer [Thu, 16 Jul 2020 20:27:50 +0000 (21:27 +0100)] 
mkosi: Keep mkosi.default out of the repository.

Defaulting to fedora makes it a pain to override mkosi.default
point to one of the other mkosi settings files. Instead, have
every developer manually add the symlink to his distro
of choice and don't commit the symlink to the repository by
putting it in the .gitignore.

3 years agotree-wide: use SYNTHETIC_ERRNO with log_device_* in more places 16491/head
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 16:04:45 +0000 (18:04 +0200)] 
tree-wide: use SYNTHETIC_ERRNO with log_device_* in more places

3 years agosd-device: use LOG_PRI() in log_device_full()
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 14:23:57 +0000 (16:23 +0200)] 
sd-device: use LOG_PRI() in log_device_full()

We use LOG_PRI() in all log_*() functions, so let's do that here too for
consistency. Effectively this doesn't change anything since we only use
LOG_{INFO,DEBUG,...} as the argument.

3 years agoanalyze: CAP_RAWIO -> CAP_SYS_RAWIO
Anita Zhang [Thu, 16 Jul 2020 18:36:28 +0000 (11:36 -0700)] 
analyze: CAP_RAWIO -> CAP_SYS_RAWIO

Fixes #16489

3 years agoAdd autosuspend rules for emulated QEMU devices
Zbigniew Jędrzejewski-Szmek [Wed, 15 Jul 2020 16:13:40 +0000 (18:13 +0200)] 
Add autosuspend rules for emulated QEMU devices

This effectively partially reverts "rules: remove all power management from
udev" / e2452eef02a839e1928f4ffd893c93a460474ab6. The rules for emulated QEMU
hardware were removed in one fell swoop with other rules which were causing
problems. But the qemu rules were working properly (and were adjusted through
patches over time). Nowadays we have a hwdb for this, so add hwdb entries using
the new detailed modalias.

https://github.com/systemd/systemd/pull/353#issuecomment-658810289

3 years agoudev: change the modalias string for usb devices to include the device name
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 14:24:14 +0000 (16:24 +0200)] 
udev: change the modalias string for usb devices to include the device name

When the kernel does not provide a modalias, we generate our own for usb devices.
For some reason, we generated the expected usb:vXXXXpYYYY string, suffixed by "*".
It was added that way already in 796b06c21b62d13c9021e2fbd9c58a5c6edb2764, but I
think that was a mistake, and Kay was thinking about the match pattern instead
of the matched string.

For example, for a qemu device:
old: "usb:v0627p0001*"
new: "usb:v0627p0001:QEMU USB Tablet"

On the match side, all hwdb files in the wild seem to be using match patterns
with "*" at the end. So we can add more stuff to our generated modalias with
impunity.

This will allow more obvious and more certain matches on USB devices. In
principle the vendor+product id should be unique, but it's only 8 digits, and
there's a high chance of people getting this wrong. And matching the wrong
device would be quite problematic. By including the name in the match string we
make a mismatch much less likely.

3 years agoudev: don't complain when udev_watch_end() is called without udev_watch_init()
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 14:12:42 +0000 (16:12 +0200)] 
udev: don't complain when udev_watch_end() is called without udev_watch_init()

E.g. udevadm test prints "Invalid inotify descriptor." which is
meaningless without any context. I think it should be OK to call udev_watch_end()
from a cleanup path without any warning (even at debug level).

3 years agobasic/string-table: reduce variable scope
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 13:57:36 +0000 (15:57 +0200)] 
basic/string-table: reduce variable scope

3 years agoudevadm: use STR_IN_SET(), add comment
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 13:55:10 +0000 (15:55 +0200)] 
udevadm: use STR_IN_SET(), add comment

3 years agosd-device: use strjoin instead of asprintf
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 13:20:57 +0000 (15:20 +0200)] 
sd-device: use strjoin instead of asprintf

strjoin should be faster for string concatenation.
Also drop "_"-prefix from function prototypes.

3 years agoudev: tweak debug logs for udev rules
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 13:04:21 +0000 (15:04 +0200)] 
udev: tweak debug logs for udev rules

We shouldn't say "ignoring" when running a program because the result is used for
the match/nomatch result of the rule.

3 years agoman: add more details for IMPORT, PROGRAM and RUN keys
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 12:56:16 +0000 (14:56 +0200)] 
man: add more details for IMPORT, PROGRAM and RUN keys

967de8faceaa83c11a1215515cb135d7a8c0c32c added a note that I found very hard
to understand. Reword it, and also describe how IMPORT and PROGRAM are different
from RUN.

Minor markup adjustements too.

3 years agoudev: accept OPTIONS+= without any fuss
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 14:04:35 +0000 (16:04 +0200)] 
udev: accept OPTIONS+= without any fuss

There is no reason to consider this wrong. In fact one could argue that +=
is more appropriate, because we always add to options, and not replace previous
assignments. If we output a debug message, we implicitly ask people to "fix" this,
and we shouldn't.

Also, all our rules use += right now.

3 years agoudev: accept IMPORT{}= without any fuss
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 11:56:57 +0000 (13:56 +0200)] 
udev: accept IMPORT{}= without any fuss

Udev logs are full of messages about wrong operator type:
...
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:54 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:57 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:60 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:63 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:66 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:67 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:93 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:107 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:110 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:113 IMPORT key takes '==' or '!=' operator, assuming '=='.
Reading rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
/usr/lib/udev/rules.d/60-persistent-v4l.rules:7 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-v4l.rules:9 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-v4l.rules:16 IMPORT key takes '==' or '!=' operator, assuming '=='.
...

The warning was downgraded in f0beb6f816035e438d684cc52ae76fc4a44fc197, but I
think it should be removed altogether. IMPORT{program}="asdf" seems like an
obvious way to write this, and people don't expect to have to write "==".
So let's just allow any operator.

3 years agonetwork: ndisc: any failures in processing event make the link in failed state 16490/head
Yu Watanabe [Thu, 16 Jul 2020 16:13:17 +0000 (01:13 +0900)] 
network: ndisc: any failures in processing event make the link in failed state

Also adjust log levels.

3 years agonetwork: radv: clean up conf parsers
Yu Watanabe [Thu, 16 Jul 2020 10:12:40 +0000 (19:12 +0900)] 
network: radv: clean up conf parsers

3 years agohwdb/autosuspend: add missing parenthesis
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 09:40:53 +0000 (11:40 +0200)] 
hwdb/autosuspend: add missing parenthesis

3 years agonetwork: downgrade log level in conf parsers
Yu Watanabe [Thu, 16 Jul 2020 05:48:08 +0000 (14:48 +0900)] 
network: downgrade log level in conf parsers

3 years agoMerge pull request #16485 from bluca/nspawn_os_release_mounts
Lennart Poettering [Thu, 16 Jul 2020 13:09:35 +0000 (15:09 +0200)] 
Merge pull request #16485 from bluca/nspawn_os_release_mounts

Follow-up for comments on #15891

3 years agoMerge pull request #16482 from poettering/coverity-246
Yu Watanabe [Thu, 16 Jul 2020 11:23:23 +0000 (20:23 +0900)] 
Merge pull request #16482 from poettering/coverity-246

two coverity fixes

3 years agonspawn: mount os-release in two steps to make it read-only 16485/head
Luca Boccassi [Thu, 16 Jul 2020 08:47:16 +0000 (09:47 +0100)] 
nspawn: mount os-release in two steps to make it read-only

The kernel interface requires setting up read-only bind-mounts in
two steps, the bind first and then a read-only remount.
Fix nspawn-mount, and cover this case in the integration test.

Fixes #16484

3 years agonspawn: use access/F_OK instead of stat to check for file existence
Luca Boccassi [Thu, 16 Jul 2020 08:46:16 +0000 (09:46 +0100)] 
nspawn: use access/F_OK instead of stat to check for file existence

3 years agoshared/os-util: fix comment style to follow guidelines
Luca Boccassi [Thu, 16 Jul 2020 08:45:44 +0000 (09:45 +0100)] 
shared/os-util: fix comment style to follow guidelines

3 years agobasic/mkdir: use uid_is_valid instead of manual check
Luca Boccassi [Thu, 16 Jul 2020 08:45:22 +0000 (09:45 +0100)] 
basic/mkdir: use uid_is_valid instead of manual check

3 years agoMerge pull request #16483 from poettering/man-env-d-no-session
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 08:06:35 +0000 (10:06 +0200)] 
Merge pull request #16483 from poettering/man-env-d-no-session

man: three minor fixes to environment.d/ man page

3 years agoMerge pull request #16480 from yuwata/network-fix-dhcp4-races
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 08:04:05 +0000 (10:04 +0200)] 
Merge pull request #16480 from yuwata/network-fix-dhcp4-races

network: fix two minor races in DHCP4 handling

3 years agoman: configuration files contain assignments, no directories 16483/head
Lennart Poettering [Thu, 16 Jul 2020 07:26:55 +0000 (09:26 +0200)] 
man: configuration files contain assignments, no directories

3 years agoman: GNOME is usually capitalized
Lennart Poettering [Thu, 16 Jul 2020 07:26:38 +0000 (09:26 +0200)] 
man: GNOME is usually capitalized

3 years agoman: don't claim environment.d/ was about sessions
Lennart Poettering [Thu, 16 Jul 2020 07:25:22 +0000 (09:25 +0200)] 
man: don't claim environment.d/ was about sessions

This only sets the environment for user *services*, it has no effect on
sessions, as those get an env block set up by whatever program sets them
up and not systemd.

3 years agoRevert "selinux: cache enforced status and treat retrieve failure as enforced mode"
Lennart Poettering [Tue, 14 Jul 2020 13:18:10 +0000 (15:18 +0200)] 
Revert "selinux: cache enforced status and treat retrieve failure as enforced mode"

This reverts commit 257188f80ce1a083e3a88b679b898a73fecab53b.

3 years agomachine: fix if check 16482/head
Lennart Poettering [Thu, 16 Jul 2020 06:32:23 +0000 (08:32 +0200)] 
machine: fix if check

Fixes: coverity 1430462
3 years agoexecute: fix if check
Lennart Poettering [Thu, 16 Jul 2020 06:32:15 +0000 (08:32 +0200)] 
execute: fix if check

Fixes: coverity 1430459
3 years agodhcp4: only renewing lease when the client already has a lease
Yu Watanabe [Wed, 15 Jul 2020 10:25:55 +0000 (19:25 +0900)] 
dhcp4: only renewing lease when the client already has a lease

Follow-up for ceaec54a3c8366e81863a7d0d9c1f1d9f09960e1.

Hopefully fixes #16299.

3 years agoload-fragment: downgrade log messages we ignore to LOG_WARNING
Lennart Poettering [Wed, 15 Jul 2020 15:44:03 +0000 (17:44 +0200)] 
load-fragment: downgrade log messages we ignore to LOG_WARNING

We typically don't log above LOG_WARNING about issues we then go on to
ignore. Do so here, too

3 years agomountpoint-util: fix error handling
Lennart Poettering [Wed, 15 Jul 2020 15:43:10 +0000 (17:43 +0200)] 
mountpoint-util: fix error handling

3 years agonetwork: dhcp4: add two warnings 16480/head
Yu Watanabe [Thu, 16 Jul 2020 01:43:49 +0000 (10:43 +0900)] 
network: dhcp4: add two warnings

3 years agonetwork: dhcp4: fix another race with SendDecline=yes
Yu Watanabe [Thu, 16 Jul 2020 01:31:49 +0000 (10:31 +0900)] 
network: dhcp4: fix another race with SendDecline=yes

If the SD_IPV4ACD_EVENT_BIND event happens before all routes are
assigned, then the link stuck in configuring state.

3 years agonetwork: dhcp4: also release old lease in dhcp_lease_lost()
Yu Watanabe [Thu, 16 Jul 2020 01:12:18 +0000 (10:12 +0900)] 
network: dhcp4: also release old lease in dhcp_lease_lost()

The lease lost may happen during renewing address. If it happens,
assertion hits in dhcp4_release_old_lease().

3 years agocore: fix invalid assertion
Lennart Poettering [Wed, 15 Jul 2020 16:49:08 +0000 (18:49 +0200)] 
core: fix invalid assertion

We miscounted here, and would hit an assert once too early.

3 years agonetwork: fix typo
Christian Göttsche [Wed, 15 Jul 2020 15:09:11 +0000 (17:09 +0200)] 
network: fix typo

3 years agotest: exercise RootImage, RootHash and RootVerity in TEST-50-DISSECT 16478/head
Luca Boccassi [Wed, 15 Jul 2020 16:54:12 +0000 (17:54 +0100)] 
test: exercise RootImage, RootHash and RootVerity in TEST-50-DISSECT

Run with both the single-filesystem image and the GPT image

3 years agotest: pre-assemble minimal image for TEST-50-DISSECT at build time
Luca Boccassi [Wed, 15 Jul 2020 16:17:31 +0000 (17:17 +0100)] 
test: pre-assemble minimal image for TEST-50-DISSECT at build time

Easier than in the limited VM environment

3 years agotest: exercise systemd-dissect with GPT and verity in TEST-50-DISSECT
Luca Boccassi [Fri, 10 Jul 2020 15:01:15 +0000 (16:01 +0100)] 
test: exercise systemd-dissect with GPT and verity in TEST-50-DISSECT

3 years agotest: exercise systemd-dissect --mount in TEST-50-DISSECT
Luca Boccassi [Fri, 10 Jul 2020 09:30:33 +0000 (10:30 +0100)] 
test: exercise systemd-dissect --mount in TEST-50-DISSECT

3 years agoupdate TODO
Lennart Poettering [Wed, 15 Jul 2020 15:41:34 +0000 (17:41 +0200)] 
update TODO

3 years agoMerge pull request #16396 from yuwata/network-configured-flag
Zbigniew Jędrzejewski-Szmek [Wed, 15 Jul 2020 13:45:38 +0000 (15:45 +0200)] 
Merge pull request #16396 from yuwata/network-configured-flag

network: about xxx_configured flags

3 years agoMerge pull request #16468 from keszybz/two-unrelated-patches
Zbigniew Jędrzejewski-Szmek [Wed, 15 Jul 2020 11:40:22 +0000 (13:40 +0200)] 
Merge pull request #16468 from keszybz/two-unrelated-patches

Two unrelated patches

3 years agonetwork: drop doubled white space 16396/head
Yu Watanabe [Tue, 14 Jul 2020 18:40:26 +0000 (03:40 +0900)] 
network: drop doubled white space

3 years agonetwork: free address when it is removed
Yu Watanabe [Tue, 14 Jul 2020 17:00:06 +0000 (02:00 +0900)] 
network: free address when it is removed

3 years agonetwork: dhcp4: do not assign new address before old one is not removed
Yu Watanabe [Tue, 14 Jul 2020 16:30:09 +0000 (01:30 +0900)] 
network: dhcp4: do not assign new address before old one is not removed

If DHCP4 client lost a lease, and then soon acquire new lease, then
the removal of the old address may not be completed. If that happens,
and the new and old addresses are the same, then the new address will be
considered as a foreign address. Such a situation can occur when the
DHCP4 server is restarted.

This makes networkd wait for the removal of the old address when a new
lease is acquired.

This also makes the link in configuring state when renewing address.

3 years agonetwork: do not call link_check_ready() in link_request_set_routing_policy_rule()
Yu Watanabe [Tue, 14 Jul 2020 03:48:02 +0000 (12:48 +0900)] 
network: do not call link_check_ready() in link_request_set_routing_policy_rule()

It will be called in link_request_set_nexthop() or serveral handlers().

3 years agonetwork: make link_request_set_nexthop() called from link_request_set_routes() or...
Yu Watanabe [Sun, 12 Jul 2020 18:12:11 +0000 (03:12 +0900)] 
network: make link_request_set_nexthop() called from link_request_set_routes() or route_handler()

Then we can drop static_routes_ready() flag.

3 years agonetwork: do not make link in configured state when no address is assigned
Yu Watanabe [Sun, 12 Jul 2020 05:57:45 +0000 (14:57 +0900)] 
network: do not make link in configured state when no address is assigned

When DHCP6 and RA are enabled, and RA does not provide any addresses,
then link may become configured state even if no address is assigned,
due to the time-lag between RA completion and DHCP reply.
This makes if DHCP is explicitly enabled, then link must have at least
one valid address to be in the configured state.

3 years agonetwork: ndisc: split ndisc_configured flag into for addresses and routes
Yu Watanabe [Sun, 12 Jul 2020 04:55:44 +0000 (13:55 +0900)] 
network: ndisc: split ndisc_configured flag into for addresses and routes

3 years agonetwork: ndisc: do not ignore remaining addresses
Yu Watanabe [Sun, 12 Jul 2020 04:26:53 +0000 (13:26 +0900)] 
network: ndisc: do not ignore remaining addresses

Follow-up for c24c83dc67a63c88b0a537f4fa7f605b1fcbac39.

3 years agotest-network: wait for addresses are not in tentative state
Yu Watanabe [Sun, 12 Jul 2020 00:28:53 +0000 (09:28 +0900)] 
test-network: wait for addresses are not in tentative state

3 years agonetwork: add debugging log why link is not in configured state yet
Yu Watanabe [Sat, 11 Jul 2020 23:23:19 +0000 (08:23 +0900)] 
network: add debugging log why link is not in configured state yet

3 years agotest-network: check assigned address is not tentative state
Yu Watanabe [Sat, 11 Jul 2020 21:26:34 +0000 (06:26 +0900)] 
test-network: check assigned address is not tentative state

3 years agotest-network: set IPv6AcceptRA=no if no dynamic addresses are not required
Yu Watanabe [Wed, 8 Jul 2020 06:56:47 +0000 (15:56 +0900)] 
test-network: set IPv6AcceptRA=no if no dynamic addresses are not required

3 years agonetwork: make link_request_set_nexthop() static
Yu Watanabe [Fri, 10 Jul 2020 15:36:38 +0000 (00:36 +0900)] 
network: make link_request_set_nexthop() static

3 years agonetwork: add a debugging log
Yu Watanabe [Sat, 11 Jul 2020 20:08:57 +0000 (05:08 +0900)] 
network: add a debugging log

3 years agonetwork: include error code in the log message
Yu Watanabe [Sat, 11 Jul 2020 20:13:43 +0000 (05:13 +0900)] 
network: include error code in the log message