From a81293105670c03cd499dd92baa4d4d62a3cce76 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Mon, 5 Mar 2018 16:54:36 +0100 Subject: [PATCH] fixed to set permissions 0600 to log files --- Changes | 2 ++ monitorix | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Changes b/Changes index 3cc017f..b5b6348 100644 --- a/Changes +++ b/Changes @@ -30,6 +30,8 @@ (thanks to Sander Bos for pointing this out) - Fixed to disable 'echo' when typing the password in './htpasswd.pl'. (thanks to Sander Bos for pointing this out) +- Fixed to set permissions 0600 to log files. + (thanks to Sander Bos for pointing this out) 3.10.0 - 25-Sep-2017 diff --git a/monitorix b/monitorix index f6f8b6c..5f219da 100755 --- a/monitorix +++ b/monitorix @@ -82,12 +82,14 @@ sub HUP_handler { close(STDERR); open(STDOUT, ">> $config{log_file}") || logger("Can't write to LOG: $!"); open(STDERR, ">> $config{log_file}") || logger("Can't write to LOG: $!"); + chmod(0600, $config{log_file}); logger("$myself: opening a new log file."); # create the HTTPd logfile open(OUT, "> " . $config{httpd_builtin}->{log_file}); close(OUT); chown($uid, $gid, $config{httpd_builtin}->{log_file}); + chmod(0600, $config{httpd_builtin}->{log_file}); } sub daemonize {