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.
Michael Chernyakhovsky wrote:
we need close outfd right before "return RLM_MODULE_FAIL;" at line 236.
... or get the fixes from CVS head which solve many other problems in rlm_detail. (for example file renamed or unlinked by another program) Everyone will save a considerable amount of time if you could backport the changes from CVS to 1.1.2, run tests to check the new code, and send unified diff to the list. http://freeradius.org/radiusd/doc/DIFFS -- Nicolas Baradakis
participants (2)
-
Michael Chernyakhovsky -
Nicolas Baradakis