diff --git a/plugins/network/tor-bandwidth-usage b/plugins/network/tor-bandwidth-usage index 316d57ca..b1871ade 100755 --- a/plugins/network/tor-bandwidth-usage +++ b/plugins/network/tor-bandwidth-usage @@ -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} . '"';