Bug 796542

Summary: Incorrect error message is displayed when no argument is provided for optional switches.
Product: Red Hat Enterprise Linux 6 Reporter: Kaleem <ksiddiqu>
Component: certmongerAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3CC: jgalipea, kchamart
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: certmonger-0.56-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:43:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kaleem 2012-02-23 07:08:11 UTC
Description of problem:
When no argument is provided for optional switches, an incorrect error message is displayed.
  "request: invalid option -- 'I'" which should be "request : option requires an argument --'I'"

Version-Release number of selected component (if applicable):
certmonger-0.55-1.el6.x86_64.rpm

How reproducible:
Always

Steps to Reproduce:
1.Install certmonger and start certmonger service
2.Try to generate a certificate request without providing argument to one of optional switches. e.g.
  getcert request -d /tmp/kaleem/ -n certtest -c Selfsign -I
3.Observe the error message displayed on console.
  
Actual results:

[root@dhcp201-197 ~]# getcert request -d /tmp/kaleem/ -n certtest -I
request: invalid option -- 'I'
getcert - client certificate enrollment tool
Usage: getcert request [options]

Expected results:
Error message of line 2 in above output, should be like RHEL 6.2's error message.
  "request : option requires an argument --'I'"

Comment 4 Kaleem 2012-03-08 14:02:49 UTC
Verified.

Certmonger Version:
[root@dhcp201-197 ~]# rpm -q certmonger
certmonger-0.56-1.el6.x86_64
[root@dhcp201-197 ~]#

Now following error message is displayed when no argument is provided with optional switches.

Manual:

[root@dhcp201-197 ~]# getcert request -d /tmp/kaleem/ -n certtest -c SelfSign -I
request: option requires an argument -- 'I'
getcert - client certificate enrollment tool

Automated:
:: [   PASS   ] :: Running 'getcert request -f /tmp/tmp.KJR6qqpdyp/test.crt -k /tmp/tmp.KJR6qqpdyp/test.key -c SelfSign -g > /tmp/tmp.KJR6qqpdyp/temp_test.out 2>&1'
:: [   PASS   ] :: File '/tmp/tmp.KJR6qqpdyp/temp_test.out' should contain 'request: option requires an argument -- 'g''
:: [   PASS   ] :: Running 'getcert request -d /tmp/tmp.KJR6qqpdyp -n certtest -c SelfSign -I > /tmp/tmp.KJR6qqpdyp/temp_test.out 2>&1'
:: [   PASS   ] :: Running 'cat /tmp/tmp.KJR6qqpdyp/temp_test.out '
:: [   PASS   ] :: File '/tmp/tmp.KJR6qqpdyp/temp_test.out' should contain 'request: option requires an argument -- 'I''
:: [   PASS   ] :: Running 'getcert request -d /tmp/tmp.KJR6qqpdyp -n certtest -c > /tmp/tmp.KJR6qqpdyp/temp_test.out 2>&1'
:: [   PASS   ] :: File '/tmp/tmp.KJR6qqpdyp/temp_test.out' should contain 'request: option requires an argument -- 'c''
:: [   PASS   ] :: Running 'getcert request -d /tmp/tmp.KJR6qqpdyp -n certtest -c SelfSign -P > /tmp/tmp.KJR6qqpdyp/temp_test.out 2>&1'
:: [   PASS   ] :: File '/tmp/tmp.KJR6qqpdyp/temp_test.out' should contain 'request: option requires an argument -- 'P''
:: [   PASS   ] :: Running 'getcert request -d /tmp/tmp.KJR6qqpdyp -n certtest -c SelfSign -p > /tmp/tmp.KJR6qqpdyp/temp_test.out 2>&1'
:: [   PASS   ] :: File '/tmp/tmp.KJR6qqpdyp/temp_test.out' should contain 'request: option requires an argument -- 'p''
:: [   PASS   ] :: Running 'getcert request -d /tmp/tmp.KJR6qqpdyp -n certtest -c SelfSign -U > /tmp/tmp.KJR6qqpdyp/temp_test.out 2>&1'
:: [   PASS   ] :: File '/tmp/tmp.KJR6qqpdyp/temp_test.out' should contain 'request: option requires an argument -- 'U''
:: [   PASS   ] :: Running 'getcert request -d /tmp/tmp.KJR6qqpdyp -n certtest -c SelfSign -E > /tmp/tmp.KJR6qqpdyp/temp_test.out 2>&1'
:: [   PASS   ] :: File '/tmp/tmp.KJR6qqpdyp/temp_test.out' should contain 'request: option requires an argument -- 'E''
:: [   PASS   ] :: Running 'selfsign-getcert request -d /tmp/tmp.KJR6qqpdyp -n certtest -N > /tmp/tmp.KJR6qqpdyp/temp_test.out 2>&1'
:: [   PASS   ] :: File '/tmp/tmp.KJR6qqpdyp/temp_test.out' should contain 'request: option requires an argument -- 'N''
:: [   PASS   ] :: Running 'getcert request -d /tmp/tmp.KJR6qqpdyp -n certtest -c SelfSign -K > /tmp/tmp.KJR6qqpdyp/temp_test.out 2>&1'
:: [   PASS   ] :: Running 'cat /tmp/tmp.KJR6qqpdyp/temp_test.out'
:: [   PASS   ] :: File '/tmp/tmp.KJR6qqpdyp/temp_test.out' should contain 'request: option requires an argument -- 'K''
:: [   PASS   ] :: Running 'getcert request -d /tmp/tmp.KJR6qqpdyp -n certtest -c SelfSign -D > /tmp/tmp.KJR6qqpdyp/temp_test.out 2>&1'
:: [   PASS   ] :: File '/tmp/tmp.KJR6qqpdyp/temp_test.out' should contain 'request: option requires an argument -- 'D''

Comment 6 errata-xmlrpc 2012-06-20 13:43:12 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-2012-0833.html