diff options
author | Antonio Alvarez Feijoo <antonio.feijoo@suse.com> | 2023-11-03 16:28:14 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2023-11-03 20:10:55 +0100 |
commit | 38cce239c1510e3736b095b95a65374192ee0312 (patch) | |
tree | abd2360abda94b8be820c3b998a89d07d46551aa /src/cryptsetup/cryptsetup.c | |
parent | NEWS: add entry for vmspawn (diff) | |
download | systemd-38cce239c1510e3736b095b95a65374192ee0312.tar.xz systemd-38cce239c1510e3736b095b95a65374192ee0312.zip |
cryptsetup: do not print (null) if pkcs11 uri not set
The pkcs11 uri is no set if the smart card is not inserted while using
`pkcs11-uri=auto` with libcryptsetup plugins.
```
> systemd-cryptsetup attach cr_data /dev/sda1 - pkcs11-uri=auto
Set cipher aes, mode xts-plain64, key size 512 bits for device /dev/sda1.
Security token (null) not present for unlocking volume Linux filesystem (cr_data), please plug it in.
```
Diffstat (limited to '')
-rw-r--r-- | src/cryptsetup/cryptsetup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index 1da7bff049..6d927ef8dd 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -1503,8 +1503,8 @@ static int attach_luks_or_plain_or_bitlk_by_pkcs11( if (r < 0) return r; - log_notice("Security token %s not present for unlocking volume %s, please plug it in.", - uri, friendly); + log_notice("Security token%s%s not present for unlocking volume %s, please plug it in.", + uri ? " " : "", strempty(uri), friendly); /* Let's immediately rescan in case the token appeared in the time we needed * to create and configure the monitor */ |