From: Arran Cudbard-Bell Date: Wed, 22 Aug 2012 16:12:39 +0000 (+0100) Subject: Missing out ssection configs is ok, but we need a sanity check if were still being... X-Git-Tag: release_3_0_0_beta0~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4dd6a6e990ae48365f28e81c27ff6b828f720d5;p=thirdparty%2Ffreeradius-server.git Missing out ssection configs is ok, but we need a sanity check if were still being called for that section --- diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index 840ffcc9195..35c773f859e 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -843,7 +843,12 @@ static int parse_sub_section(CONF_SECTION *parent, const char *name = section_type_value[comp].section; cs = cf_section_sub_find(parent, name); - if (!cs) return 1; /* no section == OK */ + if (!cs) { + radlog(L_INFO, "Couldn't find configuration for %s. \ + Will return NOOP for calls from this section.", name); + + return 1; + } if (cf_section_parse(cs, config, section_config) < 0) { radlog(L_ERR, "Failed parsing configuration for section %s", @@ -1222,6 +1227,12 @@ static int rlm_sql_redundant(SQL_INST *inst, REQUEST *request, char *p = path; + if (!section) { + DEBUG("No configuration provided for this section"); + + return RLM_MODULE_NOOP; + } + sql_set_user(inst, request, sqlusername, NULL); if (section->reference[0] != '.')