johndoe31415 / luksipc

Official master repository of the LUKS in-place-conversion utility (luksipc)
GNU General Public License v3.0
91 stars 12 forks source link

Fixed 'Cannot remove device mapper handle ...' error message. #10

Open erobhal opened 8 years ago

erobhal commented 8 years ago

In luks.c (row 223) the function isLuksMapperAvailable is called with the full path of the device mapper (including /dev/mapper/). In isLuksMapperAvailable a 'cryptsetup status' is performed with that input. However, if you call 'cryptsetup status' with the full path instead of the actual name of the device mapper it will (at least on RHEL 6) return 1 (wrong parameters) as error code, not 4 (wrong device specified). And the user will receive the "Cannot remove device mapper handle ..." error message. The fix is to strip the /dev/mapper part and only run 'cryptsetup status' using the basename.