]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't do locking on files in /dev. Closes #3057
authorAlan T. DeKok <aland@freeradius.org>
Sat, 19 Oct 2019 11:57:48 +0000 (07:57 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 19 Oct 2019 11:57:48 +0000 (07:57 -0400)
src/modules/rlm_linelog/rlm_linelog.c

index 3c15bf04b309da384df5acdf871a8c9c5cbea47c..3da07d9011c77b11e6fcbf5022ed57478cf5b3f4 100644 (file)
@@ -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;