conffile trouble
Patrick Welche
prlw1 at newn.cam.ac.uk
Mon Nov 12 20:36:21 CET 2007
Without the following conf.patch, I can't start radiusd because:
including configuration file /usr/local/etc/raddb/radiusd.conf
including configuration file /usr/local/etc/raddbclients.conf
^^
note the missing separator. That ++p fixes it.
conffiles.c also uses stat independently of dirent, so moving that #endif
to enable is useful.
I also include essentially a documentation patch for comments - I hope
the files are the ones I think are meant to be referenced.
Cheers,
Patrick
-------------- next part --------------
Index: src/main/conffile.c
===================================================================
RCS file: /source/radiusd/src/main/conffile.c,v
retrieving revision 1.184
diff -u -r1.184 conffile.c
--- src/main/conffile.c 22 Oct 2007 13:05:04 -0000 1.184
+++ src/main/conffile.c 12 Nov 2007 17:16:00 -0000
@@ -34,11 +34,11 @@
#ifdef HAVE_DIRENT_H
#include <dirent.h>
+#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#endif
#include <ctype.h>
@@ -1090,6 +1090,7 @@
p = strrchr(parentcs->item.filename, '/');
if (!p) return local;
+ ++p;
dirsize = (p - parentcs->item.filename);
if ((dirsize + strlen(local)) >= bufsize) {
-------------- next part --------------
Index: raddb/sql/postgresql/schema.sql
===================================================================
RCS file: /source/radiusd/raddb/sql/postgresql/schema.sql,v
retrieving revision 1.5
diff -u -r1.5 schema.sql
--- raddb/sql/postgresql/schema.sql 14 Sep 2007 18:32:56 -0000 1.5
+++ raddb/sql/postgresql/schema.sql 12 Nov 2007 17:15:59 -0000
@@ -181,7 +181,7 @@
/*
* Note: (pnixon: 2003-12-10) The following function should not be required
- * if you use the PG specific queries in raddb/postgresql.conf
+ * if you use the PG specific queries in raddb/sql/postgresql/dialup.conf
*
* Common utility function for date calculations. This is used in our
* alternative account stop query to calculate the start of a session.
@@ -194,13 +194,15 @@
*
* createlang plpgsql <databasename>
*/
-CREATE FUNCTION DATE_SUB(date,int4,text) RETURNS DATE AS '
-DECLARE
- var1 date;
- var2 text;
-BEGIN
- var2 = $2 || '' '' || $3;
- SELECT INTO var1
- to_date($1 - var2::interval, ''YYYY-MM-DD'');
-RETURN var1;
-END;' LANGUAGE 'plpgsql';
+/*
+ * CREATE FUNCTION DATE_SUB(date,int4,text) RETURNS DATE AS '
+ * DECLARE
+ * var1 date;
+ * var2 text;
+ * BEGIN
+ * var2 = $2 || '' '' || $3;
+ * SELECT INTO var1
+ * to_date($1 - var2::interval, ''YYYY-MM-DD'');
+ * RETURN var1;
+ * END;' LANGUAGE 'plpgsql';
+ */
Index: raddb/sql/postgresql/voip-postpaid.conf
===================================================================
RCS file: /source/radiusd/raddb/sql/postgresql/voip-postpaid.conf,v
retrieving revision 1.1
diff -u -r1.1 voip-postpaid.conf
--- raddb/sql/postgresql/voip-postpaid.conf 20 Jul 2007 12:56:33 -0000 1.1
+++ raddb/sql/postgresql/voip-postpaid.conf 12 Nov 2007 17:15:59 -0000
@@ -4,7 +4,7 @@
#
# The database schema is available at:
#
-# src/radiusd/src/billing/h323_db_postgresql.sql
+# src/billing/cisco_h323_db_schema-postgres.sql
#
sql pgsql-voip {
Index: src/billing/cisco_h323_db_schema-postgres.sql
===================================================================
RCS file: /source/radiusd/src/billing/cisco_h323_db_schema-postgres.sql,v
retrieving revision 1.20
diff -u -r1.20 cisco_h323_db_schema-postgres.sql
--- src/billing/cisco_h323_db_schema-postgres.sql 14 May 2007 22:26:58 -0000 1.20
+++ src/billing/cisco_h323_db_schema-postgres.sql 12 Nov 2007 17:15:59 -0000
@@ -2,19 +2,17 @@
* Id: postgresql.conf,v 1.8.2.11 2003/07/15 11:15:43 pnixon Exp $
*
* --- Peter Nixon [ codemonkey at peternixon.net ]
- * This is a custom SQL schema for doing H323 and SIP VoIP accounting with FreeRadius
- * and Cisco equipment. It is currently known to work with 3640, 5300 and 5350 series
- * as well as CSPS (Cisco SIP Proxy Server).
- * It will scale ALOT better than the default radius schema which is designed for
- * simple dialup installations of FreeRadius.
- *
- * For this schema to work properly you MUST replace raddb/postgresql.conf
- * with the contents of pgsql-voip.conf
- *
- * If you wish to do RADIUS Authentication using the same database, you must use
- * src/modules/rlm_sql/drivers/rlm_sql_postgresql/db_postgresql.sql as well as
- * this schema.
+ * This is a custom SQL schema for doing H323 and SIP VoIP accounting with
+ * FreeRadius and Cisco equipment. It is currently known to work with
+ * 3640, 5300 and 5350 series as well as CSPS (Cisco SIP Proxy Server).
+ * It will scale ALOT better than the default radius schema which is designed
+ * for simple dialup installations of FreeRadius.
*
+ * For this schema to work properly you MUST replace
+ * raddb/sql/postgresql/dialup.conf with the contents of pgsql-voip.conf
+ *
+ * If you wish to do RADIUS Authentication using the same database, you must
+ * use raddb/sql/postgresql/schema.sql as well as this schema.
*/
/*
More information about the Freeradius-Devel
mailing list