]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/cryptsetup/cryptsetup.c
cryptsetup: Do not fallback to PLAIN mapping if LUKS data device set fails.
authorMilan Broz <gmazyland@gmail.com>
Mon, 27 May 2019 07:27:54 +0000 (09:27 +0200)
committerMilan Broz <gmazyland@gmail.com>
Tue, 28 May 2019 13:31:25 +0000 (15:31 +0200)
commit2e4beb875bcb24e7d7d4339cc202b0b3f2953f71
tree53d4d5a5e0051db47d3a607a10cfea32474eb1f2
parent6bf901a9b510a015f317bdf81fa797a376935533
cryptsetup: Do not fallback to PLAIN mapping if LUKS data device set fails.

If crypt_load() for LUKS succeeds, we know that it is a LUKS device.
Failure of data device setting should fail in this case; remapping
as a PLAIN device late could mean data corruption.

(If a user wants to map PLAIN device over a device with LUKS header,
it should be said explicitly with "plain" argument type.)

Also, if there is no explicit PLAIN type requested and crypt device
is already initialized (crypt_data_type() is set), do not run
the initialization again.
src/cryptsetup/cryptsetup.c