Hi all Is possible to add a regular expression to the postauth section as follows?: Post-Auth-Type REJECT { if(%{User-Name}=="test") { ok } else { attr_filter.access_reject sql } } Regards!
Thanks Alan, I meant something like this: post-auth { if(!(User-Name=="test-user")){ sql exec } Post-Auth-Type REJECT { attr_filter.access_reject sql } } This rule works fine, the idea is that for this user, no data are added to the database (radpostauth and accounting table). Regards On Mon, Jun 28, 2010 at 1:33 PM, Alan DeKok <aland@deployingradius.com> wrote:
JOE wrote:
Hi all
Is possible to add a regular expression to the postauth section as follows?:
Post-Auth-Type REJECT { if(%{User-Name}=="test") {
Hmmm... that isn't a regular rexpression.
And see "man unlang". You can add statements pretty much anywhere.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
JOE <joeplc@gmail.com> wrote:
Thanks Alan, I meant something like this:
post-auth { if(!(User-Name=="test-user")){
And this is *still* not regex. The following is regex: ---- if (Calling-Station-Id =~ /^([0-9a-f]{2})-([0-9a-f]{2})-([0-9a-f]{2})-([0-9a-f]{2})-([0-9a-f]{2})-([0-9a-f]{2})$/i) { update control { MAC-Address-Trimmed := "%{1}%{2}%{3}%{4}%{5}%{6}" } } ---- For a tutorial on what and how to use regex, look at: man 7 regex - http://www.cl.cam.ac.uk/cgi-bin/manpage?7+regex http://www.zytrax.com/tech/web/regex.htm Always remember though, 'regex != perl regex', so do not mix up your tutorials. Also there is a thing known as 'extended' regex, known in POSIX.2 as 'modern RE', and also there is 'basic RE' that are obsoleted. Regards -- Alexander Clouter .sigmonster says: Please come again.
participants (3)
-
Alan DeKok -
Alexander Clouter -
JOE