From: Alan T. DeKok Date: Mon, 19 Jun 2017 19:50:09 +0000 (-0400) Subject: move error message to caller, as it sometimes may be suppressed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd0eb87ef500d222bb9150ad4b8e79993f7accb9;p=thirdparty%2Ffreeradius-server.git move error message to caller, as it sometimes may be suppressed --- diff --git a/src/main/cf_parse.c b/src/main/cf_parse.c index 932cc729412..c3fb3364948 100644 --- a/src/main/cf_parse.c +++ b/src/main/cf_parse.c @@ -1327,9 +1327,11 @@ int _cf_section_rule_push(CONF_SECTION *cs, CONF_PARSER const *rule, char const * Fixme maybe?.. Can't have a section and pair with the same name. */ if (!_cf_data_add_static(CF_TO_ITEM(cs), rule, "CONF_PARSER", rule->name, filename, lineno)) { + CONF_DATA const *cd; CONF_PARSER const *old; - old = cf_data_value(cf_data_find(CF_TO_ITEM(cs), CONF_PARSER, rule->name)); + cd = cf_data_find(CF_TO_ITEM(cs), CONF_PARSER, rule->name); + old = cf_data_value(cd); rad_assert(old != NULL); /* @@ -1339,6 +1341,9 @@ int _cf_section_rule_push(CONF_SECTION *cs, CONF_PARSER const *rule, char const return 0; } + cf_log_err(cs, "Data of type %s with name \"%s\" already exists. Existing data added %s[%i]", "CONF_PARSER", + rule->name, cd->item.filename, cd->item.lineno); + cf_debug(cs); return -1; } diff --git a/src/main/cf_util.c b/src/main/cf_util.c index 2820e5b8c5a..6658b347526 100644 --- a/src/main/cf_util.c +++ b/src/main/cf_util.c @@ -1364,8 +1364,6 @@ CONF_DATA const *_cf_data_add(CONF_ITEM *ci, void const *data, char const *name, */ found = _cf_data_find(ci, type, name); if (found) { - cf_log_err(ci, "Data of type %s with name \"%s\" already exists. Existing data added %s[%i]", type, - name, found->item.filename, found->item.lineno); return NULL; }