summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-06-09 14:18:09 +0200
committerLennart Poettering <lennart@poettering.net>2020-06-09 14:24:15 +0200
commit5af39ac850844511f673ce573efa0cf84b6589a7 (patch)
tree91fc6b7d5aaabb35e0a0a09343932e03d0f717ea /src
parent8b8ae7959d212c51ada4c1f13df5fb573461d024 (diff)
downloadsystemd-5af39ac850844511f673ce573efa0cf84b6589a7.tar.gz
cryptsetup: try to load bitlocker superblock only if requested
let's do automatic discovery only for our native LUKS/LUKS2 headers, since they are Linux stuff, and let's require that BitLocker to be requested explicitly. This makes sure cryptsetup without either "luks" nor "bitlk" in the option string will work. Right now it would fail because we'd load the superblock once with luks and once with bitlk and one of them would necessarily fail. Follow-up for #15979
Diffstat (limited to 'src')
-rw-r--r--src/cryptsetup/cryptsetup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index c05e2d1351..a8d72fcf5a 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -957,7 +957,7 @@ static int run(int argc, char *argv[]) {
/* since cryptsetup 2.3.0 (Feb 2020) */
#ifdef CRYPT_BITLK
- if (!arg_type || STR_IN_SET(arg_type, ANY_LUKS, CRYPT_BITLK)) {
+ if (streq_ptr(arg_type, CRYPT_BITLK)) {
r = crypt_load(cd, CRYPT_BITLK, NULL);
if (r < 0)
return log_error_errno(r, "Failed to load Bitlocker superblock on device %s: %m", crypt_get_device_name(cd));