Merge branch 'ent-8594-permisos-errorlog-file' into 'develop'

Set min permissions to errorlog_file

See merge request artica/pandorafms!4705
This commit is contained in:
Daniel Rodriguez 2022-03-09 15:06:10 +00:00
commit 1c347fa3ca
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";
}