[PATCH] check rlm_detail writes

John Morrissey jwm at horde.net
Sat Oct 23 20:08:29 CEST 2010

I've modified rlm_detail to check its writes and return RLM_MODULE_FAIL on
short writes. I believe this should cause FreeRADIUS to avoid sending an
Accounting-Response to the NAS, so the NAS will retry on disk-full/error

A while ago, I noticed rlm_detail writes were unchecked[1], causing
FreeRADIUS to exit on an assertion in the detail reader due to the partial
detail entries. Alan kindly fixed the detail reader's behavior in this
situation[2], and I also wanted to have the detail writer check its writes.

Truncating the detail file on error to remove the partial detail entry isn't
strictly necessary, but it seems like good form and is straightforward.
I haven't yet gotten rid of the vp_print() calls (its write is unchecked,
too) and this patch is untested (though it compiles), but I wanted to get
feedback and see if it's worthwhile for me to finish and test it.


[1] https://lists.freeradius.org/pipermail/freeradius-devel/2010-May/013826.html
[2] http://github.com/alandekok/freeradius-server/commit/73fe4311083eb684b3d7f8592d5c1a9cfe68415e
John Morrissey          _o            /\         ----  __o
jwm at horde.net        _-< \_          /  \       ----  <  \,
www.horde.net/    __(_)/_(_)________/    \_______(_) /_(_)__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeradius-check-rlm-detail-writes.patch
Type: text/x-diff
Size: 9044 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20101023/0b4a49b9/attachment.patch>

More information about the Freeradius-Devel mailing list