Why parsing and unparing done in kinit?

Ken Raeburn raeburn at MIT.EDU
Fri Sep 21 10:56:06 EDT 2007

On Sep 21, 2007, at 10:40, nukala krishna wrote:
>         I have a question. i.e. Why parsing and unparsing is done  
> in kinit.c before submitting the principal to  
> krb5_get_init_creds_password () method ? Why don't it is passed  
> directly?

We need a data structure for krb5_get_init_creds_* and a string for  
any error messages we might want to display.  We can get a principal  
as a string from the command line, or construct the data structure  
directly from some other library routines (examining the credentials  
cache, for example).  The unparsing after possibly parsing ensures  
that we've got both forms ready before we go forward.

It could be done otherwise to avoid unnecessary calls, of course, but  
saving a few bytes and milliseconds in kinit doesn't seem terribly  


More information about the krbdev mailing list