Hi,

I can't figure out the regex syntax used in attr_rewrite, and am unable to find any 
useful docs pertaining to this anywhere....

I am trying to use the attr_rewrite module to append a postfix to the
User-Name if and only if the User-Name does not contain an '@' symbol.

This does not work as expected:

attr_rewrite rewrite_User-Name {
    attribute = User-Name
    searchin = packet
    searchfor = "[EMAIL PROTECTED]"
    replacewith = %{User-Name}%{Postfix-Tag}
    ignore_case = no
    new_attribute = no 
    max_matches = 1
}

I get a match when I should not...

...from 'radiusd -X' output... 

radius_xlat:  '[EMAIL PROTECTED]'
radius_xlat:  '[EMAIL PROTECTED]'
attr_rewrite: Changed value for attribute User-Name from '[EMAIL PROTECTED]' to 
'[EMAIL PROTECTED]'

I noticed that the debug line has dropped the regex '$' end-of-string character, so I 
tried escaping it,  but to no avail: One '\' does nothing to the debug output, whilst 
two '\\' gives:

radius_xlat:  '[EMAIL PROTECTED]'

perhaps this is a bug...? Anyway, any help/info/pointers much appreciated.

Cheers,

Spencer Stapleton

-- 
Systems engineer
Compass Communications
http://www.compass.net.nz

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

Reply via email to