help-gnu-radius
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gnu-radius] Whitespace in the Username


From: Lewis Watson
Subject: [Help-gnu-radius] Whitespace in the Username
Date: Wed, 2 Jun 2004 14:47:34 -0500

Hello,
I am trying to have gnuradius ignore any whitespace in the username field.
I found a previous post where using Function-Rewrite in the hints file was
suppose to help with this but I must be missing something.

http://lists.gnu.org/archive/html/help-gnu-radius/2002-07/msg00012.html

So I added this function to the rewrite file:

string
delete_ws(string s)
{
        string rs;

        rs = "";
        while (s =~ "\([^ \t]*\)[ \t][ \t]*\(.*\)") {
                rs = rs + \1;
                s = \2;
        }
        return rs + s;
}


I then made my hints file as this:

 DEFAULT Group = "dynamicgrp", Strip-User-Name = No
         Hint = "single",
         Simultaneous-Use = 1,
         Service-Type = Framed-User,
         Framed-Protocol = PPP,
         Rewrite-Function = "delete_ws"

 DEFAULT Group = "multi", Strip-User-Name = No
         Hint = "multi",
         Simultaneous-Use = 2,
         Service-Type = Framed-User,
         Framed-Protocol = PPP,
         Rewrite-Function = "delete_ws"


Then I did a radctl reload but it still did not work.

Here's the error in the log
Jun 02 05:13:16 Auth.error: (AUTHREQ AS5350 86 alyson ): Malformed
username
Jun 02 05:13:21 Auth.error: function delete_ws() requires 1 parameter
Jun 02 05:13:21 Auth.error: hints:13: delete_ws(): not defined

I am unsure as to what else is needed for the rewrite to work and need
some help.
Thanks,
Lewis






reply via email to

[Prev in Thread] Current Thread [Next in Thread]