Updated the install, config file, and config reader to look for
authoraland <aland>
Thu, 23 Jan 2003 17:00:11 +0000 (17:00 +0000)
committeraland <aland>
Thu, 23 Jan 2003 17:00:11 +0000 (17:00 +0000)
dictionary files in $(datadir)/freeradius

It's not versioned, because we don't expect there to be conflicts
between versions.

RPMs, DEBs, etc. definitions haven't been updated, and should be.

Makefile
raddb/radiusd.conf.in
src/main/mainconfig.c

index 3ae8da0..22fe4c1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,8 @@ install:
        $(INSTALL) -d -m 755    $(R)$(RUNDIR)
        $(INSTALL) -d -m 700    $(R)$(logdir)
        $(INSTALL) -d -m 700    $(R)$(radacctdir)
+       $(INSTALL) -d -m 700    $(R)$(datadir)
+       $(INSTALL) -d -m 700    $(R)$(datadir)/freeradius
        @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
        for i in 1 5 8; do \
                $(INSTALL) -d -m 755    $(R)$(mandir)/man$$i; \
@@ -42,11 +44,13 @@ install:
                [ $$i != radiusd.conf.in -a ! -f $(R)$(raddbdir)/$$i ] && \
                 $(INSTALL) -m 644 $$i $(R)$(raddbdir); \
        done; \
-       chmod 600 $(R)$(raddbdir)/naspasswd $(R)$(raddbdir)/clients $(R)$(raddbdir)/clients.conf; \
+       chmod 600 $(R)$(raddbdir)/naspasswd $(R)$(raddbdir)/clients $(R)$(raddbdir)/clients.conf;
+       @echo "Creating/updating files in $(R)$(datadir)/freeradius"; \
+       cd share; \
        for i in dictionary*; do \
-               [ ! -f $(R)$(raddbdir)/$$i ] && $(INSTALL) -m 644 $$i $(R)$(raddbdir); \
-               if [ "`find $$i -newer $(R)$(raddbdir)/$$i`" ]; then \
-                       echo "** $(R)$(raddbdir)/$$i"; \
+               [ ! -f $(R)$(datadir)/freeradius/$$i ] && $(INSTALL) -m 644 $$i $(R)$(datadir)/freeradius; \
+               if [ "`find $$i -newer $(R)$(datadir)/freeradius/$$i`" ]; then \
+                       echo "** $(R)$(datadir)/freeradius/$$i"; \
                        nt=1; \
                fi; \
        done; \
@@ -56,7 +60,7 @@ install:
                echo "** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **";\
                echo "**";\
                echo "** The sample configuration files in `pwd`";\
-               echo "** are newer than those in $(R)$(raddbdir)";\
+               echo "** are newer than those in $(R)$(datadir)/freeradius";\
                echo "**";\
                echo "** Please investigate and manually copy (if appropriate) the files listed above.";\
                echo "**";\
index 3eaf0a0..b9b2b69 100644 (file)
@@ -28,6 +28,7 @@ sbindir = @sbindir@
 logdir = @logdir@
 raddbdir = @raddbdir@
 radacctdir = @radacctdir@
+datadir = @datadir@
 
 #  Location of config and logfiles.
 confdir = ${raddbdir}
index f09c473..d988e8a 100644 (file)
@@ -57,6 +57,7 @@ static gid_t server_gid;
  */
 static const char *localstatedir = NULL;
 static const char *prefix = NULL;
+static const char *data_dir = NULL;
 
 /*
  *  Map the proxy server configuration parameters to variables.
@@ -97,6 +98,7 @@ static CONF_PARSER server_config[] = {
        { "logdir",             PW_TYPE_STRING_PTR, 0, &radlog_dir,        "${localstatedir}/log"},
        { "libdir",             PW_TYPE_STRING_PTR, 0, &radlib_dir,        "${prefix}/lib"},
        { "radacctdir",         PW_TYPE_STRING_PTR, 0, &radacct_dir,       "${logdir}/radacct" },
+       { "datadir",             PW_TYPE_STRING_PTR, 0, &data_dir,          "${prefix}/share/freeradius"},
        { "hostname_lookups",   PW_TYPE_BOOLEAN,    0, &librad_dodns,      "no" },
 #if WITH_SNMP
        { "snmp",               PW_TYPE_BOOLEAN,    0, &mainconfig.do_snmp,      "no" },
@@ -695,7 +697,7 @@ CONF_SECTION *read_radius_conf_file(void)
 
        /* Initialize the dictionary */
        DEBUG2("read_config_files:  reading dictionary");
-       if (dict_init(radius_dir, RADIUS_DICTIONARY) != 0) {
+       if (dict_init(data_dir, RADIUS_DICTIONARY) != 0) {
                radlog(L_ERR|L_CONS, "Errors reading dictionary: %s",
                                librad_errstr);
                cf_section_free(&cs);