Hi Why not working next config? Thanks. 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 (0) update reply { (0) No cache entry found for "control:Tmp-String-0" (0) EXPAND %{cache_ldap:control:Tmp-String-0} (0) --> (0) Tmp-String-1 = (0) } # update reply = noop
On Feb 27, 2020, at 6:31 AM, Станислав Семенов via Freeradius-Users <freeradius-users@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.
I have not tried this option. But <ERROR: Unknown attribute "h323-ivr-in=ani:4822360460"> (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 (0) update reply { (0) ERROR: Unknown attribute "h323-ivr-in=ani:4822360460" (0) EXPAND %{cache_ldap:%{control:Tmp-String-0}} (0) --> (0) Tmp-String-1 = (0) } # update reply = noop On 27.02.2020 17:09, Alan DeKok wrote:
On Feb 27, 2020, at 6:31 AM, Станислав Семенов via Freeradius-Users <freeradius-users@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.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Feb 27, 2020, at 9:36 AM, Станислав Семенов via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
I have not tried this option. But <ERROR: Unknown attribute "h323-ivr-in=ani:4822360460">
Hmm... then the %{cache_ldap:...} expansion takes an attribute name. I didn't check, TBH. The solution then is simple; make sure that the control:Tmp-String-0 attribute exists. Alan DeKok.
post-auth { cache_ldap update control { Cache-Read-Only = yes } 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 (0) update control { (0) Cache-Read-Only = yes (0) } # update control = noop (0) cache_ldap: EXPAND %{User-Name} (0) cache_ldap: --> E350 (0) cache_ldap: Found entry for "E350" (0) cache_ldap: Merging cache entry into request (0) cache_ldap: &reply:Cisco-AVPair := "h323-ivr-in=ani:4822360460" (0) cache_ldap: &control:Tmp-String-0 := "h323-ivr-in=ani:4822360460" (0) [cache_ldap] = ok (0) update reply { (0) ERROR: Unknown attribute "h323-ivr-in=ani:4822360460" (0) EXPAND %{cache_ldap:%{control:Tmp-String-0}} (0) --> (0) Tmp-String-1 = (0) } # update reply = noop 27.02.2020 18:24, Alan DeKok пишет:
On Feb 27, 2020, at 9:36 AM, Станислав Семенов via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
I have not tried this option. But <ERROR: Unknown attribute "h323-ivr-in=ani:4822360460"> Hmm... then the %{cache_ldap:...} expansion takes an attribute name. I didn't check, TBH.
The solution then is simple; make sure that the control:Tmp-String-0 attribute exists.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan DeKok -
Stanislav Semenov -
Станислав Семенов