krb5_kt_resolve error in kfw 3.0

Ken Raeburn raeburn at MIT.EDU
Tue Sep 5 14:03:59 EDT 2006


On Sep 5, 2006, at 12:20, Shivakeshav Santi wrote:
>      I noticed that krb5_kt_resolve function returns  
> KRB5_KT_UNKNOWN_TYPE
> on a valid call with a correct keytab name . On further  
> investigation I
> found that the function uses strcmp which is comparing the default  
> prefixes
> with the prefix (FILE:). But the default prefixes do not have colon.
>
> changing the line in ktbase.c from strcmp(tlist->ops->prefix,pfx) to
> strncmp(tlist->ops->prefix,pfx,strlen(tlist->ops->prefix)) fixed  
> the problem.

Isn't pfx there supposed to be a copy of just the type name, without  
the colon?

Even if not, using strncmp like that would give incorrect positive  
matches if "FILEXYZ:foo" is given.

It does look to me like the wrong thing will happen with a drive- 
letter prefix -- if it sees "c:foo", it'll assume the "c:" is part of  
the filename, and use "FILE:", with the colon, which won't match  
"FILE" in the linked list.

Ken





More information about the krbdev mailing list