Commit Graph

45575 Commits

Author SHA1 Message Date
Lennart Poettering c8fe23d45c update TODO 2020-07-01 11:20:26 +02:00
Lennart Poettering 4442c26942 man: update homectl man page with documentation for new features 2020-07-01 11:20:26 +02:00
Lennart Poettering fe2520fbb5 docs: document new FIDO2 user record fields 2020-07-01 11:20:26 +02:00
Lennart Poettering 0eb3be4644 homectl: add --pkcs11-uri=auto and --pkcs-11-uri=list support
We have the same for FIDO2 devices, for listing suitable devices, or
picking the right one automatically, let's add that for PKCS11 too.
2020-07-01 11:20:26 +02:00
Lennart Poettering 2af3966af3 homectl: add acquired fido2 PIN to user record
If we successfully acquired the PIN for the fido2 key, let's add it to
our user record, so that we can pass it to homed, which will need it
too.
2020-07-01 11:20:26 +02:00
Lennart Poettering 93295a2501 homectl: split out pkcs#11 related code bits into own .c/.h file
There's some highly specific PKCS#11 code in homectl.c. Let's split that
out, since it is easily isolatable, to make homectl.c a bit more
readable.

No funcional changes, just some moving around and renaming two functions
to make them more suitably named when exported.
2020-07-01 11:20:25 +02:00
Lennart Poettering c98811d837 homectl: rework how we log when doing a home directory update
When updating a home directory we might update the record first, then
resize the image and finally synchronize the passwords to the storage
layers. These are three individually authenticated operations. Since
each might require touching a FIDO2 or PKCS#11 key we should say what we
are doing. Hence do so.

Usually we are pretty quiet with what we do, and let's stick to that.
Hence show this information only if we actually do more than one thing.
If we only update (and do not resize/sync passwords) then let's be quiet
as usual, as the command line then sufficiently clarifies what we are
doing.
2020-07-01 11:17:28 +02:00
Lennart Poettering 8e62dfb12a homectl: do generic error handling/retry also when creating a home directory
After all, when creating we might need interaction with the security
token too, and our initial attempt to create the user will fail, since
we do not allow interactive auth on the security token, so that we then
can print a log message and retry with interactive auth then enabled.
2020-07-01 11:17:28 +02:00
Lennart Poettering f737186ab1 homectl: show touch emoji when asking for PKCS#11 protected auth path 2020-07-01 11:17:28 +02:00
Lennart Poettering 85b1294488 pam-systemd-home: print helpful message when token's PIN is locked 2020-07-01 11:17:28 +02:00
Lennart Poettering 7b78db28e5 homed: add support for authenticating with fido2 hmac-secret tokens 2020-07-01 11:17:28 +02:00
Lennart Poettering 1c0c4a43c6 homectl: add support for enrolling FIDO2 HMAC-SECRET tokens 2020-07-01 11:17:28 +02:00
Lennart Poettering 5e4fa456fa user-record: add fields for FIDO2 HMAC authentication options 2020-07-01 11:17:28 +02:00
Lennart Poettering af4fbd463f build-sys: add libfido2 as optional dependency 2020-07-01 11:17:28 +02:00
Lennart Poettering c0bde0d240 user-record: rename JSON field "pkcs11Pin" to "tokenPin"
We'd like to use it for FIDO2 tokens too, and the concept is entirely
generic, hence let's just reuse the field, but rename it. Read the old
name for compatibility, and treat the old name and the new name as
identical for most purposes.
2020-07-01 11:17:28 +02:00
Lennart Poettering d00f318323 user-record: securely erase pkcs#11 when assigned NULL too 2020-07-01 11:17:28 +02:00
Lennart Poettering 7b8d55b72c homectl: add missing log messages when json_variant_format() fails 2020-07-01 11:17:28 +02:00
Lennart Poettering c63ec11bf5 pkcs11-util: reduce scope of a variable 2020-07-01 11:17:28 +02:00
Lennart Poettering 1146b664e6 macro: add new FOREACH_POINTER() macro magic
This allows us to iterate through a series of specified pointers. It's a
bit like FOREACH_STRING(), but for all kinds of pointers.
2020-07-01 11:17:28 +02:00
Lennart Poettering 428d32afea locale-util: add support for touch emoji
We can use this to highlight when users are supposed to touch their
security tokens.
2020-07-01 11:17:27 +02:00
Yu Watanabe 830ffbce1b doc: add recentry introduced transient settings
Also sort entries for service settings.
2020-07-01 10:38:08 +02:00
Yu Watanabe 9457b6bb21
Merge pull request #16303 from poettering/dbus-util-split
shared: split src/shared/bus-util.c into multiple files
2020-07-01 14:15:40 +09:00
Marc Kleine-Budde b46d8c1c70 udev: spi: include chip select number in ID_PATH
All devices behind a SPI controller have the same udev ID_PATH property.
This is a problem for predicable network names for CAN controllers.

CAN controllers, in contrast to Ethernet controllers, don't have a MAC
Address, so there's no way to tell two CAN controllers on the same SPI
host controller apart:

$ udevadm info /sys/class/net/can0
P: /devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.1/net/can0
L: 0
E: DEVPATH=/devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.1/net/can0
E: INTERFACE=can0
E: IFINDEX=3
E: SUBSYSTEM=net
E: USEC_INITIALIZED=11187199
E: ID_PATH=platform-fe204000.spi
E: ID_PATH_TAG=platform-fe204000_spi
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/can0
E: TAGS=:systemd:

$ udevadm info /sys/class/net/can1
P: /devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.0/net/can1
L: 0
E: DEVPATH=/devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.0/net/can1
E: INTERFACE=can1
E: IFINDEX=4
E: SUBSYSTEM=net
E: USEC_INITIALIZED=11192211
E: ID_PATH=platform-fe204000.spi
E: ID_PATH_TAG=platform-fe204000_spi
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/can1
E: TAGS=:systemd:

With this the chip select number is added to the ID_PATH, to make
predictable network names possible.

$ sudo udevadm info /sys/class/net/can0
P: /devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.1/net/can0
L: 0
E: DEVPATH=/devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.1/net/can0
E: INTERFACE=can0
E: IFINDEX=3
E: SUBSYSTEM=net
E: USEC_INITIALIZED=11187199
E: ID_PATH=platform-fe204000.spi-cs-1
E: ID_PATH_TAG=platform-fe204000_spi-cs-1
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/can0
E: TAGS=:systemd:

$ sudo udevadm info /sys/class/net/can1
P: /devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.0/net/can1
L: 0
E: DEVPATH=/devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.0/net/can1
E: INTERFACE=can1
E: IFINDEX=4
E: SUBSYSTEM=net
E: USEC_INITIALIZED=11192211
E: ID_PATH=platform-fe204000.spi-cs-0
E: ID_PATH_TAG=platform-fe204000_spi-cs-0
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/can1
E: TAGS=:systemd:
2020-07-01 13:12:11 +09:00
Zbigniew Jędrzejewski-Szmek d17eabb105 Fix build with µhttpd 0.9.71
The return type of callbacks was changed from int to an enum.
2020-07-01 13:10:48 +09:00
Yu Watanabe 116739cfb6
Merge pull request #16316 from yuwata/backlight-use-actual-brightness
backlight: use actual_brightness attribute to get current backlight level
2020-07-01 13:10:15 +09:00
Lennart Poettering 5c236388c3 update TODO 2020-06-30 17:13:38 +02:00
Zbigniew Jędrzejewski-Szmek 6c3a19d5b3
Merge pull request #16313 from yuwata/network-move-ipv6ll-gen-mode
network: move IPv6LinkLocalAddressGenerationMode= to [Network] section
2020-06-30 17:13:02 +02:00
Luca Boccassi 7233e91af0 core: store timestamps of unit load attempts
When the system is under heavy load, it can happen that the unit cache
is refreshed for an unrelated reason (in the test I simulate this by
attempting to start a non-existing unit). The new unit is found and
accounted for in the cache, but it's ignored since we are loading
something else.
When we actually look for it, by attempting to start it, the cache is
up to date so no refresh happens, and starting fails although we have
it loaded in the cache.

When the unit state is set to UNIT_NOT_FOUND, mark the timestamp in
u->fragment_loadtime. Then when attempting to load again we can check
both if the cache itself needs a refresh, OR if it was refreshed AFTER
the last failed attempt that resulted in the state being
UNIT_NOT_FOUND.

Update the test so that this issue reproduces more often.
2020-06-30 16:50:00 +02:00
Zbigniew Jędrzejewski-Szmek f93dd4b940
Merge pull request #16282 from poettering/repart-copy-blocks
repart: add new CopyBlocks= setting
2020-06-30 15:26:06 +02:00
Yu Watanabe 437b9a7f75 backlight: read current backlight brightness from 'actual_brightness' attribute
Closes #16302.
2020-06-30 22:19:21 +09:00
Yu Watanabe daa227a320 backlight: call log_setup_service() before logging 2020-06-30 22:19:21 +09:00
Yu Watanabe 74f1bb5c9f backlight: use SYNTHETIC_ERRNO() macro 2020-06-30 22:19:21 +09:00
Lennart Poettering 40af3d020f shared: split out property get helpers
No code changes, just some refactoring.
2020-06-30 15:10:17 +02:00
Lennart Poettering 9176326ba2 shared: split out code for printing properties
No code changes, just some refactoring.
2020-06-30 15:09:56 +02:00
Lennart Poettering 807542bece shared: split out code that maps properties to local structs
Just some refactoring, no code changes.
2020-06-30 15:09:35 +02:00
Lennart Poettering 9b71e4ab90 shared: actually move all BusLocator related calls to bus-locator.c 2020-06-30 15:09:19 +02:00
Lennart Poettering c664cf5607 shared: split out BusObjectImplementor APIs
Just some refactoring, no code changes
2020-06-30 15:08:35 +02:00
Amos Bird 7aee1e7304
hwdb: adjust touchpad edge detection for X1Tab3 (#16310) 2020-06-30 19:04:08 +09:00
Yu Watanabe aa0b850bca NEWS: minor fixes 2020-06-30 19:00:18 +09:00
Yu Watanabe 6f6296b93f network: move IPv6LinkLocalAddressGenerationMode= to [Network] section
This also moves and renames variables and functions.

Follow-ups for a6f1848a23.
2020-06-30 18:58:52 +09:00
Yu Watanabe 3ea58e010d NEWS: add several entries about networkd 2020-06-30 11:29:14 +02:00
Zbigniew Jędrzejewski-Szmek 26b0fda9b7 test-repart: allow the test to pass on non-amd64 architectures
We specified type=root and expected to always get root-x86-64, which obviously
cannot work.
2020-06-30 11:06:48 +02:00
Yu Watanabe e4f8d5e01f shell-completion: add missing verbs for networkctl 2020-06-30 08:56:36 +02:00
Frantisek Sumsal 8f843190ff test: bump the timeout for systemd-hwdb-update.service under ASan
Since the hwdb update from a79be2f807
the systemd-hwdb-update service started timing out under ASan when
compiled with gcc, as we started tripping over the 3 minutes timeout.

This affects only gcc runs, since the current gcc on Arch still suffers
from the detect_stack_use_after_return performance penalty[0]. Until
the fixed gcc is present in the respective repositories, let's bump
the timeout to 4 minutes, as we might not be able to upgrade right
away, due to systemd/systemd#16199.

Before the hwdb update:
[ 7958.292540] systemd[63]: systemd-hwdb-update.service: Executing: /usr/bin/time systemd-hwdb update
[ 7958.304005] systemd[1]: systemd-journald.service: Got notification message from PID 44 (FDSTORE=1)
[ 7958.314434] systemd[1]: systemd-journald.service: Added fd 3 (n/a) to fd store.
[ 8008.520082] systemd[1]: systemd-journald.service: Got notification message from PID 44 (WATCHDOG=1)
[ 8068.520151] systemd[1]: systemd-journald.service: Got notification message from PID 44 (WATCHDOG=1)
[ 8125.682843] time[63]: 84.47user 82.92system 2:47.50elapsed 99%CPU (0avgtext+0avgdata 811512maxresident)k
[ 8125.682843] time[63]: 0inputs+19680outputs (0major+25000853minor)pagefaults 0swaps

After the hwdb update:
[ 6215.491958] systemd[63]: systemd-hwdb-update.service: Executing: /usr/bin/time systemd-hwdb update
[ 6215.503380] systemd[1]: systemd-journald.service: Got notification message from PID 44 (FDSTORE=1)
[ 6215.514172] systemd[1]: systemd-journald.service: Added fd 3 (n/a) to fd store.
[ 6329.392918] systemd[1]: systemd-journald.service: Got notification message from PID 44 (WATCHDOG=1)
[ 6394.920205] time[63]: 89.48user 89.98system 2:59.55elapsed 99%CPU (0avgtext+0avgdata 812764maxresident)k
[ 6394.920205] time[63]: 0inputs+20568outputs (0major+27318354minor)pagefaults 0swaps

[0] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94910
2020-06-29 16:07:11 +02:00
Zbigniew Jędrzejewski-Szmek 0e31a6c2ad
Merge pull request #16142 from poettering/random-seed-cmdline
pid1: add support for allowing to pass in random seed via kernel cmdline
2020-06-26 22:42:51 +02:00
Lennart Poettering bed0b7dfc0
pid1: warn if people use User=nobody (#16293) 2020-06-26 22:36:39 +02:00
Luca Boccassi 7143b95552 efi: define cache functions inside EFI_ENABLE ifdef
../src/shared/efi-loader.c:738:5: error: redefinition of 'efi_loader_get_config_timeout_one_shot'
 int efi_loader_get_config_timeout_one_shot(usec_t *ret) {
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/shared/efi-loader.c:9:
../src/shared/efi-loader.h:85:19: note: previous definition of 'efi_loader_get_config_timeout_one_shot' was here
 static inline int efi_loader_get_config_timeout_one_shot(usec_t *ret) {
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/efi-loader.c:776:5: error: redefinition of 'efi_loader_update_entry_one_shot_cache'
 int efi_loader_update_entry_one_shot_cache(char **cache, struct stat *cache_stat) {
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/shared/efi-loader.c:9:
../src/shared/efi-loader.h:89:19: note: previous definition of 'efi_loader_update_entry_one_shot_cache' was here
 static inline int efi_loader_update_entry_one_shot_cache(char **cache, struct stat *cache_stat) {
2020-06-26 22:34:22 +02:00
Frantisek Sumsal cb713f1696 tree-wide: spellcheck fixes
Most of them were reported by Fossies.org
2020-06-26 22:33:56 +02:00
Zbigniew Jędrzejewski-Szmek 7f56c26d10 NEWS: reorder entries with some minor additions
Let's make this easier for readers by grouping common subjects together.

Roughly: pid1 features, unit file changes, general syntax changes, kernel
options, general defaults, udevd features, networkd and .network/.netdev
features, networkctl, resolved, systemctl, systemd-run, journald, journalctl,
various other tools, low-level dbus and library stuff, documentation.
2020-06-26 19:51:34 +02:00
Luca Boccassi 0cffae953a core: add device mapper to allow-list with DevicePolicy=closed and RootImage
To set up a verity/cryptsetup RootImage the forked child needs to
ioctl /dev/mapper/control and create a new mapper.
If PrivateDevices=yes and/or DevicePolicy=closed are used, this is
blocked by the cgroup setting, so add an exception like it's done
for loop devices (and also add a dependency on the kernel modules
implementing them).
2020-06-26 18:39:45 +02:00