]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow left / right shift
authorAlan T. DeKok <aland@freeradius.org>
Tue, 20 Feb 2024 14:51:45 +0000 (09:51 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 20 Feb 2024 15:15:27 +0000 (10:15 -0500)
src/lib/server/cf_file.c
src/lib/server/cf_util.c
src/lib/unlang/compile.c
src/lib/util/token.c

index 07f4a4233ce81c7ae0d86a8a18a4c4ddefa244f2..254acbec35fb8026e65acf8bd6f3a7f75cb17bd1 100644 (file)
@@ -2418,8 +2418,10 @@ check_for_eol:
        case T_OP_AND_EQ:
        case T_OP_OR_EQ:
        case T_OP_NE:
+       case T_RSHIFT:
        case T_OP_GE:
        case T_OP_GT:
+       case T_LSHIFT:
        case T_OP_LE:
        case T_OP_LT:
        case T_OP_CMP_EQ:
index 7bdf524b363946875c57eb34229960b7db09a63c..d8757fa6af2e6ca3e2002b09bf62d81dd2372bff 100644 (file)
@@ -1222,7 +1222,7 @@ CONF_PAIR *cf_pair_alloc(CONF_SECTION *parent, char const *attr, char const *val
 {
        CONF_PAIR *cp;
 
-       fr_assert(fr_comparison_op[op] || fr_assignment_op[op]);
+       fr_assert(fr_comparison_op[op] || fr_assignment_op[op] || fr_binary_op[op]);
        if (!attr) return NULL;
 
        cp = talloc_zero(parent, CONF_PAIR);
index 61177f8a0aabf966a0d951cc93899e7a74f94040..fcc54aa61b59627e05d10a21629a5efacc6718c7 100644 (file)
@@ -628,7 +628,7 @@ int unlang_fixup_update(map_t *map, void *ctx)
         *      Depending on the attribute type, some operators are disallowed.
         */
        if (tmpl_is_attr(map->lhs)) {
-               if (!fr_assignment_op[map->op] && !fr_comparison_op[map->op]) {
+               if (!fr_assignment_op[map->op] && !fr_comparison_op[map->op] && !fr_binary_op[map->op]) {
                        cf_log_err(map->ci, "Invalid operator \"%s\" in update section.  "
                                   "Only assignment or filter operators are allowed",
                                   fr_table_str_by_value(fr_tokens_table, map->op, "<INVALID>"));
index ab85b4724a894e853d432fc29ad863c31fa9ebe8..fb58cb9b0e6e0748cb53e8036a013801397d7c22 100644 (file)
@@ -52,8 +52,10 @@ fr_table_num_ordered_t const fr_tokens_table[] = {
        { L("="),       T_OP_EQ         },
        { L("!="),      T_OP_NE         },
        { L("!=="),     T_OP_CMP_NE_TYPE },
+       { L(">>="),     T_RSHIFT        },
        { L(">="),      T_OP_GE         },
        { L(">"),       T_OP_GT         },
+       { L("<<="),     T_LSHIFT        },
        { L("<="),      T_OP_LE         },
        { L("<"),       T_OP_LT         },
        { L("#"),       T_HASH          },