Possible Bug in valuepair / rlm_file etc etc.

Alan DeKok aland at ox.org
Fri Oct 21 19:51:35 CEST 2005

Alister Winfield <alister.winfield at uk.easynet.net> wrote:
> I have found a potential bug in the way rlm_file or valuepair does the
> xlat of %{var} items. These are supposedly dynamic, being based on a
> per-packet replacement. The following example can be done a different
> way but its the simplest example I can think of ;-)

  Yeah, it's a bug.  The "users" file originally didn't have variable
expansion, and once we added it, things like this happen.

> Am I missing something here and if not I'll be back soon with a complete
> patch (Currently I just save the old check_item and put it back which is
> fine in a single thread but not so clever in a threaded system).

  Rather, if flags.xlat is set, do:

  VALUE_PAIR *new_check = rad_malloc(sizeof(*new_check));
  memcpy(new_check, check, sizeof(*new_check));
  new_check->next = NULL
  paircmp(... new_check...)

  Alan DeKok.

More information about the Freeradius-Devel mailing list