]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Only check if config items are deprecated if they exist
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 19 Jul 2015 17:14:49 +0000 (13:14 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 19 Jul 2015 17:15:04 +0000 (13:15 -0400)
src/main/conffile.c

index 23e120fc6affc8c174b1426d6c434c8a103d2d83..5d8dccefd9537aa1a7f71cf1f43a7a8b6417cc24 100644 (file)
@@ -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