]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agonetwork: use request queue to set IPv6LL address generation mode
Yu Watanabe [Fri, 21 May 2021 05:43:35 +0000 (14:43 +0900)] 
network: use request queue to set IPv6LL address generation mode

4 years agonetwork: use request queue to set interface group
Yu Watanabe [Fri, 21 May 2021 05:21:09 +0000 (14:21 +0900)] 
network: use request queue to set interface group

4 years agonetwork: use request queue to set MAC address
Yu Watanabe [Fri, 21 May 2021 04:57:24 +0000 (13:57 +0900)] 
network: use request queue to set MAC address

4 years agonetwork: use request queue to set link flags
Yu Watanabe [Fri, 21 May 2021 04:50:39 +0000 (13:50 +0900)] 
network: use request queue to set link flags

4 years agonetwork: use request queue to set MTU
Yu Watanabe [Thu, 20 May 2021 19:51:07 +0000 (04:51 +0900)] 
network: use request queue to set MTU

4 years agonetwork: merge link_configure() and link_configure_continue() again
Yu Watanabe [Mon, 24 May 2021 05:59:09 +0000 (14:59 +0900)] 
network: merge link_configure() and link_configure_continue() again

It is not necessary to stop whole configuration process until MTU and
IPv6LL address generation mode are set. But it is enough just setting
IPv6 MTU again after MTU is set, and dropping IPv6LL address after
setting the address generation mode.

4 years agonetwork: drop meaningless condition about setting MTU
Yu Watanabe [Mon, 24 May 2021 05:53:05 +0000 (14:53 +0900)] 
network: drop meaningless condition about setting MTU

The condition does not fix infinite loop of interface reset, as the
interface is reset after netlink reply is received, thus setting_mtu is
false.

See also #18738.

4 years agonetwork: introduces link_drop_ipv6ll_addresses()
Yu Watanabe [Sun, 23 May 2021 14:47:19 +0000 (23:47 +0900)] 
network: introduces link_drop_ipv6ll_addresses()

It is not necessary to parse whole message and store the address in
Link::addresses_foreign, as the address will be removed soon later.

4 years agonetwork: make link enter failed state on failure in link_update() and link_reset_carr...
Yu Watanabe [Tue, 18 May 2021 05:59:10 +0000 (14:59 +0900)] 
network: make link enter failed state on failure in link_update() and link_reset_carrier()

Previously, several failures in link_carrier_gained() make link enter
failed state, and other errors are ignored. Now, all failures in
link_carrier_gained(), moreover, link_update() are critical.

4 years agonetwork: rename link_acquire_conf() -> link_acquire_dynamic_conf()
Yu Watanabe [Tue, 18 May 2021 05:46:22 +0000 (14:46 +0900)] 
network: rename link_acquire_conf() -> link_acquire_dynamic_conf()

To clarify it starts dynamic configuration engines e.g. DHCP clients.

4 years agonetwork: request to configure static settings earlier
Yu Watanabe [Tue, 18 May 2021 05:42:47 +0000 (14:42 +0900)] 
network: request to configure static settings earlier

Now, all static configs should be ordered after the link gains its carrier.
So, it is not necessary to wait for that before queuing requests.

4 years agonetwork: introduce request_hash_ops to dedup requests
Yu Watanabe [Wed, 19 May 2021 02:30:35 +0000 (11:30 +0900)] 
network: introduce request_hash_ops to dedup requests

If KeepConfiguration= or ConfigureWithoutCarrier= is set, then the same
requests may be queued.

4 years agonetwork: expose hash and compare functions
Yu Watanabe [Wed, 19 May 2021 01:49:05 +0000 (10:49 +0900)] 
network: expose hash and compare functions

4 years agonetwork: use request queue to configure IPv6 proxy NDP addresses
Yu Watanabe [Tue, 18 May 2021 05:21:42 +0000 (14:21 +0900)] 
network: use request queue to configure IPv6 proxy NDP addresses

4 years agonetwork: move logic for setting proxy_ndp sysctl to networkd-sysctl.c
Yu Watanabe [Tue, 18 May 2021 05:00:48 +0000 (14:00 +0900)] 
network: move logic for setting proxy_ndp sysctl to networkd-sysctl.c

4 years agonetwork: introduce network_adjust_ipv6_proxy_ndp()
Yu Watanabe [Tue, 18 May 2021 04:59:49 +0000 (13:59 +0900)] 
network: introduce network_adjust_ipv6_proxy_ndp()

4 years agonetwork: address label: use request queue to configure address labels
Yu Watanabe [Tue, 18 May 2021 04:24:32 +0000 (13:24 +0900)] 
network: address label: use request queue to configure address labels

4 years agonetwork: address label: use struct in6_addr instead
Yu Watanabe [Tue, 18 May 2021 04:05:31 +0000 (13:05 +0900)] 
network: address label: use struct in6_addr instead

Address label is for IPv6.

4 years agonetwork: address label: refuse IPv4 mapped address with large prefix length
Yu Watanabe [Tue, 18 May 2021 04:02:16 +0000 (13:02 +0900)] 
network: address label: refuse IPv4 mapped address with large prefix length

See ip6addrlbl_alloc() in net/ipv6/addrlabel.c of kernel.

4 years agoin-addr-util: introduce in6_addr_is_ipv4_mapped_address()
Yu Watanabe [Tue, 18 May 2021 03:56:23 +0000 (12:56 +0900)] 
in-addr-util: introduce in6_addr_is_ipv4_mapped_address()

4 years agonetwork: use request queue to configure bridge MDB
Yu Watanabe [Mon, 17 May 2021 20:45:28 +0000 (05:45 +0900)] 
network: use request queue to configure bridge MDB

4 years agonetwork: rename MdbEntry -> BridgeMDB
Yu Watanabe [Mon, 17 May 2021 20:09:59 +0000 (05:09 +0900)] 
network: rename MdbEntry -> BridgeMDB

4 years agotest-network: fix setting name
Yu Watanabe [Thu, 27 May 2021 17:19:38 +0000 (02:19 +0900)] 
test-network: fix setting name

This fixes an issue introduced by 72ffb9133d686bef6d9d79e9d2899571651d5c1b.

4 years agotest-network: add a testcase for UplinkInterface= for DHCP server
Yu Watanabe [Mon, 17 May 2021 18:50:04 +0000 (03:50 +0900)] 
test-network: add a testcase for UplinkInterface= for DHCP server

4 years agonetwork: introduce UplinkInterface= setting for DHCP server
Yu Watanabe [Mon, 17 May 2021 18:42:19 +0000 (03:42 +0900)] 
network: introduce UplinkInterface= setting for DHCP server

4 years agonetwork: make manager_find_uplink() uses stored route information
Yu Watanabe [Mon, 17 May 2021 18:01:58 +0000 (03:01 +0900)] 
network: make manager_find_uplink() uses stored route information

networkd already has all information about routes. It is not necessary
to re-read them by using local_gateways().

This also makes manager_find_uplink() take family.

4 years agonetwork: restart DHCP server on carrier gain
Yu Watanabe [Tue, 18 May 2021 07:12:40 +0000 (16:12 +0900)] 
network: restart DHCP server on carrier gain

4 years agosd-dhcp-server: make sd_dhcp_server_start() no-op if it is already running
Yu Watanabe [Tue, 18 May 2021 07:12:02 +0000 (16:12 +0900)] 
sd-dhcp-server: make sd_dhcp_server_start() no-op if it is already running

4 years agonetwork: use request queue to configure DHCP server
Yu Watanabe [Mon, 17 May 2021 16:55:42 +0000 (01:55 +0900)] 
network: use request queue to configure DHCP server

4 years agocryptsetup-pkcs11: use erase_and_free for decrypted key cleanup.
Ondrej Kozina [Thu, 27 May 2021 06:50:01 +0000 (08:50 +0200)] 
cryptsetup-pkcs11: use erase_and_free for decrypted key cleanup.

It's hard to hit but it could leave decrypted key in memory on error
path.

4 years agocryptsetup: Fix misplaced assert.
Ondrej Kozina [Mon, 31 May 2021 17:08:14 +0000 (19:08 +0200)] 
cryptsetup: Fix misplaced assert.

Seems the assert should be placed in-before decrypted_key
pointer is passed to libcryptsetup API.

Original placement would trigger abort in case tpm2
hw was not present in the system while required
to activate crypt devices.

4 years agoMerge pull request #19839 from yuwata/network-address-fix-flags-handling
Yu Watanabe [Mon, 7 Jun 2021 18:38:15 +0000 (03:38 +0900)] 
Merge pull request #19839 from yuwata/network-address-fix-flags-handling

network: fix address flag handling

4 years agoinstall: allow adding plain templates to .wants/ or .requires/
Zbigniew Jędrzejewski-Szmek [Fri, 4 Jun 2021 13:26:37 +0000 (15:26 +0200)] 
install: allow adding plain templates to .wants/ or .requires/

Fixes #19437.

As reported in the bug:

> # drkonqi-coredump-processor@.service
>  ...
> [Install]
> WantedBy=systemd-coredump@.service
>
> The plan here is to have a systemd-coredump@ instance start the same %i for
> drkonqi-coredump-processor@. Works perfectly when creating the symlink manually
> ln -sv /usr/lib/systemd/system/drkonqi-coredump-processor@.service
> /etc/systemd/system/systemd-coredump@.service.wants/.

When DefaultInstance is set, we replace template references with
template@default-inst. But in this case we want to create a symlink for the
template name, so that systemd will fill in the instance from the
wanting/requiring unit. This is only possible for those units that actually
have an instance set, so we create the symlink only from .requires/ or .wants
of an instantiated unit (then this specific instance will be used), or a
template (than some instance will be inherited later).

Specifically:
...
[Install]
WantedBy=other@.service, fixed.service
DefaultInstance=inst

→ enable foo@.service creates other@.service.wants/foo@inst.service, and
other@a.service will want foo@inst.service, and other@b.service will want foo@inst.service,
and fixed.service will want foo@inst.service.

Without DefaultInstance,
→ enable foo@.service creates other@.service.wants/foo@.service, and
other@a.service would want foo@a.service, and other@b.service would want foo@b.service,
but enablement fails because no dependency can be created for fixed.service:

  Failed to enable unit, unit fixed.service is a non-template unit.

4 years agoMerge pull request #19835 from keszybz/user-manager-bpf-errors
Yu Watanabe [Mon, 7 Jun 2021 16:50:57 +0000 (01:50 +0900)] 
Merge pull request #19835 from keszybz/user-manager-bpf-errors

Silence errors about BPF object permissions in user manager

4 years agoudevadm: fix --tag-match help + description
Lennart Poettering [Mon, 7 Jun 2021 14:08:45 +0000 (16:08 +0200)] 
udevadm: fix --tag-match help + description

4 years agoMerge pull request #19837 from keszybz/disable-more-units
Yu Watanabe [Mon, 7 Jun 2021 16:46:15 +0000 (01:46 +0900)] 
Merge pull request #19837 from keszybz/disable-more-units

Disable more units

4 years agoMerge pull request #19815 from yuwata/sd-device-clone
Yu Watanabe [Mon, 7 Jun 2021 16:45:45 +0000 (01:45 +0900)] 
Merge pull request #19815 from yuwata/sd-device-clone

sd-device: make cloned sd_device object can read udev database without uevent file

4 years agoMerge pull request #19820 from yuwata/udev-node-fix-hashed-path
Lennart Poettering [Mon, 7 Jun 2021 15:19:38 +0000 (17:19 +0200)] 
Merge pull request #19820 from yuwata/udev-node-fix-hashed-path

udev: fix conflict of hashed string

4 years agonetwork: address: always read address flag from IFA_FLAGS attribute 19839/head
Yu Watanabe [Mon, 7 Jun 2021 12:53:35 +0000 (21:53 +0900)] 
network: address: always read address flag from IFA_FLAGS attribute

Otherwise, update flag become incomplete and the IFA_F_MANAGETEMPADDR flag
will not be stored, thus no temporary addresses will be removed when
networkd requests to remove the main address.

Follow-up for a8481354f0cd2c0855472193d0f57c7a77674969.
Fixes #13218.
Fixes #19838.

4 years agonetwork: show address flag in debugging logs
Yu Watanabe [Mon, 7 Jun 2021 13:12:59 +0000 (22:12 +0900)] 
network: show address flag in debugging logs

4 years agopid1: only add a Wants= type dependency on /tmp when PrivateTmp=yes
Franck Bui [Fri, 28 Aug 2020 14:03:06 +0000 (16:03 +0200)] 
pid1: only add a Wants= type dependency on /tmp when PrivateTmp=yes

We support that tmp.mount being masked, and this should not be considered an
error.

4 years agocore: disable "update" units in the initramfs 19837/head
Zbigniew Jędrzejewski-Szmek [Mon, 7 Jun 2021 11:29:19 +0000 (13:29 +0200)] 
core: disable "update" units in the initramfs

Initially I wanted to add ConditionPathExists=!/etc/initrd-release in various
units (ldconfig.service, systemd-sysusers.service, systemd-hwdb-update.service,
systemd-journal-catalog-update, systemd-update-done.service), but I think it's
better to just disable the mechanism in the initrd altogether. Initrd images
are put together in a very particular way, and there is not need to do
post-update steps on them. If a unit from some other package winds up in the
initrd, we wouldn't want to invoke it either.

Also, any modifications are ephemeral, so any update would happen on every
use. And finally, initrd images are all about speed, and we shouldn't invoke
any unneeded services.

4 years agounits: stop automount unit when shutting down
Zbigniew Jędrzejewski-Szmek [Tue, 1 Jun 2021 06:05:03 +0000 (08:05 +0200)] 
units: stop automount unit when shutting down

This is currently our only .automount unit. We wouldn't want to trigger it
accidentally during shutdown, so let's stop it too.

4 years agoRename crypttab opt silent to password-echo
Sebastian Blunt [Thu, 3 Jun 2021 07:10:38 +0000 (00:10 -0700)] 
Rename crypttab opt silent to password-echo

Use the option name 'password-echo' instead of the generic term
'silent'.

Make the option take an argument for better control over echoing
behavior.

Related discussion in https://github.com/systemd/systemd/pull/19619

4 years agocore: downgrade errors about BPF loading when called from socket_bind_supported() 19835/head
Zbigniew Jędrzejewski-Szmek [Mon, 7 Jun 2021 08:20:30 +0000 (10:20 +0200)] 
core: downgrade errors about BPF loading when called from socket_bind_supported()

prepare_socket_bind_bpf() is called from two sites: socket_bind_supported() and
socket_bind_install_impl(). For the latter, when errors occur we certainly want
to log, since they'll be fatal for the unit.  But for the former, we should be
quiet, at least on the "expected" errors like lack of permissions. I kept error
on map resizing and such, which should not fail, at log_warning(). They are not
fatal when called from socket_bind_suppported(), but still a sign that
something is off.

Currently BPF filters can only be used by privileged users. Thus each systemd
--user will fail in socket_bind_supported(). With the patch, we only log this
at debug level.

https://lwn.net/ml/bpf/cover.1620499942.git.yifeifz2@illinois.edu/ gives some
hope that unprivileged access will be possible, so let's keep the code trying.
We might get lucky and get support for filters in user mode without any changes
on our side.

4 years agocore/bpf: add forgotten %m
Zbigniew Jędrzejewski-Szmek [Sun, 6 Jun 2021 11:12:18 +0000 (13:12 +0200)] 
core/bpf: add forgotten %m

4 years agoMerge pull request #19793 from keszybz/tmpfiles-autofs-and-globs
Luca Boccassi [Mon, 7 Jun 2021 08:14:27 +0000 (09:14 +0100)] 
Merge pull request #19793 from keszybz/tmpfiles-autofs-and-globs

tmpfiles: better handling of autofs and globs

4 years agosd-device: make cloned sd_device object can read udev database without uevent file 19815/head
Yu Watanabe [Fri, 4 Jun 2021 05:56:21 +0000 (14:56 +0900)] 
sd-device: make cloned sd_device object can read udev database without uevent file

Some devices sent CHANGE and REMOVE uevent simultaneously.
To support that such device read udev database, let's copy minimal set of
properties which requires to read the database.

Fixes #19788.

4 years agosd-device: do not try to read uevent file multiple times
Yu Watanabe [Fri, 4 Jun 2021 08:28:34 +0000 (17:28 +0900)] 
sd-device: do not try to read uevent file multiple times

4 years agosd-device: set driver subsystem if the sd_device object is generated from nulstr
Yu Watanabe [Fri, 4 Jun 2021 08:18:25 +0000 (17:18 +0900)] 
sd-device: set driver subsystem if the sd_device object is generated from nulstr

Otherwise, the sd_device object cannot read correct udev database file.

4 years agoconf-parser: make config_parse_tristate() accept an empty string
Yu Watanabe [Fri, 4 Jun 2021 17:30:17 +0000 (02:30 +0900)] 
conf-parser: make config_parse_tristate() accept an empty string

Fixes #19822.

4 years agoudev: always use last 11 chars for hash string 19820/head
Yu Watanabe [Fri, 4 Jun 2021 13:28:09 +0000 (22:28 +0900)] 
udev: always use last 11 chars for hash string

This makes the last 11 chars are always preserved for hashed string.
So, it is hard to generate a path which conflicts to another path.

Fixes an issue demonstrated in the previous commit.

4 years agotest: add a testcase that demonstrates a conflict of hashed filename
Yu Watanabe [Fri, 4 Jun 2021 13:16:02 +0000 (22:16 +0900)] 
test: add a testcase that demonstrates a conflict of hashed filename

The commit e64943363a8dd8bd320c2b633478be8befd1af5c introduces hashed
path at the end of the filename. But we can easily generate the path
which conflicts another path. The issue will be fixed in later commit.

4 years agoshell-completion: udevadm: support --uuid option
Yu Watanabe [Fri, 4 Jun 2021 09:36:01 +0000 (18:36 +0900)] 
shell-completion: udevadm: support --uuid option

Follow-up for 730b9c1e1469dfd6d6850e9ea06da3cac469eba0.

4 years agoMerge pull request #19796 from yuwata/udev-node-cleanups
Yu Watanabe [Fri, 4 Jun 2021 12:46:43 +0000 (21:46 +0900)] 
Merge pull request #19796 from yuwata/udev-node-cleanups

udev: several cleanups about creating device symlink

4 years agohwdb: Add ProBook to use micmute hotkey
Kai-Heng Feng [Thu, 3 Jun 2021 16:20:32 +0000 (00:20 +0800)] 
hwdb: Add ProBook to use micmute hotkey

Like HP EliteBooks and ZBooks, all ProBooks use the same micmute
scancode.

4 years agotest: don't expect that clone() always makes it to the kernel
Lennart Poettering [Fri, 4 Jun 2021 08:35:43 +0000 (10:35 +0200)] 
test: don't expect that clone() always makes it to the kernel

We might get EPERM on certain clone() flag combinations. Apparently in
Docker for example.

Prompted by: https://github.com/systemd/systemd/pull/19800#issuecomment-854196491

4 years agoTODO: coalesce entries for tmpfiles 19793/head
Zbigniew Jędrzejewski-Szmek [Wed, 2 Jun 2021 14:32:36 +0000 (16:32 +0200)] 
TODO: coalesce entries for tmpfiles

4 years agotmpfiles: do not check if unresolved globs are autofs paths
Zbigniew Jędrzejewski-Szmek [Wed, 2 Jun 2021 13:44:29 +0000 (15:44 +0200)] 
tmpfiles: do not check if unresolved globs are autofs paths

With the previous commit, we would not complain about the not-found path, but
the check is still not useful. We use a libc function to resolve the glob, and
it has no notion of treating autofs specially. So we can't avoid touching
autofs when resolving globs. But usually the glob is found in the last
component of the path, so if we strip the glob part, we can still do a useful
check in many cases. (E.g. if /var/tmp is on autofs, something like
"/var/tmp/<glob>" is much more likely than "/var/<glob-that-matches-tmp>/<something>".)

With the system config in F34, we check the following prefixes:

/var/tmp/abrt/* → /var/tmp/abrt/
/run/log/journal/08a5690a2eed47cf92ac0a5d2e3cf6b0/*.journal* → /run/log/journal/08a5690a2eed47cf92ac0a5d2e3cf6b0/
/var/lib/systemd/coredump/.#core*.21e5c6c28c5747e6a4c7c28af9560a3d* → /var/lib/systemd/coredump/
/tmp/podman-run-* → /tmp/
/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-*/tmp → /tmp/
/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-* → /tmp/
/tmp/containers-user-* → /tmp/
/var/tmp/beakerlib-* → /var/tmp/
/var/tmp/dnf*/locks/* → /var/tmp/
/var/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-*/tmp → /var/tmp/
/var/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-* → /var/tmp/
/var/tmp/abrt/* → /var/tmp/abrt/
/var/tmp/beakerlib-* → /var/tmp/
/var/tmp/dnf*/locks/* → /var/tmp/
/tmp/podman-run-* → /tmp/
/tmp/containers-user-* → /tmp/
/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-* → /tmp/
/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-*/tmp → /tmp/
/var/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-* → /var/tmp/
/var/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-*/tmp → /var/tmp/
/var/lib/systemd/coredump/.#core*.21e5c6c28c5747e6a4c7c28af9560a3d* → /var/lib/systemd/coredump/
/run/log/journal/08a5690a2eed47cf92ac0a5d2e3cf6b0/*.journal* → /run/log/journal/08a5690a2eed47cf92ac0a5d2e3cf6b0/

4 years agobasic/glob-util: add helper to strip the glob part from a glob
Zbigniew Jędrzejewski-Szmek [Wed, 2 Jun 2021 14:01:40 +0000 (16:01 +0200)] 
basic/glob-util: add helper to strip the glob part from a glob

4 years agotools/analyze-dump-sort: a helper to compare two 'systemd-analyze dump' outputs
Zbigniew Jędrzejewski-Szmek [Wed, 2 Jun 2021 14:56:31 +0000 (16:56 +0200)] 
tools/analyze-dump-sort: a helper to compare two 'systemd-analyze dump' outputs

Lines in the dumps are ordered by some pseudo-random hashmap entry order, which
makes it hard to diff two outputs. This sort the entries alphabetically, and
also sorts items within the entries, and supresses timestamps and other fields
which always vary.

We could sort the output inside of systemd itself, but it'd make things more
complex, and we probably don't need output to be sorted in most cases. It also
wouldn't be enough, because timestamps and such would still need to be ignored
to do a nice diff. So I think doing the sorting and suppression in a python
helper is a better approach.

4 years agodocs/ARCHITECTURE: more markup and unicode
Zbigniew Jędrzejewski-Szmek [Fri, 4 Jun 2021 08:50:33 +0000 (10:50 +0200)] 
docs/ARCHITECTURE: more markup and unicode

4 years agoNEWS: adjust grammar and other small changes
Zbigniew Jędrzejewski-Szmek [Fri, 4 Jun 2021 08:25:42 +0000 (10:25 +0200)] 
NEWS: adjust grammar and other small changes

4 years agofix typo
Yu Watanabe [Fri, 4 Jun 2021 04:51:41 +0000 (13:51 +0900)] 
fix typo

4 years agodocs: use uppercase letters in title
Lennart Poettering [Fri, 4 Jun 2021 08:34:56 +0000 (10:34 +0200)] 
docs: use uppercase letters in title

We usually do it that way, do so here, too.

4 years agomore 249 NEWS work
Lennart Poettering [Fri, 4 Jun 2021 08:32:59 +0000 (10:32 +0200)] 
more 249 NEWS work

4 years agoutil: drop DEV_NUM_PATH_MAX and xsprintf_dev_num_path() 19796/head
Yu Watanabe [Wed, 2 Jun 2021 18:22:16 +0000 (03:22 +0900)] 
util: drop DEV_NUM_PATH_MAX and xsprintf_dev_num_path()

4 years agoutil: move device-node.[ch] to shared
Yu Watanabe [Wed, 2 Jun 2021 18:12:53 +0000 (03:12 +0900)] 
util: move device-node.[ch] to shared

4 years agoudev: warn and propagate error in creating device symlink
Yu Watanabe [Wed, 2 Jun 2021 16:27:39 +0000 (01:27 +0900)] 
udev: warn and propagate error in creating device symlink

Also, this makes the file in /run/udev/links/ is kept on failure, as the
target of the symbolic link may be belonging to another device.

4 years agoudev: try to create device symlink directly only when the link does not exist yet
Yu Watanabe [Wed, 2 Jun 2021 16:16:44 +0000 (01:16 +0900)] 
udev: try to create device symlink directly only when the link does not exist yet

4 years agoudev: extract same logic of creating device symlink
Yu Watanabe [Wed, 2 Jun 2021 16:07:45 +0000 (01:07 +0900)] 
udev: extract same logic of creating device symlink

This also limits the number of trial.

4 years agoudev: use path_extract_directory() and path_equal()
Yu Watanabe [Wed, 2 Jun 2021 15:53:58 +0000 (00:53 +0900)] 
udev: use path_extract_directory() and path_equal()

4 years agoudev: refuse to create device symlink when a non-symlink file already exists
Yu Watanabe [Wed, 2 Jun 2021 15:44:39 +0000 (00:44 +0900)] 
udev: refuse to create device symlink when a non-symlink file already exists

4 years agoudev: make link_find_prioritized() return 0, 1, or negative errno
Yu Watanabe [Wed, 2 Jun 2021 15:10:52 +0000 (00:10 +0900)] 
udev: make link_find_prioritized() return 0, 1, or negative errno

4 years agoudev: slightly update log message and adjust log level
Yu Watanabe [Wed, 2 Jun 2021 14:56:04 +0000 (23:56 +0900)] 
udev: slightly update log message and adjust log level

4 years agoudev: logs if failed to remove devlink
Yu Watanabe [Wed, 2 Jun 2021 15:13:55 +0000 (00:13 +0900)] 
udev: logs if failed to remove devlink

4 years agoudev: do not try to remove /dev
Yu Watanabe [Wed, 2 Jun 2021 14:52:46 +0000 (23:52 +0900)] 
udev: do not try to remove /dev

4 years agoudev: use touch_file() and limit the number of trial
Yu Watanabe [Wed, 2 Jun 2021 14:36:03 +0000 (23:36 +0900)] 
udev: use touch_file() and limit the number of trial

4 years agoudev: logs when failed to remove saved info about devlink
Yu Watanabe [Wed, 2 Jun 2021 14:32:17 +0000 (23:32 +0900)] 
udev: logs when failed to remove saved info about devlink

4 years agoudev: refuse unsafe device symbolic link
Yu Watanabe [Wed, 2 Jun 2021 14:23:21 +0000 (23:23 +0900)] 
udev: refuse unsafe device symbolic link

4 years agotest: add tests for udev_node_escape_path()
Yu Watanabe [Thu, 3 Jun 2021 18:09:08 +0000 (03:09 +0900)] 
test: add tests for udev_node_escape_path()

4 years agoudev: use hashed path as a filename to save devlink
Yu Watanabe [Wed, 2 Jun 2021 13:33:34 +0000 (22:33 +0900)] 
udev: use hashed path as a filename to save devlink

4 years agoNEWS: more preparation for v249
Lennart Poettering [Thu, 3 Jun 2021 21:36:28 +0000 (23:36 +0200)] 
NEWS: more preparation for v249

4 years agodocs: add ARCHITECTURE.md with code map
Luca Boccassi [Thu, 3 Jun 2021 14:37:17 +0000 (15:37 +0100)] 
docs: add ARCHITECTURE.md with code map

Initial and coarse version of a code map, useful for people getting
started and looking at the repository for the first time.

4 years agoman: fix typo
adrian5 [Thu, 3 Jun 2021 19:05:20 +0000 (21:05 +0200)] 
man: fix typo

4 years agoutil: expose urlsafe_base64char()
Yu Watanabe [Wed, 2 Jun 2021 13:46:47 +0000 (22:46 +0900)] 
util: expose urlsafe_base64char()

4 years agoMerge pull request #19801 from poettering/device-unit-name-length
Lennart Poettering [Thu, 3 Jun 2021 16:08:07 +0000 (18:08 +0200)] 
Merge pull request #19801 from poettering/device-unit-name-length

pid1: reduce amount of warnings about sysfs device paths we cannot convert into device unit names

4 years agoNEWS: start putting together NEWS for v249
Lennart Poettering [Thu, 3 Jun 2021 15:57:23 +0000 (17:57 +0200)] 
NEWS: start putting together NEWS for v249

4 years agoMerge pull request #19806 from poettering/ask-pw-asterisk
Lennart Poettering [Thu, 3 Jun 2021 14:09:43 +0000 (16:09 +0200)] 
Merge pull request #19806 from poettering/ask-pw-asterisk

systemd-ask-password: make pw echo fully configurable

4 years agopid1: don't choke on overly long device paths 19801/head
Lennart Poettering [Wed, 2 Jun 2021 13:49:10 +0000 (15:49 +0200)] 
pid1: don't choke on overly long device paths

This mimics what we do for device units: if there's a device we cannot
synthesize a good swap unit name for, then proceed without failure.

4 years agopid1: make swap_process_new() void
Lennart Poettering [Wed, 2 Jun 2021 13:48:14 +0000 (15:48 +0200)] 
pid1: make swap_process_new() void

This matches device_process_new(): this function should not fail, since
it just reacts to external events.

4 years agopid1: downgrade if we can't make sense of the old device on MOVE uevent
Lennart Poettering [Wed, 2 Jun 2021 13:34:34 +0000 (15:34 +0200)] 
pid1: downgrade if we can't make sense of the old device on MOVE uevent

If the name of the old device didn#t work for us, we don't have to clean
anything up, since we know for sure that there won't be a device unit
for it. hence downgrade log message about it.

4 years agopid1: eat up errors in device_update_found_by_name()
Lennart Poettering [Wed, 2 Jun 2021 13:34:03 +0000 (15:34 +0200)] 
pid1: eat up errors in device_update_found_by_name()

We eat up all errors in the caller already, and rightly so.

4 years agopid1: properly propagate errors from device_setup_unit()
Lennart Poettering [Wed, 2 Jun 2021 13:31:50 +0000 (15:31 +0200)] 
pid1: properly propagate errors from device_setup_unit()

We want to propagate errors here, since we want to make dependent on the
success of creating the main device unit the creation of the auxiliary
device units. Thus if we suppress errors here we might end up in exotic
corner cases in a situation were we create the auxiliary ("following")
device units without the primary one.

4 years agopid1: reduce log noise generated by devices with overly long sysfs paths
Lennart Poettering [Wed, 2 Jun 2021 13:29:29 +0000 (15:29 +0200)] 
pid1: reduce log noise generated by devices with overly long sysfs paths

This basically does what 2c905207db37c691d4abef868165ad5ea2dd0f4f did
for mount units

Fixes: #16161
4 years agopid1: make return value of device_remove_old() void too
Lennart Poettering [Wed, 2 Jun 2021 08:36:53 +0000 (10:36 +0200)] 
pid1: make return value of device_remove_old() void too

4 years agopid1: shorten code a bit
Lennart Poettering [Wed, 2 Jun 2021 08:35:23 +0000 (10:35 +0200)] 
pid1: shorten code a bit

4 years agopid1: make device_process_new() return void
Lennart Poettering [Wed, 2 Jun 2021 08:31:41 +0000 (10:31 +0200)] 
pid1: make device_process_new() return void

We never use the return value, and we really shouldn't, hence let's drop
it.

4 years agoMerge pull request #19800 from poettering/podman-test
Lennart Poettering [Thu, 3 Jun 2021 12:11:59 +0000 (14:11 +0200)] 
Merge pull request #19800 from poettering/podman-test

make our testsuite pass in a podman container with default privs

4 years agotest: add a 'static' on a global variable we don't actually export 19800/head
Lennart Poettering [Wed, 2 Jun 2021 20:11:34 +0000 (22:11 +0200)] 
test: add a 'static' on a global variable we don't actually export

All global but not exported variables should be "static" in our
codebase, add "static" to one more such variable hence.