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

4 years agotest: tweak privilege tests for two more tests
Lennart Poettering [Wed, 2 Jun 2021 20:10:22 +0000 (22:10 +0200)] 
test: tweak privilege tests for two more tests

These tests require properly privileged root users, hence skip things
when we don't have CAP_SYS_ADMIN.

Fixes: #19746
4 years agotest-seccomp: tighten privilege check before seccomp()
Lennart Poettering [Wed, 2 Jun 2021 19:38:44 +0000 (21:38 +0200)] 
test-seccomp: tighten privilege check before seccomp()

geteuid() without CAP_SYS_ADMIN is not enough to do unrestricted
seccomp(). Hence tighten the check.

See: #19746

4 years agotest-capability: skip tests that need CAP_NET_RAW if cap is not passed
Lennart Poettering [Wed, 2 Jun 2021 13:50:16 +0000 (15:50 +0200)] 
test-capability: skip tests that need CAP_NET_RAW if cap is not passed

See: #19746

4 years agoask-password: once we hit the message argument, don't process switches anymore 19806/head
Lennart Poettering [Thu, 3 Jun 2021 09:08:20 +0000 (11:08 +0200)] 
ask-password: once we hit the message argument, don't process switches anymore

Let's not mangle the message part unnecessarily, that'd be confusing and
unexpected.

4 years agoask-password: default to a different prompt than "Password:" if the echo is on
Lennart Poettering [Thu, 3 Jun 2021 08:42:55 +0000 (10:42 +0200)] 
ask-password: default to a different prompt than "Password:" if the echo is on

4 years agoask-password: make password echo fully configurable
Lennart Poettering [Thu, 3 Jun 2021 08:41:05 +0000 (10:41 +0200)] 
ask-password: make password echo fully configurable

This adds --visible=yes|no|asterisk which allow controlling the echo of
the password prompt in detail. The existing --echo switch is then made
an alias for --visible=yes (and a shortcut -e added for it too).

4 years agoefi: drop glibc header and use pre-defined macros
Yu Watanabe [Wed, 2 Jun 2021 20:55:05 +0000 (05:55 +0900)] 
efi: drop glibc header and use pre-defined macros

This reverts 72dc626b3d6905b105ae61ca2c60f51a6f74070e and replace glibc
specific macros with compiler's pre-defined macros.

4 years agosd-device: do not use ::subsystem member directly
Yu Watanabe [Wed, 2 Jun 2021 07:29:59 +0000 (16:29 +0900)] 
sd-device: do not use ::subsystem member directly

The value is set dynamically when sd_device_get_subsystem() is called
first time.

Fixes the following issue:
```
$ build/udevadm test /sys/class/block/dm-1
...
Assertion '_subsystem' failed at src/libsystemd/sd-device/sd-device.c:767, function device_set_subsystem(). Aborting.
Program received signal SIGABRT, Aborted.
```

4 years agoMerge pull request #19798 from bluca/todo_landlock
Yu Watanabe [Wed, 2 Jun 2021 18:37:33 +0000 (03:37 +0900)] 
Merge pull request #19798 from bluca/todo_landlock

Add new item to TODO list

4 years agoMerge pull request #19792 from keszybz/more-logging-stuff
Yu Watanabe [Wed, 2 Jun 2021 18:36:28 +0000 (03:36 +0900)] 
Merge pull request #19792 from keszybz/more-logging-stuff

More logging tweaks

4 years agoTODO: mention the new Landlock LSM as a way to implement sandboxing for systemd ... 19798/head
Luca Boccassi [Wed, 2 Jun 2021 18:13:05 +0000 (19:13 +0100)] 
TODO: mention the new Landlock LSM as a way to implement sandboxing for systemd --user

4 years agoTODO: remove some features that have been implemented
Luca Boccassi [Wed, 2 Jun 2021 17:57:31 +0000 (18:57 +0100)] 
TODO: remove some features that have been implemented

4 years agoMerge pull request #19791 from yuwata/udev-node-logs
Yu Watanabe [Wed, 2 Jun 2021 16:32:29 +0000 (01:32 +0900)] 
Merge pull request #19791 from yuwata/udev-node-logs

udev: update several log messages

4 years agopo: Translated using Weblate (Danish)
scootergrisen [Wed, 2 Jun 2021 16:03:12 +0000 (18:03 +0200)] 
po: Translated using Weblate (Danish)

Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: scootergrisen <scootergrisen@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/da/
Translation: systemd/main

4 years agoMerge pull request #19783 from yuwata/efi-build-options
Luca Boccassi [Wed, 2 Jun 2021 16:02:57 +0000 (17:02 +0100)] 
Merge pull request #19783 from yuwata/efi-build-options

efi: constify several functions and enable more warnings

4 years agotmpfiles: stop complaining about autofs on not-found paths
Zbigniew Jędrzejewski-Szmek [Wed, 2 Jun 2021 13:40:27 +0000 (15:40 +0200)] 
tmpfiles: stop complaining about autofs on not-found paths

systemd-tmpfiles[328]: Failed to determine whether '/run/cryptsetup' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/etc/resolv.conf' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/lock/subsys' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/setrans' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/console' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/faillock' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/sepermit' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/motd.d' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/motd.d' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/motd' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/nologin' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/var/lib/systemd/pstore' is below autofs, ignoring: No such file or directory
... and so on and so on.

4 years agovarious: don't say that the timestamp 'changed' on initial load 19792/head
Zbigniew Jędrzejewski-Szmek [Tue, 1 Jun 2021 15:40:51 +0000 (17:40 +0200)] 
various: don't say that the timestamp 'changed' on initial load

I always found this a bit annoying.
With the patch:

$ SYSTEMD_LOG_LEVEL=debug build/udevadm test /sys/class/block/dm-1
...
Loaded timestamp for '/etc/systemd/network'.
Loaded timestamp for '/usr/lib/systemd/network'.
Parsed configuration file /usr/lib/systemd/network/99-default.link
Parsed configuration file /etc/systemd/network/10-eth0.link
Created link configuration context.
Loaded timestamp for '/etc/udev/rules.d'.
Loaded timestamp for '/usr/lib/udev/rules.d'.
...

4 years agoudev: upgrade log level about failure in updating devlinks 19791/head
Yu Watanabe [Wed, 2 Jun 2021 10:26:29 +0000 (19:26 +0900)] 
udev: upgrade log level about failure in updating devlinks

4 years agoudev: check that passed symbolic link path starts with /dev
Yu Watanabe [Wed, 2 Jun 2021 10:25:53 +0000 (19:25 +0900)] 
udev: check that passed symbolic link path starts with /dev

4 years agoMerge pull request #19779 from poettering/unit-name-length-tweak
Luca Boccassi [Wed, 2 Jun 2021 10:32:52 +0000 (11:32 +0100)] 
Merge pull request #19779 from poettering/unit-name-length-tweak

improve logging when encountering mount points we cannot convert to unit names due to length

4 years agoudev: explicitly mention that the error will be ignored
Yu Watanabe [Wed, 2 Jun 2021 10:14:12 +0000 (19:14 +0900)] 
udev: explicitly mention that the error will be ignored

See #19788.

4 years agoudev: ignore the case that the device is already removed
Yu Watanabe [Wed, 2 Jun 2021 10:10:49 +0000 (19:10 +0900)] 
udev: ignore the case that the device is already removed

See #19788.

4 years agocryptsetup: fix typo
Yu Watanabe [Wed, 2 Jun 2021 07:37:19 +0000 (16:37 +0900)] 
cryptsetup: fix typo

4 years agocore: show manager version in dump
Zbigniew Jędrzejewski-Szmek [Tue, 1 Jun 2021 14:46:53 +0000 (16:46 +0200)] 
core: show manager version in dump

This makes it easier to not get lost which one is which when
comparing two dumps.

4 years agocore: split out core/manager-dump.[ch]
Zbigniew Jędrzejewski-Szmek [Tue, 1 Jun 2021 13:25:44 +0000 (15:25 +0200)] 
core: split out core/manager-dump.[ch]

This is a fairly specialized topic, let's create a separate file for it.

4 years agoTODO: add entry about alias logging
Zbigniew Jędrzejewski-Szmek [Tue, 1 Jun 2021 10:56:33 +0000 (12:56 +0200)] 
TODO: add entry about alias logging

4 years agovarlink: remove duplicated "varlink:" prefix
Zbigniew Jędrzejewski-Szmek [Tue, 1 Jun 2021 08:00:01 +0000 (10:00 +0200)] 
varlink: remove duplicated "varlink:" prefix

We had:

systemd[1]: varlink-36: New incoming message: {"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"userName":"gdm","service":"io.systemd.DynamicUser"},"more":true}
systemd[1]: varlink-36: varlink: changing state idle-server → processing-method-more
systemd[1]: varlink-36: Sending message: {"error":"io.systemd.UserDatabase.NoRecordFound","parameters":{}}
systemd[1]: varlink-36: varlink: changing state processing-method-more → processed-method
systemd[1]: varlink-36: varlink: changing state processed-method → idle-server
systemd[1]: varlink-36: Got POLLHUP from socket.
systemd[1]: varlink-36: varlink: changing state idle-server → pending-disconnect
systemd[1]: varlink-36: varlink: changing state pending-disconnect → processing-disconnect
systemd[1]: varlink-36: varlink: changing state processing-disconnect → disconnected

So let's drop the "varlink:" prefix and use capitalized sentences like in other messages.

4 years agovarlink: say "varlink:" instead of "n/a:" when no description is available
Zbigniew Jędrzejewski-Szmek [Tue, 1 Jun 2021 07:55:09 +0000 (09:55 +0200)] 
varlink: say "varlink:" instead of "n/a:" when no description is available

For new connections, we log something like this:

systemd[1]: n/a: New incoming connection.
systemd[1]: n/a: Connections of user 997: 0 (of 1024 max)
systemd[1]: varlink-22: varlink: setting state idle-server
systemd[1]: varlink-22: New incoming message: ...

This "n/a" is not very pretty, and without context it would be hard to even
figure out this is a varlink connection.

4 years agomeson: sort compiler flags 19783/head
Yu Watanabe [Wed, 2 Jun 2021 06:53:29 +0000 (15:53 +0900)] 
meson: sort compiler flags

4 years agomeson: enable more warnings when building efi binary
Yu Watanabe [Wed, 2 Jun 2021 06:49:44 +0000 (15:49 +0900)] 
meson: enable more warnings when building efi binary

4 years agoefi: constify several arguments of functions which handle loader entries
Yu Watanabe [Wed, 2 Jun 2021 06:45:47 +0000 (15:45 +0900)] 
efi: constify several arguments of functions which handle loader entries

4 years agoefi: drop const qualifiers from arguments in uefi_call_wrapper()
Yu Watanabe [Wed, 2 Jun 2021 06:43:21 +0000 (15:43 +0900)] 
efi: drop const qualifiers from arguments in uefi_call_wrapper()

4 years agoefi: add const qualifier to EFI variable handling functions
Yu Watanabe [Wed, 2 Jun 2021 06:41:39 +0000 (15:41 +0900)] 
efi: add const qualifier to EFI variable handling functions

4 years agoefi: add const qualifier to string utils
Yu Watanabe [Wed, 2 Jun 2021 06:40:56 +0000 (15:40 +0900)] 
efi: add const qualifier to string utils

4 years agoefi: include endian.h to handle endian correctly
Yu Watanabe [Wed, 2 Jun 2021 06:38:29 +0000 (15:38 +0900)] 
efi: include endian.h to handle endian correctly

The macro __BYTE_ORDER__ is defined in endian.h.

4 years agoefi: do not use _STRING_ARCH_unaligned macro
Yu Watanabe [Wed, 2 Jun 2021 06:36:26 +0000 (15:36 +0900)] 
efi: do not use _STRING_ARCH_unaligned macro

It is already removed from glibc. See,
https://sourceware.org/git/?p=glibc.git;a=commit;h=16396c41deab45f715ffd813280d9d685b3b281e
https://sourceware.org/git/?p=glibc.git;a=commit;h=09a596cc2cf4e0f9f8e9f3bba4b1a97efcb13bcb

4 years agostring-util: trivial optimizations for strverscmp_improved()
Yu Watanabe [Tue, 1 Jun 2021 08:58:56 +0000 (17:58 +0900)] 
string-util: trivial optimizations for strverscmp_improved()

4 years agomount: be more descriptive when logging about overly long mount point paths 19779/head
Lennart Poettering [Tue, 1 Jun 2021 20:26:49 +0000 (22:26 +0200)] 
mount: be more descriptive when logging about overly long mount point paths

This is prompted by #17684: let's very explicitly say that the name is
too long for us, and that we'll ignore it.

4 years agocore: when looping over mount/swap names, continue if we find one which doesn't trans...
Lennart Poettering [Tue, 1 Jun 2021 20:20:55 +0000 (22:20 +0200)] 
core: when looping over mount/swap names, continue if we find one which doesn't translate to a valid unit name

4 years agounit-name: generate a clear error code when converting an overly long fs path to...
Lennart Poettering [Tue, 1 Jun 2021 17:43:55 +0000 (19:43 +0200)] 
unit-name: generate a clear error code when converting an overly long fs path to a unit name

4 years agodissect: if dissecting without udev, don't look for usec timestamp on db record
Lennart Poettering [Tue, 1 Jun 2021 15:17:37 +0000 (17:17 +0200)] 
dissect: if dissecting without udev, don't look for usec timestamp on db record

There will likely be none, hence don't bother.

This fixes an issue in systemd-gpt-auto-generator where we'll try to
wait for the udev db for the partitions even though though udev might
simplynot be around and via the DISSECT_IMAGE_NO_UDEV flag were
explicitly told not to bother.

Fixes: #19377
4 years agopam: do not require a non-expired password for user@.service
Zbigniew Jędrzejewski-Szmek [Tue, 1 Jun 2021 14:17:16 +0000 (16:17 +0200)] 
pam: do not require a non-expired password for user@.service

Without this parameter, we would allow user@ to start if the user
has no password (i.e. the password is "locked"). But when the user does have a password,
and it is marked as expired, we would refuse to start the service.
There are other authentication mechanisms and we should not tie this service to
the password state.

The documented way to disable an *account* is to call 'chage -E0'. With a disabled
account, user@.service will still refuse to start:

systemd[16598]: PAM failed: User account has expired
systemd[16598]: PAM failed: User account has expired
systemd[16598]: user@1005.service: Failed to set up PAM session: Operation not permitted
systemd[16598]: user@1005.service: Failed at step PAM spawning /usr/lib/systemd/systemd: Operation not permitted
systemd[1]: user@1005.service: Main process exited, code=exited, status=224/PAM
systemd[1]: user@1005.service: Failed with result 'exit-code'.
systemd[1]: Failed to start user@1005.service.
systemd[1]: Stopping user-runtime-dir@1005.service...

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

4 years agoMerge pull request #19774 from poettering/tpm2-tweaks
Lennart Poettering [Tue, 1 Jun 2021 17:27:06 +0000 (19:27 +0200)] 
Merge pull request #19774 from poettering/tpm2-tweaks

cryptsetup: two minor tpm2 tweaks

4 years agologind-dbus: correctly calculate when to create /etc/nologin file in all cases
Lennart Poettering [Tue, 1 Jun 2021 14:46:40 +0000 (16:46 +0200)] 
logind-dbus: correctly calculate when to create /etc/nologin file in all cases

Fixes: #19258
4 years agocryptsetup: add missing error branch
Lennart Poettering [Tue, 1 Jun 2021 14:17:24 +0000 (16:17 +0200)] 
cryptsetup: add missing error branch

Found in the process of trying to figure out #19193, but I doubt it's
going to fix that.

4 years agocryptsetup: don't bother waiting for TPM2 devices if we are on EFI and EFI says there... 19774/head
Lennart Poettering [Tue, 1 Jun 2021 14:35:13 +0000 (16:35 +0200)] 
cryptsetup: don't bother waiting for TPM2 devices if we are on EFI and EFI says there is no TPM2 device

Note that this means EFI-systems with a manually added TPM device won't
be supported automatically, but given that the TPM2 trust model kinda
requires firmware support I doubt it matters supporting this. And in all
other cases it speeds things up a bit.

4 years agocryptsetup: if TPM2 support is not compiled in, fallback to non-TPM2 mode gracefully
Lennart Poettering [Tue, 1 Jun 2021 14:34:34 +0000 (16:34 +0200)] 
cryptsetup: if TPM2 support is not compiled in, fallback to non-TPM2 mode gracefully

Fixes: #19177
4 years agoMerge pull request #19768 from poettering/homectl-fido2-lock-with
Lennart Poettering [Tue, 1 Jun 2021 13:53:36 +0000 (15:53 +0200)] 
Merge pull request #19768 from poettering/homectl-fido2-lock-with

homed: catch up with FIDO2 features in cryptsetup + other fixes

4 years agocryptsetup-util: disable pbkdf benchmark in cryptsetup_set_minimal_pbkdf.
Ondrej Kozina [Thu, 27 May 2021 06:43:18 +0000 (08:43 +0200)] 
cryptsetup-util: disable pbkdf benchmark in cryptsetup_set_minimal_pbkdf.

No need to benchmark pbkdf when asking for minimal values
anyway.

1000 iterations count is minimum for both LUKS1 and LUKS2
pbkdf2 keyslot parameters according to NIST SP 800-132, ch. 5.2.

Iterations count can not be lower than recommended minimum
when benchmark is disabled. The time_ms member is ignored with
benchmark disabled.