From 0e1d54f2fd1850871a90463be78a709fa165f984 Mon Sep 17 00:00:00 2001 From: Kenyon Ralph Date: Sun, 11 Mar 2012 04:08:48 -0700 Subject: [PATCH] fix tor-bandwidth-usage I mistakenly broke the authentication routine during my overhaul of the plugin. --- plugins/network/tor-bandwidth-usage | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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} . '"';