buildsql
is a testing tool that creates
or updates an SQL authentication table from the contents of a Unix
password file or from a (Livingston) standard RADIUS users file. It can
also be used to print or delete the information for a single user from an
SQL authentication table.
Use an SQL database with Radiator if you
require fast authentication, large user populations, and also need to
change your user database on the fly while Radiator is running, and you do
not or cannot use <AuthBy DBM> or <AuthBy FILE> in Nocache
mode.
By default,
buildsql
connects to the SQL
database specified by the
-dbsource
,
-dbusername
, and
-dbauth
command
line flags. You must specify these flags. For more information about
setting these flags for different database vendors, see
Section 19. Using SQL with various database vendors.
By default,
buildsql
inserts or updates records in a table called
SUBSCRIBERS, but you can change this with a command line flag. By default,
it only affects four columns in the table: USERNAME, PASSWORD, CHECKATTR,
REPLYATTR, but you can change this with command line arguments. All other
columns are unaffected by buildsql
, so you can have
arbitrarily complicated tables. You can change the names of the columns
that buildsql
uses with command line arguments. The
default names are compatible with the default names used by the SQL
authentication module.
The arguments are:
buildsql [-z] [-u] [-f] [-d user] [-l user] [-v]
-dbsource dbi:drivername:option
[-dbusername dbusername] [-dbauth auth]
[-password | -dbm | -flat]
[-tablename name]
[-username_column columnname]
[-password_column columnname]
[encryptedpassword]
[-checkattr_column columnname]
[-replyattr_column columnname] file ....
-z
This deletes all user entries from the
database before processing other commands.
-u
This is the update mode. It replaces
user entries that already exist in the database rather than shows
error about constraint violations.
-f
This forces database update for
non-defined fields.
-d user
This deletes
user
from the SQL database
-l user
This prints out the entry for
user
in a format that could be re-imported into
buildsql
.
-v
This prints out every SQL statement
being issued before its executed
-dbsource dbi:drivername:option
This
specifies the data source name of the database to connect to. Must be
specified.
-dbusername username
This specifies the
user name to use to connect to the SQL database.
dbauth password
This specifies the password
for dbusername
. Not required for some database
types.
-password
-dbm
-t dbmtype
Forces
buildsql
to use a particular format of DBM file.
The value of dbmtype
can be
AnyDBM_File
, NDBM_File
,
DB_File
, GDBM_File
,
SDBM_File
, or ODBM_File
. The
default value is AnyDBM_File
, which selects the
best format on the host machine.
-flat
The source files are in standard
RADIUS flat file format. For more information, see
Section 9.2. Flat file user database. This is the
default. If no input file type is specified,
-flat
is assumed.
-tablename name
This specifies the name of
the database table to use. The default value is
SUBSCRIBERS
.
-username_column columnname
This specifies
the name of the column where the user name are stored. The default
value is USERNAME
.
-password_column columnname
This specifies
the name of the column where the passwords are stored. The default
value is PASSWORD
.
-checkattr_column columnname
This specifies
the name of the column where the Check Items are stored. The default
value is CHECKATTR
.
-replyattr_column columnname
This specifies
the name of the column where the Reply Items are stored. The default
value is REPLYATTR
.
-encryptedpassword
This handles and prints
all passwords as if they were encrypted. When printing passwords with
-l
, the password is given with
Encrypted-Password.
Example
Rebuild the entire SQL database from the
/etc/passwd
file, clearing the old entries first.
Then connect to an Oracle database SID called osc
as
user system and password manager. Use the default table and column
names:
buildsql -z -dbsource dbi:Oracle:osc \
-dbusername system -dbauth manager \
-password /etc/passwd
Example
Print out the attributes for user mikem
in the same database:
buildsql dbsource dbi:Oracle:osc \
-dbusername system -dbauth manager -l mikem
Example
Delete user mikem
from the same
database:
buildsql dbsource dbi:Oracle:osc \
-dbusername system -dbauth manager -d mikem