X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnector%2FLocalSudo.pm;h=e9bbb9661afcca1c1e16b49458d43087b2593fde;hb=9de32e1d7e5f896e00a8d14aeb2103be94b047f2;hp=043b688bf378fbf417aecc5f9ad0c80a476b1e00;hpb=498c4ad5b1cc2db13c7b581b44ff3f6b9e33eaba;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote/Connector/LocalSudo.pm b/lib/Object/Remote/Connector/LocalSudo.pm index 043b688..e9bbb96 100644 --- a/lib/Object/Remote/Connector/LocalSudo.pm +++ b/lib/Object/Remote/Connector/LocalSudo.pm @@ -64,9 +64,13 @@ sub _start_perl { ->watch_io( handle => $sudo_stderr, on_read_ready => sub { - 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" }; } else { + log_debug { "LocalSudo: received EOF or error on file handle, unwatching it" }; Object::Remote->current_loop ->unwatch_io( handle => $sudo_stderr, @@ -84,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;