]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
function to mark VPs as tainted
authorAlan T. DeKok <aland@freeradius.org>
Tue, 15 Nov 2016 15:49:22 +0000 (10:49 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 15 Nov 2016 15:56:57 +0000 (10:56 -0500)
src/include/pair.h
src/lib/pair.c

index 0f3af7b15876bad80f9ec70346a60c9bb4839ca4..6ab7c1dc27bb52fc9220cf21b17477c56235a453 100644 (file)
@@ -300,6 +300,8 @@ void                fr_pair_list_fprint(FILE *, VALUE_PAIR const *vp);
 char           *fr_pair_type_asprint(TALLOC_CTX *ctx, PW_TYPE type);
 char           *fr_pair_asprint(TALLOC_CTX *ctx, VALUE_PAIR const *vp, char quote);
 
+void           fr_pair_list_tainted(VALUE_PAIR *vp);
+
 /* Hacky raw pair thing that needs to go away */
 FR_TOKEN       fr_pair_raw_from_str(char const **ptr, VALUE_PAIR_RAW *raw);
 
index e82bcd02ae1200eb68644383b85e7893947fa8fb..5856c15dbf6a48148d92aabf395415a5b0e5f5bc 100644 (file)
@@ -2833,3 +2833,23 @@ void fr_pair_list_verify(char const *file, int line, TALLOC_CTX *expected, VALUE
        }
 }
 #endif
+
+/** Mark up a list of VPs as tainted.
+ *
+ */
+void fr_pair_list_tainted(VALUE_PAIR *vps)
+{
+       VALUE_PAIR      *vp;
+       vp_cursor_t     cursor;
+
+       if (!vps) {
+               return;
+       }
+
+       for (vp = fr_cursor_init(&cursor, &vps);
+            vp;
+            vp = fr_cursor_next(&cursor)) {
+               VERIFY_VP(vp);
+               vp->vp_tainted = true;
+       }
+}