From: Alan T. DeKok Date: Sat, 26 Aug 2023 19:22:38 +0000 (-0400) Subject: remove xlat wrapper for paircmp X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b52ed02156a05b4110d3e8215cee2ded93bbd559;p=thirdparty%2Ffreeradius-server.git remove xlat wrapper for paircmp --- diff --git a/src/lib/unlang/xlat_expr.c b/src/lib/unlang/xlat_expr.c index ae7f2594370..07d88b80355 100644 --- a/src/lib/unlang/xlat_expr.c +++ b/src/lib/unlang/xlat_expr.c @@ -416,49 +416,6 @@ done: return XLAT_ACTION_DONE; } -static xlat_arg_parser_t const xlat_paircmp_xlat_args[] = { - { .required = true, .concat = true, .type = FR_TYPE_STRING }, - { .required = true, .concat = true, .type = FR_TYPE_STRING }, - XLAT_ARG_PARSER_TERMINATOR -}; - -/* - * Wrapper around &LDAP-Group == "foo" - */ -static xlat_action_t xlat_paircmp_func(TALLOC_CTX *ctx, fr_dcursor_t *out, - UNUSED xlat_ctx_t const *xctx, - request_t *request, fr_value_box_list_t *in) -{ - fr_value_box_t *dst, *vb_da, *vb; - fr_dict_attr_t const *da; - char const *p; - - vb_da = fr_value_box_list_head(in); - vb = fr_value_box_list_next(in, vb_da); - -#ifdef STATIC_ANALYZER - if (!vb_da || !vb) return XLAT_ACTION_FAIL; -#endif - - p = vb_da->vb_strvalue; - if (*p == '&') p++; - - da = fr_dict_attr_by_name(NULL, fr_dict_root(fr_dict_internal()), p); - if (!da) { - RERROR("Unknown attribute '%s'", vb_da->vb_strvalue); - return XLAT_ACTION_FAIL; - } - - /* - * These callbacks only implement equality. Nothing else works. - */ - MEM(dst = fr_value_box_alloc(ctx, FR_TYPE_BOOL, attr_expr_bool_enum)); - dst->vb_bool = (paircmp_virtual(request, da, T_OP_CMP_EQ, vb) == 0); - fr_dcursor_append(out, dst); - - return XLAT_ACTION_DONE; -} - #define XLAT_BINARY_FUNC(_name, _op) \ static xlat_action_t xlat_func_ ## _name(TALLOC_CTX *ctx, fr_dcursor_t *out, \ xlat_ctx_t const *xctx, \ @@ -1735,13 +1692,6 @@ int xlat_register_expressions(void) XLAT_REGISTER_UNARY(T_COMPLEMENT, "unary_complement", xlat_func_unary_complement); XLAT_REGISTER_UNARY(T_NOT, "unary_not", xlat_func_unary_not); - /* - * Callback wrapper around old paircmp() API. - */ - if (unlikely((xlat = xlat_func_register(NULL, "paircmp", xlat_paircmp_func, FR_TYPE_VOID)) == NULL)) return -1; /* never pure! */ - xlat_func_args_set(xlat, xlat_paircmp_xlat_args); - xlat_func_flags_set(xlat, XLAT_FUNC_FLAG_INTERNAL); - return 0; }