rlm_cache xlat

Alan DeKok aland at deployingradius.com
Thu Feb 27 15:09:06 CET 2020


On Feb 27, 2020, at 6:31 AM, Станислав Семенов via Freeradius-Users <freeradius-users at lists.freeradius.org> wrote:
> Why not working next config? Thanks.

  The documentation in the mods-available/cache file should be pretty clear.

> cache cache_ldap {
>    driver = "rlm_cache_rbtree"
>    key = "%{User-Name}"
>    ttl = 300
>    add_stats = no
>    update {
> &reply:Cisco-AVPair := &reply:Cisco-AVPair
> &control:Tmp-String-0 := &control:Tmp-String-0
>    }
> }
> 
> post-auth {
>    cache_ldap
>    update reply {
>       Tmp-String-1 = "%{cache_ldap:control:Tmp-String-0}"
>    }
>    detail_reply
> }
> 
> (0) # Executing section post-auth from file /usr/local/radius/etc/raddb/radiusd.conf
> (0)   post-auth {
> (0) cache_ldap: EXPAND %{User-Name}
> (0) cache_ldap:    --> E350
> (0) cache_ldap: No cache entry found for "E350"
> (0) cache_ldap: Creating new cache entry
> (0) cache_ldap: &reply:Cisco-AVPair := &reply:Cisco-AVPair -> 'h323-ivr-in=ani:4822360460'
> (0) cache_ldap: &control:Tmp-String-0 := &control:Tmp-String-0 -> 'h323-ivr-in=ani:4822360460'
> (0) cache_ldap: Committed entry, TTL 300 seconds
> (0)     [cache_ldap] = updated

  That's good.

> (0)     update reply {
> (0)       No cache entry found for "control:Tmp-String-0"

  It's looking up the string "control:Tmp-String-0" in the cache.  It's NOT looking up the value of that attribute.

  You will need to use:

   update reply {
      Tmp-String-1 = "%{cache_ldap:%{control:Tmp-String-0}}"
   }


  This expands the attribute, and then uses the value of the attribute as the key lookup.

  Alan DeKok.




More information about the Freeradius-Users mailing list