From: Arran Cudbard-Bell Date: Sun, 19 Jul 2015 17:14:49 +0000 (-0400) Subject: Only check if config items are deprecated if they exist X-Git-Tag: release_3_0_10~320 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7603a8ca2c20126e07f44cc6d1a960dc1fe996cb;p=thirdparty%2Ffreeradius-server.git Only check if config items are deprecated if they exist --- diff --git a/src/main/conffile.c b/src/main/conffile.c index 23e120fc6af..5d8dccefd95 100644 --- a/src/main/conffile.c +++ b/src/main/conffile.c @@ -1428,6 +1428,8 @@ int cf_item_parse(CONF_SECTION *cs, char const *name, unsigned int type, void *d * section, use the default value. */ if (!cp) { + if (deprecated) return 0; /* Don't set the default value */ + rcode = 1; value = dflt; /* @@ -1446,6 +1448,12 @@ int cf_item_parse(CONF_SECTION *cs, char const *name, unsigned int type, void *d if (multi) while ((next = cf_pair_find_next(cs, next, name))) { next->parsed = true; } + + if (deprecated) { + cf_log_err(c_item, "Configuration item \"%s\" is deprecated", name); + + return -2; + } } if (!value) { @@ -1468,11 +1476,6 @@ int cf_item_parse(CONF_SECTION *cs, char const *name, unsigned int type, void *d return -1; } - if (deprecated) { - cf_log_err(c_item, "Configuration item \"%s\" is deprecated", name); - - return -2; - } /* * Process a value as a LITERAL template. Once all of