]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't mash log->file. Or, set it from the input file
authorAlan T. DeKok <aland@freeradius.org>
Sat, 23 Nov 2024 17:25:48 +0000 (12:25 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 23 Nov 2024 17:25:48 +0000 (12:25 -0500)
src/lib/util/log.c

index 2598af93dce4cfbff3992fa0f0b25a99eac9497e..61a8fbf7226af8afd886f39c3a493a24f0672a45 100644 (file)
@@ -1089,7 +1089,13 @@ int fr_log_init_file(fr_log_t *log, char const *file)
                return -1;
        }
 
-       return fr_log_init_fp(log, fp);
+       if (fr_log_init_fp(log, fp) < 0) return -1;
+
+       /*
+        *      The init over-rode any filename, so we reset it here.
+        */
+       log->file = file;
+       return 0;
 }
 
 /** Write complete lines to syslog