mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
minor fix
Former-commit-id: 4222b217953e88da43d0f50d3217a065dbb13332
This commit is contained in:
parent
45c9f6d51c
commit
8bdc980ab0
pandora_server/lib/PandoraFMS
@ -202,15 +202,15 @@ sub data_consumer ($$) {
|
||||
|| $cnf_extra{'cloud_util_path'} ne $ENV{'AWS_SECRET_ACCESS_KEY'}) {
|
||||
# Environmental data is out of date. Create a tmp file to manage
|
||||
# credentials. Perl limitation. We cannot update ENV here.
|
||||
$cnf_extra{'cred_file'} = $pa_config->{'temporal'} . '/tmp_discovery.' . md5($task->{'id_rt'} . $task->{'name'} . time());
|
||||
$cnf_extra{'creds_file'} = $pa_config->{'temporal'} . '/tmp_discovery.' . md5($task->{'id_rt'} . $task->{'name'} . time());
|
||||
eval {
|
||||
open(my $__file_cfg, '> '. $cnf_extra{'cred_file'}) or die($!);
|
||||
open(my $__file_cfg, '> '. $cnf_extra{'creds_file'}) or die($!);
|
||||
print $__file_cfg $cnf_extra{'aws_access_key_id'} . "\n";
|
||||
print $__file_cfg $cnf_extra{'aws_secret_access_key'} . "\n";
|
||||
close($__file_cfg);
|
||||
set_file_permissions(
|
||||
$pa_config,
|
||||
$cnf_extra{'cred_file'},
|
||||
$cnf_extra{'creds_file'},
|
||||
"0600"
|
||||
);
|
||||
};
|
||||
@ -270,9 +270,9 @@ sub data_consumer ($$) {
|
||||
$recon->scan();
|
||||
|
||||
# Clean tmp file.
|
||||
if (defined($cnf_extra{'cred_file'})
|
||||
&& -f $cnf_extra{'cred_file'}) {
|
||||
unlink($cnf_extra{'cred_file'});
|
||||
if (defined($cnf_extra{'creds_file'})
|
||||
&& -f $cnf_extra{'creds_file'}) {
|
||||
unlink($cnf_extra{'creds_file'});
|
||||
}
|
||||
};
|
||||
if ($@) {
|
||||
|
@ -1456,6 +1456,7 @@ sub cloud_scan($) {
|
||||
aws_access_key_id => $self->{'aws_access_key_id'},
|
||||
aws_secret_access_key => $self->{'aws_secret_access_key'},
|
||||
cloud_util_path => $self->{'cloud_util_path'},
|
||||
creds_file => $self->{'creds_file'},
|
||||
parent => $self
|
||||
]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user