mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Updated config and tools
New configuration tokens and functions added: set_file_permissions added: configuration tokens: user group umask updates on transactional_threshold valid inputs
This commit is contained in:
parent
21ddb758ba
commit
04c27a9fd3
@ -195,6 +195,9 @@ sub pandora_load_config {
|
|||||||
$pa_config->{"dbname"} = "pandora";
|
$pa_config->{"dbname"} = "pandora";
|
||||||
$pa_config->{"basepath"} = $pa_config->{'pandora_path'}; # Compatibility with Pandora 1.1
|
$pa_config->{"basepath"} = $pa_config->{'pandora_path'}; # Compatibility with Pandora 1.1
|
||||||
$pa_config->{"incomingdir"} = "/var/spool/pandora/data_in";
|
$pa_config->{"incomingdir"} = "/var/spool/pandora/data_in";
|
||||||
|
$pa_config->{"user"} = "pandora"; # environment settings default user owner for files generated
|
||||||
|
$pa_config->{"group"} = "apache"; # environment settings default group owner for files generated
|
||||||
|
$pa_config->{"umask"} = "0007"; # environment settings umask applied over chmod (A & (not B))
|
||||||
$pa_config->{"server_threshold"} = 30;
|
$pa_config->{"server_threshold"} = 30;
|
||||||
$pa_config->{"alert_threshold"} = 60;
|
$pa_config->{"alert_threshold"} = 60;
|
||||||
$pa_config->{"log_file"} = "/var/log/pandora_server.log";
|
$pa_config->{"log_file"} = "/var/log/pandora_server.log";
|
||||||
@ -549,6 +552,15 @@ sub pandora_load_config {
|
|||||||
elsif ($parametro =~ m/^translate_enterprise_strings\s+([0-1])/i) {
|
elsif ($parametro =~ m/^translate_enterprise_strings\s+([0-1])/i) {
|
||||||
$pa_config->{'translate_enterprise_strings'}= clean_blank($1);
|
$pa_config->{'translate_enterprise_strings'}= clean_blank($1);
|
||||||
}
|
}
|
||||||
|
elsif ($parametro =~ m/^user\s(.*)/i) {
|
||||||
|
$pa_config->{'user'}= clean_blank($1);
|
||||||
|
}
|
||||||
|
elsif ($parametro =~ m/^group\s(.*)/i) {
|
||||||
|
$pa_config->{'group'}= clean_blank($1);
|
||||||
|
}
|
||||||
|
elsif ($parametro =~ m/^umask\s(.*)/i) {
|
||||||
|
$pa_config->{'umask'}= clean_blank($1);
|
||||||
|
}
|
||||||
elsif ($parametro =~ m/^dbengine\s(.*)/i) {
|
elsif ($parametro =~ m/^dbengine\s(.*)/i) {
|
||||||
$pa_config->{'dbengine'}= clean_blank($1);
|
$pa_config->{'dbengine'}= clean_blank($1);
|
||||||
}
|
}
|
||||||
@ -606,7 +618,7 @@ sub pandora_load_config {
|
|||||||
elsif ($parametro =~ m/^transactional_threads\s+([0-9]*)/i) {
|
elsif ($parametro =~ m/^transactional_threads\s+([0-9]*)/i) {
|
||||||
$pa_config->{'transactional_threads'}= clean_blank($1);
|
$pa_config->{'transactional_threads'}= clean_blank($1);
|
||||||
}
|
}
|
||||||
elsif ($parametro =~ m/^transactional_threshold\s+([0-9]*)/i) {
|
elsif ($parametro =~ m/^transactional_threshold\s+([0-9]*\.{0,1}[0-9]*)/i) {
|
||||||
$pa_config->{'transactional_threshold'}= clean_blank($1);
|
$pa_config->{'transactional_threshold'}= clean_blank($1);
|
||||||
}
|
}
|
||||||
if ($parametro =~ m/^transactional_pool\s(.*)/i) {
|
if ($parametro =~ m/^transactional_pool\s(.*)/i) {
|
||||||
|
@ -98,6 +98,7 @@ our @EXPORT = qw(
|
|||||||
month_have_days
|
month_have_days
|
||||||
translate_obj
|
translate_obj
|
||||||
valid_regex
|
valid_regex
|
||||||
|
set_file_permissions
|
||||||
);
|
);
|
||||||
|
|
||||||
# ID of the different servers
|
# ID of the different servers
|
||||||
@ -141,6 +142,28 @@ if ($OS eq 'linux') {
|
|||||||
}
|
}
|
||||||
chomp($OS_VERSION);
|
chomp($OS_VERSION);
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Sets user:group owner for the given file
|
||||||
|
###############################################################################
|
||||||
|
sub set_file_permissions($$) {
|
||||||
|
my ($pa_config, $file) = @_;
|
||||||
|
if ($^O !~ /win/i ) { # Only for Linux environments
|
||||||
|
eval {
|
||||||
|
my $uid = getpwnam($pa_config->{'user'});
|
||||||
|
my $gid = getgrnam($pa_config->{'group'});
|
||||||
|
my $perm = oct("0777") & (~oct($pa_config->{'umask'}));
|
||||||
|
|
||||||
|
chown $uid, $gid, $file;
|
||||||
|
chmod ( $perm, $file );
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
# Ignore error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
## SUB pandora_trash_ascii
|
## SUB pandora_trash_ascii
|
||||||
# Generate random ascii strings with variable lenght
|
# Generate random ascii strings with variable lenght
|
||||||
|
Loading…
x
Reference in New Issue
Block a user