Bug 1135429

Summary: kadmin.local -q with wrong value in -e option doesn't return nonzero return code
Product: Red Hat Enterprise Linux 6 Reporter: David Spurek <dspurek>
Component: krb5Assignee: Roland Mainz <rmainz>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: dpal, ebenes, jplans, kerberos-dev-list, nalin, pkis, qe-baseos-security, rharwood, rmainz
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1135427 Environment:
Last Closed: 2014-12-04 16:39:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1135427    
Bug Blocks:    

Description David Spurek 2014-08-29 09:52:14 UTC
the same problem with krb5-1.10.3-33.el6
+++ This bug was initially created as a clone of Bug #1135427 +++

Description of problem:
kadmin.local -q with wrong value in -e option doesn't return nonzero  return code

[test]kadmin.local -r EXAMPLE.COM -q "addprinc -randkey -e aes256-cts,aes128-cts kvnoprinc"
Authenticating as principal root/admin with password.
add_principal: Invalid argument while parsing keysalts aes256-cts,aes128-cts
usage: add_principal [options] principal
        options are:
                [-x db_princ_args]* [-expire expdate] [-pwexpire pwexpdate] [-maxlife maxtixlife]
                [-kvno kvno] [-policy policy] [-clearpolicy] [-randkey]
                [-pw password] [-maxrenewlife maxrenewlife]
                [-e keysaltlist]
                [{+|-}attribute]
        attributes are:
                allow_postdated allow_forwardable allow_tgs_req allow_renewable
                allow_proxiable allow_dup_skey allow_tix requires_preauth
                requires_hwauth needchange allow_svr password_changing_service
                ok_as_delegate ok_to_auth_as_delegate no_auth_data_required

where,
        [-x db_princ_args]* - any number of database specific arguments.
                        Look at each database documentation for supported arguments
[test]echo $?
0


Version-Release number of selected component (if applicable):
krb5-server-1.11.3-49.el7

How reproducible:
always

Steps to Reproduce:
1.kadmin.local -r EXAMPLE.COM -q "addprinc -randkey -e aes256-cts,aes128-cts kvnoprinc"
2.echo $?
3.

Actual results:
0

Expected results:
nonzero

Additional info:
cpw has incorrect behavior as well

kadmin.local -r EXAMPLE.COM -q "cpw -randkey -keepold -e aes256-cts,aes128-cts kvnoprinc"
Authenticating as principal root/admin with password.
 change_password: Invalid argument while parsing keysalts aes256