Red Hat Bugzilla – Bug 176035
kadmin should have more fine-grained exit codes
Last modified: 2008-04-09 11:05:46 EDT
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):
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 $?
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.
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.