summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-06-27 13:02:28 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-06-28 10:18:59 +0200
commit844d5a87c9aec9e70546a4addc4e0da9422effe0 (patch)
tree6b4ebad737c356c48beda66c073f12a69f7f8260
parentcc82851c0dcd65cc737be1d95a6cae8c3dfa663e (diff)
downloadsystemd-844d5a87c9aec9e70546a4addc4e0da9422effe0.tar.gz
cryptsetup-generator: fix luks-* entry parsing from crypttab
This reverts a part of commit 49fe5c099639 ('tree-wide: port various places over to STARTSWITH_SET()') that replaced a pair of startswith() calls with STARTSWITH_SET(). They were in fact for a different strings (device vs. name), botching the crypttap parsing.
-rw-r--r--src/cryptsetup/cryptsetup-generator.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 690ce0f8b0..92314b667e 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -546,9 +546,11 @@ static int add_crypttab_devices(void) {
continue;
}
- uuid = STARTSWITH_SET(device, "UUID=", "luks-");
+ uuid = startswith(device, "UUID=");
if (!uuid)
uuid = path_startswith(device, "/dev/disk/by-uuid/");
+ if (!uuid)
+ uuid = startswith(name, "luks-");
if (uuid)
d = hashmap_get(arg_disks, uuid);