X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fshellcommands.pm;h=6fe4254beeec14538a89e3e262bfa1ba0fd5524b;hb=0ee87ce2f12ab1ba734f6d2b60c60469c07f9b8c;hp=4d603cbd2c76cc94f0705d1bb1214b9b53648803;hpb=7d8bc7cdd5bd9f5578701d16874a2cbb0c336106;p=freeside.git diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm index 4d603cbd2..6fe4254be 100644 --- a/FS/FS/part_export/shellcommands.pm +++ b/FS/FS/part_export/shellcommands.pm @@ -475,12 +475,16 @@ sub shellcommands_queue { sub ssh_cmd { #subroutine, not method use Net::OpenSSH; my $opt = { @_ }; - my $ssh = Net::OpenSSH->new($opt->{'user'}.'@'.$opt->{'host'}); + open my $def_in, '<', '/dev/null' or die "unable to open /dev/null\n"; + my $ssh = Net::OpenSSH->new( + $opt->{'user'}.'@'.$opt->{'host'}, + 'default_stdin_fh' => $def_in + ); die "Couldn't establish SSH connection: ". $ssh->error if $ssh->error; my $ssh_opt = {}; $ssh_opt->{'stdin_data'} = $opt->{'stdin_string'} - if exists($opt->{'stdin_string'}); + if exists($opt->{'stdin_string'}) and length($opt->{'stdin_string'}); my ($output, $errput) = $ssh->capture2($ssh_opt, $opt->{'command'}); die "Error running SSH command: ". $ssh->error if $ssh->error;