[krbdev.mit.edu #6548] strptime() doesn't like being touched that way by krb5_ldap_get_time

Ken Raeburn via RT rt-comment at krbdev.mit.edu
Wed Aug 19 23:08:27 EDT 2009


On Aug 19, 2009, at 18:56, Tom Yu via RT wrote:
> I noticed this problem on Mac OS X, but we probably want to fix it in
> the general case for portability reasons.
>
> getepochtime(), called by krb5_ldap_get_time(), passes a format string
> of "%Y%m%d%H%M%SZ" to strptime(), causing a a return of EINVAL on Mac
> OS X when any KDC programs attempt to fetch the master key list when
> using an LDAP back end.  According to POSIX / SUS, the application
> must provide nonalphanumeric separators between format specifiers in
> the format string of strptime().

I think we might see similar problems in krb5_string_to_timestamp,  
too.  Currently it ignores conversion errors (assumes that the pattern  
tried wasn't applicable so the next pattern should be tried).  The  
t_kerb test program can exercise krb5_string_to_timestamp, but we  
don't currently have it do so.

Ken




More information about the krb5-bugs mailing list