Set min permissions to errorlog_file

This commit is contained in:
Kike 2022-02-18 10:09:18 +01:00
parent d65eaed8ba
commit 5458cd7a44
1 changed files with 6 additions and 1 deletions

View File

@ -1388,8 +1388,13 @@ sub pandora_start_log ($){
# Dump all errors to errorlog
open (STDERR, ">> " . $pa_config->{'errorlog_file'}) or die " [ERROR] " . pandora_get_initial_product_name() . " can't write to Errorlog. Aborting : \n $! \n";
my $mode = 0664;
my $file_mode = (stat($pa_config->{'errorlog_file'}))[2] & 0777;
my $min_mode = 0664;
my $mode = $file_mode | $min_mode;
chmod $mode, $pa_config->{'errorlog_file'};
print STDERR strftime ("%Y-%m-%d %H:%M:%S", localtime()) . ' - ' . $pa_config->{'servername'} . " Starting " . pandora_get_initial_product_name() . " Server. Error logging activated.\n";
}