mirror of https://github.com/mikaku/Monitorix.git
fixed the message 'Odd number of elements in hash assignment' in lib/HTTPServer.pm
This commit is contained in:
parent
dd694ac72a
commit
82d8c9ed9e
3
Changes
3
Changes
|
@ -20,6 +20,9 @@
|
||||||
- Fixed the MIME type of graphs in 'emailreports.pm' and in 'traffacct.pm' to
|
- Fixed the MIME type of graphs in 'emailreports.pm' and in 'traffacct.pm' to
|
||||||
honor the 'image_format' option. [#174]
|
honor the 'image_format' option. [#174]
|
||||||
- Fixed in 'emailreports.pm' to name each attached graph correctly.
|
- Fixed in 'emailreports.pm' to name each attached graph correctly.
|
||||||
|
- Fixed the message 'Odd number of elements in hash assignment' in
|
||||||
|
HTTPServer.pm line 58, generated by a malformed line in the 'htpasswd' file.
|
||||||
|
Now it warns about such malformed line in the HTTP built-in log.
|
||||||
|
|
||||||
|
|
||||||
3.9.0 - 14-Oct-2016
|
3.9.0 - 14-Oct-2016
|
||||||
|
|
|
@ -55,7 +55,21 @@ sub check_passwd {
|
||||||
|
|
||||||
if(open(IN, $main::config{httpd_builtin}->{auth}->{htpasswd})) {
|
if(open(IN, $main::config{httpd_builtin}->{auth}->{htpasswd})) {
|
||||||
while(<IN>) {
|
while(<IN>) {
|
||||||
my %pair = split(':', $_);
|
my $line = trim($_);
|
||||||
|
|
||||||
|
# append character ':' if not exist
|
||||||
|
if(index($line, ":") < 0) {
|
||||||
|
logger("Malformed line in " . $main::config{httpd_builtin}->{auth}->{htpasswd}, "ERROR");
|
||||||
|
$line .= ":" if index($line, ":") < 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
# discard that line if password is missing
|
||||||
|
if(length($line) == index($line, ":") + 1) {
|
||||||
|
logger("Malformed line in " . $main::config{httpd_builtin}->{auth}->{htpasswd}, "ERROR");
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
my %pair = split(':', $line);
|
||||||
if($pair{$user || ""}) {
|
if($pair{$user || ""}) {
|
||||||
chomp($pair{$user});
|
chomp($pair{$user});
|
||||||
if(crypt($pass, $pair{$user}) ne $pair{$user}) {
|
if(crypt($pass, $pair{$user}) ne $pair{$user}) {
|
||||||
|
|
Loading…
Reference in New Issue