kadmin: Unbalanced quotes in command line

Klaus Jensen kjensen at diku.dk
Tue Jul 8 10:53:00 EDT 2008


Hi,

I'm working on using a script to change the password for a given principal.
The resulting command line is something like this:

kadmin -k -t keytapfile -p host/host.foobar -q "cpw -pw <somepassword> princ at REALM"

When <somepassword> contains a quote character (i.e. password is: foobar"omg)
I get the following error:

kadmin: Unbalanced quotes in command line

Note that the quote is escaped:
kadmin -k -t keytapfile -p host/host.foobar -q "cpw -pw foobar\"omg princ at REALM"



I tried using kadmin without '-q' and got the same error message when using
the command directly:

# kadmin -k -t keytapfile -p host/host.foobar
kadmin:  cpw -pw foobar"omg princ at REALM
kadmin: Unbalanced quotes in command line

Samething when escaped:

kadmin:  cpw -pw foobar\"omg princ at REALM 
kadmin: Unbalanced quotes in command line



Only succesful way I found to set a password using a quote (not escaped) was:

# kadmin -k -t keytapfile -p host/host.foobar
kadmin:  cpw princ at REALM
Enter password for principal "princ at REALM": 
Re-enter password for principal "princ at REALM": 
Password for "princ at REALM" changed.


I'm using krb5-1.5.3.


Any ideas or alternative approaches?



Thanks!

-- 
Klaus

   "Oops, I always forget the purpose of competition is to divide people into
winners and losers." -Hobbes being sarcastic



More information about the Kerberos mailing list