Bug 176035

Summary: kadmin should have more fine-grained exit codes
Product: [Fedora] Fedora Reporter: W. Michael Petullo <redhat>
Component: krb5Assignee: Nalin Dahyabhai <nalin>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideKeywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-09 11:05:46 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description W. Michael Petullo 2005-12-17 19:39:41 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.7.12) Gecko/20051018 Epiphany/1.9.2

Description of problem:
I am trying to write a shell script that does something if a Kerberos principal exists.  However, kadmin makes it difficult to check if a principal exists.  "kadmin -q 'getprinc foo'" exits with a code of "0" whether or not the principal exists.

Version-Release number of selected component (if applicable):
krb5-server-1.4.1-5

How reproducible:
Always

Steps to Reproduce:
[root@golem scripts]# kadmin.local -q "getprinc foo"
Authenticating as principal mike/admin@FLYN.ORG with password.
get_principal: Principal does not exist while retrieving "foo@FLYN.ORG".
[root@golem scripts]# echo $?
0
 

Actual Results:  Exit status is always 0.

Expected Results:  I think the program should exist with a non-zero status code if a queried principal does not exist.

Additional info:
Comment 1 W. Michael Petullo 2005-12-29 09:25:26 EST
After looking at the kadmin code, this does not seem to be as simple to 
implement as I thought it would be.  However, I think this may still be a 
worthwhile feature.  The bottom line is that it seems difficult to execute 
kerberos commands from a shell script and determine if they succeed or fail.