Bug 439191 - cryptsetup status gives wrong return codes
cryptsetup status gives wrong return codes
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cryptsetup-luks (Show other bugs)
5.1
All Linux
low Severity low
: rc
: ---
Assigned To: Milan Broz
Alexander Todorov
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-27 10:37 EDT by Petr Šplíchal
Modified: 2016-05-31 21:36 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 07:18:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Šplíchal 2008-03-27 10:37:02 EDT
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)
Comment 5 Milan Broz 2009-02-11 09:38:07 EST
Fixed in cryptsetup-luks-1.0.3-5.el5.
Comment 7 Alexander Todorov 2009-05-12 04:24:39 EDT
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
Comment 9 errata-xmlrpc 2009-09-02 07:18:05 EDT
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

Note You need to log in before you can comment on or make changes to this bug.