From: Alan T. DeKok Date: Tue, 15 Nov 2016 15:49:22 +0000 (-0500) Subject: function to mark VPs as tainted X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc07d3418537e2b22c0e83c00bf5cd26919cbfd0;p=thirdparty%2Ffreeradius-server.git function to mark VPs as tainted --- diff --git a/src/include/pair.h b/src/include/pair.h index 0f3af7b1587..6ab7c1dc27b 100644 --- a/src/include/pair.h +++ b/src/include/pair.h @@ -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); diff --git a/src/lib/pair.c b/src/lib/pair.c index e82bcd02ae1..5856c15dbf6 100644 --- a/src/lib/pair.c +++ b/src/lib/pair.c @@ -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; + } +}