Commit Graph
52160 Commits
Author SHA1 Message Date
Lennart Poettering 68695ce4d6 pid1: eat up errors in device_update_found_by_name()
We eat up all errors in the caller already, and rightly so.
2021-06-03 15:01:05 +02:00
Lennart Poettering 9951c8df1e 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.
2021-06-03 15:01:05 +02:00
Lennart Poettering ad172d19d5 pid1: reduce log noise generated by devices with overly long sysfs paths
This basically does what 2c905207db did
for mount units

Fixes: #16161
2021-06-03 15:01:05 +02:00
Lennart Poettering c8ad151a58 pid1: make return value of device_remove_old() void too 2021-06-03 15:01:05 +02:00
Lennart Poettering e41db484c3 pid1: shorten code a bit 2021-06-03 15:01:05 +02:00
Lennart Poettering 75a50eb0dd pid1: make device_process_new() return void
We never use the return value, and we really shouldn't, hence let's drop
it.
2021-06-03 15:01:05 +02:00
Lennart Poettering 8d8053c2fe Merge pull request #19800 from poettering/podman-test
make our testsuite pass in a podman container with default privs
2021-06-03 14:11:59 +02:00
Lennart Poettering 9b1c5610e0 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.
2021-06-03 11:30:56 +02:00
Lennart Poettering c75370cc18 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
2021-06-03 11:30:56 +02:00
Lennart Poettering 6da5d7de78 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
2021-06-03 11:27:36 +02:00
Lennart Poettering e80cb4cba4 test-capability: skip tests that need CAP_NET_RAW if cap is not passed
See: #19746
2021-06-03 11:27:36 +02:00
Lennart Poettering 4b1c842d95 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.
2021-06-03 11:16:48 +02:00
Lennart Poettering a51168481f ask-password: default to a different prompt than "Password:" if the echo is on 2021-06-03 11:16:48 +02:00
Lennart Poettering 49365d1c6d 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).
2021-06-03 11:16:48 +02:00
Yu Watanabe ffc36c276c efi: drop glibc header and use pre-defined macros
This reverts 72dc626b3d and replace glibc
specific macros with compiler's pre-defined macros.
2021-06-03 13:49:33 +09:00
Yu Watanabe 2255e8adee 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.
```
2021-06-03 05:59:03 +09:00
Yu Watanabe f0273cba25 Merge pull request #19798 from bluca/todo_landlock
Add new item to TODO list
2021-06-03 03:37:33 +09:00
Yu Watanabe a884774635 Merge pull request #19792 from keszybz/more-logging-stuff
More logging tweaks
2021-06-03 03:36:28 +09:00
Luca Boccassi 88511a3712 TODO: mention the new Landlock LSM as a way to implement sandboxing for systemd --user 2021-06-02 19:13:28 +01:00
Luca Boccassi e91035abf0 TODO: remove some features that have been implemented 2021-06-02 18:57:31 +01:00
Yu Watanabe 63b8a781b6 Merge pull request #19791 from yuwata/udev-node-logs
udev: update several log messages
2021-06-03 01:32:29 +09:00
scootergrisen a22bcf503b 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
2021-06-03 01:31:51 +09:00
Luca Boccassi c17b4f4b0e Merge pull request #19783 from yuwata/efi-build-options
efi: constify several functions and enable more warnings
2021-06-02 17:02:57 +01:00
Zbigniew Jędrzejewski-Szmek 16eff8271b 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.
2021-06-02 16:26:52 +02:00
Zbigniew Jędrzejewski-Szmek 0d5a24beae 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'.
...
2021-06-02 16:23:54 +02:00
Yu Watanabe 7b80829575 udev: upgrade log level about failure in updating devlinks 2021-06-02 21:00:45 +09:00
Yu Watanabe cd8bcff507 udev: check that passed symbolic link path starts with /dev 2021-06-02 21:00:22 +09:00
Luca Boccassi 357f5b07ae 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
2021-06-02 11:32:52 +01:00
Yu Watanabe d46969072a udev: explicitly mention that the error will be ignored
See #19788.
2021-06-02 19:15:02 +09:00
Yu Watanabe 6be1feb1d7 udev: ignore the case that the device is already removed
See #19788.
2021-06-02 19:10:52 +09:00
Yu Watanabe 7bbcaee307 cryptsetup: fix typo 2021-06-02 11:35:14 +02:00
Zbigniew Jędrzejewski-Szmek 0517ececff core: show manager version in dump
This makes it easier to not get lost which one is which when
comparing two dumps.
2021-06-02 09:22:08 +02:00
Zbigniew Jędrzejewski-Szmek 2a341bb9d2 core: split out core/manager-dump.[ch]
This is a fairly specialized topic, let's create a separate file for it.
2021-06-02 09:22:08 +02:00
Zbigniew Jędrzejewski-Szmek 5b326dee29 TODO: add entry about alias logging 2021-06-02 09:22:08 +02:00
Zbigniew Jędrzejewski-Szmek 953394e3bb 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.
2021-06-02 09:22:08 +02:00
Zbigniew Jędrzejewski-Szmek f35e9b101d 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.
2021-06-02 09:22:08 +02:00
Yu Watanabe 505ab9dda2 meson: sort compiler flags 2021-06-02 15:53:29 +09:00
Yu Watanabe 6526736397 meson: enable more warnings when building efi binary 2021-06-02 15:49:44 +09:00
Yu Watanabe ca474d5114 efi: constify several arguments of functions which handle loader entries 2021-06-02 15:45:47 +09:00
Yu Watanabe cfb7fa289d efi: drop const qualifiers from arguments in uefi_call_wrapper() 2021-06-02 15:43:21 +09:00
Yu Watanabe edad24c61e efi: add const qualifier to EFI variable handling functions 2021-06-02 15:41:39 +09:00
Yu Watanabe ef53d52b01 efi: add const qualifier to string utils 2021-06-02 15:40:56 +09:00
Yu Watanabe 72dc626b3d efi: include endian.h to handle endian correctly
The macro __BYTE_ORDER__ is defined in endian.h.
2021-06-02 15:38:32 +09:00
Yu Watanabe 959ab90bbc 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
2021-06-02 15:36:29 +09:00
Yu Watanabe 122dbd92c9 string-util: trivial optimizations for strverscmp_improved() 2021-06-02 14:20:25 +09:00
Lennart Poettering 3ebc9b9b30 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.
2021-06-01 23:08:21 +02:00
Lennart Poettering 598a6a8491 core: when looping over mount/swap names, continue if we find one which doesn't translate to a valid unit name 2021-06-01 23:08:21 +02:00
Lennart Poettering 9d5acfab20 unit-name: generate a clear error code when converting an overly long fs path to a unit name 2021-06-01 23:08:13 +02:00
Lennart Poettering 3fe398cec0 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
2021-06-01 22:52:16 +02:00
Zbigniew Jędrzejewski-Szmek 71889176e4 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.
2021-06-01 19:27:25 +02:00