(RADIATOR) Dynamic Vars

Nick Rogness nick at rogness.net
Thu Aug 21 18:37:21 CDT 2003


In my radius config file I have:

	<Client DEFAULT>
		.
		.
        	PreHandlerHook file:"/etc/raddb/prehandler.radhook"
	</Client>


In /etc/raddb/prehandler.radhook I have:

	.
	.
	$p->add_attr('CCC-DB',"testdb");
	.


For my SessionDB I try to reference my %{CCC-DB} variable:

	<SessionDatabase SQL>
	Identifier      SDB
	DBSource        dbi:mysql:%{CCC-DB}:db1.domain.com
	.
	.

But it appears I can't reference it as it comes up with an error:

Wed Aug 20 19:28:01 2003: ERR: do failed for 'delete from RADONLINE where
NASIDENTIFIER='203.63.154.1' and NASPORT=01234': No Database Selected

So I'm assuming that you can only reference certain %{attr} in certain
cases.  I want to be able to use the same sessionDB "template" and have it
reference different databases as determined by the PreHandlerHook.  I
don't want to build 50 different <SessionDatabase ...> statements for all
of our customers (since they all have different DBs).  How can I
accomplish this?

Same problem exists for <AuthBy SQL> DBSource directives.  I want the
Prehandler to choose the database to connect to.  Any pointers?

Thanks,

Nick Rogness

===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list