Restructure raddb dir
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 27 Jun 2013 19:12:53 +0000 (20:12 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 27 Jun 2013 19:12:53 +0000 (20:12 +0100)
Move all module specific files into mods-config

Create symbolic links for critical files to legacy locations

Update man pages

Fix certificate generation (so it doesn't run every time)

73 files changed:
Make.inc.in
configure
configure.ac
man/man5/acct_users.5 [deleted file]
man/man5/rlm_attr_filter.5
man/man5/rlm_sql_log.5 [deleted file]
man/man5/users.5
raddb/all.mk
raddb/mods-available/attr_filter
raddb/mods-available/cui
raddb/mods-available/dhcp_sqlippool
raddb/mods-available/files
raddb/mods-available/mac2ip
raddb/mods-available/mac2vlan
raddb/mods-available/perl
raddb/mods-available/preprocess
raddb/mods-available/sql
raddb/mods-available/sqlcounter [deleted file]
raddb/mods-available/sqlippool
raddb/mods-available/yubikey
raddb/mods-config/attr_filter/access_challenge [moved from raddb/filter/access_challenge with 100% similarity]
raddb/mods-config/attr_filter/access_reject [moved from raddb/filter/access_reject with 100% similarity]
raddb/mods-config/attr_filter/accounting_response [moved from raddb/filter/accounting_response with 100% similarity]
raddb/mods-config/attr_filter/post-proxy [moved from raddb/filter/post-proxy with 100% similarity]
raddb/mods-config/attr_filter/pre-proxy [moved from raddb/filter/pre-proxy with 100% similarity]
raddb/mods-config/files/accounting [moved from raddb/acct_users with 100% similarity]
raddb/mods-config/files/authorize [moved from raddb/users with 100% similarity]
raddb/mods-config/files/pre-proxy [moved from raddb/preproxy_users with 100% similarity]
raddb/mods-config/preprocess/hints [moved from raddb/hints with 100% similarity]
raddb/mods-config/preprocess/huntgroups [moved from raddb/huntgroups with 100% similarity]
raddb/mods-config/sql/counter/mysql/queries.conf [moved from raddb/sql/counter/mysql/queries.conf with 100% similarity]
raddb/mods-config/sql/counter/postgresql/queries.conf [moved from raddb/sql/counter/postgresql/queries.conf with 100% similarity]
raddb/mods-config/sql/cui/mysql/queries.conf [moved from raddb/sql/cui/sqlite/queries.conf with 100% similarity]
raddb/mods-config/sql/cui/mysql/schema.sql [moved from raddb/sql/cui/mysql/schema.sql with 100% similarity]
raddb/mods-config/sql/cui/postgresql/queries.conf [moved from raddb/sql/cui/postgresql/queries.conf with 100% similarity]
raddb/mods-config/sql/cui/postgresql/schema.sql [moved from raddb/sql/cui/postgresql/schema.sql with 100% similarity]
raddb/mods-config/sql/cui/sqlite/queries.conf [moved from raddb/sql/cui/mysql/queries.conf with 100% similarity]
raddb/mods-config/sql/cui/sqlite/schema.sql [moved from raddb/sql/cui/sqlite/schema.sql with 100% similarity]
raddb/mods-config/sql/ippool-dhcp/mysql/queries.conf [moved from raddb/sql/ippool/mysql/queries.conf with 100% similarity]
raddb/mods-config/sql/ippool-dhcp/sqlite/queries.conf [moved from raddb/sql/ippool-dhcp/sqlite/queries.conf with 100% similarity]
raddb/mods-config/sql/ippool/mysql/queries.conf [moved from raddb/sql/ippool-dhcp/mysql/queries.conf with 100% similarity]
raddb/mods-config/sql/ippool/mysql/schema.sql [moved from raddb/sql/ippool/mysql/schema.sql with 100% similarity]
raddb/mods-config/sql/ippool/oracle/msqlippool.txt [moved from raddb/sql/ippool/oracle/msqlippool.txt with 100% similarity]
raddb/mods-config/sql/ippool/oracle/queries.conf [moved from raddb/sql/ippool/oracle/queries.conf with 100% similarity]
raddb/mods-config/sql/ippool/oracle/schema.sql [moved from raddb/sql/ippool/oracle/schema.sql with 100% similarity]
raddb/mods-config/sql/ippool/postgresql/queries.conf [moved from raddb/sql/ippool/postgresql/queries.conf with 100% similarity]
raddb/mods-config/sql/ippool/postgresql/schema.sql [moved from raddb/sql/ippool/postgresql/schema.sql with 100% similarity]
raddb/mods-config/sql/ippool/sqlite/queries.conf [moved from raddb/sql/ippool/sqlite/queries.conf with 100% similarity]
raddb/mods-config/sql/ippool/sqlite/schema.sql [moved from raddb/sql/ippool/sqlite/schema.sql with 100% similarity]
raddb/mods-config/sql/main/mssql/queries.conf [moved from raddb/sql/main/mssql/queries.conf with 100% similarity]
raddb/mods-config/sql/main/mssql/schema.sql [moved from raddb/sql/main/mssql/schema.sql with 100% similarity]
raddb/mods-config/sql/main/mysql/extras/wimax/queries.conf [moved from raddb/sql/main/mysql/extras/wimax/queries.conf with 100% similarity]
raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql [moved from raddb/sql/main/mysql/extras/wimax/schema.sql with 100% similarity]
raddb/mods-config/sql/main/mysql/queries.conf [moved from raddb/sql/main/mysql/queries.conf with 100% similarity]
raddb/mods-config/sql/main/mysql/schema.sql [moved from raddb/sql/main/mysql/schema.sql with 100% similarity]
raddb/mods-config/sql/main/mysql/setup.sql [moved from raddb/sql/main/mysql/setup.sql with 100% similarity]
raddb/mods-config/sql/main/ndb/README [moved from raddb/sql/main/ndb/README with 100% similarity]
raddb/mods-config/sql/main/ndb/schema.sql [moved from raddb/sql/main/ndb/schema.sql with 100% similarity]
raddb/mods-config/sql/main/ndb/setup.sql [moved from raddb/sql/main/ndb/setup.sql with 100% similarity]
raddb/mods-config/sql/main/oracle/queries.conf [moved from raddb/sql/main/oracle/queries.conf with 100% similarity]
raddb/mods-config/sql/main/oracle/schema.sql [moved from raddb/sql/main/oracle/schema.sql with 100% similarity]
raddb/mods-config/sql/main/postgresql/extras/cisco_h323_db_schema.sql [moved from raddb/sql/main/postgresql/extras/cisco_h323_db_schema.sql with 100% similarity]
raddb/mods-config/sql/main/postgresql/extras/update_radacct_group.sql [moved from raddb/sql/main/postgresql/extras/update_radacct_group.sql with 100% similarity]
raddb/mods-config/sql/main/postgresql/extras/voip-postpaid.conf [moved from raddb/sql/main/postgresql/extras/voip-postpaid.conf with 100% similarity]
raddb/mods-config/sql/main/postgresql/queries.conf [moved from raddb/sql/main/postgresql/queries.conf with 100% similarity]
raddb/mods-config/sql/main/postgresql/schema.sql [moved from raddb/sql/main/postgresql/schema.sql with 100% similarity]
raddb/mods-config/sql/main/postgresql/setup.sql [moved from raddb/sql/main/postgresql/setup.sql with 100% similarity]
raddb/mods-config/sql/main/sqlite/queries.conf [moved from raddb/sql/main/sqlite/queries.conf with 100% similarity]
raddb/mods-config/sql/main/sqlite/schema.sql [moved from raddb/sql/main/sqlite/schema.sql with 100% similarity]
raddb/radiusd.conf.in
src/modules/rlm_perl/all.mk.in
src/modules/rlm_python/all.mk.in
src/modules/rlm_ruby/all.mk.in

index b47d850..bf6e694 100644 (file)
@@ -19,6 +19,7 @@ dictdir               = $(datadir)/freeradius
 logdir         = @logdir@
 includedir     = @includedir@
 raddbdir       = @raddbdir@
+modconfdir     = @modconfdir@
 radacctdir     = @radacctdir@
 top_builddir   = @abs_top_builddir@
 top_build_prefix=@abs_top_builddir@/
index 4ef1ef5..70ec08b 100755 (executable)
--- a/configure
+++ b/configure
@@ -650,6 +650,7 @@ RUSERS
 SNMPWALK
 SNMPGET
 PERL
+modconfdir
 raddbdir
 radacctdir
 logdir
@@ -5110,6 +5111,9 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $raddbdir" >&5
 $as_echo "$raddbdir" >&6; }
 
+modconfdir="$raddbdir/mods-config"
+
+
 WITH_ASCEND_BINARY=yes
 
 # Check whether --with-ascend-binary was given.
index 8936e33..ae1a47c 100644 (file)
@@ -317,6 +317,9 @@ AC_ARG_WITH(raddbdir,
 AC_SUBST(raddbdir)
 AC_MSG_RESULT($raddbdir)
 
+modconfdir="$raddbdir/mods-config"
+AC_SUBST(modconfdir)
+
 dnl #
 dnl #  extra argument: --with-ascend-binary
 dnl #
diff --git a/man/man5/acct_users.5 b/man/man5/acct_users.5
deleted file mode 100644 (file)
index 6f53469..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-.TH ACCT_USERS 5 "05 August 2000" "" "FreeRADIUS user accounting file"
-.SH NAME
-acct_users \- user accounting file for the FreeRADIUS server
-.SH DESCRIPTION
-The \fBacct_users\fP file resides in the radius database directory, by
-default \fB/etc/raddb\fP.  It contains a series of configuration
-directives which are used by the \fIfiles\fP module to decide how to
-log accounting messages.
-
-The format of this file is identical to that of the \fBusers\fP file,
-except that it controls the response to accounting requests, not
-authentication requests.
-
-.SH FILES
-/etc/raddb/acct_users
-.SH "SEE ALSO"
-.BR radclient (1),
-.BR radiusd (8),
-.BR dictionary (5),
-.BR users (5)
-
-.SH AUTHOR
-Alan DeKok <aland@ox.org>
index 3cb885f..1c567b8 100644 (file)
@@ -10,7 +10,7 @@
 .RE
 .sp
 ..
-.TH rlm_attr_filter 5 "12 February 2008" "" "FreeRADIUS Module"
+.TH rlm_attr_filter 5 "27 June 2013" "" "FreeRADIUS Module"
 .SH NAME
 rlm_attr_filter \- FreeRADIUS Module
 .SH DESCRIPTION
diff --git a/man/man5/rlm_sql_log.5 b/man/man5/rlm_sql_log.5
deleted file mode 100644 (file)
index b91d945..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-.\"     # DS - begin display
-.de DS
-.RS
-.nf
-.sp
-..
-.\"     # DE - end display
-.de DE
-.fi
-.RE
-.sp
-..
-.TH rlm_sql_log 5 "28 May 2005" "" "FreeRADIUS Module"
-.SH NAME
-rlm_sql_log \- FreeRADIUS Module
-.SH DESCRIPTION
-The \fBrlm_sql_log\fP module appends the SQL queries in a log file
-which is read later by the scripts/radsqlrelay Perl program.
-.PP
-The purpose of this module is to de-couple the storage of long-term
-accounting data in SQL from "live" information needed by the RADIUS
-server as it's running.  If you are not using SQL for simultaneous
-login restrictions (i.e. "sql" is not listed in the "session" section
-of "radiusd.conf"), then this module allows you to log SQL queries to
-a file, and then process them at your leisure.
-.PP
-The benefit of this approach is that for a busy server, the overhead
-of performing SQL qeuries may be significant.  Also, if the SQL
-databases are large (as is typical for ones storing months of data),
-the INSERTs and UPDATEs may take a relatively long time.  Rather than
-slowing down the RADIUS server by having it interact with a database,
-you can just log the queries to a file, and then run those queries on
-another machine, or at a time when the RADIUS server is typically
-lightly loaded.
-.PP
-If the "sql" module is listed in the "session" section of
-"radiusd.conf", then a similar system can still be used.  In that
-case, one database would be used to maintain "live" session
-information.  That database would be small, fast, and information
-would be deleted from it when a user logs out.  A second database
-would store long-term accounting information, as described above.
-.SH LIMITATIONS
-This module only performs the dynamic expansion of the variables found
-in the SQL statements. No operation is executed on the database server.
-(this would be done later by an external program) That means the module
-is useful only with non-"SELECT" statements.
-.SH CONFIGURATION
-The main configuration items to be aware of are the path of the log
-file and the different SQL queries.
-.IP "path"
-An entry named "path" sets the full path of the file where the SQL
-queries are recorded. (this variable is run through dynamic string
-expansion, and can include FreeRADIUS variables to create a dynamic
-filename)
-.IP "Accounting queries"
-When a accounting record is processed, the module searches a config
-entry keyed by the Acct-Status-Type attribute present in the
-packet. For example, the SQL to be run on an accounting start must be
-named "Start" in the configuration for the module. Other usual values
-for Acct-Status-Type are "Stop", "Alive", "Accounting-On", etc.  See
-the VALUEs for Acct-Status-Type in the dictionary.rfc2866 file.
-.IP "Post-Auth query"
-An entry named "Post-Auth" sets the query to run during the
-post-authentication stage.  This query is mainly used to log sessions
-where there may not be a later accounting packet.
-.PP
-.DS
-modules {
-  ...
-.br
-  sql_log {
-.br
-    path = "${radacctdir}/sql-relay"
-.br
-    acct_table = "radacct"
-.br
-    postauth_table = "radpostauth"
-.br
-    sql_user_name = "%{%{User-Name}:-DEFAULT}"
-.br
-
-.br
-    Start = "INSERT INTO ${acct_table} ..."
-.br
-    Stop = "UPDATE ${acct_table} SET ..."
-.br
-    Alive = "UPDATE ${acct_table} SET ..."
-.br
-
-.br
-    Post-Auth = "INSERT INTO ${postauth_table} ..."
-.br
-  }
-.br
-  ...
-.br
-}
-
-.br
-accounting {
-  ...
-.br
-  sql_log
-  ...
-.br
-}
-.br
-
-.br
-post-auth {
-  ...
-.br
-  sql_log
-  ...
-.br
-}
-.DE
-.SH SECTIONS
-.BR accounting,
-.BR post-auth
-.SH FILES
-.I /etc/raddb/radiusd.conf
-.SH SEE ALSO
-.BR radsqlrelay (8),
-.BR radiusd (8),
-.BR radiusd.conf (5)
-.SH AUTHOR
-Nicolas Baradakis <nicolas.baradakis@cegetel.net>
index 69ee7e2..ed8f471 100644 (file)
 .SH NAME
 users \- user authorization file for the FreeRADIUS server
 .SH DESCRIPTION
-The \fBusers\fP file resides in the RADIUS database directory, by
-default \fB/etc/raddb\fP.  It contains a series of configuration
-directives which are used by the \fIfiles\fP module to decide how to
-authorize and authenticate each user request.
+The \fBusers\fP files reside in the files module configuration directory,
+by default \fB/etc/raddb/mods-config/files/\fP.  It contains a series
+of configuration directives which are used by the \fIfiles\fP 
+module to decide how to authorize and authenticate each user request.
 
 Every line starting with a hash sign
 .RB (' # ')
@@ -238,7 +238,7 @@ next.  Any DEFAULT entries should usually come last, except as fall-through
 entries that set reply attributes.
 
 .SH FILES
-/etc/raddb/users
+/etc/raddb/mods-config/files/
 .SH "SEE ALSO"
 .BR radclient (1),
 .BR radiusd (8),
index 6474795..fd5983e 100644 (file)
@@ -1,43 +1,45 @@
 #
 #  The list of files to install.
 #
-LOCAL_FILES := acct_users clients.conf dictionary templates.conf \
-               experimental.conf hints huntgroups \
-               preproxy_users proxy.conf radiusd.conf trigger.conf \
-               users README.rst
+LOCAL_FILES :=         clients.conf dictionary templates.conf experimental.conf \
+                       proxy.conf radiusd.conf trigger.conf README.rst
 
-DEFAULT_SITES := default inner-tunnel
-LOCAL_SITES   := $(addprefix raddb/sites-enabled/,$(DEFAULT_SITES))
+DEFAULT_SITES :=       default inner-tunnel
+LOCAL_SITES :=         $(addprefix raddb/sites-enabled/,$(DEFAULT_SITES))
 
-DEFAULT_MODULES := always attr_filter cache_eap chap \
-               detail detail.log digest dhcp dynamic_clients eap \
-               echo exec expiration expr files linelog logintime \
-               mschap ntlm_auth pap passwd preprocess radutmp realm \
-               replicate soh sradutmp unix utf8
+DEFAULT_MODULES :=     always attr_filter cache_eap chap \
+                       detail detail.log digest dhcp dynamic_clients eap \
+                       echo exec expiration expr files linelog logintime \
+                       mschap ntlm_auth pap passwd preprocess radutmp realm \
+                       replicate soh sradutmp unix utf8
 
-LOCAL_MODULES   := $(addprefix raddb/mods-enabled/,$(DEFAULT_MODULES))
+LOCAL_MODULES :=       $(addprefix raddb/mods-enabled/,$(DEFAULT_MODULES))
 
-LOCAL_CERT_FILES := Makefile README xpextensions \
-                   ca.cnf server.cnf client.cnf bootstrap
+LOCAL_CERT_FILES :=    Makefile README xpextensions \
+                       ca.cnf server.cnf client.cnf bootstrap
+                       
+LOCAL_CERT_PRODUCTS := $(addprefix $(R)$(raddbdir)/certs/,ca.key ca.pem \
+                       client.key client.pem server.key server.pem)
+                       
+LEGACY_LINKS :=                $(addprefix $(R)$(raddbdir)/,users huntgroups hints)
 
-RADDB_DIRS := sites-available sites-enabled mods-available mods-enabled \
-               filter policy.d certs
+RADDB_DIRS :=          certs mods-available mods-enabled policy.d \
+                       sites-available sites-enabled \
+                       $(patsubst raddb/%,%,$(shell find raddb/mods-config -type d -print))
 
 # Installed directories
-INSTALL_RADDB_DIRS := $(R)$(raddbdir)/ $(addprefix $(R)$(raddbdir)/, \
-                       $(RADDB_DIRS) $(shell find raddb/sql -type d -print))
+INSTALL_RADDB_DIRS :=  $(R)$(raddbdir)/ $(addprefix $(R)$(raddbdir)/, $(RADDB_DIRS))
 
 # Grab files from the various subdirectories
-INSTALL_FILES := $(wildcard raddb/sites-available/* raddb/mods-available/*) \
-                $(LOCAL_SITES) $(LOCAL_MODULES) \
-                $(addprefix raddb/,$(LOCAL_FILES)) \
-                $(addprefix raddb/certs/,$(LOCAL_CERT_FILES)) \
-                $(wildcard raddb/policy.d/* raddb/filter/*) \
-                $(shell find raddb/sql -type f -print)
-
+INSTALL_FILES :=       $(wildcard raddb/sites-available/* raddb/mods-available/*) \
+                       $(LOCAL_SITES) $(LOCAL_MODULES) \
+                       $(addprefix raddb/,$(LOCAL_FILES)) \
+                       $(addprefix raddb/certs/,$(LOCAL_CERT_FILES)) \
+                       $(shell find raddb/mods-config -type f -print) \
+                       $(shell find raddb/policy.d -type f -print)
 
 # Re-write local files to installed files, filtering out editor backups
-INSTALL_RADDB := $(patsubst raddb/%,$(R)$(raddbdir)/%,\
+INSTALL_RADDB :=       $(patsubst raddb/%,$(R)$(raddbdir)/%,\
                        $(filter-out %~,$(INSTALL_FILES)))
 
 all: build.raddb
@@ -55,12 +57,12 @@ raddb/sites-enabled raddb/mods-enabled:
 
 # Set up the default modules for running in-source builds
 raddb/mods-enabled/%: raddb/mods-available/% | raddb/mods-enabled
-       @echo LN-S $@
+       @echo "LN-S $@"
        @cd $(dir $@) && ln -sf ../mods-available/$(notdir $@)
 
 # Set up the default sites for running in-source builds
 raddb/sites-enabled/%: raddb/sites-available/% | raddb/sites-enabled
-       @echo LN-S $@
+       @echo "LN-S $@"
        @cd $(dir $@) && ln -sf ../sites-available/$(notdir $@)
 
 # Installation rules for directories.  Note permissions are 750!
@@ -87,20 +89,33 @@ $(R)$(raddbdir)/sites-enabled/%: | $(R)$(raddbdir)/sites-available/%
 $(R)$(raddbdir)/%: | raddb/%
        @echo INSTALL $(patsubst $(R)$(raddbdir)/%,raddb/%,$@)
        @$(INSTALL) -m 640 $(patsubst $(R)$(raddbdir)/%,raddb/%,$@) $@
-
-.PHONY: certs.bootstrap
-certs.bootstrap:
-       @echo BOOTSTRAP certs
+       
+# Create symbolic links for legacy files
+$(R)$(raddbdir)/huntgroups : $(R)$(modconfdir)/preprocess/huntgroups
+       @echo "LN-S $@ -> $<"
+       @ln -s $< $@
+       
+$(R)$(raddbdir)/hints : $(R)$(modconfdir)/preprocess/hints
+       @echo "LN-S $@ -> $<"
+       @ln -s $< $@
+       
+$(R)$(raddbdir)/users : $(R)$(modconfdir)/files/authorize
+       @echo "LN-S $@ -> $<"
+       @ln -s $< $@
+
+
+$(LOCAL_CERT_PRODUCTS):
+       @echo BOOTSTRAP $(R)$(raddbdir)/certs/
        @$(MAKE) -C $(R)$(raddbdir)/certs/
 
 # Bootstrap is special
-$(R)$(raddbdir)/certs/bootstrap: | raddb/certs/bootstrap certs.bootstrap
+$(R)$(raddbdir)/certs/bootstrap: | raddb/certs/bootstrap $(LOCAL_CERT_PRODUCTS)
        @echo INSTALL $(patsubst $(R)$(raddbdir)/%,raddb/%,$@)
        @$(INSTALL) -m 750 $(patsubst $(R)$(raddbdir)/%,raddb/%,$@) $@
 
 #  List directories before the file targets.
 #  It's not clear why GNU Make doesn't deal well with this.
-install.raddb: $(INSTALL_RADDB_DIRS) $(INSTALL_RADDB)
+install.raddb: | $(INSTALL_RADDB_DIRS) $(INSTALL_RADDB) $(LEGACY_LINKS)
 
 clean.raddb:
        @rm -f *~ $(addprefix raddb/sites-enabled/,$(DEFAULT_SITES)) \
index 0a0861b..b064b9e 100644 (file)
 # proxied servers, to make sure we send back to our RADIUS client
 # only allowed attributes.
 attr_filter attr_filter.post-proxy {
-       file = ${confdir}/filter/post-proxy
+       file = ${modconfdir}/${.:name}/post-proxy
 }
 
 # attr_filter - filters the attributes in the packets we send to
 # the RADIUS home servers.
 attr_filter attr_filter.pre-proxy {
-       file = ${confdir}/filter/pre-proxy
+       file = ${modconfdir}/${.:name}/pre-proxy
 }
 
 # Enforce RFC requirements on the contents of Access-Reject
@@ -25,7 +25,7 @@ attr_filter attr_filter.pre-proxy {
 #
 attr_filter attr_filter.access_reject {
        key = %{User-Name}
-       file = ${confdir}/filter/access_reject
+       file =  ${modconfdir}/${.:name}/access_reject
 }
 
 # Enforce RFC requirements on the contents of Access-Challenge
@@ -34,7 +34,7 @@ attr_filter attr_filter.access_reject {
 #
 attr_filter attr_filter.access_challenge {
        key = %{User-Name}
-       file = ${confdir}/filter/access_challenge
+       file = ${modconfdir}/${.:name}/access_challenge
 }
 
 
@@ -44,5 +44,5 @@ attr_filter attr_filter.access_challenge {
 #
 attr_filter attr_filter.accounting_response {
        key = %{User-Name}
-       file = ${confdir}/filter/accounting_response
+       file = ${modconfdir}/${.:name}/accounting_response
 }
index 03026ad..7b42400 100644 (file)
@@ -30,7 +30,7 @@ sql cuisql {
 
        sqlite {
                filename = ${radacctdir}/cui.sqlite
-               bootstrap = ../sql/cui/sqlite/schema.sql
+               bootstrap = ${modconfdir}/${..:name}/cui/sqlite/schema.sql
        }
 
 #      sqltrace = yes
@@ -49,5 +49,5 @@ sql cuisql {
        cui_table = "cui"
        sql_user_name = "%{User-Name}"
        
-       $INCLUDE ../sql/cui/${dialect}/queries.conf
+       $INCLUDE ${modconfdir}/${.:name}/cui/${dialect}/queries.conf
 }
index fc69e45..0fa0acf 100644 (file)
@@ -15,7 +15,7 @@ sqlippool dhcp_sqlippool {
        pool-key = "%{Calling-Station-Id}"
 
        # For now, it only works with MySQL.
-       $INCLUDE ${confdir}/sql/ippool-dhcp/mysql/queries.conf
+       $INCLUDE ${modconfdir}/sql/ippool-dhcp/mysql/queries.conf
  
        sqlippool_log_exists = "DHCP: Existing IP: %{reply:Framed-IP-Address} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
 
index 6275b6a..0b9e13f 100644 (file)
@@ -5,14 +5,24 @@
 # Livingston-style 'users' file
 #
 files {
+       # Search for files in a subdirectory of mods-config which 
+       # matches this instance of the files module.
+       moddir = ${modconfdir}/${.:instance}
+       
        # The default key attribute to use for matches.  The content
        # of this attribute is used to match the "name" of the
        # entry.
        #key = "%{Stripped-User-Name:-%{User-Name}}"
 
-       usersfile = ${confdir}/users
-       acctusersfile = ${confdir}/acct_users
-       preproxy_usersfile = ${confdir}/preproxy_users
+       # Sets a common file for all sections which do not have
+       # specific files configured. It's recommended that 
+       # per section instances of 'files' are used, as per section
+       # files will be deprecated in a future release.
+       file = ${moddir}/authorize
+
+       usersfile = ${moddir}/authorize
+       acctusersfile = ${moddir}/accounting
+       preproxy_usersfile = ${moddir}/pre-proxy
 
        #  If you want to use the old Cistron 'users' file
        #  with FreeRADIUS, you should change the next line
index 793d569..eb528bd 100644 (file)
@@ -19,7 +19,7 @@
 ######################################################################
 
 passwd mac2ip {
-       filename = ${confdir}/mac2ip
+       filename = ${modconfdir}/${.:name}/${.:instance}
        format = "*DHCP-Client-Hardware-Address:=DHCP-Your-IP-Address"
        delimiter = ","
 }
index bdfef23..a1db803 100644 (file)
@@ -12,7 +12,7 @@
 #      ...
 #
 passwd mac2vlan {
-       filename = ${confdir}/mac2vlan
+       filename = ${modconfdir}/${.:name}/${.:instance}
        format = "*VMPS-Mac:=VMPS-VLAN-Name"
        delimiter = ","
 }
index 69ad307..95602cf 100644 (file)
@@ -11,7 +11,7 @@ perl {
        #  'rlm_exec' module, but it is persistent, and therefore
        #  faster.
        #
-       module = ${confdir}/example.pl
+       module = ${modconfdir}/${.:instance}/example.pl
 
        #
        #  The following hashes are given to the module and
index e00aa85..fe663d4 100644 (file)
 #  is a little more standard.
 #
 preprocess {
-       huntgroups = ${confdir}/huntgroups
-       hints = ${confdir}/hints
+       # Search for files in a subdirectory of mods-config which 
+       # matches this instance of the preprocess module.
+       moddir = ${modconfdir}/${.:instance}
+       
+       huntgroups = ${moddir}/huntgroups
+       hints = ${moddir}/hints
 
        # This hack changes Ascend's wierd port numberings
        # to standard 0-??? port numbers so that the "+" works
index ca896ab..030f815 100644 (file)
@@ -146,5 +146,5 @@ sql {
        nas_table = "nas"
 
        # Read database-specific queries
-       $INCLUDE ../sql/main/${dialect}/queries.conf
+       $INCLUDE ${modconfdir}/${.:name}/${dialect}/queries.conf
 }
diff --git a/raddb/mods-available/sqlcounter b/raddb/mods-available/sqlcounter
deleted file mode 100644 (file)
index 0816ea2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#  Configuration for the SQL based IP Pool module (rlm_sqlippool)
-#
-#  Database queries and main configuration are available at:
-#
-#       raddb/sql/counter/<DB>/schema.sql
-#       raddb/sql/counter/<DB>/queries.conf
-#
-#  $Id$
-
-$INCLUDE sql/counter/mysql/queries.conf
index 8120f86..06393a5 100644 (file)
@@ -59,5 +59,5 @@ sqlippool {
        #  Use the same database as configured in the "sql" module, "database"
        #  configuration item.
        #
-       $INCLUDE sql/ippool/${modules.${sql-instance-name}.dialect}/queries.conf
+       $INCLUDE ${modconfdir}/sql/ippool/${modules.${sql-instance-name}.dialect}/queries.conf
 }
index 2aeb8e8..0220f94 100644 (file)
@@ -18,7 +18,7 @@ yubikey {
        #
        #  Yubikey authentication needs two control attributes 
        #  retrieved from persistent storage:
-       #    * Yubikey-Key     - The AES key use to decrypt the OTP data.
+       #    * Yubikey-Key     - The AES key used to decrypt the OTP data.
        #                        The Yubikey-Public-Id and/or User-Name 
        #                        attrubutes may be used to retrieve the key.
        #    * Yubikey-Counter - This is compared with the counter in the OTP
@@ -28,7 +28,7 @@ yubikey {
        #                        decryption.                    
        #
        #  Yubikey-Counter isn't strictly required, but the server will
-       #  generate warnings if it's not present when Yubikey.authenticate
+       #  generate warnings if it's not present when yubikey.authenticate
        #  is called.
        #
        #  These attributes are available after authorization:
index 651ef1f..88ac95c 100644 (file)
@@ -66,6 +66,7 @@ name = radiusd
 
 #  Location of config and logfiles.
 confdir = ${raddbdir}
+modconfdir = ${raddbdir}/mods-config
 certdir = ${confdir}/certs
 cadir   = ${confdir}/certs
 run_dir = ${localstatedir}/run/${name}
index c913797..57ba99d 100644 (file)
@@ -9,8 +9,12 @@ SOURCES                := rlm_perl.c
 SRC_CFLAGS     := @mod_cflags@
 TGT_LDLIBS     := @mod_ldflags@
 
-install: $(R)$(raddbdir)/example.pl
+install: $(R)$(modconfdir)/perl/example.pl
 
-$(R)$(raddbdir)/example.pl: src/modules/rlm_perl/example.pl | $(R)$(raddbdir)/
+$(R)$(modconfdir)/perl: $(R)$(modconfdir)
+       @echo MKDIR $@
+       @mkdir -p $@
+
+$(R)$(modconfdir)/perl/example.pl: src/modules/rlm_perl/example.pl | $(R)$(modconfdir)/perl
        @$(ECHO) INSTALL $(notdir $<)
-       @$(INSTALL) -m 755 $< $(R)$(raddbdir)/
+       @$(INSTALL) -m 755 $< $(R)$(modconfdir)/perl
index cd17c31..229d7fe 100644 (file)
@@ -9,8 +9,12 @@ SOURCES                := $(TARGETNAME).c
 SRC_CFLAGS     := @mod_cflags@
 TGT_LDLIBS     := @mod_ldflags@
 
-install: $(R)$(raddbdir)/example.py
+install: $(R)$(modconfdir)/python/example.py
 
-$(R)$(raddbdir)/example.py: src/modules/rlm_python/example.py | $(R)$(raddbdir)/
+$(R)$(modconfdir)/python: $(R)$(modconfdir)
+       @echo MKDIR $@
+       @mkdir -p $@
+
+$(R)$(modconfdir)/python/example.py: src/modules/rlm_python/example.py | $(R)$(modconfdir)/python
        @$(ECHO) INSTALL $(notdir $<)
-       @$(INSTALL) -m 755 $< $(R)$(raddbdir)/
+       @$(INSTALL) -m 755 $< $(R)$(modconfdir)/python
index 72d0975..33cca94 100644 (file)
@@ -9,8 +9,12 @@ SOURCES                := $(TARGETNAME).c
 SRC_CFLAGS     := @mod_cflags@
 TGT_LDLIBS     := @mod_ldflags@
 
-install: $(R)$(raddbdir)/example.rb
+install: $(R)$(modconfdir)/ruby/example.rb
 
-$(R)$(raddbdir)/example.rb: src/modules/rlm_ruby/example.rb | $(R)$(raddbdir)/
+$(R)$(modconfdir)/ruby: $(R)$(modconfdir)
+       @echo MKDIR $@
+       @mkdir -p $@
+
+$(R)$(modconfdir)/ruby/example.rb: src/modules/rlm_ruby/example.rb | $(R)$(modconfdir)/ruby
        @$(ECHO) INSTALL $(notdir $<)
-       @$(INSTALL) -m 755 $< $(R)$(raddbdir)/
+       @$(INSTALL) -m 755 $< $(R)$(modconfdir)/ruby