[Date Prev][Date Next]
slap_timestamp with microsecond granularity?
- To: firstname.lastname@example.org
- Subject: slap_timestamp with microsecond granularity?
- From: "Paul B. Henson" <email@example.com>
- Date: Mon, 28 Apr 2014 20:17:35 -0700
- Content-disposition: inline
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=B57jr9Wv5T6ymX/8H99TuJNvk8DmmBHnxRE2Dp5w7TA=; b=0FgU5u4G4rVL2vrC8ikheI0pI4IX9M3CTpenYDedqzjlG1+27AEiuTgPL7jX3P/Ht9 6YgidihT2hpq95Md3XOoMB/oxZaiqpw2M5Lt5cAvY0WFeANjnZjydc4vky5hZLVmoEeJ V+gc7IfydXdGAIr94ODFNvrJ0FHKXELhkhBb3H9esUQm34FOUxtgyV6v9PgMyh2oh+dt 9d4zsbsgU1i1UP8psxt5iPvi+1tGz7viSBwscKUbkeED92UTj9XkEHBfTn21uJ9MM8W3 EkZ3EYJBeu+edTvxCxw3w8DqAMOHIh8GdS4VvleGbpMOF0DPfaNgc9MabS1TMeOOD2mt rIsg==
- User-agent: Mutt/1.5.23 (2014-03-12)
Reviewing current time handling code, while lutil_parsetime understands
and can parse a generalized time that includes fractions of a second,
there doesn't seem to be any code that can generate a generalized time
string including fractions of a second, in particular to microsecond
resolution (to match a struct timeval time)?
I'd like to enhance the current password policy module to use
microsecond resolution for the pwdFailureTime attribute, as the current
1 second resolution makes it less than ideal for account lockouts.
Currently, it is using slap_timestamp to generate the generalized time
to store, which only provides a generalized time with 1 second
granularity. On initial review, it looks like simply storing a generalized
time with microsecond resolution in the pwdFailureTime attribute is all
that is required to enhance the ppolicy module for better account
lockout support, because as previously mentioned lutil_parsetime already
understands and can parse fractional seconds. I don't see any other code
that would need to be modified so far.
The question is how to generate the needed format? One option would be
to enhance one way or another the existing generic support, perhaps
adding a slap_timestamp_usec function? Another would be to just add a
call to gettimeofday() next to the current call to time() in the ppolicy
code, generate the generalized time string with slap_timestamp, and then
mash the fractional seconds into it.
Ideally I'd like to get this enhancement to ppolicy accepted into the
code base, so I'd appreciate some feedback as to what implementation
would be preferred for this.