rlm_detail bug when "locking = yes"

Michael Chernyakhovsky magmike at mail.ru
Fri Jun 16 10:34:37 CEST 2006


hello, everybody.


my radius use a rlm_perl module, wich  open and write some
informations to files. also it use rlm_detail but without locking.

2 days ago i add second rlm_detail to config with option
"locking = yes".
since i got 2 files with corrupted datas which accessed by rlm_perl.

i think bug is in rlm_detail.c. there is no close() after successful
open and failed filelock!

198:    /*
199:     *  Open & create the file, with the given permissions.
200:     */
201:    if ((outfd = open(buffer, O_WRONLY | O_APPEND | O_CREAT,
202:              inst->detailperm)) < 0) {
203:        radlog(L_ERR, "rlm_detail: Couldn't open file %s: %s",
204:               buffer, strerror(errno));
205:        return RLM_MODULE_FAIL;
206:    }
...
233:    if (!locked && inst->locking && lock_count >= 80) {
234:        radlog(L_ERR, "rlm_detail: Failed to aquire filelock for %s, givingup",
235:               buffer);
236:        return RLM_MODULE_FAIL;
237:    }

we need close outfd right before  "return RLM_MODULE_FAIL;" at line
236.

Mike.




More information about the Freeradius-Users mailing list