]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move disallow_qualifiers boolean to list_presence enum
authorAlan T. DeKok <aland@freeradius.org>
Tue, 28 Mar 2023 07:36:46 +0000 (16:36 +0900)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 28 Mar 2023 07:36:46 +0000 (16:36 +0900)
src/bin/unit_test_attribute.c
src/lib/server/map.c
src/lib/server/tmpl.h
src/lib/server/tmpl_tokenize.c
src/lib/server/users_file.c
src/listen/ldap_sync/proto_ldap_sync.c

index ae137fcd04a84a18f1f01fd112cebb942f3ccbd4..1f5dbc865813ff3b0f69a1a7ad849703b02b1923 100644 (file)
@@ -2595,16 +2595,6 @@ static ssize_t command_tmpl_rule_attr_parent(UNUSED TALLOC_CTX *ctx, tmpl_rules_
        return slen;
 }
 
-static ssize_t command_tmpl_rule_disallow_qualifiers(UNUSED TALLOC_CTX *ctx, tmpl_rules_t *rules, fr_sbuff_t *value)
-{
-       bool res;
-       ssize_t slen;
-
-       slen = fr_sbuff_out_bool(&res, value);
-       rules->attr.disallow_qualifiers = res;
-       return slen;
-}
-
 static ssize_t command_tmpl_rule_list_def(UNUSED TALLOC_CTX *ctx, tmpl_rules_t *rules, fr_sbuff_t *value)
 {
        ssize_t slen;
@@ -2647,7 +2637,6 @@ static size_t command_tmpl_rules(command_result_t *result, command_file_ctx_t *c
                { L("allow_unknown"),           (void *)command_tmpl_rule_allow_unknown         },
                { L("allow_unresolved"),        (void *)command_tmpl_rule_allow_unresolved      },
                { L("attr_parent"),             (void *)command_tmpl_rule_attr_parent           },
-               { L("disallow_qualifiers"),     (void *)command_tmpl_rule_disallow_qualifiers   },
                { L("list_def"),                (void *)command_tmpl_rule_list_def              },
                { L("request_def"),             (void *)command_tmpl_rule_request_def           }
        };
@@ -3152,7 +3141,7 @@ static fr_table_ptr_sorted_t      commands[] = {
 
        { L("tmpl-rules "),     &(command_entry_t){
                                        .func = command_tmpl_rules,
-                                       .usage = "tmpl-rule [allow_foreign=yes] [allow_unknown=yes|no] [allow_unresolved=yes|no] [attr_parent=<oid>] [disallow_qualifiers=yes|no] [list_def=request|reply|control|session-state] [request_def=current|outer|parent]",
+                                       .usage = "tmpl-rule [allow_foreign=yes] [allow_unknown=yes|no] [allow_unresolved=yes|no] [attr_parent=<oid>] [list_def=request|reply|control|session-state] [request_def=current|outer|parent]",
                                        .description = "Alter the tmpl parsing rules for subsequent tmpl parsing commands in the same command context"
                                }},
        { L("touch "),          &(command_entry_t){
index 5eea7c9d07cfa53af2c12e50362793549c3dcb57..610d82db5ff9c71cb9d33937a6bdda3d5c30f611 100644 (file)
@@ -846,14 +846,6 @@ do_children:
                                goto error; /* re-do "goto marker" stuff to print out spaces ? */
                        }
 
-                       /*
-                        *      Disallow list qualifiers for the child
-                        *      templates.  The syntax requires that
-                        *      the child attributes go into the
-                        *      parent one.
-                        */
-                       child_lhs_rules.attr.disallow_qualifiers = true;
-
                        /*
                         *      The leaf reference of the outer section
                         *      is used as the parsing context of the
index c9683aa95b216fc32b0f11c4c4b86a243b1594fb..5874ab9f917a677ec1cc1d9dfce5fafb3aaa102c 100644 (file)
@@ -321,8 +321,6 @@ struct tmpl_attr_rules_s {
 
        uint8_t                 allow_foreign:1;        //!< Allow arguments not found in dict_def.
 
-       uint8_t                 disallow_qualifiers:1;  //!< disallow request / list qualifiers
-
        uint8_t                 disallow_filters:1;     //!< disallow filters.
 };
 
index 3dd45e4afd302cc917ec8752845671a838cbe062..a56260ec80a2c247186f4b01d050af0840f1e1e1 100644 (file)
@@ -595,7 +595,7 @@ static fr_slen_t tmpl_request_ref_list_from_substr(TALLOC_CTX *ctx, tmpl_attr_er
                }
 
                if (depth == 0) {
-                       if (at_rules->namespace || at_rules->disallow_qualifiers) {
+                       if (at_rules->namespace || (at_rules->list_presence == TMPL_ATTR_LIST_FORBID)) {
                                fr_strerror_const("It is not permitted to specify a request reference here");
                                if (err) *err = TMPL_ATTR_ERROR_INVALID_LIST_QUALIFIER;
 
index 321f19b316a561e213fc125a4edc552364b79f91..98aafb387cf843644704fef5b8f2457dc984b6fb 100644 (file)
@@ -273,7 +273,7 @@ int pairlist_read(TALLOC_CTX *ctx, fr_dict_t const *dict, char const *file, PAIR
                        .dict_def = dict,
                        .prefix = TMPL_ATTR_REF_PREFIX_NO,
                        .list_def = request_attr_request,
-                       .disallow_qualifiers = true, /* for now, until more tests are made */
+                       .list_presence = TMPL_ATTR_LIST_FORBID,
 
                        /*
                         *      Otherwise the tmpl code returns 0 when asked
@@ -290,7 +290,7 @@ int pairlist_read(TALLOC_CTX *ctx, fr_dict_t const *dict, char const *file, PAIR
                        .dict_def = dict,
                        .prefix = TMPL_ATTR_REF_PREFIX_YES,
                        .list_def = request_attr_request,
-                       .disallow_qualifiers = true, /* for now, until rlm_files supports it */
+                       .list_presence = TMPL_ATTR_LIST_FORBID,
                }
        };
 
index 76a9310db33f8648462eeadfbdd2c90bb3df6223..4ef2f195f4ae63065a04ade882e4b27a381f86a5 100644 (file)
@@ -290,7 +290,7 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
                        .allow_foreign = false,
                        .allow_unknown = false,
                        .allow_unresolved = false,
-                       .disallow_qualifiers = true,
+                       .list_presence = TMPL_ATTR_LIST_FORBID,
                }
        };