]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
logging: restrict file log permissions
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 11 Feb 2020 11:37:57 +0000 (12:37 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 18 Feb 2020 15:01:25 +0000 (16:01 +0100)
With the new file utility functions permissions can be restricted for
newly created files. For the log file specified by the -l option it
is better to remove the "other" permissions (0640) to make it similar
to the system log.

logging.c

index 87f263ed24d64595aa0f7e8a0930ff9fe32be175..9bcc0c5f7c8987ea49aab8db81939a8bb2c11f0d 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -186,7 +186,7 @@ LOG_OpenFileLog(const char *log_file)
   FILE *f;
 
   if (log_file) {
-    f = UTI_OpenFile(NULL, log_file, NULL, 'A', 0644);
+    f = UTI_OpenFile(NULL, log_file, NULL, 'A', 0640);
   } else {
     f = stderr;
   }