]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Set main_config.dict_dir in radiusd.c
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 23 May 2018 04:31:25 +0000 (10:31 +0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 23 May 2018 04:31:25 +0000 (10:31 +0600)
src/main/mainconfig.c
src/main/radiusd.c

index 2f263d83fb17e2ccf666e5bc865f5c5643d1e006..40de32eb4688704c5904fdef09d259dac072661b 100644 (file)
@@ -735,14 +735,6 @@ int main_config_init(void)
 #endif
        INFO("Starting - reading configuration files ...");
 
-       /*
-        *      We need to load the dictionaries before reading the
-        *      configuration files.  This is because of the
-        *      pre-compilation in conf_file.c.  That should probably
-        *      be fixed to be done as a second stage.
-        */
-       if (!main_config.dict_dir) main_config.dict_dir = talloc_typed_strdup(NULL, DICTDIR);
-
        /*
         *      About sizeof(REQUEST) + sizeof(RADIUS_PACKET) * 2 + sizeof(VALUE_PAIR) * 400
         *
@@ -751,8 +743,10 @@ int main_config_init(void)
        main_config.talloc_pool_size = 8 * 1024; /* default */
 
        /*
-        *      Read the distribution dictionaries first, then
-        *      the ones in raddb.
+        *      We need to load the dictionaries before reading the
+        *      configuration files.  This is because of the
+        *      pre-compilation in conf_file.c.  That should probably
+        *      be fixed to be done as a second stage.
         */
        DEBUG2("Including dictionary file \"%s/%s\"", main_config.dict_dir, FR_DICTIONARY_FILE);
        if (fr_dict_from_file(&main_config.dict, FR_DICTIONARY_FILE) != 0) {
@@ -919,8 +913,7 @@ do {\
                        return -1;
                }
 
-               default_log.dst = fr_str2int(log_str2dst, log_dest,
-                                             L_DST_NUM_DEST);
+               default_log.dst = fr_str2int(log_str2dst, log_dest, L_DST_NUM_DEST);
                if (default_log.dst == L_DST_NUM_DEST) {
                        fprintf(stderr, "%s: Error: Unknown log_destination %s\n",
                                main_config.name, log_dest);
index b8d51e0eda62331c3453318265b9ed1a59f29fd8..9c0cddbe0b36934affb58f7e2ab58a08f951b0c5 100644 (file)
@@ -210,6 +210,11 @@ int main(int argc, char *argv[])
        default_log.fd = -1;
        main_config.log_file = NULL;
 
+       /*
+        *      Set the default dictionary directory
+        */
+       main_config.dict_dir = DICTDIR;
+
        /*
         *  Set the panic action and enable other debugging facilities
         */
@@ -394,11 +399,6 @@ int main(int argc, char *argv[])
         */
        dl_init();
 
-       /*
-        *  Read the configuration files, BEFORE doing anything else.
-        */
-       if (main_config_init() < 0) exit(EXIT_FAILURE);
-
        /*
         *      Initialise the top level dictionary hashes which hold
         *      the protocols.
@@ -408,6 +408,11 @@ int main(int argc, char *argv[])
                fr_exit(EXIT_FAILURE);
        }
 
+       /*
+        *  Read the configuration files, BEFORE doing anything else.
+        */
+       if (main_config_init() < 0) exit(EXIT_FAILURE);
+
        /*
         *  Initialising OpenSSL once, here, is safer than having individual modules do it.
         *  Must be called before display_version to ensure relevant engines are loaded.