accounting being saved in detail files with := attribute
I recall this being brought up here recently, but I dont know if there is a fix in yet. Anyways I have these pair of patches for the problem, encountered when using detail_reader, since it skips all AVP's with += or := #! /bin/sh /usr/share/dpatch/dpatch-run ## 450-pairmove-set-operator.dpatch by <joe@debian09> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. @DPATCH@ diff -urNad freeradius-server~/src/lib/valuepair.c freeradius-server/src/lib/valuepair.c --- freeradius-server~/src/lib/valuepair.c 2009-09-23 09:40:54.000000000 -0400 +++ freeradius-server/src/lib/valuepair.c 2009-09-24 18:16:41.000000000 -0400 @@ -542,6 +542,7 @@ * here, so instead we over-write * the vp that it's pointing to. */ + i->operator = T_OP_EQ; memcpy(found, i, sizeof(*found)); found->next = mynext; @@ -563,6 +564,7 @@ * if similar ones already exist. */ default: + i->operator = T_OP_EQ; case T_OP_ADD: /* += */ break; } diff -urNad freeradius-server~/src/main/valuepair.c freeradius-server/src/main/valuepair.c --- freeradius-server~/src/main/valuepair.c 2009-09-24 18:10:49.000000000 -0400 +++ freeradius-server/src/main/valuepair.c 2009-09-24 18:16:51.000000000 -0400 @@ -795,6 +795,7 @@ VALUE_PAIR *vp; vp = found->next; + i->operator = T_OP_EQ; memcpy(found, i, sizeof(*found)); found->next = vp; continue; @@ -814,6 +815,7 @@ */ default: case T_OP_ADD: /* += */ + i->operator = T_OP_EQ; break; } #! /bin/sh /usr/share/dpatch/dpatch-run ## 460-detail-reader-opset.dpatch by <joe@debian09> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. @DPATCH@ diff -urNad freeradius-server~/src/main/detail.c freeradius-server/src/main/detail.c --- freeradius-server~/src/main/detail.c 2009-09-23 09:40:54.000000000 -0400 +++ freeradius-server/src/main/detail.c 2009-09-24 18:28:12.000000000 -0400 @@ -510,7 +510,11 @@ * FIXME: print an error for badly formatted attributes? */ if (sscanf(buffer, "%255s = %1023s", key, value) != 2) { - continue; + if (sscanf(buffer, "%255s := %1023s", key, value) != 2) { + if (sscanf(buffer, "%255s += %1023s", key, value) != 2) { + continue; + } + } } /*
Joe Maimon wrote:
I recall this being brought up here recently, but I dont know if there is a fix in yet.
Anyways I have these pair of patches for the problem, encountered when using detail_reader, since it skips all AVP's with += or :=
Ah... rather than mucking with the library and server core, it's easier to fix the detail file reader. I've committed a fix which makes it care less about operators. Alan DeKok.
Alan DeKok wrote:
Joe Maimon wrote:
I recall this being brought up here recently, but I dont know if there is a fix in yet.
Anyways I have these pair of patches for the problem, encountered when using detail_reader, since it skips all AVP's with += or :=
Ah... rather than mucking with the library and server core, it's easier to fix the detail file reader. I've committed a fix which makes it care less about operators.
Alan DeKok. -
Yes, I saw. Thank you. I will continue to utilize the patch for the library and server core, as I believe the patched behavior to be fundamentally correct and I am willing to take one for the team should I be wrong.
participants (2)
-
Alan DeKok -
Joe Maimon