From: Alan T. DeKok Date: Wed, 17 Feb 2016 16:04:14 +0000 (-0500) Subject: exfile will create directories for us X-Git-Tag: release_3_0_12~221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef2da24866ff5147b67bf1de631c40a9d516120a;p=thirdparty%2Ffreeradius-server.git exfile will create directories for us --- diff --git a/src/modules/rlm_linelog/rlm_linelog.c b/src/modules/rlm_linelog/rlm_linelog.c index d0b1d84e694..0f8065055bc 100644 --- a/src/modules/rlm_linelog/rlm_linelog.c +++ b/src/modules/rlm_linelog/rlm_linelog.c @@ -221,7 +221,6 @@ static size_t linelog_escape_func(UNUSED REQUEST *request, static rlm_rcode_t CC_HINT(nonnull) mod_do_linelog(void *instance, REQUEST *request) { int fd = -1; - char *p; rlm_linelog_t *inst = (rlm_linelog_t*) instance; char const *value = inst->line; @@ -238,9 +237,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_do_linelog(void *instance, REQUEST *requ CONF_ITEM *ci; CONF_PAIR *cp; - p = line + 1; - - if (radius_xlat(p, sizeof(line) - 2, request, inst->reference, linelog_escape_func, NULL) < 0) { + if (radius_xlat(line + 1, sizeof(line) - 1, request, inst->reference, linelog_escape_func, NULL) < 0) { return RLM_MODULE_FAIL; } @@ -297,17 +294,6 @@ static rlm_rcode_t CC_HINT(nonnull) mod_do_linelog(void *instance, REQUEST *requ return RLM_MODULE_FAIL; } - /* check path and eventually create subdirs */ - p = strrchr(path, '/'); - if (p) { - *p = '\0'; - if (rad_mkdir(path, 0700, -1, -1) < 0) { - RERROR("rlm_linelog: Failed to create directory %s: %s", path, fr_syserror(errno)); - return RLM_MODULE_FAIL; - } - *p = '/'; - } - fd = exfile_open(inst->ef, path, inst->permissions, true); if (fd < 0) { ERROR("rlm_linelog: Failed to open %s: %s", path, fr_syserror(errno));