Bug 705404 - dasdinfo return 0 if action failed
Summary: dasdinfo return 0 if action failed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: s390utils
Version: 6.1
Hardware: s390x
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Dan Horák
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On: 705400
Blocks: 684953
TreeView+ depends on / blocked
 
Reported: 2011-05-17 15:24 UTC by Petr Sklenar
Modified: 2011-12-06 18:09 UTC (History)
6 users (show)

Fixed In Version: s390utils-1.8.2-37.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 705400
Environment:
Last Closed: 2011-12-06 17:44:46 UTC
Target Upstream Version:


Attachments (Terms of Use)
s390-tools-rhel6-dasdinfo-returncode.patch (895 bytes, text/plain)
2011-05-23 10:00 UTC, IBM Bug Proxy
no flags Details


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 72188 0 None None None Never
Red Hat Product Errata RHBA-2011:1525 0 normal SHIPPED_LIVE s390utils bug fix and enhancement update 2011-12-06 01:02:25 UTC

Description Petr Sklenar 2011-05-17 15:24:34 UTC
# dasdinfo -b /dev/aaaa -a
Error: could not read unique DASD ID
 echo $?
0
# rpm -q s390utils
s390utils-1.8.2-28.el6.s390x

there is same issue on rhel6 with s390utils-1.8.2-28.el6.s390x

+++ This bug was initially created as a clone of Bug #705400 +++

Description of problem:
dasdinfo return 0 if action failed.

Version-Release number of selected component (if applicable):
s390utils-1.8.1-16.el5

How reproducible:
always

Steps to Reproduce:
use dasdinfo in a wrong way, place wahtever string into block device

[root@ibm-z10-32 /]# dasdinfo -b /dev/write_whatever_here -l
Error: could not read unique DASD ID
[root@ibm-z10-32 /]# echo $?
0
[root@ibm-z10-32 /]# dasdinfo -b /dev/write_whatever_here -u
Error: could not read unique DASD ID
[root@ibm-z10-32 /]# echo $?
0
[root@ibm-z10-32 /]# dasdinfo -b /dev/write_whatever_here -x
Error: could not read unique DASD ID
[root@ibm-z10-32 /]# echo $?
0


Actual results:
return code = 0

Expected results:
return code = 1 or more

Additional info:

Comment 2 IBM Bug Proxy 2011-05-20 20:10:35 UTC
------- Comment From lnx1138.ibm.com 2011-05-20 16:04 EDT-------
.

Comment 3 IBM Bug Proxy 2011-05-23 10:00:43 UTC
------- Comment From brueckner.ibm.com 2011-05-23 05:56 EDT-------
The patch has been tested, fixes the problem, and will be included in the next
upstream release of the s390-tools.

With best regards,
Hendrik

Comment 4 IBM Bug Proxy 2011-05-23 10:00:48 UTC
Created attachment 500384 [details]
s390-tools-rhel6-dasdinfo-returncode.patch


------- Comment on attachment From brueckner.ibm.com 2011-05-23 05:56 EDT-------


Description: dasdinfo: return error code in case of failure.
Symptom:     The dasdinfo tool always returns 0 even in case of an error.
Problem:     If the tool is used in a script the return code can not be used
	     since it is always 0.
Solution:    Give a non zero return value in case of an error.

Comment 7 IBM Bug Proxy 2011-09-15 09:40:33 UTC
------- Comment From sachinp.com 2011-09-15 05:32 EDT-------
Tested against RHEL 6.2 Alpha. The issue is fixed.

# dasdinfo -b /dev/write_whatever_here -l
# echo $?
255
# echo $?
255

# cat /etc/issue
Red Hat Enterprise Linux Server release 6.2 Beta (Santiago)
Kernel \r on an \m

Comment 9 errata-xmlrpc 2011-12-06 17:44:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1525.html


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