rlm_detail issue (bug report + patch).
Konstantin Chekushin
koch2 at inbox.lv
Wed May 18 08:58:06 CEST 2011
I think, this module needs a little patch.
This will prevent uncontrolled situation, when no space left on
device.
At this moment, if there are no space left, then rlm_detail doesn't
return any error, when he cannot flush buffered information to the
file. Client continue sending accounting to the primary server, but
server cannot save it. As a result - accounting info can be lost.
Just meet this problem and it was solved with this code change.
--- rlm_detail.c 2011-05-18 09:37:28.000000000 +0300
+++ rlm_detail.c.new 2011-05-18 09:41:26.000000000 +0300
@@ -185,6 +185,7 @@
int lock_count;
struct timeval tv;
VALUE_PAIR *pair;
+ int fpf;
struct detail_instance *inst = instance;
@@ -463,7 +464,11 @@
RDEBUG2("Released filelock");
}
- fclose(outfp);
+ fpf = fclose(outfp);
+ if (fpf == EOF) {
+ radlog(L_ERR,"rlm_detail: cannot close the file!
(%s)", strerror(errno));
+ return RLM_MODULE_FAIL;
+ }
/*
* And everything is fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20110518/1169e804/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rlm_detail.patch
Type: application/octet-stream
Size: 531 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20110518/1169e804/attachment.obj>
More information about the Freeradius-Users
mailing list