#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
#include <freeradius-devel/rad_assert.h>
-#include <freeradius-devel/detail.h>
#include <freeradius-devel/exfile.h>
#include <ctype.h>
#include <fcntl.h>
#include <sys/stat.h>
-#ifdef HAVE_FNMATCH_H
-# include <fnmatch.h>
-#endif
-
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
RDEBUG2("%s expands to %s", inst->filename, buffer);
-#ifdef WITH_ACCOUNTING
-#if defined(HAVE_FNMATCH_H) && defined(FNM_FILE_NAME)
- /*
- * If we read it from a detail file, and we're about to
- * write it back to the SAME detail file directory, then
- * suppress the write. This check prevents an infinite
- * loop.
- */
- if (request->listener && (request->listener->type == RAD_LISTEN_DETAIL) &&
- (fnmatch(((listen_detail_t *)request->listener->data)->filename,
- buffer, FNM_FILE_NAME | FNM_PERIOD ) == 0)) {
- RWDEBUG2("Suppressing infinite loop");
- return RLM_MODULE_NOOP;
- }
-#endif
-#endif
-
outfd = exfile_open(inst->ef, request, buffer, inst->perm);
if (outfd < 0) {
RERROR("Couldn't open file %s: %s", buffer, fr_strerror());
*/
static rlm_rcode_t CC_HINT(nonnull) mod_accounting(void *instance, UNUSED void *thread, REQUEST *request)
{
-#ifdef WITH_DETAIL
- if (request->listener && (request->listener->type == RAD_LISTEN_DETAIL) &&
- strcmp(((rlm_detail_t const *)instance)->filename,
- ((listen_detail_t *)request->listener->data)->filename) == 0) {
- RDEBUG("Suppressing writes to detail file as the request was just read from a detail file");
- return RLM_MODULE_NOOP;
- }
-#endif
-
return detail_do(instance, request, request->packet, true);
}