]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
tmpl_find_vp() returns -1 for "list/request OK, but no VP"
authorAlan T. DeKok <aland@freeradius.org>
Sun, 24 Dec 2023 03:29:22 +0000 (22:29 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 24 Dec 2023 03:29:22 +0000 (22:29 -0500)
src/lib/server/pairmove.c

index 87f5ee4b76d3c6fd7f65eba45a0f12345fc4487b..edf397402b562cb873fb534fcda19ef2eb422919 100644 (file)
@@ -544,7 +544,7 @@ int radius_legacy_map_apply(request_t *request, map_t const *map)
         */
        switch (map->op) {
        case T_OP_EQ:
-               if (tmpl_find_vp(&vp, request, map->lhs) < 0) return -1;
+               if (tmpl_find_vp(&vp, request, map->lhs) < -1) return -1;
                if (vp) return 0;
                goto add;
 
@@ -570,7 +570,7 @@ int radius_legacy_map_apply(request_t *request, map_t const *map)
                 *      We're editing a specific number.  It must exist, otherwise the edit does nothing.
                 */
                if ((num >= 0) || (num == NUM_LAST)) {
-                       if (tmpl_find_vp(&vp, request, map->lhs) < 0) return -1;
+                       if (tmpl_find_vp(&vp, request, map->lhs) < -1) return -1;
 
                        if (!vp) return 0;
 
@@ -650,7 +650,7 @@ int radius_legacy_map_apply(request_t *request, map_t const *map)
        case T_OP_GE:           /* replace if not >= */
                if (fr_type_is_structural(da->type)) goto invalid_operator;
 
-               if (tmpl_find_vp(&vp, request, map->lhs) < 0) return -1;
+               if (tmpl_find_vp(&vp, request, map->lhs) < -1) return -1;
                if (!vp) goto add;
                break;
 
@@ -661,7 +661,7 @@ int radius_legacy_map_apply(request_t *request, map_t const *map)
                        return -1;
                }
 
-               if (tmpl_find_vp(&vp, request, map->lhs) < 0) return -1;
+               if (tmpl_find_vp(&vp, request, map->lhs) < -1) return -1;
                if (!vp) return 0;
                break;
 
@@ -685,7 +685,7 @@ int radius_legacy_map_apply(request_t *request, map_t const *map)
         *
         *      Note that
         *
-        *              &foo = %tolower(&foo)
+        *              &foo := %tolower(&foo)
         *
         *      works, as we save the value above in the T_OP_SET handler.  So we don't delete it.
         */