Description of problem: before F15, I could do this cryptsetup status luks-${UUID} if [ $? = 0 ]; then echo "Device already unlocked" else echo "need to unlock device" cryptsetup luksOpen /dev/BANANA luks-${UUID} fi But since I installed F15 x86_64 on this box, cryptsetup status always has a return code of 0 Version-Release number of selected component (if applicable): cryptsetup-luks-1.2.0-2.fc15.x86_64 How reproducible: always Steps to Reproduce: [root@karhu ~]# cryptsetup status luks-SOMETHING /dev/mapper/luks-SOMETHING is inactive. [root@karhu ~]# echo $? 0 [root@karhu ~]# cryptsetup luksOpen /dev/BANANA luks-SOMETHING Enter passphrase for /dev/BANANA: [root@karhu ~]# cryptsetup status luks-SOMETHING /dev/mapper/luks-SOMETHING is active. type: LUKS1 cipher: aes-cbc-essiv:sha256 keysize: 256 bits device: /dev/BANANA offset: 2056 sectors size: 104855544 sectors mode: read/write [root@karhu ~]# echo $? 0 Actual results: exit code is 0 also when device is still locked Expected results: exit code 0 only when device is unlocked Additional info: obviously BANANA and SOMETHING is me replacing the UUID and device path by hand for the bug report
Hm. yes, it should return error code if device dosn't exist.
Just one line fix. I'll plan to update cryptsetup to 1.3.1 version in F15, so I'll add this patch too. Thanks for report.
Updated cryptsetup-luks-1.3.1-2.fc15 with patch for this problem as well.
cryptsetup-luks-1.3.1-2.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/cryptsetup-luks-1.3.1-2.fc15
Package cryptsetup-luks-1.3.1-2.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing cryptsetup-luks-1.3.1-2.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/cryptsetup-luks-1.3.1-2.fc15 then log in and leave karma (feedback).
cryptsetup-luks-1.3.1-2.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.