Show quoted text> I apologize for the delay. I keep getting distracted by my day job.
No problems. I certainly know how that goes.
The module I'm experiencing this with uses:
File::Rsync
File::HomeDir
Data::Dumper
It's parent module uses:
Net::OpenSSH (was Net::SSH::Perl when I reported this)
File::Path
File::HomeDir
Data::Dumper
However, my code isn't doing anything fancy. For this bit, the inherited stuff is little more than getting/setting values OO-style (the code uses a factory pattern, so the common bits are abstracted, and this module is the only one with File::Rsync). The part that actually uses File::Rsync is just a straightforward copy, although with the custom RSH command string.
Which version of IPC::Open3 are you testing against? I show 1.02 installed here, and it's part of the RHEL5 perl package.
Show quoted text> All my tests treat the rsh value as a single arg with no extra quoting required.
I took a quick glance at Open3 and didn't see anything definitive, but I've seen other APIs where your choices were either a single command string that would be interpreted like a shell or an array of individual arguments as interpreted after the split on spaces. Any chance this internally looks something like (A), as opposed to (B)?
A.
('rsync',
'--rsh="/usr/bin/ssh -p 12345 -l userid"',
<MISC_ARGS>)
B.
('rsync',
'--rsh="/usr/bin/ssh',
'-p',
'12345',
'-l',
'userid"',
<MISC_ARGS>)
Rick Houser
Web Administration
(517)367-3516
Show quoted text> -----Original Message-----
> From: Eakin, Lee via RT [mailto:bug-File-Rsync@rt.cpan.org]
> Sent: Monday, August 13, 2012 11:47 AM
> To: Houser, Rick
> Subject: Re: [rt.cpan.org #78217] Broken rsh processing
>
> <URL:
https://rt.cpan.org/Ticket/Display.html?id=78217 >
>
> Rick,
> I apologize for the delay. I keep getting distracted by my day job.
>
> I haven't been able to reproduce this. The code uses IPC::Open3 and passes
> the command as an array so that exec should avoid the shell completely. All
> my tests treat the rsh value as a single arg with no extra quoting required.
> Are you using any other modules that could be overloading arrays, or exec, or
> anything that might cause a shell to get back into the process?
>
> -Lee
>
>
> On 7/5/12 08:54 , Houser, Rick via RT wrote:
> > Thu Jul 05 09:54:27 2012: Request 78217 was acted upon.
> > Transaction: Ticket created by rick.houser@us.pgds.com
> > Queue: File-Rsync
> > Subject: Broken rsh processing
> > Broken in: (no value)
> > Severity: (no value)
> > Owner: Nobody
> > Requestors: rick.houser@us.pgds.com
> > Status: new
> > Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=78217 >
> >
> >
> > I'm trying to port an existing rsync command into File::Rsync, and I'm stuck.
> As near as I can tell, I'm hitting a bug in the processing of the rsh directive
> (specifically, quoting). Would you please take a look?
> >
> > This works from a shell:
> >
> > rsync <MISC_ARGS> --rsh="/usr/bin/ssh -p 12345 -l userid" <MISC_ARGS>
> >
> >
> > This generates a command that works when pasted on a shell, but
> File::Rsync can't find the executable (status code 14):
> >
> > my $rsync = File::Rsync->new( {
> > rsh => '"/usr/bin/ssh -p '.$self->{build_port}.' -l '.$self->{userid}.'"'
> > } );
> >
> > Removing the quote pair from above results in an rsync command line that
> won't connect, as I would expect. Basically, rsync tries to interpret the ssh
> arguments, and that doesn't work.
> >
> > I was able to get around this by removing the File::Rsync rsh argument and
> exporting the unquoted value via $ENV{RSYNC_RSH}, so this isn't holding me
> up. It looks really hacky, however.
> >
> > Rick Houser
> > Web Administration
> > (517)367-3516
> >
> >
>