-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 04/15/2011 11:44 AM, Pierre Carrier wrote:
Hello Stephen,
On 11 Apr 2011, at 17:26, Stephen Gallagher wrote:
days = ll / 864000000000LL - 134774LL
I note also that your calculation was wrong, because it was dealing in nanoseconds, but pwdLastSet is a count of HUNDRED nanosecond blocks.
For reference to whoever might Google this thread, the conversion in nss_ldap is actually correct:
24*60*60*1000*1000*10 / 864000000000 1.00000
Confirmed with a password set today:
(129473838084062500/(24*60*60*1000*1000*10))-134774 | | | value in passwdLastSet | days between 1601 and 1970 100ns in days
= 15079.97926
15079.97926/365+1970 2011.31501
Okay, I'm completely willing to believe I made a mistake there. That's EXACTLY why I'd rather have the source read 24*60*60*1000*1000*10 instead of a magic number. It makes it easier to understand where the number comes from.
- -- Stephen Gallagher RHCE 804006346421761
Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/