]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove xlat wrapper for paircmp
authorAlan T. DeKok <aland@freeradius.org>
Sat, 26 Aug 2023 19:22:38 +0000 (15:22 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 26 Aug 2023 19:29:23 +0000 (15:29 -0400)
src/lib/unlang/xlat_expr.c

index ae7f2594370f87b5b829960b0d8765fb0b702e00..07d88b803552ecae577e27a46701897dc974bf57 100644 (file)
@@ -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;
 }