Skip Menu |

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

Report information
The Basics
Id: 22909
Status: resolved
Priority: 0/
Queue: Net-SCP-Expect

People
Owner: RYBSKEJ [...] cpan.org
Requestors: awkay69 [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.12
Fixed in: 0.13



Subject: scp command string is underquoted
Various options are underquoted, including file names, which may contain spaces. Known problems in Expect.pm: Line 170: $flags .= "-i $identity_file" if $identity_file; identity file might contain spaces. Should be: $flags .= "-i '$identity_file' " if $identity_file; OR use s/ /\\ / on $identity_file. Same for line 176: my $scp_string = "scp $flags $from $to"; should be: my $scp_string = "scp $flags '$from' '$to'"; Note, that existing users might have already put the quotes in as a workaround, so a proper fix should check if $from or $to are already quoted. i.e. $from = qq('$from') if $from !~ m/^'/; $to = qq('$to') if $to !~ m/^'/; my $scp_string = "scp $flags $from $to";
New option 'auto_quote' has been added that auto-quotes scp option values and to/from arguments. This option is enabled by default. To revert to 0.12 or older behavior, specify 'auto_quote=>0' as an argument when calling class constructor. Changes included in 0.13 release.