freeradius and the current date

Arran Cudbard-Bell a.cudbardb at
Thu Mar 5 16:25:48 CET 2015

> On 5 Mar 2015, at 09:56, Graham Leggett <minfrin at> wrote:
> Hi all,
> I am looking to perform an LDAP search in freeradius that includes the option to specify users that have not expired, where expiry is contained an a standard LDAP attribute. Something similar to this:
> (&(uid=%{User-Name})(myExpiryTimestamp>=%{[TIMESTAMP_NOW]}))
> (In other words, I am looking for a suitable unlang attribute that represents “time now on radius server”)
> The closest I’ve found are these deprecated one character variables as follows:
> Unfortunately they are marked as deprecated with no indication of what replaces them.
> The source code for rlm_date seems to indicate that date formatting is possible, but there is no functionality that I can see to provide the current date, which is a shame. Should this module be a good place for this kind of functionality or should I be looking somewhere else for this?

Call rlm_preprocess which will give you Event-Timestamp.

#  Create or parse an ASN1 generalized time stamp
#  Note: Not as flexible as it should be due to fixed strftime format
#  Should be able to deal with fractional seconds and lack of timezone.
date generalized_time {
	format = "%Y%m%d%H%M%S%z"


the rlm_date and Event-Timestamp combo replace the one letter expansions.


Arran Cudbard-Bell <a.cudbardb at>
FreeRADIUS development team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 872 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <>

More information about the Freeradius-Users mailing list