I have double checked and the patch was attached both times.
I've checked the MIME in the Maildir file for sent items and evolution
seems to have done everything sane.
Therefore here it is inline:
diff -Naur Net-SCP-0.08/SCP.pm Net-SCP-new/SCP.pm
--- Net-SCP-0.08/SCP.pm 2008-07-25 10:52:16.000000000 +0100
+++ Net-SCP-new/SCP.pm 2008-07-25 10:53:25.000000000 +0100
@@ -71,20 +71,22 @@
sub scp {
my $self = ref($_[0]) ? shift : {};
my($src, $dest, $interact) = @_;
- my $flags = '-p';
- $flags .= 'r' unless &_islocal($src) && ! -d $src;
+ $dest = $self->{'user'}. '@'. $dest if $self->{'user'};
+ my @flags = ('-p');
+ push @flags, '-r' unless &_islocal($src) && ! -d $src;
+ push @flags, '-i', $self->{identity_file} if $self->{identity_file};
my @cmd;
if ( ( defined($interact) && $interact )
|| ( defined($self->{interactive}) && $self->{interactive} ) ) {
- @cmd = ( $scp, $flags, $src, $dest );
+ @cmd = ( $scp, @flags, $src, $dest );
print join(' ', @cmd), "\n";
unless ( &_yesno ) {
$self->{errstr} = "User declined";
return 0;
}
} else {
- $flags .= 'qB';
- @cmd = ( $scp, $flags, $src, $dest );
+ push @flags, '-qB';
+ @cmd = ( $scp, @flags, $src, $dest );
}
my($reader, $writer, $error ) =
( new IO::Handle, new IO::Handle, new IO::Handle );
@@ -150,6 +152,7 @@
user - username
interactive - bool
cwd - current working directory on remote server
+ identity_file - identity file to be used for public key authentication
=cut
@@ -166,6 +169,7 @@
'interactive' => 0,
'cwd' => '',
};
+ $self->{identity_file} = shift if scalar @_;
}
bless($self, $class);
}
@@ -181,6 +185,17 @@
$self->{'user'} = $user if $user;
}
+=item identity_file [IDENTITY_FILE]
+
+Sets the identity file used for public key authentication.
+
+=cut
+
+sub identity_file {
+ my($self, $identity_file) = @_;
+ $self->{'identity_file'} = $identity_file if $identity_file;
+}
+
=item cwd CWD
Sets the cwd (used for a subsequent get or put request without a full
pathname).
@@ -204,7 +219,6 @@
$remote = $self->{'cwd'}. "/$remote" if $self->{'cwd'} && $remote !~
/^\//;
$local ||= basename($remote);
my $source = $self->{'host'}. ":$remote";
- $source = $self->{'user'}. '@'. $source if $self->{'user'};
$self->scp($source,$local);
}
@@ -289,7 +303,6 @@
$remote ||= basename($local);
$remote = $self->{'cwd'}. "/$remote" if $self->{'cwd'} && $remote !~
/^\//;
my $dest = $self->{'host'}. ":$remote";
- $dest = $self->{'user'}. '@'. $dest if $self->{'user'};
warn "scp $local $dest\n" if $DEBUG;
$self->scp($local, $dest);
}