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

Tom Yu via RT rt-comment at krbdev.mit.edu
Wed Aug 19 18:56:35 EDT 2009


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().

Experimentation with a test program implies that the "%Y" format
specifier to strptime() tries to eat as many digits as it can, which
is about ten.  This happens to be the number of decimal digits
required to represent a 32-bit integer...




More information about the krb5-bugs mailing list