[RADIATOR] mixed up User-Name values
Dave Kitabjian
dave at netcarrier.com
Tue Jul 15 09:15:44 CDT 2008
Hello folks,
I could use a little help here. My CountQuery is not using the rewritten
username (%U), but rather the original (%u), although it seems to
respect other specials such as %h:
<SessionDatabase SQL>
...
# Use the Rewritten username, %U, rather than
the %u default:
CountQuery select NASIDENTIFIER, NASPORT,
ACCTSESSIONID, FRAMEDIPADDRESS, USERNAME \
from RADONLINE \
where USERNAME='%h' #works!!
#where USERNAME='%U' #DOESN'T
work!
</SessionDatabase>
I have tried the setup with and without the
SessionDatabaseUseRewrittenName flag:
<Handler>
PreProcessingHook file:"%D/pphook.cfgx"
<AuthBy FILE>
NoCheckPassword
Filename %D/MY.users-inbound
AuthenticateAttribute User-Name
</AuthBy>
PostAuthHook file:"%D/pahook.cfgx"
# SessionDatabaseUseRewrittenName #ie, the
AccountId
SessionDatabase SDBSQL1
</Handler>
In pphook, I replace the User-Name (an IP address) value with a value
from a SQL db, "1":
$p->change_attr('User-Name', $accountID ) if defined $accountID;
The Auth, then, correctly uses the rewritten value:
Tue Jul 15 09:45:28 2008: DEBUG: Radius::AuthFILE looks for
match with 1 [192.168.1.100]
But the Session checker insists on using the original value:
Tue Jul 15 10:01:06 2008: DEBUG: Query is: 'select
NASIDENTIFIER, NASPORT, ACCTSESSIONID, FRAMEDIPADDRESS, USERNAME from
RADONLINE where USERNAME='192.168.1.100'':
I also tried replacing the change_attr() call with:
$p->delete_attr('User-Name') if defined $accountID;
$p->add_attr('User-Name', $accountID ) if defined $accountID;
but that didn't help. I had no luck with a search through the code.
Thanks in advance for the help!
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.open.com.au/pipermail/radiator/attachments/20080715/a6a9ffa9/attachment.html>
More information about the radiator
mailing list