From b81175411f760ac325fc6e4c6d1f5ac78fa09a5b Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Sat, 2 May 2020 22:57:20 +0200 Subject: New upstream version 0.79 --- Changes | 8 ++++++++ META.json | 8 ++++---- META.yml | 4 ++-- README | 5 +++-- lib/Net/OpenSSH.pm | 24 +++++++++++++----------- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/Changes b/Changes index 6d40d31..7885c3b 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,13 @@ Revision history for Perl extension Net::OpenSSH. +0.79 Apr 29, 2020 + - Don't clobber $? in disconnect (bug report by Slaven Rezic, + #rt129350). + - Silence spurious warnings being generated in _set_error (bug + report by Jaroslav Reindl, #rt132449). + - Error handling in _master_check method was broken. + - Fix documentation error (patch by Martin Barth) + 0.78 May 5, 2018 - Free master pty when the user calls disconnect (bug report by Jaroslav Reindl, #rt125240). diff --git a/META.json b/META.json index 5a398c2..802731f 100644 --- a/META.json +++ b/META.json @@ -4,13 +4,13 @@ "Salvador Fandino " ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" + "version" : 2 }, "name" : "Net-OpenSSH", "no_index" : { @@ -42,6 +42,6 @@ "url" : "https://github.com/salva/p5-Net-OpenSSH" } }, - "version" : "0.78", - "x_serialization_backend" : "JSON::PP version 2.27400_02" + "version" : "0.79", + "x_serialization_backend" : "JSON::PP version 4.02" } diff --git a/META.yml b/META.yml index ef9ad20..1de698c 100644 --- a/META.yml +++ b/META.yml @@ -7,7 +7,7 @@ build_requires: configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -21,5 +21,5 @@ requires: Test::More: '0' resources: repository: https://github.com/salva/p5-Net-OpenSSH -version: '0.78' +version: '0.79' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff --git a/README b/README index 3ee7dac..f9138b4 100644 --- a/README +++ b/README @@ -21,12 +21,13 @@ This module requires these other modules and libraries: IO::Pty (optional, required for password authentication) Net::SFTP::Foreign (optional, required for SFTP support) - OpenSSH binary client version 4.1 or later, 5.x recommended. + OpenSSH binary client version 4.1 or later, 5.x or later + recommended. COPYRIGHT AND LICENCE -Copyright (C) 2008-2018 by Salvador Fandino +Copyright (C) 2008-2020 by Salvador Fandino This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, diff --git a/lib/Net/OpenSSH.pm b/lib/Net/OpenSSH.pm index 8e2c9c9..a269bc0 100644 --- a/lib/Net/OpenSSH.pm +++ b/lib/Net/OpenSSH.pm @@ -1,6 +1,6 @@ package Net::OpenSSH; -our $VERSION = '0.78'; +our $VERSION = '0.79'; use strict; use warnings; @@ -118,9 +118,10 @@ sub _catch_tainted_args { sub _set_error { my $self = shift; my $code = shift || 0; + my @extra = grep defined, @_; my $err = $self->{_error} = ( $code ? Scalar::Util::dualvar($code, join(': ', @{$self->{_error_prefix}}, - (@_ ? @_ : "Unknown error $code"))) + (@extra ? @extra : "Unknown error $code"))) : 0 ); $debug and $debug & 1 and _debug "set_error($code - $err)"; return $err @@ -417,7 +418,7 @@ sub new { $self->{_default_stdin_fh} = $self->_open_file('<', $default_stdin_file) if defined $default_stdin_file; - if ($self->error == OSSH_SLAVE_PIPE_FAILED) { + if ($self->{_error} == OSSH_SLAVE_PIPE_FAILED) { $self->_master_fail($async, "Unable to create default slave stream", $self->{_error}); return $self; } @@ -808,7 +809,7 @@ sub _waitpid { my $time_limit; if (defined $timeout and $self->{_kill_ssh_on_timeout}) { - $timeout = 0 if $self->error == OSSH_SLAVE_TIMEOUT; + $timeout = 0 if $self->{_error} == OSSH_SLAVE_TIMEOUT; $time_limit = time + $timeout; } local $SIG{CHLD} = sub {} unless __has_sigchld_handle; @@ -994,7 +995,7 @@ sub _master_check { } else { my $out = $self->_master_ctl('check'); - my $error = $self->{_error}; + $error = $self->{_error}; unless ($error) { my $pid = $self->{_pid}; if ($out =~ /pid=(\d+)/) { @@ -1229,6 +1230,7 @@ sub _master_ctl { my %opts = (ref $_[0] eq 'HASH' ? %{shift()} : ()); my $cmd = shift; + local $?; local $self->{_error_prefix} = [@{$self->{_error_prefix}}, "control command failed"]; $self->capture({ %opts, @@ -1740,7 +1742,7 @@ sub _encode_args { local $self->{_error_prefix} = [@{$self->{_error_prefix}}, "argument encoding failed"]; $self->_encode($enc, @_); } - return !$self->error; + return !$self->{_error}; } 1; } @@ -1781,7 +1783,7 @@ sub _io3 { if ($enc and @data) { local $self->{_error_prefix} = [@{$self->{_error_prefix}}, "stdin data encoding failed"]; $self->_encode($enc, @data) if $has_input; - return if $self->error; + return if $self->{_error}; } my $bout = ''; @@ -2061,7 +2063,7 @@ sub test { _croak_bad_options %opts; $self->system(\%opts, @_); - my $error = $self->error; + my $error = $self->{_error}; unless ($error) { return 1; } @@ -2370,7 +2372,7 @@ sub _rsync { return $pid if $async; $self->_waitpid($pid, $timeout) and return 1; - if ($self->error == OSSH_SLAVE_CMD_FAILED and $?) { + if ($self->{_error} == OSSH_SLAVE_CMD_FAILED and $?) { my $err = ($? >> 8); my $errstr = $rsync_error{$err}; $errstr = 'Unknown rsync error' unless defined $errstr; @@ -4669,7 +4671,7 @@ notice between releases. If you are using password authentication, enabling debugging for L may also show interesting information: - IO::Tty::DEBUG = 1; + $IO::Tty::DEBUG = 1; Finally, by default debugging output is sent to C. You can override it pointing C<$Net::OpenSSH::debug_fh> to a different file @@ -5225,7 +5227,7 @@ I always welcome documentation corrections and improvements. =head1 COPYRIGHT AND LICENSE -Copyright (C) 2008-2018 by Salvador FandiEo +Copyright (C) 2008-2020 by Salvador FandiEo (sfandino@yahoo.com) This library is free software; you can redistribute it and/or modify -- cgit v1.2.3