From: Alan T. DeKok Date: Tue, 20 Feb 2024 14:51:45 +0000 (-0500) Subject: allow left / right shift X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f34fed6a30ab4c61119cd112dc77e6ab1267469c;p=thirdparty%2Ffreeradius-server.git allow left / right shift --- diff --git a/src/lib/server/cf_file.c b/src/lib/server/cf_file.c index 07f4a4233ce..254acbec35f 100644 --- a/src/lib/server/cf_file.c +++ b/src/lib/server/cf_file.c @@ -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: diff --git a/src/lib/server/cf_util.c b/src/lib/server/cf_util.c index 7bdf524b363..d8757fa6af2 100644 --- a/src/lib/server/cf_util.c +++ b/src/lib/server/cf_util.c @@ -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); diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 61177f8a0aa..fcc54aa61b5 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -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, "")); diff --git a/src/lib/util/token.c b/src/lib/util/token.c index ab85b4724a8..fb58cb9b0e6 100644 --- a/src/lib/util/token.c +++ b/src/lib/util/token.c @@ -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 },