3.0.2: rlm_sql_null duplicating its statements

Alan DeKok aland at deployingradius.com
Thu Apr 10 15:20:57 CEST 2014


Stefan Winter wrote:
> My colleague Bruno investigated this further. It looks like the fcntl()
> locking doesn't catch all corner cases. He writes:

  Yes.  This is a surprising side-effect of locks.

> We think we fixed it locally (Bruno's patch attached) by combining both
> strings into one write() as I suggested earlier.

  That will help, but not be perfect.

  If we're just blocking other threads from writing at the same time, a
mutex around the write() is sufficient.  If we need to lock the file
from readers, then the module needs to use ONE file descriptor to write
to the file.  That descriptor needs to be shared by ALL threads.

  Ugh.  Sometimes posix is crazy.

  Alan DeKok.


More information about the Freeradius-Users mailing list