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";