]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove "parse_new_conditions"
authorAlan T. DeKok <aland@freeradius.org>
Mon, 15 May 2023 19:45:31 +0000 (15:45 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 15 May 2023 19:45:31 +0000 (15:45 -0400)
That was only useful while developing the new conditions.  We can
now just switch to them via "use_new_conditions"

src/lib/server/cf_file.c
src/lib/server/main_config.c
src/lib/server/main_config.h
src/lib/unlang/compile.c
src/tests/keywords/all.mk
src/tests/modules/all.mk
src/tests/process/all.mk

index 1bfeb5814a637b0dc9b6b7a87cec5f1da45edcb1..9cc7976f445c46a0f6ff59bb4dc4868380643b0d 100644 (file)
@@ -1518,7 +1518,6 @@ static CONF_ITEM *process_if(cf_stack_t *stack)
        char            *buff[4];
        tmpl_rules_t    t_rules;
        bool            use_new_conditions = main_config_migrate_option_get("use_new_conditions");
-       bool            parse_new_conditions = main_config_migrate_option_get("parse_new_conditions");
 
        /*
         *      Short names are nicer.
@@ -1678,9 +1677,7 @@ static CONF_ITEM *process_if(cf_stack_t *stack)
                                talloc_free(cs);
                                return NULL;
                        }
-               }
-
-               if (parse_new_conditions) {
+               } else {
                        name2 = buff[3];
                }
        }
index 21c50b91bcf945b0ffeeb85c4701f64b3a340aa9..f46db3ac6c453cae0c11a76bdde8e8d9f855cd01 100644 (file)
@@ -184,7 +184,6 @@ static const CONF_PARSER migrate_config[] = {
        { FR_CONF_OFFSET("unflatten_after_decode", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, unflatten_after_decode) },
        { FR_CONF_OFFSET("unflatten_before_encode", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, unflatten_before_encode) },
        { FR_CONF_OFFSET("tmpl_tokenize_all_nested", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, tmpl_tokenize_all_nested) },
-       { FR_CONF_OFFSET("parse_new_conditions", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, parse_new_conditions) },
        { FR_CONF_OFFSET("use_new_conditions", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, use_new_conditions) },
        { FR_CONF_OFFSET("rewrite_update", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, rewrite_update) },
        { FR_CONF_OFFSET("forbid_update", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, forbid_update) },
@@ -1461,7 +1460,6 @@ void main_config_hup(main_config_t *config)
 }
 
 static fr_table_num_ordered_t config_arg_table[] = {
-       { L("parse_new_conditions"),     offsetof(main_config_t, parse_new_conditions) },
        { L("use_new_conditions"),       offsetof(main_config_t, use_new_conditions) },
        { L("tmpl_tokenize_all_nested"), offsetof(main_config_t, tmpl_tokenize_all_nested) },
        { L("rewrite_update"),           offsetof(main_config_t, rewrite_update) },
index 48aa39fb5e08f3faeb75ce1dbe84d1eecfd8063f..916b125a80d89c8565195970060c2d0a00ad60cb 100644 (file)
@@ -161,7 +161,6 @@ struct main_config_s {
        bool            unflatten_after_decode;         //!< the worker will call "unflatten" after protocol decoding
        bool            unflatten_before_encode;        //!< the worker will call "unflatten" before all encoding
        bool            tmpl_tokenize_all_nested;       //!< tmpl_tokenize will create nested tmpls instead of flat ones
-       bool            parse_new_conditions;           //!< the new xlat expressions will be parsed, but not used.
        bool            use_new_conditions;             //!< the new xlat expressions will be used for conditions, instead of the old code
        bool            rewrite_update;                 //!< rewrite "update" to be new edit sections
        bool            forbid_update;                  //!< forbid "update" sections
index b1b366749bb34857adbafb86639247fb5ecc69fb..fb5a4da8411506671a8955fce344082098d6fdb7 100644 (file)
@@ -3654,7 +3654,7 @@ static unlang_t *compile_if_subsection(unlang_t *parent, unlang_compile_t *unlan
        /*
         *      Migration support.
         */
-       if (main_config->parse_new_conditions) {
+       if (main_config->use_new_conditions) {
                char const *name2 = cf_section_name2(cs);
                ssize_t slen;
 
@@ -3700,11 +3700,9 @@ static unlang_t *compile_if_subsection(unlang_t *parent, unlang_compile_t *unlan
                 *      If the condition is always false, we don't compile the
                 *      children.
                 */
-               if (main_config->use_new_conditions) {
-                       if (is_truthy && !value) goto skip;
+               if (is_truthy && !value) goto skip;
 
-                       goto do_compile;
-               }
+               goto do_compile;
        }
 
        cond = cf_data_value(cf_data_find(cs, fr_cond_t, NULL));
index 59924f72433b63c2711b84bdd8d796f59563b977..b82a4df6fdb21cfe8c6fa232b88cadb2a93c16b6 100644 (file)
@@ -72,13 +72,13 @@ KEYWORD_UPDATE_REWRITE_TESTS := update-all update-array update-delete update-rem
 #  conditions, so we don't run them under the new conditions.
 #
 ifneq "$(findstring ${1}, paircmp if-paircmp)" ""
-$(OUTPUT)/${1}: NEW_COND=-S parse_new_conditions=no -S use_new_conditions=no
+$(OUTPUT)/${1}: NEW_COND=-S use_new_conditions=no
 else ifneq "$(findstring ${1}, comments update-to-edit if-regex-multivalue smash wimax unknown $(KEYWORD_UPDATE_TESTS) vendor_specific vendor_specific.raw xlat-unknown update-proto update-proto-error)" ""
-$(OUTPUT)/${1}: NEW_COND=-S parse_new_conditions=yes -S use_new_conditions=yes
+$(OUTPUT)/${1}: NEW_COND=-S use_new_conditions=yes
 else ifneq "$(findstring ${1}, $(KEYWORD_UPDATE_REWRITE_TESTS))" ""
-$(OUTPUT)/${1}: NEW_COND=-S parse_new_conditions=yes -S use_new_conditions=yes -S rewrite_update=yes
+$(OUTPUT)/${1}: NEW_COND=-S use_new_conditions=yes -S rewrite_update=yes
 else
-$(OUTPUT)/${1}: NEW_COND=-S parse_new_conditions=yes -S use_new_conditions=yes -S forbid_update=yes
+$(OUTPUT)/${1}: NEW_COND=-S use_new_conditions=yes -S forbid_update=yes
 endif
 
 endef
index eb719bd96de3651230a01f7218ae57a1b14c6e0c..b0c32583be46db81182cf1bf2259d6450a77de0e 100644 (file)
@@ -79,8 +79,8 @@ $(foreach x, $(filter sql_%,$(FILES)), $(eval $$(OUTPUT.$(TEST))/$x: $(patsubst
 #  Migration support.  Some of the tests don't run under the new
 #  conditions, so we don't run them under the new conditions.
 #
-$(foreach x, $(filter ldap% sql_%,$(FILES)), $(eval $$(OUTPUT.$(TEST))/$x: NEW_COND=-S parse_new_conditions=no -S use_new_conditions=no))
-$(foreach x, $(filter-out ldap% sql_%,$(FILES)), $(eval $$(OUTPUT.$(TEST))/$x: NEW_COND=-S parse_new_conditions=yes -S use_new_conditions=yes))
+$(foreach x, $(filter ldap% sql_%,$(FILES)), $(eval $$(OUTPUT.$(TEST))/$x: NEW_COND=-S use_new_conditions=no))
+$(foreach x, $(filter-out ldap% sql_%,$(FILES)), $(eval $$(OUTPUT.$(TEST))/$x: NEW_COND=-S use_new_conditions=yes))
 
 #
 #  Files in the output dir depend on the unit tests
index a76630ec97043ed67718bf160e4bc16da8674cb9..0fc6fb96f55541233956ee60fedcf1022bcc1e85 100644 (file)
@@ -28,7 +28,7 @@ FILES := $(filter-out %.ignore %.conf %.md %.attrs %.mk %~ %.rej,$(subst $(DIR)/
 
 $(eval $(call TEST_BOOTSTRAP))
 
-# -S parse_new_conditions=yes -S use_new_conditions=yes -S forbid_update=yes
+# -S use_new_conditions=yes -S forbid_update=yes
 
 #
 #  The dictionaries are in "share", because the server tries to load
@@ -85,7 +85,7 @@ $(foreach x,$(FILES),$(eval $(call PROCESS_TEST,$x)))
 #
 PROCESS_ARGS := -p test
 PROCESS_ARGS += -D $(DIR)/share -d $(DIR)/
-PROCESS_ARGS += -S parse_new_conditions=yes -S use_new_conditions=yes -S forbid_update=yes
+PROCESS_ARGS += -S use_new_conditions=yes -S forbid_update=yes
 PROCESS_ARGS += -i $(DIR)/test.attrs -f $(DIR)/test.attrs
 
 $(OUTPUT)/%: $(DIR)/% $(TEST_BIN_DIR)/unit_test_module $(DIR)/unit_test_module.conf