]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agohomework: add new helper home_setup_undo_mount()
Lennart Poettering [Thu, 21 Oct 2021 11:58:10 +0000 (13:58 +0200)] 
homework: add new helper home_setup_undo_mount()

2 years agohomework: make sure fscrypt backend takes a HomeSetup object for all calls
Lennart Poettering [Thu, 21 Oct 2021 11:46:01 +0000 (13:46 +0200)] 
homework: make sure fscrypt backend takes a HomeSetup object for all calls

Similar to the same chage we did for the directory backend. Let's always
path the setup context object, i.e. HomeSetup, and store whatever we set
up in there.

No actual change in behaviour.

2 years agoMerge pull request #20344 from poettering/revert-close-all
Lennart Poettering [Wed, 27 Oct 2021 20:02:38 +0000 (22:02 +0200)] 
Merge pull request #20344 from poettering/revert-close-all

Alternative to #20288 – close_all_fds() reworking

2 years agotest: update comment
Yu Watanabe [Wed, 27 Oct 2021 19:11:19 +0000 (04:11 +0900)] 
test: update comment

Follow-up for 8524db502134135d96219ecd6df0d0fc5c475b9d.

2 years agoMerge pull request #21153 from yuwata/network-lifetime-fix
Yu Watanabe [Wed, 27 Oct 2021 19:52:25 +0000 (04:52 +0900)] 
Merge pull request #21153 from yuwata/network-lifetime-fix

network: fix lifetime handling

2 years agosystemctl: drop redundant "else"
Yu Watanabe [Wed, 27 Oct 2021 14:22:12 +0000 (23:22 +0900)] 
systemctl: drop redundant "else"

2 years agoMerge pull request #21150 from yuwata/sd-radv-shorten-default-lifetime-2
Yu Watanabe [Wed, 27 Oct 2021 19:51:45 +0000 (04:51 +0900)] 
Merge pull request #21150 from yuwata/sd-radv-shorten-default-lifetime-2

sd-radv: shorten default lifetime

2 years agoMerge pull request #21136 from poettering/homed-uidmap-dir-only
Yu Watanabe [Wed, 27 Oct 2021 19:51:31 +0000 (04:51 +0900)] 
Merge pull request #21136 from poettering/homed-uidmap-dir-only

homed uidmapping (just for the directory backend)

2 years agodoc: fix typo in command
Yu Watanabe [Wed, 27 Oct 2021 15:40:35 +0000 (00:40 +0900)] 
doc: fix typo in command

Follow-up for #21147.

2 years agorun: do not validate exe early if MountImages/ExtensionImages are used
Luca Boccassi [Wed, 27 Oct 2021 10:59:19 +0000 (11:59 +0100)] 
run: do not validate exe early if MountImages/ExtensionImages are used

Same as with RootImage&friends, the executable might be in the
image, so it's not visible in the host before the unit is set up.

2 years agoMerge pull request #21138 from bluca/show_extensions
Yu Watanabe [Wed, 27 Oct 2021 18:56:04 +0000 (03:56 +0900)] 
Merge pull request #21138 from bluca/show_extensions

systemctl: pretty-print ExtensionImages property

2 years agotest: do not use alloca() in function call
Yu Watanabe [Sat, 23 Oct 2021 15:16:57 +0000 (00:16 +0900)] 
test: do not use alloca() in function call

2 years agotest-fd-util: extend close_all_fds() test to trigger all fallback codepaths 20344/head
Lennart Poettering [Thu, 12 Aug 2021 09:22:50 +0000 (11:22 +0200)] 
test-fd-util: extend close_all_fds() test to trigger all fallback codepaths

This extends the close_all_fds() logic to overmount /proc with an empty
tmpfs, and/or to block close_range() via seccomp, so that we run the
test case for the function with the fallback paths.

This should make sure that we don't regress in limited environments or
older kernels.

2 years agofd-util: export get_max_fd() so that we can use it in tests
Lennart Poettering [Thu, 12 Aug 2021 08:46:10 +0000 (10:46 +0200)] 
fd-util: export get_max_fd() so that we can use it in tests

2 years agoexec-util: use close_all_fds_without_malloc() from freeze()
Lennart Poettering [Thu, 29 Jul 2021 14:50:44 +0000 (16:50 +0200)] 
exec-util: use close_all_fds_without_malloc() from freeze()

2 years agofd-util: split out close_all_fds() special case handling and call it from close_all_f...
Lennart Poettering [Tue, 12 Oct 2021 14:11:46 +0000 (16:11 +0200)] 
fd-util: split out close_all_fds() special case handling and call it from close_all_fds_without_malloc(), too

The optimization is useful there too.

2 years agofd-util: close_all() check d_type
Lennart Poettering [Tue, 12 Oct 2021 13:50:39 +0000 (15:50 +0200)] 
fd-util: close_all() check d_type

Tiny optimization: check dirent's d_type before trying to parse
/proc/self/fd/ filenames, given we have that anyway.

2 years agofd-util: always return 0 on success in close_all_fds()
Lennart Poettering [Tue, 12 Oct 2021 13:54:54 +0000 (15:54 +0200)] 
fd-util: always return 0 on success in close_all_fds()

We never make use of the return value, and in case of close_range() we
don't even know how many fds got closed, hence don't pretend we knew.

2 years agofd-util: special case invocation of close_all_fds() with single exception fd
Lennart Poettering [Tue, 12 Oct 2021 13:53:55 +0000 (15:53 +0200)] 
fd-util: special case invocation of close_all_fds() with single exception fd

Add special case optimization for a single exception fd. It's a
pretty common case in our codebase, and the optimization is simple
and means we don't need to copy/sort the exception array, so do it.

2 years agofd-util: split out inner fallback loop of close_all_fds() as close_all_fds_without_ma...
Lennart Poettering [Tue, 12 Oct 2021 13:53:27 +0000 (15:53 +0200)] 
fd-util: split out inner fallback loop of close_all_fds() as close_all_fds_without_malloc()

2 years agoRevert "basic/fd-util: sort the 'except' array in place"
Lennart Poettering [Thu, 29 Jul 2021 14:36:15 +0000 (16:36 +0200)] 
Revert "basic/fd-util: sort the 'except' array in place"

This reverts commit 9c46228b7deb53d6384545535b37b2844a102b2b.

2 years agoRevert "Add variant of close_all_fds() that does not allocate and use it in freeze()"
Lennart Poettering [Thu, 29 Jul 2021 14:34:45 +0000 (16:34 +0200)] 
Revert "Add variant of close_all_fds() that does not allocate and use it in freeze()"

This reverts commit cbcf371abc328167fa869721c1add4850c793240.

2 years agohomework: support uidmapping in the "directory" backend 21136/head
Lennart Poettering [Wed, 20 Oct 2021 20:18:12 +0000 (22:18 +0200)] 
homework: support uidmapping in the "directory" backend

2 years agohomework: add new helper call that can shift home dir UID/GID ranges
Lennart Poettering [Wed, 20 Oct 2021 20:12:16 +0000 (22:12 +0200)] 
homework: add new helper call that can shift home dir UID/GID ranges

This new helper is not used yet, but it's useful for apply UID/GID
shifts so that the underlying home dir can use an arbitrary UID (for
example "nobody") and we'll still make it appear as owned by the target
UID.

This operates roughly like this:

1. The relevant underlying UID is mapped to the target UID
2. Everything in the homed UID range except for the target UID is left
   unmapped (and thus will appear as "nobody")
3. Everything in the 16bit UID range outside of the homed UID
   range/target UID/nobody user is mapped to itself
4. Everything else is left unmapped (in particular everything outside of
   the 16 bit range).

Why do it like this?

The 2nd rule done to ensure that any files from homed's managed UID
range that do not match the user's own UID will be shown as "unmapped"
basically. Of course, IRL this should never happen, except if people
managed to manipulate the underlying fs directly.

The 3rd rule is to allow that if devs untar an OS image it more or
less just works as before: 16bit UIDs outside of the homed range will
be mapped onto themselves: you can untar things and tar it back up and
things will just work.

2 years agohomework: rework directory backend to set up mounts in /run/systemd/user-home-mount...
Lennart Poettering [Wed, 20 Oct 2021 20:07:57 +0000 (22:07 +0200)] 
homework: rework directory backend to set up mounts in /run/systemd/user-home-mount before moving them to /home

This does what we already do for the LUKS backend: instead of mounting
the source directory directly to the final home dir, we instead bind
mount it to /run/systemd/user-home-mount (where /run/ is unshared and
specific to our own mount namespace), then adjust its mount flags and
then bind mount it in a single atomic operation into the final
destination, fully set up.

This doesn't improve much on its own, but it makes things a tiny bit
more correct: this way MS_NODEV/MS_NOEXEC/MS_NOSUID will already be
applied when the bind mount appears in the host mount namespace, instead
of being adjusted after the fact.

Doing things this way also makes things work more like the LUKS backend,
reducing surprises. Most importantly it's preparation for doing
uidmapping for directory homes, added in a later commit.

2 years agohomework: when activating a directory, include info about it in resulting record
Lennart Poettering [Wed, 20 Oct 2021 20:03:30 +0000 (22:03 +0200)] 
homework: when activating a directory, include info about it in resulting record

For the other backends we synthesize a "binding" section in the json
record of the user that stores meta info how a user record is "bound" to
the local host. It declares storage info and such. Let's do the same for
the directory/subvolume backends.

2 years agohomework: port home_create_directory_or_subvolume() to use HomeSetup
Lennart Poettering [Wed, 20 Oct 2021 19:45:51 +0000 (21:45 +0200)] 
homework: port home_create_directory_or_subvolume() to use HomeSetup

Let's migrate home_create_directory_or_subvolume() to also use HomeSetup
for storing its runtime objects we'd like to destroy in case of failure.

In the beginning this is just the root_fd, but later on we can add more.

No change in behaviour, just shifting things around.

2 years agohomed: move HOME_UID_{MIN,MAX} into a header we can reuse in homework.c
Lennart Poettering [Wed, 20 Oct 2021 14:14:27 +0000 (16:14 +0200)] 
homed: move HOME_UID_{MIN,MAX} into a header we can reuse in homework.c

2 years agonetwork: radv: shorten default lifetime of prefix, route prefix, DNS, and domains 21150/head
Yu Watanabe [Sun, 24 Oct 2021 19:32:05 +0000 (04:32 +0900)] 
network: radv: shorten default lifetime of prefix, route prefix, DNS, and domains

See draft-ietf-6man-slaac-renum-02 section 4.1.1.

2 years agosd-radv: shorten the default lifetime for prefix/route prefix
Yu Watanabe [Sun, 24 Oct 2021 19:13:14 +0000 (04:13 +0900)] 
sd-radv: shorten the default lifetime for prefix/route prefix

See draft-ietf-6man-slaac-renum-02 section 4.1.1.

2 years agosd-radv: make prefix/route prefix lifetime can be specified with independently with...
Yu Watanabe [Sun, 24 Oct 2021 17:44:29 +0000 (02:44 +0900)] 
sd-radv: make prefix/route prefix lifetime can be specified with independently with valid_until

Previously, valid_until (or preferred_until for preferred lifetime) was
calculated from lifetime. So, when an upstream interface acquire a
dynamic prefix (e.g. through DHCPv6-PD) with long lifetime, then sd-radv
advertise the same lifetime. It may not be desired for some situations.

2 years agonetwork: route: update lifetime of existing route 21153/head
Yu Watanabe [Wed, 27 Oct 2021 14:37:26 +0000 (23:37 +0900)] 
network: route: update lifetime of existing route

Otherwise, the route whose lifetime is managed by the sd-event's timer
event source will be removed when the initial lifetime expires.

2 years agonetwork: address: use passed Address object if possible
Yu Watanabe [Wed, 27 Oct 2021 14:34:40 +0000 (23:34 +0900)] 
network: address: use passed Address object if possible

Then, we can avoid unnecessary duplication.

2 years agoMerge pull request #21143 from yuwata/sd-radv-router-lifetime 21112/head
Yu Watanabe [Wed, 27 Oct 2021 13:14:35 +0000 (22:14 +0900)] 
Merge pull request #21143 from yuwata/sd-radv-router-lifetime

sd-radv: several cleanups for router lifetime

2 years agobootctl: refuse parsing unknown special '@' entry ids
Lennart Poettering [Wed, 27 Oct 2021 08:30:29 +0000 (10:30 +0200)] 
bootctl: refuse parsing unknown special '@' entry ids

Let's make sure '@' is never written as entry ID into any EFI variable,
as we want the ability to add new ids like this later on, with them
resulting in a clear error on older implementations.

2 years agoMerge pull request #21147 from DaanDeMeyer/hacking-docs
Zbigniew Jędrzejewski-Szmek [Wed, 27 Oct 2021 12:09:46 +0000 (14:09 +0200)] 
Merge pull request #21147 from DaanDeMeyer/hacking-docs

docs: Clean up HACKING.md

2 years agodocs: Specify code block language for mkosi boot instructions 21147/head
Daan De Meyer [Wed, 27 Oct 2021 11:21:57 +0000 (12:21 +0100)] 
docs: Specify code block language for mkosi boot instructions

2 years agodocs: Make mkosi install instructions generic
Daan De Meyer [Wed, 27 Oct 2021 11:08:59 +0000 (12:08 +0100)] 
docs: Make mkosi install instructions generic

2 years agodocs: Extend builddep instructions to include more distros
Daan De Meyer [Wed, 27 Oct 2021 10:30:47 +0000 (11:30 +0100)] 
docs: Extend builddep instructions to include more distros

2 years agosystemctl: small fixes for MountImages pretty printing 21138/head
Luca Boccassi [Wed, 27 Oct 2021 10:17:02 +0000 (11:17 +0100)] 
systemctl: small fixes for MountImages pretty printing

2 years agosystemctl: pretty-print ExtensionImages property
Luca Boccassi [Tue, 26 Oct 2021 21:55:30 +0000 (22:55 +0100)] 
systemctl: pretty-print ExtensionImages property

Complex type, so without explicit support 'systemctl show' just prints [unprintable]

2 years agoMerge pull request #21144 from yuwata/sd-radv-trivial-cleanups
Yu Watanabe [Wed, 27 Oct 2021 10:52:57 +0000 (19:52 +0900)] 
Merge pull request #21144 from yuwata/sd-radv-trivial-cleanups

sd-radv: trivial cleanups

2 years agoconf-parse: make config_parse_many() optionally save 'struct stat' for each file
Yu Watanabe [Mon, 25 Oct 2021 02:13:27 +0000 (11:13 +0900)] 
conf-parse: make config_parse_many() optionally save 'struct stat' for each file

Fixes #21113.

2 years agodocs/COREDUMP_PACKAGE_METADATA: ELF section should be allocated and 0-padded
Luca Boccassi [Wed, 27 Oct 2021 10:27:50 +0000 (11:27 +0100)] 
docs/COREDUMP_PACKAGE_METADATA: ELF section should be allocated and 0-padded

2 years agonetwork: radv: refuse invalid router lifetime in conf parser 21143/head
Yu Watanabe [Wed, 27 Oct 2021 04:22:49 +0000 (13:22 +0900)] 
network: radv: refuse invalid router lifetime in conf parser

2 years agosd-radv: update how to calculate interval of sending advertisements
Yu Watanabe [Wed, 27 Oct 2021 07:08:22 +0000 (16:08 +0900)] 
sd-radv: update how to calculate interval of sending advertisements

2 years agosd-radv: router lifetime must be 0 or between 4 seconds and 9000 seconds
Yu Watanabe [Sun, 24 Oct 2021 16:21:22 +0000 (01:21 +0900)] 
sd-radv: router lifetime must be 0 or between 4 seconds and 9000 seconds

See RFC 4861 section 6.2.1.

2 years agodocs: Remove mkosi symlink instruction from HACKING
Daan De Meyer [Wed, 27 Oct 2021 09:54:53 +0000 (10:54 +0100)] 
docs: Remove mkosi symlink instruction from HACKING

mkosi automatically builds for the host distro which seems a much
better default to encourage since dnf won't be installed on any host
system that's not Fedora anyway.

2 years agodocs: Simplify git instructions in HACKING slightly
Daan De Meyer [Wed, 27 Oct 2021 09:54:24 +0000 (10:54 +0100)] 
docs: Simplify git instructions in HACKING slightly

2 years agodocs: Clean up links in HACKING.md
Daan De Meyer [Wed, 27 Oct 2021 09:50:19 +0000 (10:50 +0100)] 
docs: Clean up links in HACKING.md

2 years agosd-radv: introduce RADV_DEFAULT_ROUTER_LIFETIME_USEC
Yu Watanabe [Sun, 24 Oct 2021 16:03:30 +0000 (01:03 +0900)] 
sd-radv: introduce RADV_DEFAULT_ROUTER_LIFETIME_USEC

2 years agosd-radv: add several notes about constants
Yu Watanabe [Sun, 24 Oct 2021 15:48:43 +0000 (00:48 +0900)] 
sd-radv: add several notes about constants

2 years agosd-radv: make several constants not exposed
Yu Watanabe [Sun, 24 Oct 2021 15:37:45 +0000 (00:37 +0900)] 
sd-radv: make several constants not exposed

2 years agosd-radv: drop SD_ prefix for unexposed constants
Yu Watanabe [Wed, 27 Oct 2021 09:54:33 +0000 (18:54 +0900)] 
sd-radv: drop SD_ prefix for unexposed constants

2 years agoMerge pull request #21130 from systemd/wip/hadess/webcams
Lennart Poettering [Wed, 27 Oct 2021 10:03:30 +0000 (12:03 +0200)] 
Merge pull request #21130 from systemd/wip/hadess/webcams

Tag IR cameras and allow media* access

2 years agosd-radv: use IPv6 specific functions 21144/head
Yu Watanabe [Sun, 24 Oct 2021 19:39:10 +0000 (04:39 +0900)] 
sd-radv: use IPv6 specific functions

2 years agosd-radv: use assert_return()
Yu Watanabe [Sun, 24 Oct 2021 19:37:11 +0000 (04:37 +0900)] 
sd-radv: use assert_return()

2 years agosd-radv: make sd_radv_set_router_lifetime() take usec_t (uint64_t)
Yu Watanabe [Sun, 24 Oct 2021 15:15:06 +0000 (00:15 +0900)] 
sd-radv: make sd_radv_set_router_lifetime() take usec_t (uint64_t)

2 years agochange indicator used for later versions of VirtualBox (#21127)
Greg Zuro [Wed, 27 Oct 2021 04:02:37 +0000 (21:02 -0700)] 
change indicator used for later versions of VirtualBox (#21127)

Detection of VirtualBox is accomplished in the existing code by *either* `innotek GmbH`
or `Oracle Corporation` existing in any of:

- /sys/class/dmi/id/product_name
- /sys/class/dmi/id/sys_vendor
- /sys/class/dmi/id/board_vendor
- /sys/class/dmi/id/bios_vendor

With Oracle's physical servers, both `/sys/class/dmi/id/sys_vendor` and
`/sys/class/dmi/id/board_vendor` contain `Oracle Corporation`, so those
servers are detected as `oracle` (VirtualBox).

VirtualBox has the following values in the latest versions:

- /sys/class/dmi/id/product_name: `VirtualBox`
- /sys/class/dmi/id/sys_vendor: `innotek GmbH`
- /sys/class/dmi/id/board_vendor: `Oracle Corporation`
- /sys/class/dmi/id/bios_vendor: `innotek GmbH`

Presumably the existing check for `innotek GmbH` is meant to detect
older versions of VirtualBox, while changing the second checked value
from `Oracle Corporation` to `VirtualBox` will reliably detect later and future
versions.

2 years agoMerge pull request #21129 from yuwata/network-dhcp6-pd-vs-ndisc
Yu Watanabe [Wed, 27 Oct 2021 03:15:18 +0000 (12:15 +0900)] 
Merge pull request #21129 from yuwata/network-dhcp6-pd-vs-ndisc

network: several follow-ups for DHCPv6-PD

2 years agohwdb: Tag IR cameras as such 21130/head
Bastien Nocera [Tue, 26 Oct 2021 10:17:27 +0000 (12:17 +0200)] 
hwdb: Tag IR cameras as such

So that front-ends can ignore them if they wish to.

See https://gitlab.gnome.org/GNOME/cheese/-/merge_requests/4

2 years agojson: do something remotely reasonable when we see NaN/infinity
Lennart Poettering [Tue, 26 Oct 2021 13:45:49 +0000 (15:45 +0200)] 
json: do something remotely reasonable when we see NaN/infinity

JSON doesn't have NaN/infinity/-infinity concepts in the spec.
Implementations vary what they do with it. JSON5 + Python simply
generate special words "NAN" and "Inifinity" from it. Others generate
"null" for it.

At this point we never actually want to output this, so let's be
conservative and generate RFC compliant JSON, i.e. convert to null.

One day should JSON5 actually become a thing we can revisit this, but in
that case we should implement things via a flag, and only optinally
process nan/infinity/-infinity.

This patch is extremely simple: whenever accepting a
nan/infinity/-infinity from outside it converts it to NULL. I.e. we
convert on input, not output.

2 years agotest: add a missing `udevadm settle` to the multipath test case
Frantisek Sumsal [Tue, 26 Oct 2021 12:39:02 +0000 (14:39 +0200)] 
test: add a missing `udevadm settle` to the multipath test case

8a088877ab92d3777d7f487393e3daef6edf43ff uncovered a missing `udevadm
settle` in the multipath test case, causing the test to occasionally
fail with:

```
[   41.718617] testsuite-64.sh[806]: + for i in {0..63}
[   41.727917] systemd-udevd[1120]: sdhf: /usr/lib/udev/rules.d/60-persistent-storage.rules:66 Importing properties from results of 'scsi_id --export --whitelisted -d /dev/sdhf'
[   41.728668] testsuite-64.sh[2341]: ++ printf %.4d 1
[   41.733851] systemd-udevd[1415]: sdhc: Adding watch on '/dev/sdhc'
[   41.734477] testsuite-64.sh[806]: + wwid=deaddeadbeef0001
[   41.734477] testsuite-64.sh[806]: + path=/dev/disk/by-id/wwn-0xdeaddeadbeef0001
[   41.746174] systemd-udevd[1409]: sdhb: 'scsi_id --export --whitelisted -d /dev/sdhb'(out) 'ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20'
[   41.747058] testsuite-64.sh[2342]: ++ readlink -f /dev/disk/by-id/wwn-0xdeaddeadbeef0001
[   41.755512] testsuite-64.sh[806]: + dmpath=/dev/sdi
[   41.755512] testsuite-64.sh[806]: + lsblk /dev/disk/by-id/wwn-0xdeaddeadbeef0001
[   41.766884] systemd-udevd[1402]: sdhd: 'scsi_id --export --whitelisted -d /dev/sdhd'(out) 'ID_VENDOR=QEMU'
[   41.767532] testsuite-64.sh[2343]: NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
[   41.767532] testsuite-64.sh[2343]: sdi    8:128  0  512B  0 disk
[   41.779219] systemd-udevd[1400]: dm-33: 'kpartx_id 254 33 mpath-3deaddeadbeef0051'(out) 'DM_WWN=0xdeaddeadbeef0051'
[   41.779902] testsuite-64.sh[806]: + multipath -C /dev/sdi
[   41.785296] systemd-udevd[1414]: dm-31: Device processed (SEQNUM=4839, ACTION=change)
[   41.785925] testsuite-64.sh[2344]: 37.658168 | /dev/sdi is not a dm device
```

2 years agoman: adjust the explanations related to the DHCPv6 client starting mode 21129/head
Yu Watanabe [Thu, 14 Oct 2021 10:27:08 +0000 (19:27 +0900)] 
man: adjust the explanations related to the DHCPv6 client starting mode

2 years agonetwork: dhcp6: make UplinkInterface=:self imply WithoutRA=solicit
Yu Watanabe [Thu, 14 Oct 2021 10:10:49 +0000 (19:10 +0900)] 
network: dhcp6: make UplinkInterface=:self imply WithoutRA=solicit

2 years agonetwork: do not restart DHCPv6 client when WithoutRA= is set
Yu Watanabe [Thu, 14 Oct 2021 07:35:29 +0000 (16:35 +0900)] 
network: do not restart DHCPv6 client when WithoutRA= is set

Previously, even if WithoutRA= is specified, the DHCPv6 client may be
restarted in undesired mode when a RA is received.

2 years agonetwork: deprecate ForceDHCPv6PDOtherInformation= setting
Yu Watanabe [Thu, 14 Oct 2021 06:42:33 +0000 (15:42 +0900)] 
network: deprecate ForceDHCPv6PDOtherInformation= setting

The setting is completely meaningless, as WithoutRA= and UseDelegatedPrefix=
in [DHCPv6] section, and DHCPv6Client= in [IPv6AcceptRA] section control
the behavior.

2 years agoMerge pull request #21000 from yuwata/network-dhcp6-pd-introduce-uplink
Yu Watanabe [Tue, 26 Oct 2021 15:32:50 +0000 (00:32 +0900)] 
Merge pull request #21000 from yuwata/network-dhcp6-pd-introduce-uplink

network: dhcp6: introduce UplinkInterface= for prefix delegation

2 years agoMerge pull request #21126 from bluca/meta_arch
Zbigniew Jędrzejewski-Szmek [Tue, 26 Oct 2021 14:24:22 +0000 (16:24 +0200)] 
Merge pull request #21126 from bluca/meta_arch

docs/COREDUMP_PACKAGE_METADATA: add architecture field

2 years agoupdate TODO
Lennart Poettering [Tue, 26 Oct 2021 13:40:25 +0000 (15:40 +0200)] 
update TODO

2 years agodocs/COREDUMP_PACKAGE_METADATA: ELF section should be read-only and 4-bytes-aligned 21126/head
Luca Boccassi [Tue, 26 Oct 2021 11:49:39 +0000 (12:49 +0100)] 
docs/COREDUMP_PACKAGE_METADATA: ELF section should be read-only and 4-bytes-aligned

2 years agotest-network: add test cases for DHCPv6 prefix delegation 21000/head
Yu Watanabe [Thu, 14 Oct 2021 17:51:18 +0000 (02:51 +0900)] 
test-network: add test cases for DHCPv6 prefix delegation

2 years agonetwork: dhcp6: introduce UplinkInterface= for DHCP6 prefix delegation
Yu Watanabe [Wed, 13 Oct 2021 09:00:52 +0000 (18:00 +0900)] 
network: dhcp6: introduce UplinkInterface= for DHCP6 prefix delegation

2 years agonetwork: move config_parse_uplink() to networkd-dhcp-common.[ch]
Yu Watanabe [Wed, 13 Oct 2021 08:15:10 +0000 (17:15 +0900)] 
network: move config_parse_uplink() to networkd-dhcp-common.[ch]

2 years agonetwork: dhcp6pd: do not trigger prefix reassignment for all downstreams when a new...
Yu Watanabe [Thu, 21 Oct 2021 08:49:08 +0000 (17:49 +0900)] 
network: dhcp6pd: do not trigger prefix reassignment for all downstreams when a new downstream appears

It is not necessary to reconfigure other interfaces.

2 years agonetwork: dhcp6: do not reconfigure/restart DHCPv6 clients when a new downstream appears
Yu Watanabe [Wed, 13 Oct 2021 07:52:24 +0000 (16:52 +0900)] 
network: dhcp6: do not reconfigure/restart DHCPv6 clients when a new downstream appears

Previously, when a downstream appears which requests delegated prefix to
be assigned, then possibly restart all DHCPv6 clients for another
interfaces.

This makes networkd always honor the UseDelegatedPrefix= setting, and
not restart DHCPv6 clients.

2 years agonetwork: dhcp6: introduce UseDelegatedPrefix= setting and enable by default
Yu Watanabe [Wed, 13 Oct 2021 07:26:09 +0000 (16:26 +0900)] 
network: dhcp6: introduce UseDelegatedPrefix= setting and enable by default

Previously, the prefix delegation is enabled when at least one
downstream interfaces request it. But, when the DHCPv6 client on the
upstream interface is configured, some downstream interfaces may not
exist yet, nor have .network file assigned.

Also, if a system has thousands of interfaces, then the previous logic
introduce O(n^2) search.

This makes the prefix delegation is always enabled, except when it is
explicitly disabled. Hopefully, that should not break anything, as the
DHCPv6 server should ignore the prefix delegation request if the server
do not have any prefix to delegate.

2 years agohwdb: Allow console users access to media* nodes
Bastien Nocera [Tue, 26 Oct 2021 09:57:30 +0000 (11:57 +0200)] 
hwdb: Allow console users access to media* nodes

Newer webcams and video devices have controls only available through
/dev/media* nodes. Make sure they're accessible in the same way as
/dev/video* nodes.

Closes: #21054
2 years agochange req meson version
gregzuro [Mon, 25 Oct 2021 23:51:40 +0000 (16:51 -0700)] 
change req meson version

since `meson compile` first appears in 0.54.0

2 years agoMerge pull request #21122 from yuwata/network-optimize-reload
Yu Watanabe [Tue, 26 Oct 2021 06:55:01 +0000 (15:55 +0900)] 
Merge pull request #21122 from yuwata/network-optimize-reload

network: slightly optimize "networkctl reload"

2 years agotest-network: reconfigure interface instead of restarting networkd 21122/head
Yu Watanabe [Mon, 25 Oct 2021 17:47:30 +0000 (02:47 +0900)] 
test-network: reconfigure interface instead of restarting networkd

2 years agonetwork: delay dropping addresses or so on reloading .network files
Yu Watanabe [Mon, 25 Oct 2021 17:29:09 +0000 (02:29 +0900)] 
network: delay dropping addresses or so on reloading .network files

When a .network file is updated but its change is not so big, it is not
necessary to first drop all configs and then reassign later again.
This slightly optimize such situation. First foreignize all configs, and
then drop later when it is not requested by the updated .network file.

2 years agohomework: replace homegrown "dir-is-empty" check with dir_is_empty_at()
Lennart Poettering [Thu, 21 Oct 2021 16:07:50 +0000 (18:07 +0200)] 
homework: replace homegrown "dir-is-empty" check with dir_is_empty_at()

2 years agoMerge pull request #21097 from poettering/dir-is-empty-fix
Yu Watanabe [Mon, 25 Oct 2021 23:12:50 +0000 (08:12 +0900)] 
Merge pull request #21097 from poettering/dir-is-empty-fix

dir_is_empty_at() tweaks

2 years agotest: enable debug logging of systemd-udevd
Yu Watanabe [Mon, 25 Oct 2021 20:06:49 +0000 (05:06 +0900)] 
test: enable debug logging of systemd-udevd

Otherwise, it is hard to debug when the test fails.

2 years agonetwork: dhcp6pd: do not assign downstream prefix when RADV is requested but not...
Yu Watanabe [Thu, 21 Oct 2021 14:36:04 +0000 (23:36 +0900)] 
network: dhcp6pd: do not assign downstream prefix when RADV is requested but not configured yet

2 years agonetwork: ndisc: fix behavior when DHCPv6Client=always
Yu Watanabe [Thu, 14 Oct 2021 07:16:07 +0000 (16:16 +0900)] 
network: ndisc: fix behavior when DHCPv6Client=always

The man page says that when 'always' is set, the DHCPv6 client always
starts in managed mode, and that means we need to ignore the RA flags.

2 years agoMerge pull request #21119 from yuwata/network-dhcp6-pd-cleanups
Yu Watanabe [Mon, 25 Oct 2021 23:10:56 +0000 (08:10 +0900)] 
Merge pull request #21119 from yuwata/network-dhcp6-pd-cleanups

network: dhcp6pd: several cleanups

2 years agolibsystemd-network: do not warn when log_dhcp_client() or friends with NULL
Yu Watanabe [Sun, 24 Oct 2021 19:48:39 +0000 (04:48 +0900)] 
libsystemd-network: do not warn when log_dhcp_client() or friends with NULL

2 years agodocs/COREDUMP_PACKAGE_METADATA: add architecture field
Luca Boccassi [Mon, 25 Oct 2021 22:09:43 +0000 (23:09 +0100)] 
docs/COREDUMP_PACKAGE_METADATA: add architecture field

2 years agotree-wide: explicitly unpoison getdents64() memory 21097/head
Lennart Poettering [Mon, 25 Oct 2021 08:59:56 +0000 (10:59 +0200)] 
tree-wide: explicitly unpoison getdents64() memory

Apparently memory sanitizer doesn't grok getdents64() properly. Let's
address that by explicitly marken memory initialized by getdents64() as
unpoisoned.

2 years agotest: add test for dir_is_empty_at()
Lennart Poettering [Fri, 22 Oct 2021 22:32:59 +0000 (00:32 +0200)] 
test: add test for dir_is_empty_at()

2 years agostat-util: make sure dir_is_empty_at() does something useful in all cases
Lennart Poettering [Fri, 22 Oct 2021 22:31:33 +0000 (00:31 +0200)] 
stat-util: make sure dir_is_empty_at() does something useful in all cases

2 years agostat-util: optimize dir_is_empty_at() a bit, by using getdents64()
Lennart Poettering [Fri, 22 Oct 2021 22:30:14 +0000 (00:30 +0200)] 
stat-util: optimize dir_is_empty_at() a bit, by using getdents64()

That way we have a single syscall only for it, instead of the multiple
readdir() and friends do. And we can operate entirely on the stack, no
malloc() implicit.

2 years agodirent-util: add FOREACH macro for iterating through getdents64() buffers
Lennart Poettering [Fri, 22 Oct 2021 22:28:24 +0000 (00:28 +0200)] 
dirent-util: add FOREACH macro for iterating through getdents64() buffers

We already have a similar loop twice, let's make it easier to read via
an iteration macro.

(The new macro is a bit more careful even, as it verifies the full
dirent fits into the remaining buffer when returning it)

2 years agodirent-util: move getdents64() related definitions to common header
Lennart Poettering [Fri, 22 Oct 2021 22:21:20 +0000 (00:21 +0200)] 
dirent-util: move getdents64() related definitions to common header

We want to reuse getdents64() wherever necessary, let's hence move
definitions useful for that into public code.

2 years agostat-util: specify O_DIRECTORY when reopening dir in dir_is_empty_at()
Lennart Poettering [Thu, 21 Oct 2021 16:07:06 +0000 (18:07 +0200)] 
stat-util: specify O_DIRECTORY when reopening dir in dir_is_empty_at()

That way we can fail earlier if the specified fd is not actually a
directory.

(Also, it's not exactly according to standards to open things without
either O_RDONLY/O_RDWR...)

2 years agoudev: do not try to rename interface if it is already up
Yu Watanabe [Sun, 24 Oct 2021 11:43:34 +0000 (20:43 +0900)] 
udev: do not try to rename interface if it is already up

See dev_change_name() in kernel's net/core/dev.c.

Fixes #21105.

2 years agonetwork: rename function
Yu Watanabe [Mon, 25 Oct 2021 17:27:26 +0000 (02:27 +0900)] 
network: rename function

2 years agonetwork: dhcp6: rename variables 21119/head
Yu Watanabe [Wed, 13 Oct 2021 07:12:51 +0000 (16:12 +0900)] 
network: dhcp6: rename variables