X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnector%2FLocalSudo.pm;h=aa19ced3fbcbc1dcef95ba9c093af24235cb68f1;hp=1bd6d6e7c26182dcf9aa8209f667fea1a08bbb62;hb=aa052874c2efdb5837fd42ae2f924d6f05b49c71;hpb=4c17fea55a562db315a029e6bd67b7dbb028a8e9 diff --git a/lib/Object/Remote/Connector/LocalSudo.pm b/lib/Object/Remote/Connector/LocalSudo.pm index 1bd6d6e..aa19ced 100644 --- a/lib/Object/Remote/Connector/LocalSudo.pm +++ b/lib/Object/Remote/Connector/LocalSudo.pm @@ -35,11 +35,14 @@ sub _start_perl { unless $cb; print $foreign_stdin $cb->($line, @_), "\n"; chomp($line = <$sudo_stderr>); - die "sent password and expected newline from sudo, got ${line}" - if $line; - chomp($line = <$sudo_stderr>); - die "sent password but next line was ${line}" - unless $line eq "GO"; + if ($line and $line ne 'GO') { + die "sent password and expected newline from sudo, got ${line}"; + } + elsif (not $line) { + chomp($line = <$sudo_stderr>); + die "sent password but next line was ${line}" + unless $line eq "GO"; + } } else { die "Got inexplicable line ${line} trying to sudo"; };