Net-OpenSSH

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        - implement parse_connections_opts
        - solve bug related to expansion of HOST var when an IPv6
          address was given
        - move FACTORY docs to the right place
        - add FAQ about running remote commands via sudo
        - add sample for Net::Telnet integration
        - add sample for sudo usage reading password from DATA

0.53_04  Sep 2, 2011
        - add default_ssh_opts feature
        - getpwuid may fail, check $home is defined before using it
        - add FAQ entry about MaxSessions limit reached
        - move FACTORY docs to the right place

0.53_03  Aug 18, 2011
        - handling of default_std*_file was broken (bug report and
          patch by Nic Sandfield)
        - keep errors from opening default slave streams
        - add Net::OpenSSH::ConnectionCache package
        - add FACTORY hook
        - place '--' in ssh command after host name

lib/Net/OpenSSH.pm  view on Meta::CPAN

    _croak_bad_options %opts;

    my @ssh_opts;
    # TODO: are those options really requiered or just do they eat on
    # the command line limited length?
    push @ssh_opts, -l => $user if defined $user;
    push @ssh_opts, -p => $port if defined $port;

    my $home = do {
	local ($@, $SIG{__DIE__});
	eval { Cwd::realpath((getpwuid $>)[7]) }
    };

    if (${^TAINT}) {
	($home) = $home =~ /^(.*)$/;
	Scalar::Util::tainted($ENV{PATH}) and
		_tcroak('Insecure $ENV{PATH}');
    }

    my $self = { _error => 0,
		 _error_prefix => [],

t/common.pm  view on Meta::CPAN

    for my $cmd (@_) {
	for my $path (@path) {
	    my $r = "$path/$cmd";
	    return $r if -x $r;
	}
    }
    undef;
}

sub shell_is_clean {
    my $shell = (getpwuid($>))[8];

    socketpair my $up, my $down, AF_UNIX, SOCK_STREAM, PF_UNSPEC or return;
    my $pid = fork;
    unless ($pid) {
        unless (defined $pid) {
            diag "fork failed: $!";
            return;
        }
        open STDIN,  '<&', $down;
        open STDOUT, '>>&', $down;



( run in 0.354 second using v1.01-cache-2.11-cpan-8d75d55dd25 )