Skip to content

Commit

Permalink
fix: UTF-8 and special characters are now supported in toolbox creden…
Browse files Browse the repository at this point in the history
…tials user and password

Closes #582, #596, #671
  • Loading branch information
g-bougard committed May 21, 2024
1 parent 5cfd7db commit be309b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Revision history for GLPI agent
Deploy:
* Fix: Avoid possible crash on windows while using WTS for User Interactions

toolbox:
* fix #582, #596, #671: UTF-8 and special characters are now supported in user and
password for RemoteInventory credentials

packaging:
* Fix: Call SetDllDirectory system API to help finding provided DLL libraries on windows
* Fix: Fix OpenSSL to use zlib1__.dll provided library
Expand Down
8 changes: 5 additions & 3 deletions lib/GLPI/Agent/Task/RemoteInventory/Remote.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use warnings;
use English qw(-no_match_vars);
use UNIVERSAL::require;

use Encode qw(encode);
use URI;
use URI::Escape;
use Socket qw(getaddrinfo getnameinfo);

use GLPI::Agent::Tools::Network;
Expand Down Expand Up @@ -92,8 +94,8 @@ sub handle_url {
my $userinfo = $url->userinfo;
if ($userinfo) {
my ($user, $pass) = split(/:/, $userinfo);
$self->user($user);
$self->pass($pass) if defined($pass);
$self->user(uri_unescape($user));
$self->pass(uri_unescape($pass)) if defined($pass);
}
}

Expand Down Expand Up @@ -246,7 +248,7 @@ sub safe_url {

return $self->{_url} if $self->config && $self->config->{'show-passwords'};

my $pass = $self->pass();
my $pass = uri_escape(encode("UTF-8", $self->pass()));
return $self->{_url} unless length($pass);

my $url = $self->{_url};
Expand Down

0 comments on commit be309b3

Please sign in to comment.