#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
*
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) {
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);
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
*/
*/
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.
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.