AW: unlang - delete attribute - !*

Hachmer, Tobias Tobias.Hachmer at stadt-frankfurt.de
Wed Oct 9 08:28:44 CEST 2013


Hello Arran,

thanks for the answer. This has worked!

Regards,
Tobias Hachmer


-----Ursprüngliche Nachricht-----
Von: freeradius-users-bounces+tobias.hachmer=stadt-frankfurt.de at lists.freeradius.org [mailto:freeradius-users-bounces+tobias.hachmer=stadt-frankfurt.de at lists.freeradius.org] Im Auftrag von Arran Cudbard-Bell
Gesendet: Mittwoch, 9. Oktober 2013 08:22
An: FreeRadius users mailing list
Betreff: Re: unlang - delete attribute - !*


On 9 Oct 2013, at 07:05, "Hachmer, Tobias" <Tobias.Hachmer at stadt-frankfurt.de> wrote:

> Hello list,
>  
> I want to delete one reply attribute from the reply list if the access-request is originating not from a special NAS-IP-Address.
>  
> Currently I have solved this by adding this unlang code in authorize section:
>  
>         if(!NAS-IP-Address == x.x.x.x) {
>                 update reply {
>                         Aruba-Admin-Role := ""
>                 }
>         }
>  
> The man page of unlang says:
> !*     Delete all occurances of the named attribute, no matter what the value.
>  
> I think this is the better way than just to clear the attribute value. But how can I use this, what's the correct syntax?
>  
> I have tested the following without success:
>  
> Aruba-Admin-Role !* ""
> Aruba-Admin-Role !*
> !* Aruba-Admin-Role
>  

update reply {
	Aruba-Admin-Role !* ANY
}

Will delete all.

update reply {
	Aruba-Admin-Role -= "%{reply:Aruba-Admin-Role}"
}

Will delete the first instance.

-Arran

Arran Cudbard-Bell <a.cudbardb at freeradius.org> FreeRADIUS Development Team

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list