Move sql 'loaded and linked' message to bootstrap
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 5 May 2015 02:12:02 +0000 (22:12 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 5 May 2015 02:12:32 +0000 (22:12 -0400)
src/modules/rlm_sql/rlm_sql.c

index dde08c0..f0f1fde 100644 (file)
@@ -818,9 +818,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)
        inst->cs = conf;
 
        inst->name = cf_section_name2(conf);
-       if (!inst->name) {
-               inst->name = cf_section_name1(conf);
-       }
+       if (!inst->name) inst->name = cf_section_name1(conf);
 
        /*
         *      Load the appropriate driver for our database.
@@ -840,6 +838,9 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)
                return -1;
        }
 
+       INFO("rlm_sql (%s): Driver %s (module %s) loaded and linked", inst->name,
+            inst->config->sql_driver_name, inst->module->name);
+
        if (inst->config->groupmemb_query) {
                if (!cf_section_name2(conf)) {
                        char buffer[256];
@@ -987,9 +988,6 @@ do { \
                return -1;
        }
 
-       INFO("rlm_sql (%s): Driver %s (module %s) loaded and linked", inst->name,
-            inst->config->sql_driver_name, inst->module->name);
-
        /*
         *      Initialise the connection pool for this instance
         */
@@ -1681,7 +1679,7 @@ static rlm_rcode_t mod_post_auth(void *instance, REQUEST *request)
 extern module_t rlm_sql;
 module_t rlm_sql = {
        .magic          = RLM_MODULE_INIT,
-       .name           = "SQL",
+       .name           = "sql",
        .type           = RLM_TYPE_THREAD_SAFE,
        .inst_size      = sizeof(rlm_sql_t),
        .config         = module_config,