Skip Menu |

This queue is for tickets about the Net-OpenSSH CPAN distribution.

Report information
The Basics
Id: 53522
Status: rejected
Worked: 1.2 hours (70 min)
Priority: 0/
Queue: Net-OpenSSH

People
Owner: salva [...] cpan.org
Requestors: horne [...] infoblox.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Net::OpenSSH remove _check_is_system_fh requirement
Date: Fri, 08 Jan 2010 11:22:39 -0800
To: bug-Net-OpenSSH [...] rt.cpan.org
From: Geoff Horne <horne [...] infoblox.com>
i'm trying to use scp_put(), and if there is a permission error on the remote side the error goes to STDERR. i want to capture that error, or at least suppress it since this is running inside a CGI/mod_perl all. perl 5.8 lets you redirect filehandles to a variable thus : open(STDERR, '>', \$errstring); but fileno() doesn't return a valid numnber : (Filehandles connected to memory objects via new features of "open" may return undefined even though they are open.) so i'm stuck, the only workaround is to redirect the output to /dev/null
Subject: Re: [rt.cpan.org #53522] Net::OpenSSH remove _check_is_system_fh requirement
Date: Fri, 8 Jan 2010 13:19:38 -0800 (PST)
To: bug-Net-OpenSSH [...] rt.cpan.org
From: Salvador Fandino <sfandino [...] yahoo.com>
Hi, Show quoted text
> i'm trying to use scp_put(), and if there is a permission error on the
Show quoted text
> remote side the error goes to STDERR. > > i want to capture that error, or at least suppress it since this is running > inside a CGI/mod_perl all. > > perl 5.8 lets you redirect filehandles to a variable thus : > > open(STDERR, '>', \$errstring); > > but fileno() doesn't return a valid numnber : > > (Filehandles connected to memory objects via new features of > "open" may return undefined even though they are open.) > > so i'm stuck, the only workaround is to redirect the output to /dev/null
The error messages come from the scp process forked by Net::OpenSSH. Unfortunately, the perl redirection to a scalar feature does not work across forks and actually, that's the reason the _check_is_system_fh check is there. Removing the test will not solve the problem! Besides sending stderr to /dev/null, you can also send it to a temporal file or to a log so it doesn't get lost. Anyway, scp is called by default with the quiet flag set, so no errors errors should be printed to stderr. Can you send me the exact error message you are getting? - Salva
Subject: Re: [rt.cpan.org #53522] Net::OpenSSH remove _check_is_system_fh requirement
Date: Fri, 08 Jan 2010 13:44:24 -0800
To: bug-Net-OpenSSH [...] rt.cpan.org
From: Geoff Horne <horne [...] infoblox.com>
On 1/8/10 1:19 PM, Salvador \"FandiƱo\" via RT wrote: Show quoted text
> Removing the test will not solve the problem!
understood. Show quoted text
> Anyway, scp is called by default with the quiet flag set, so no errors > errors should be printed to stderr. Can you send me the exact error > message you are getting?
try and scp a file to a directory that doesn't exist, you get the following : scp: /var/named/include/named-include.conf: No such file or directory
scp quiet option (-q) does not suppress errors, only warnings and diagnostics. Silence the error as follows: $ssh->scp_put({stderr_discard => 1}, ...); $ssh->error and warn "scp operation failed: " . $ssh->error;