[krbdev.mit.edu #7991] kadmin should have a script-friendly mode

Greg Hudson via RT rt-comment at krbdev.mit.edu
Fri Aug 15 10:15:10 EDT 2014


The following design should be relatively easy to implement and would 
make kadmin and kadmin.local easier to use in administrative scripts, 
without creating backwards compatibility issues.

If there are any command-line arguments after the kadmin_startup getopt 
loop is complete, they should be interpreted as a command with the 
following semantics:

1. The command is split according to the argv entries (i.e. using 
ss_execute_command), not according to ss_execute_line quoting.

2. No informational messages are displayed to stdout.  Error messages 
can still be displayed to stderr.

3. If the command fails to complete, kadmin exits with a non-zero 
status.  (In normal use, even with -q, it only exits with nonzero status 
if it fails to connect to kadmind.)

I don't propose to fix #743 (prompt is displayed to stdout).  I expect 
this to be most useful in combination with kadmin -c so that the script 
doesn't have to deal with inputting a password on each kadmin 
invocation.

Converting our Python tests to use the new syntax would be a bonus, as 
it would mean the tests would immediately notice when a kadmin command 
fails.


More information about the krb5-bugs mailing list