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

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

Re: [Help-gnu-radius] problems getting rewrite hook right


From: Charles Sprickman
Subject: Re: [Help-gnu-radius] problems getting rewrite hook right
Date: Wed, 25 Oct 2006 15:53:44 -0400 (EDT)

On Mon, 23 Oct 2006, Sergey Poznyakoff wrote:

Hi Charles,

Long time no talk :))

Gnu-Radius works so well I don't ever have to touch it! :)

So it is rewriting the "%" to "@", but not doing the split...

Any suggestions?

Sure: gsub does not modify its third argument, instead it returns
the new string. So, your function should be:

I'm trying that, but I get an even stranger result:

Oct 25 15:53:10 elephant radiusd: Auth.debug: mysql.c:216:rad_mysql_exec: query: SELECT attr,value FROM radius_attrib WHERE username='address@hidden' AND op IS NULL AND domain='address@hidden'

The test user logs in using "address@hidden"... I'm so lost with this since I haven't touched it for years (literally).

Thanks,

Charles

string
domain_split(string name)
{
        integer a;

        %[User-Name] = gsub("%", "@", name);
        a = index(%[User-Name], '@');                          /* * */
        if (a != -1)
                return substr(%[User-Name], a+1, -1);          /* * */
        else
                return "bway.net";
        return "";
}

(lines, marked with /* * */ were changed)

Regards,
Sergey





reply via email to

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