Description of problem: When calling "cryptsetup status" for nonexistent device, it returns 0. Calling "cryptsetup status" for existing device works fine, displays details about the device but returns 1. Version-Release number of selected component (if applicable): cryptsetup-luks-1.0.3-2.2.el5 How reproducible: Always Steps to Reproduce: cryptsetup status existing-device cryptsetup status nonexistent-device Actual results: # cryptsetup status crypted /dev/mapper/crypted is active: cipher: aes-cbc-plain keysize: 256 bits device: /dev/loop7 offset: 0 sectors size: 14336 sectors mode: read/write # echo $? 1 # cryptsetup status nonexistent /dev/mapper/nonexistent is inactive. # echo $? 0 Expected results: should return 0 when everything's ok and non-zero if there's been some problem (e.g. missing device)
Fixed in cryptsetup-luks-1.0.3-5.el5.
With cryptsetup-luks-1.0.3-5.el5 # cryptsetup status luks-b17bec60-d73f-40be-834f-cd813ad1d26a /dev/mapper/luks-b17bec60-d73f-40be-834f-cd813ad1d26a is active: cipher: aes-cbc-essiv:sha256 keysize: 128 bits device: /dev/mapper/VolGroup00-LogVol00 offset: 1032 sectors size: 18086904 sectors mode: read/write # echo $? 0 # cryptsetup status nonexistent /dev/mapper/nonexistent is inactive. # echo $? 1
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-1349.html