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

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

Re: [Help-gnu-radius] Whitespace in the Username


From: Sergey Poznyakoff
Subject: Re: [Help-gnu-radius] Whitespace in the Username
Date: Thu, 03 Jun 2004 02:21:09 +0300

Hi Lewis,

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

First, inform radius that you allow whitespace to appear in usernames:

# raddb/config

options {
        username-chars " ";
        ...

(see
http://www.gnu.org/software/radius/manual/html_node/radius_21.html#SEC24)

Secondly, notice that delete_ws() cannot be directly used in
Rewrite-Function attribute. (see
http://www.gnu.org/software/radius/manual/html_node/radius_207.html#SEC308
for the description of the attribute and its requirements). What you
need to do is add an interface to it, e.g.:

integer
my_rewrite()
{
        %[User-Name] = delete_ws(%[User-Name]);
        return 0;
}

(it is a good idea to place this definition in the same file where
delete_ws() is declared) and then use this function as the value of
Rewrite-Function attribute:

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

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


Regards,
Sergey   


        




reply via email to

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