(RADIATOR) Variable Passing in Config Files

Hugh Irvine hugh at open.com.au
Wed Feb 19 00:29:37 CST 2003


Hello Jay -

The simplest way to do the sort of thing you describe is to use 
GlobalVar's that you pass in on the command line for each instance of 
Radiator.

For the Handler and the AuthBy, you can use an Identifier in the 
Handler.

# define AuthBy clauses

<AuthBy SQL>
	Identifier CheckSQL
	.....
	AuthSelect ..... %{Handler:Identifier} ....
	....
</AuthBy>

.....

# define Handlers

<Handler .....>
	Identifier blahblah
	....
</Handler>

BTW - if you are doing lots of proxy radius you might also consider 
using the AuthBy SQLRADIUS clause.

regards

Hugh


On Wednesday, Feb 19, 2003, at 07:18 Australia/Melbourne, Jay Pike 
wrote:

> Hello All,
>
> 	I have what I hope is a simple question.  Is there a way to
> pass variables around in the config file?
>
> 	I've RTFM'd and found variables for use in filenames, date
> formatting, etc, but, what I'm looking to do is twofold:
>
> 	a) Have two configs: one that is used globally across all
> authentication servers and the other one which holds specific
> information about that local server.
>
> 	b) Pass variables from within an <Handler ...> statement to SQL
> select statmenets within the <AuthBy ...> statements.
>
>
> Part A
> ------
>
> 	Currently, I'm doing this using the include syntax, but, I
> either have to do multiple includes, or I have to include large chunks
> of the config file in the local config file.
>
> 	Things that I'm changing on a host-per-host config file level:
>
> 	- AuthPort
> 	- AcctPort
> 	- BindAddress
> 	- DBSource
> 	- <Monitor> - 'Clients' line
>
> 	Rather than have to specify these as specific per host, I would
> like to be able to specify these values as variables in the radius.cfg
> and just include their actual values in a local file, say,
> radius-local.cfg.
>
> Part B
> ------
>
> 	I currently have about 20 or 30 <AuthBy ...> clauses in each
> config file, but, in each of these, only one thing changes.  It would 
> be
> much easier if I could use a variable in the AuthSelect lines.  The
> variable could then be set from within the <Handler ...> clause.
>
> 	IE:
>
> <Handler Realm=/^(abc.com|def.com|hij.com)$/, CHAP-Password=/.+/,
> Client-Identifier=Blah >
> 	%variable1 = 'chapblah';
> </Handler>
>
> <AuthBy thishandler>
> 	AuthSelect select ENCRYPTPEDPASSOWRD, REALM from SUBSCRIBERS
> 	  where (USERNAME = '%U' and REALM = '%R' and ALLOW = '%variable1'
> </AuthBy>
>
> Note: Writing this email, I just realized that I might be able to do
> this using the '%{Client:Identifier}' or '{Client:Name}' values in the
> check.
>
> Thoughts?
>
> jp
>
>
> -- 
>    __________________________________________________________________
>  /                                                                    \
> |       James J. Pike Jr.         Phone: 888.747.4638                  
> |
> |       Systems Engineer          Direct Phone: 517-664-8610           
> |
> |       CoreComm Inc.             Http: http://www.core.com/           
> |
> |                EMail: jay.pike at corecomm.com                          
> |
> |         PGPKey: http://my.voyager.net/jaypike/pgpkey.txt             
> |
>  \                                                                    /
>    ------------------------------------------------------------------
> ===
> 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.
>
>

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.

===
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