From: Alan T. DeKok Date: Sat, 19 Oct 2019 11:57:48 +0000 (-0400) Subject: don't do locking on files in /dev. Closes #3057 X-Git-Tag: release_3_0_20~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e52715e895da2bf64b7a1a5253c39045ee04c87e;p=thirdparty%2Ffreeradius-server.git don't do locking on files in /dev. Closes #3057 --- diff --git a/src/modules/rlm_linelog/rlm_linelog.c b/src/modules/rlm_linelog/rlm_linelog.c index 3c15bf04b30..3da07d9011c 100644 --- a/src/modules/rlm_linelog/rlm_linelog.c +++ b/src/modules/rlm_linelog/rlm_linelog.c @@ -144,7 +144,13 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance) return -1; } - inst->ef = exfile_init(inst, 256, 30, true); + /* + * If the admin wants the logs to go to stdout or stderr, + * then skip locking / seeking on those files. Since + * everything in /dev/ isn't a real file, we can't seek + * or lock it. + */ + inst->ef = exfile_init(inst, 256, 30, (strncmp(inst->filename, "/dev/", 5) != 0)); if (!inst->ef) { cf_log_err_cs(conf, "Failed creating log file context"); return -1;