2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

fix tor-bandwidth-usage

I mistakenly broke the authentication routine during my overhaul of
the plugin.
This commit is contained in:
Kenyon Ralph 2012-03-11 04:08:48 -07:00
parent d8ef1a40a1
commit 0e1d54f2fd

View File

@ -60,9 +60,13 @@ sub Authenticate
if (open(COOKIE, "<$ENV{cookiefile}")) {
my $cookie;
binmode COOKIE;
read(COOKIE, $cookie, 32);
$authline .= " ";
while (read(COOKIE, $cookie, 32)) {
foreach my $byte (unpack "C*", $cookie) {
$authline .= sprintf "%02x", $byte;
}
}
close COOKIE;
$authline .= ' "' . $cookie . '"';
}
} elsif (defined($ENV{password})) {
$authline .= ' "' . $ENV{password} . '"';