X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnector%2FLocalSudo.pm;h=e9bbb9661afcca1c1e16b49458d43087b2593fde;hb=4e4463355a9ec6afdc7983ee36daa9f11306d4fc;hp=0b5f33dfd995fd07caa944ab5353b1fce78df40e;hpb=9d64d2d9b2401f99b747ecf754384adb661f0a5b;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote/Connector/LocalSudo.pm b/lib/Object/Remote/Connector/LocalSudo.pm index 0b5f33d..e9bbb96 100644 --- a/lib/Object/Remote/Connector/LocalSudo.pm +++ b/lib/Object/Remote/Connector/LocalSudo.pm @@ -64,11 +64,8 @@ sub _start_perl { ->watch_io( handle => $sudo_stderr, on_read_ready => sub { - #TODO is there a specific reason sysread() and syswrite() aren't - #a part of ::MiniLoop? It's one spot to handle errors and other - #logic involving filehandles - log_debug { "LocalSudo: Preparing to read data" }; - if (sysread($sudo_stderr, my $buf, 1024) > 0) { + Dlog_debug { "LocalSudo: Preparing to read data from $_" } $sudo_stderr; + if (sysread($sudo_stderr, my $buf, 32768) > 0) { log_trace { "LocalSudo: successfully read data, printing it to STDERR" }; print STDERR $buf; log_trace { "LocalSudo: print() to STDERR is done" }; @@ -91,7 +88,8 @@ push @Object::Remote::Connection::Guess, sub { for ($_[0]) { # username followed by @ if (defined and !ref and /^ ([^\@]*?) \@ $/x) { - return __PACKAGE__->new(target_user => $1); + shift(@_); + return __PACKAGE__->new(@_, target_user => $1); } } return;