]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoMerge pull request #15930 from poettering/udev-no-lock-warn
Yu Watanabe [Fri, 29 May 2020 01:39:14 +0000 (10:39 +0900)] 
Merge pull request #15930 from poettering/udev-no-lock-warn

udev: when the BSD lock on a block device is taken, don't complain

3 years agoMerge pull request #15619 from ddstreet/ignore_carrier_loss_default
Yu Watanabe [Fri, 29 May 2020 01:04:00 +0000 (10:04 +0900)] 
Merge pull request #15619 from ddstreet/ignore_carrier_loss_default

Set IgnoreCarrierLoss= default to value of ConfigureWithoutCarrier=

3 years agotree-wide: remove spurious whitespace
Lennart Poettering [Thu, 28 May 2020 07:17:31 +0000 (09:17 +0200)] 
tree-wide: remove spurious whitespace

3 years agoMerge pull request #15882 from poettering/pam-sudo-fixes-part4
Lennart Poettering [Wed, 27 May 2020 22:27:51 +0000 (00:27 +0200)] 
Merge pull request #15882 from poettering/pam-sudo-fixes-part4

More pam_systemd fixes split out of #15742

3 years agoMerge pull request #15893 from DaanDeMeyer/firstboot-overwrite
Lennart Poettering [Wed, 27 May 2020 20:51:02 +0000 (22:51 +0200)] 
Merge pull request #15893 from DaanDeMeyer/firstboot-overwrite

systemd-firstboot: Add --force, --delete-root-password and --root-password-is-hashed options

3 years agopam_systemd: set legacy D-Bus path only if the runtime directory is validated 15882/head
Lennart Poettering [Thu, 7 May 2020 11:21:14 +0000 (13:21 +0200)] 
pam_systemd: set legacy D-Bus path only if the runtime directory is validated

3 years agopam_systemd: be more thorough when validating runtime paths
Lennart Poettering [Thu, 7 May 2020 11:20:44 +0000 (13:20 +0200)] 
pam_systemd: be more thorough when validating runtime paths

3 years agofirstboot: Add --kernel-command-line option 15893/head
Daan De Meyer [Mon, 25 May 2020 19:39:51 +0000 (21:39 +0200)] 
firstboot: Add --kernel-command-line option

3 years agofirstboot: Add --root-password-hashed option
Daan De Meyer [Mon, 25 May 2020 17:24:07 +0000 (19:24 +0200)] 
firstboot: Add --root-password-hashed option

3 years agoRemove systemd-firstboot --force entry from TODO
Daan De Meyer [Mon, 25 May 2020 15:50:28 +0000 (17:50 +0200)] 
Remove systemd-firstboot --force entry from TODO

3 years agofirstboot: Add --delete-root-password option
Daan De Meyer [Sat, 23 May 2020 19:35:21 +0000 (21:35 +0200)] 
firstboot: Add --delete-root-password option

3 years agofirstboot: Add --force option
Daan De Meyer [Fri, 22 May 2020 18:31:16 +0000 (20:31 +0200)] 
firstboot: Add --force option

3 years agofileio: Rename rename_and_apply_smack to rename_and_apply_smack_floor_label.
Daan De Meyer [Tue, 26 May 2020 17:49:26 +0000 (19:49 +0200)] 
fileio: Rename rename_and_apply_smack to rename_and_apply_smack_floor_label.

3 years agofileio: Refactor sync_rights to take fds as arguments
Daan De Meyer [Tue, 26 May 2020 18:00:45 +0000 (20:00 +0200)] 
fileio: Refactor sync_rights to take fds as arguments

3 years agosysusers: Move sync_rights and rename_and_apply_smack to basic
Daan De Meyer [Fri, 22 May 2020 18:30:24 +0000 (20:30 +0200)] 
sysusers: Move sync_rights and rename_and_apply_smack to basic

3 years agofirstboot: Don't check twice if /etc/shadow exists
Daan De Meyer [Thu, 21 May 2020 18:31:55 +0000 (20:31 +0200)] 
firstboot: Don't check twice if /etc/shadow exists

3 years agoMerge pull request #15669 from andir/systemd-ipv6-pd-subnet-id
Lennart Poettering [Wed, 27 May 2020 16:47:26 +0000 (18:47 +0200)] 
Merge pull request #15669 from andir/systemd-ipv6-pd-subnet-id

networkd: subnet id support for ipv6 prefix delegation

3 years agoMerge pull request #15226 from benzea/benzea/xdg-autostart-generator
Lennart Poettering [Wed, 27 May 2020 16:41:01 +0000 (18:41 +0200)] 
Merge pull request #15226 from benzea/benzea/xdg-autostart-generator

xdg-autostart-generator: a generator for XDG autostart files

3 years agoman: fix conditional in homed.conf.xml
Michael Biebl [Wed, 27 May 2020 13:48:02 +0000 (15:48 +0200)] 
man: fix conditional in homed.conf.xml

3 years agoudev: when the BSD lock on a block device is taken, don't complain 15930/head
Lennart Poettering [Tue, 26 May 2020 16:58:15 +0000 (18:58 +0200)] 
udev: when the BSD lock on a block device is taken, don't complain

if someone implements https://systemd.io/BLOCK_DEVICE_LOCKING/ then we
shouldn't loudly complain about that.

This reverts back to the original behaviour from
3ebdb81ef088afd3b4c72b516beb5610f8c93a0d: when the lock is taken we
silently skip processing the device and sending out the messages for it.

3 years agoMerge pull request #15934 from keszybz/docs-and-test-fix
Lennart Poettering [Wed, 27 May 2020 13:16:24 +0000 (15:16 +0200)] 
Merge pull request #15934 from keszybz/docs-and-test-fix

A few sundry documentation and code fixes

3 years agoMerge pull request #15928 from poettering/kill-mode-warnings
Lennart Poettering [Wed, 27 May 2020 13:05:41 +0000 (15:05 +0200)] 
Merge pull request #15928 from poettering/kill-mode-warnings

warn on KillMode=none, inform about left-over processes on stop and warn about sysv services

3 years agoman: Fix typo in suggested permissions
Chris Kerr [Wed, 27 May 2020 12:57:56 +0000 (15:57 +0300)] 
man: Fix typo in suggested permissions

The user and group name is 'systemd-network' not 'systemd-networkd'

3 years agorun: when waiting for unit, also check if no job is pending anymore
Lennart Poettering [Tue, 26 May 2020 14:22:36 +0000 (16:22 +0200)] 
run: when waiting for unit, also check if no job is pending anymore

This is a fix-up for a7c71d214c37797d82de2f66cfe0a0a79c3a5c92: since we
now don't wait for the job to finish anymore right after enqueuing it,
we should not exit our ptyfwd logic before the unit is back to inactive
*and* no job pending anymore.

3 years agoMerge pull request #15853 from poettering/tmp-argument
Lennart Poettering [Wed, 27 May 2020 12:51:50 +0000 (14:51 +0200)] 
Merge pull request #15853 from poettering/tmp-argument

support the Debian-style tmp= argument in crypttab

3 years agomeson: support building fuzzers with meson <0.48.0
Frantisek Sumsal [Tue, 26 May 2020 21:47:49 +0000 (23:47 +0200)] 
meson: support building fuzzers with meson <0.48.0

3 years agoservice: Display updated WatchdogUSec from sd_notify
Chris Down [Tue, 26 May 2020 13:35:18 +0000 (14:35 +0100)] 
service: Display updated WatchdogUSec from sd_notify

Suppose a service has WatchdogSec set to 2 seconds in its unit file. I
then start the service and WatchdogUSec is set correctly:

    % systemctl --user show psi-notify -p WatchdogUSec
    WatchdogUSec=2s

Now I call `sd_notify(0, "WATCHDOG_USEC=10000000")`. The new timer seems
to have taken effect, since I only send `WATCHDOG=1` every 4 seconds,
and systemd isn't triggering the watchdog handler. However, `systemctl
show` still shows WatchdogUSec as 2s:

    % systemctl --user show psi-notify -p WatchdogUSec
    WatchdogUSec=2s

This seems surprising, since this "original" watchdog timer isn't the
one taking effect any more. This patch makes it so that we instead
display the new watchdog timer after sd_notify(WATCHDOG_USEC):

    % systemctl --user show psi-notify -p WatchdogUSec
    WatchdogUSec=10s

Fixes #15726.

3 years agoshared/efi-loader: remove check that uses absolute tick value 15934/head
Zbigniew Jędrzejewski-Szmek [Tue, 26 May 2020 19:08:10 +0000 (21:08 +0200)] 
shared/efi-loader: remove check that uses absolute tick value

sd-boot uses rdtsc to set those timestamps. There is no guarantee that the tsc
has any particular absolute value.

On my VM:
$ head /sys/firmware/efi/efivars/LoaderTime*
==> /sys/firmware/efi/efivars/LoaderTimeExecUSec-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f <==
4397904074
==> /sys/firmware/efi/efivars/LoaderTimeInitUSec-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f <==
4396386839
==> /sys/firmware/efi/efivars/LoaderTimeMenuUSec-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f <==
4396392521

$ build/test-boot-timestamps
...
LoaderTimeExecUSec=4396386839 too large, refusing.
Failed to read EFI loader data: Input/output error
Assertion 'q >= 0' failed at src/test/test-boot-timestamps.c:84, function main(). Aborting.

(with patch)
$ build/test-boot-timestamps
...
EFI Loader: start=1h 13min 16.386s exit=1h 13min 17.904s duration=1.517s
Firmware began 1h 13min 17.904074s before kernel.
Loader began 1.517235s before kernel.
Firmware began Tue 2020-05-26 11:04:13 CEST.
Loader began Tue 2020-05-26 12:17:30 CEST.
Kernel began Tue 2020-05-26 12:17:31 CEST.

3 years agocore: minor simplification
Zbigniew Jędrzejewski-Szmek [Tue, 26 May 2020 17:28:53 +0000 (19:28 +0200)] 
core: minor simplification

3 years agouserwork: remove trailing comma in message
Zbigniew Jędrzejewski-Szmek [Tue, 26 May 2020 16:55:23 +0000 (18:55 +0200)] 
userwork: remove trailing comma in message

3 years agocore: add forgotten return in error path
Zbigniew Jędrzejewski-Szmek [Tue, 26 May 2020 14:07:30 +0000 (16:07 +0200)] 
core: add forgotten return in error path

If we get an error here, this is most likely oom, and we should not continue.

3 years agofuzz: Add an XDG desktop file fuzzer 15226/head
Benjamin Berg [Tue, 31 Mar 2020 14:16:27 +0000 (16:16 +0200)] 
fuzz: Add an XDG desktop file fuzzer

To test the XDG parser used by the xdg-autostart-generator.

Co-authored-by: Evgeny Vereshchagin <evvers@ya.ru>
3 years agotest: Add test for XDG desktop file parsing and interpretation
Benjamin Berg [Mon, 30 Mar 2020 16:14:56 +0000 (18:14 +0200)] 
test: Add test for XDG desktop file parsing and interpretation

3 years agoman: Add systemd-xdg-autostart-generator man page
Benjamin Berg [Fri, 22 May 2020 17:20:13 +0000 (19:20 +0200)] 
man: Add systemd-xdg-autostart-generator man page

3 years agoxdg-autostart-generator: Add a generator for XDG autostart files
Benjamin Berg [Wed, 25 Mar 2020 15:59:40 +0000 (16:59 +0100)] 
xdg-autostart-generator: Add a generator for XDG autostart files

This generator can be used by desktop environments to launch autostart
applications and services. The feature is an opt-in, triggered by
xdg-desktop-autostart.target being activated.

Also included is the new binary xdg-autostart-condition. This binary is
used as an ExecCondition to test the OnlyShowIn and NotShowIn XDG
desktop file keys. These need to be evaluated against the
XDG_CURRENT_DESKTOP environment variable which may not be known at
generation time.

Co-authored-by: Henri Chain <henri.chain@enioka.com>
3 years agocore: update comment about sysv compat
Zbigniew Jędrzejewski-Szmek [Tue, 26 May 2020 13:06:53 +0000 (15:06 +0200)] 
core: update comment about sysv compat

We don't want people to consider that part deprecated.

Follow-up for 6589a56972.

3 years agosysv-generator: Downgrade directory listing fails to warning
Benjamin Berg [Fri, 22 May 2020 15:52:21 +0000 (17:52 +0200)] 
sysv-generator: Downgrade directory listing fails to warning

This is not a fatal error and should therefore be a warning instead.

3 years agotest: create public images by default
Frantisek Sumsal [Mon, 25 May 2020 20:48:01 +0000 (22:48 +0200)] 
test: create public images by default

Let's create new images public by default and then symlink/copy them
into the respective private directories afterwards, not the other way
around. This should fix a nasty race condition in parallel runs where
one tests attempts to copy the backing public image at the same moment
another test is already modifying it.

3 years agofuzzit: switch to -fundefined
Evgeny Vereshchagin [Tue, 26 May 2020 12:23:08 +0000 (14:23 +0200)] 
fuzzit: switch to -fundefined

Now that https://github.com/systemd/systemd/issues/15907 is gone,
we can simply use "undefined" instead of listing all the possible checks
explicitly.

3 years agotest: make the systemd-run calls synchronous
Frantisek Sumsal [Tue, 26 May 2020 10:57:29 +0000 (12:57 +0200)] 
test: make the systemd-run calls synchronous

Otherwise we might be checking results of such calls before they even
finish, causing nasty races like:

```
[   15.656530] testsuite-43.sh[303]: + su testuser -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID exec "$@"' -- sh systemd-run --user --unit=test-unprotected-home -P touch /home/testuser/works.txt
...
[   15.757744] testsuite-43.sh[324]: Running as unit: test-unprotected-home.service
[   15.775611] systemd[296]: Started /usr/bin/touch /home/testuser/works.txt.
[   15.783597] testsuite-43.sh[303]: + test -e /home/testuser/works.txt
[   15.787542] systemd[296]: test-unprotected-home.service: Succeeded.
...
[   15.787684] systemd[1]: Received SIGCHLD from PID 303 (bash).
[   15.787790] systemd[1]: Child 303 (bash) died (code=exited, status=1/FAILURE)
[   15.787881] systemd[1]: testsuite-43.service: Child 303 belongs to testsuite-43.service.
[   15.788040] systemd[1]: testsuite-43.service: Main process exited, code=exited, status=1/FAILURE
[   15.788224] systemd[1]: testsuite-43.service: Failed with result 'exit-code'.
[   15.788333] systemd[1]: testsuite-43.service: Service will not restart (restart setting)
[   15.788421] systemd[1]: testsuite-43.service: Changed start -> failed
[   15.788790] systemd[1]: testsuite-43.service: Job 160 testsuite-43.service/start finished, result=failed
[   15.788995] systemd[1]: Failed to start testsuite-43.service.
```

3 years agoefivars: log whenever an EFI variable read access is slow
Lennart Poettering [Mon, 25 May 2020 15:13:57 +0000 (17:13 +0200)] 
efivars: log whenever an EFI variable read access is slow

This should allow us to detect slowdowns caused by EFI variable read
access a bit.

3 years agoupdate TODO 15928/head
Lennart Poettering [Tue, 26 May 2020 12:46:35 +0000 (14:46 +0200)] 
update TODO

3 years agosysv: generate warning for every SysV service lacking a native systemd unit
Lennart Poettering [Tue, 26 May 2020 12:47:30 +0000 (14:47 +0200)] 
sysv: generate warning for every SysV service lacking a native systemd unit

It's 2020, let's tighten the screws a bit and start warning about
left-over SysV services that still have no native systemd unit file.

3 years agosysv: use structured initialization
Lennart Poettering [Tue, 26 May 2020 12:47:05 +0000 (14:47 +0200)] 
sysv: use structured initialization

3 years agocore: voidify one function return
Lennart Poettering [Tue, 26 May 2020 12:32:03 +0000 (14:32 +0200)] 
core: voidify one function return

3 years agocore: some more structured initialization
Lennart Poettering [Tue, 26 May 2020 12:31:34 +0000 (14:31 +0200)] 
core: some more structured initialization

3 years agocore: also log about left-over processes during unit stop
Lennart Poettering [Tue, 26 May 2020 12:29:46 +0000 (14:29 +0200)] 
core: also log about left-over processes during unit stop

Only log at LOG_INFO level, i.e. make this informational. During start
let's leave it at LOG_WARNING though.

Of course, it's ugly leaving processes around like that either in start
or in stop, but at start its more dangerous than on stop, so be tougher
there.

3 years agounits: remove KillMode=process in our regular gettys
Lennart Poettering [Tue, 26 May 2020 12:12:56 +0000 (14:12 +0200)] 
units: remove KillMode=process in our regular gettys

In our regular gettys the actual shell commands live the the session
scope anyway (as long as logind is used). Hence, let's avoid
KillMode=process, it serves no purpose and is simply unsafe since it
disables systemd's own process lifecycle management.

3 years agoman: document that KillMode=none is a bad idea
Lennart Poettering [Tue, 26 May 2020 12:08:09 +0000 (14:08 +0200)] 
man: document that KillMode=none is a bad idea

3 years agocore: warn if KillMode=none is used
Lennart Poettering [Tue, 26 May 2020 11:59:04 +0000 (13:59 +0200)] 
core: warn if KillMode=none is used

3 years agogpt: include homed GPT partition type in well-known partition table
Lennart Poettering [Tue, 26 May 2020 16:52:15 +0000 (18:52 +0200)] 
gpt: include homed GPT partition type in well-known partition table

3 years agounits: don't set PrivateNetwork= in systemd-homed.service
Lennart Poettering [Tue, 26 May 2020 17:20:33 +0000 (19:20 +0200)] 
units: don't set PrivateNetwork= in systemd-homed.service

We want to watch USB sticks being plugged in, and that requires
AF_NETLINK to work correctly and get the host's events. But if we live
in a network namespace AF_NETLINK is disconnected too and we'll not get
the host udev events.

Fixes: #15287
3 years agoMerge pull request #15910 from poettering/tmpfiles-pstore-tweak
Daan De Meyer [Tue, 26 May 2020 19:59:13 +0000 (21:59 +0200)] 
Merge pull request #15910 from poettering/tmpfiles-pstore-tweak

tmpfiles: let's make pstore sysfs failure silent

3 years agotmpfiles: deal with kernel errno change if quota is not enabled
Lennart Poettering [Tue, 26 May 2020 10:52:57 +0000 (12:52 +0200)] 
tmpfiles: deal with kernel errno change if quota is not enabled

Old kernels returned EINVAL if quota was off but we tried to manipulate
it anyway. Since
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a36e408d40606e21cd4e2dd9601004a67b14868
this changed: now ENOTCONN is returned. This of course is a kernel API
compat breakage, but let's not make a fuss and just map EINVAL to
ENOTCONN to make it recognizable the same way everywhere.

Fixes: #15896
3 years agoRevert "presets: "disable" all passive targets by default"
Lennart Poettering [Tue, 7 Apr 2020 16:46:04 +0000 (18:46 +0200)] 
Revert "presets: "disable" all passive targets by default"

This reverts commit 61c3e2c8bfc28cea5b52d8643fac3d85f4c571d2.

The original commit doesn't make sense to me, none of the listed units
have an [Install] section, they hence are not subject to enable/disable
and hence not preset either. This commit hence has no effect whatsoever,
let's undo it to avoid further confusion.

3 years agoresolved-dns-query: remove dns_query_candidate_is_routable
Florian Klink [Sat, 23 Nov 2019 10:45:34 +0000 (11:45 +0100)] 
resolved-dns-query: remove dns_query_candidate_is_routable

Resolved can't reliably determine on whether "it makes sense" to query
AAAA records when not explicitly specifying it in the request, so we
shouldn't remove them.

After having done the resolving, applications can use RFC6724 to
determine whether that address is reachable.

We can't know whether an address is reachable before having resolved it
and inspecting the routing table, and not resolving AAAA just because
there's no IPv6 default route on the main interface link them breaks
various setups, including IPv6-providing wireguard tunnels on a
non-dualstacked environment.

Fixes #5782
Fixes #5915
Fixes #8017

3 years agosd-boot: fix menu ordering with boot counting
Daniel Fullmer [Thu, 23 Apr 2020 18:47:56 +0000 (14:47 -0400)] 
sd-boot: fix menu ordering with boot counting

systemd-boot selects the last valid entry by default, not the first.

Fixes: #15256
3 years agoupdate TODO
Lennart Poettering [Tue, 26 May 2020 17:05:54 +0000 (19:05 +0200)] 
update TODO

3 years agoMerge pull request #15920 from keszybz/userwork-proc-title
Lennart Poettering [Tue, 26 May 2020 16:29:06 +0000 (18:29 +0200)] 
Merge pull request #15920 from keszybz/userwork-proc-title

Avoid log noise when setting proc titles and some doc updates

3 years agocryptsetup: support tmp= file system argument 15853/head
Lennart Poettering [Tue, 19 May 2020 15:48:50 +0000 (17:48 +0200)] 
cryptsetup: support tmp= file system argument

Let's catch up with Debian a bit more.

This also changes the default from ext2 to ext4.

Fixes: #952
3 years agofstab-util: prefix return parameters with ret_
Lennart Poettering [Tue, 19 May 2020 15:48:33 +0000 (17:48 +0200)] 
fstab-util: prefix return parameters with ret_

3 years agotest: add bridge configure-without-carrier test 15619/head
Dan Streetman [Mon, 27 Apr 2020 19:47:28 +0000 (15:47 -0400)] 
test: add bridge configure-without-carrier test

Verify configure-without-carrier works, and retains configuration
across carrier losses/gains.

3 years agotest: expand configure-without-carrier test
Dan Streetman [Mon, 27 Apr 2020 19:35:30 +0000 (15:35 -0400)] 
test: expand configure-without-carrier test

The test currently doesn't actually test configure-without-carrier since
it does have carrier for the entire test.  It now forces carrier down
before starting the network portion of the test. Also, it tests to verify
the configuration is retained across future carrier losses/gains.

3 years agonetwork: return 1 on start and 0 if ipv4ll is already started
Dan Streetman [Sat, 2 May 2020 13:56:33 +0000 (09:56 -0400)] 
network: return 1 on start and 0 if ipv4ll is already started

Instead of -EBUSY, return 0 from sd_ipv4ll_start() if it's already started,
and change successful start return value to 1.

This matches sd_ndisc_start() behavior; 1 indicates successful start, and
0 indicates already started.

3 years agoMerge pull request #15906 from keszybz/busctl-stdout-stderr
Lennart Poettering [Tue, 26 May 2020 13:38:14 +0000 (15:38 +0200)] 
Merge pull request #15906 from keszybz/busctl-stdout-stderr

Make busctl stdout/stderr split consistent

3 years agoMerge pull request #15909 from keszybz/sd-network-serialization
Lennart Poettering [Tue, 26 May 2020 13:37:57 +0000 (15:37 +0200)] 
Merge pull request #15909 from keszybz/sd-network-serialization

networkd link serialization fix

3 years agoeditorconfig: add man configuration
Andreas Rammhold [Tue, 26 May 2020 11:06:42 +0000 (13:06 +0200)] 
editorconfig: add man configuration

My VIM usually defaults to tabs (8ch) on these XML files. With this
change it behaves as defined in the coding style documentation.

3 years agodont install systemd-initctl, runlevel, telinit if no SYSV compat
Norbert Lange [Tue, 28 Apr 2020 21:11:55 +0000 (23:11 +0200)] 
dont install systemd-initctl, runlevel, telinit if no SYSV compat

systemd-initctl executable is still built.

3 years agonetwork: Change IgnoreCarrierLoss default to value of ConfigureWithoutCarrier
Dan Streetman [Mon, 27 Apr 2020 10:38:40 +0000 (06:38 -0400)] 
network: Change IgnoreCarrierLoss default to value of ConfigureWithoutCarrier

It doesn't make much sense to have ConfigureWithoutCarrier set, but not
IgnoreCarrierLoss; all the configuration added during initial interface
bring-up will be lost at the first carrier up/down.

3 years agoMerge pull request #15914 from poettering/ubsan-float-check
Evgeny Vereshchagin [Tue, 26 May 2020 12:11:16 +0000 (15:11 +0300)] 
Merge pull request #15914 from poettering/ubsan-float-check

json: disable ubsan float checking

3 years agonetworkd: Add support for setting a preferred subnet id for IPv6 PD leases 15669/head
Andreas Rammhold [Wed, 13 May 2020 22:54:37 +0000 (00:54 +0200)] 
networkd: Add support for setting a preferred subnet id for IPv6 PD leases

This allows users to configure a subnet id that should be used instead
of automatically (sequentially) assigned subnets. The previous attempt
had the downside that the subnet id would not be the same between
networkd restarts. In some setups it is desirable to have predictable
subnet ids across restarts of services and systems.

The code for the assignment had to be broken up into two pieces. One of
them is the old (sequential) assignment of prefixes and the other is the
new assignment based on configured subnet ids. The new assignment code
has to be executed first and has to be taken into account when (later
on) allocating the "old" subnets from the same pool.

Instead of having one iteration through the links we are now trying to
allocate a prefix for every link on every delegated prefix, unless they
received an assignment in a previous iteration.

3 years agoin-addr-util: removed in_addr_prefix_next implementation
Andreas Rammhold [Wed, 29 Apr 2020 21:48:41 +0000 (23:48 +0200)] 
in-addr-util: removed in_addr_prefix_next implementation

The in_addr_prefix_nth function does everything this function did and
more. We can substitute 100% of its users with the new function.

3 years agoin-addr-util: introduce in_addr_prefix_nth
Andreas Rammhold [Wed, 13 May 2020 22:52:18 +0000 (00:52 +0200)] 
in-addr-util: introduce in_addr_prefix_nth

3 years agoman: reword description of IPAddressDeny/Allow a bit 15920/head
Zbigniew Jędrzejewski-Szmek [Tue, 26 May 2020 09:13:06 +0000 (11:13 +0200)] 
man: reword description of IPAddressDeny/Allow a bit

3 years agotree-wide: s/time-out/timeout/g
Zbigniew Jędrzejewski-Szmek [Fri, 22 May 2020 07:39:36 +0000 (09:39 +0200)] 
tree-wide: s/time-out/timeout/g

See 3f9a0a522f2029e9295ea5e9984259022be88413 for justification.

3 years agouserwork: fix typos in comment
Zbigniew Jędrzejewski-Szmek [Fri, 22 May 2020 07:38:00 +0000 (09:38 +0200)] 
userwork: fix typos in comment

3 years agobasic/process-util: only try PR_SET_MM once
Zbigniew Jędrzejewski-Szmek [Fri, 22 May 2020 07:23:31 +0000 (09:23 +0200)] 
basic/process-util: only try PR_SET_MM once

userwork wants to update the title many times, and a strace is full of
attempts that fail the same way:

[pid 21765] prctl(PR_SET_NAME, "systemd-userwor"...) = 0
[pid 21765] geteuid()                   = 0
[pid 21765] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fedce329000
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_START, 0x7fedce329000, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_END, 0x7fedce32901d, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] munmap(0x7fedce329000, 4096) = 0
[pid 21765] accept4(3, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable)
[pid 21765] prctl(PR_SET_NAME, "systemd-userwor"...) = 0
[pid 21765] geteuid()                   = 0
[pid 21765] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fedce329000
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_START, 0x7fedce329000, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_END, 0x7fedce329020, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] munmap(0x7fedce329000, 4096) = 0
[pid 21765] prctl(PR_SET_NAME, "systemd-userwor"...) = 0
[pid 21765] geteuid()                   = 0
[pid 21765] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fedce329000
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_START, 0x7fedce329000, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_END, 0x7fedce32901d, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] munmap(0x7fedce329000, 4096) = 0
[pid 21765] accept4(3, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable)
[pid 21765] prctl(PR_SET_NAME, "systemd-userwor"...) = 0
[pid 21765] geteuid()                   = 0
[pid 21765] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fedce329000
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_START, 0x7fedce329000, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_END, 0x7fedce329020, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] munmap(0x7fedce329000, 4096) = 0
[pid 21765] prctl(PR_SET_NAME, "systemd-userwor"...) = 0
[pid 21765] geteuid()                   = 0
[pid 21765] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fedce329000
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_START, 0x7fedce329000, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_END, 0x7fedce32901d, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] munmap(0x7fedce329000, 4096) = 0
[pid 21765] accept4(3, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable)
[pid 21765] prctl(PR_SET_NAME, "systemd-userwor"...) = 0
[pid 21765] geteuid()                   = 0
[pid 21765] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fedce329000
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_START, 0x7fedce329000, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] prctl(PR_SET_MM, PR_SET_MM_ARG_END, 0x7fedce329020, 0, 0) = -1 EPERM (Operation not permitted)
[pid 21765] munmap(0x7fedce329000, 4096) = 0

If we get a permission error, don't try again.

3 years agobasic/process-util: create helper function
Zbigniew Jędrzejewski-Szmek [Fri, 22 May 2020 07:00:49 +0000 (09:00 +0200)] 
basic/process-util: create helper function

No functional change.

3 years agoman: beef up $MAINPID examples
Zbigniew Jędrzejewski-Szmek [Thu, 21 May 2020 12:05:40 +0000 (14:05 +0200)] 
man: beef up $MAINPID examples

Inspired by https://github.com/systemd/systemd/pull/15400#discussion_r428537955.

3 years agonetwork: simplify how initial space is handled 15909/head
Zbigniew Jędrzejewski-Szmek [Tue, 26 May 2020 08:19:31 +0000 (10:19 +0200)] 
network: simplify how initial space is handled

3 years agonetworkd: unfoobar serialization of links
Zbigniew Jędrzejewski-Szmek [Sun, 24 May 2020 20:02:47 +0000 (22:02 +0200)] 
networkd: unfoobar serialization of links

We'd start writing an entry line, then another one, then another one,
and then output the rest of the first one, and then some other random
stuff, and the rest of some other lines... Results were ...eh... random.

Let's define a helper to avoid some of the copy&paste madness, and separate
blocks that output a single line with /**********************************/.

This rework doesn't change what data is written, it only tries to fix the
format of the output. The fact that some entries only write data from
link->network, and some from either link->network or link, some stuff only
for dhpc4 leases while some for both dhpc4 and dhcp6, etc, looks rather
suspicious too, but I didn't touch this.

3 years agoMerge pull request #15840 from Werkov/mkosi-opensuse
Lennart Poettering [Tue, 26 May 2020 08:02:29 +0000 (10:02 +0200)] 
Merge pull request #15840 from Werkov/mkosi-opensuse

mkosi: openSUSE updates

3 years agosd-dhcp6: constify output arguments in get_{ntp,nds}_addr
Zbigniew Jędrzejewski-Szmek [Sun, 24 May 2020 19:51:39 +0000 (21:51 +0200)] 
sd-dhcp6: constify output arguments in get_{ntp,nds}_addr

This matches what we do for ipv4 and is in general better.

3 years agosd-network: reduce scope of some variables
Zbigniew Jędrzejewski-Szmek [Sun, 24 May 2020 17:18:39 +0000 (19:18 +0200)] 
sd-network: reduce scope of some variables

3 years agoMerge pull request #15862 from hunger/master
Lennart Poettering [Tue, 26 May 2020 07:32:22 +0000 (09:32 +0200)] 
Merge pull request #15862 from hunger/master

repart: Add Uuid option to config files

3 years agoupdate TODO
Lennart Poettering [Tue, 26 May 2020 07:21:40 +0000 (09:21 +0200)] 
update TODO

3 years agobusctl: drop unneeded param 15906/head
Zbigniew Jędrzejewski-Szmek [Tue, 26 May 2020 07:13:39 +0000 (09:13 +0200)] 
busctl: drop unneeded param

3 years agobusctl: verify args early and always print results to stdout
Zbigniew Jędrzejewski-Szmek [Sun, 24 May 2020 11:47:53 +0000 (13:47 +0200)] 
busctl: verify args early and always print results to stdout

We would print the error sometimes to stdout and sometimes to stderr. It *is*
useful to get the message if one of the names is not found on the bus to
stdout, so that this shows out in the pager. So let's do verification of args
early to catch invalid arguments, and then if we receive an error over the bus
(most likely that the name is not activatable), let's print to stdout so it
gets paged. E.g. 'busctl tree org.freedesktop.systemd1 org.freedesktop.systemd2'
gives a nicely usable output.

3 years agoadd a test triggering https://github.com/systemd/systemd/issues/15907 15914/head
Evgeny Vereshchagin [Mon, 25 May 2020 11:38:36 +0000 (13:38 +0200)] 
add a test triggering https://github.com/systemd/systemd/issues/15907

3 years agojson: turn off ubsan for json_variant_has_type()
Lennart Poettering [Mon, 25 May 2020 16:21:08 +0000 (18:21 +0200)] 
json: turn off ubsan for json_variant_has_type()

Fixes: #15907
3 years agomacro: introduce DISABLE_WARNING_TYPE_LIMITS and make use of it everywhere
Lennart Poettering [Mon, 25 May 2020 16:20:52 +0000 (18:20 +0200)] 
macro: introduce DISABLE_WARNING_TYPE_LIMITS and make use of it everywhere

3 years agotree-wide: use DISABLE_WARNING_FORMAT_NONLITERAL where appropriate
Lennart Poettering [Mon, 25 May 2020 16:16:33 +0000 (18:16 +0200)] 
tree-wide: use DISABLE_WARNING_FORMAT_NONLITERAL where appropriate

3 years agojson: use our regular way to turn off compiler warnings
Lennart Poettering [Mon, 25 May 2020 16:08:21 +0000 (18:08 +0200)] 
json: use our regular way to turn off compiler warnings

3 years agoMerge pull request #15167 from ssahani/address-gen-mode
Lennart Poettering [Mon, 25 May 2020 15:32:00 +0000 (17:32 +0200)] 
Merge pull request #15167 from ssahani/address-gen-mode

networkctl: Add a range to address genmode

3 years agoMerge pull request #15872 from keszybz/networkd-types
Lennart Poettering [Mon, 25 May 2020 15:31:00 +0000 (17:31 +0200)] 
Merge pull request #15872 from keszybz/networkd-types

Type and parsing fixes for networkd

3 years agotmpfiles: don't complain if we can't enable pstore in containers 15910/head
Lennart Poettering [Mon, 25 May 2020 14:11:51 +0000 (16:11 +0200)] 
tmpfiles: don't complain if we can't enable pstore in containers

3 years agotmpfiles: downgrade log message when we can't write a file and failure is allowed
Lennart Poettering [Mon, 25 May 2020 14:19:17 +0000 (16:19 +0200)] 
tmpfiles: downgrade log message when we can't write a file and failure is allowed

3 years agoRepart: Add simple tests for Label="" and UUID="" 15862/head
Tobias Hunger [Wed, 20 May 2020 15:28:55 +0000 (17:28 +0200)] 
Repart: Add simple tests for Label="" and UUID=""

Make sure Labels and UUIDs taken from destination definitions are
taken into account when no Label/UUID is currently set already.

3 years agorepart: Add UUID option to config files
Tobias Hunger [Wed, 20 May 2020 08:44:33 +0000 (10:44 +0200)] 
repart: Add UUID option to config files

Add a option to provide a UUID for the partition that will get
created and document that.

3 years agonetwork: allow empty assignment to PreferredLifetime= 15872/head
Zbigniew Jędrzejewski-Szmek [Thu, 21 May 2020 06:36:01 +0000 (08:36 +0200)] 
network: allow empty assignment to PreferredLifetime=

Users might want to use that to unset a previous setting. The docs seem OK as
they are: we don't need to explictly mention the empty value, since it is
almost always allowed.