To: | krb5-bugs@MIT.EDU |
Subject: | strptime() doesn't like being touched that way by krb5_ldap_get_time |
From: | Tom Yu <tlyu@MIT.EDU> |
Date: | Wed, 19 Aug 2009 18:56:27 -0400 |
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...
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...