Skip to content

Commit

Permalink
fix: Fix PostgreSQL inventory when password is given by dedicated dat…
Browse files Browse the repository at this point in the history
…abaseinventory plugin
  • Loading branch information
g-bougard committed Feb 6, 2025
1 parent 2e101d4 commit f0dfcfd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Revision history for GLPI agent
inventory:
* On windows, don't cache system is not 64 bits for the service lifetime as this can
be the result of a failed WMI call at the service start.
* Fix PostgreSQL inventory when password is given by dedicated databaseinventory plugin

netdiscovery/netinventory:
* PR #836 from @eduardomozart: Enhanced HP wireless printers by reporting wifi ports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ sub _getDatabaseService {
$params{options} = "";
$params{options} .= " -h '$credential->{host}'" if $credential->{host};
$params{options} .= " -p $credential->{port}" if $credential->{port};
$params{options} .= " -U '$credential->{login}'" if $credential->{login};
$params{options} .= " -U $credential->{login}" if $credential->{login};

unless ($params{options}) {
my $id = getFirstLine(command => "id -u");
Expand Down Expand Up @@ -196,6 +196,7 @@ sub _psqlPgpassFile {
$fh = File::Temp->new(
TEMPLATE => 'pgpass-XXXXXX',
SUFFIX => '.conf',
PERMS => 0600, ## no critic
);
print $fh join(":",
$credential->{host} || "*",
Expand Down

0 comments on commit f0dfcfd

Please sign in to comment.