Codebase list libnet-sftp-foreign-perl / 52c113f
* New upstream release * Added myself to Uploaders and Copyright * Standards-Version 3.8.3 (no changes) * Use new short debhelper rules format * Remove README.source; it's rather self-explanatory Jonathan Yu 14 years ago
10 changed file(s) with 79 addition(s) and 57 deletion(s). Raw diff Collapse all Expand all
00 Revision history for Net::SFTP::Foreign
1
2 1.55 Sep 9, 2009
3 - re-release as stable
4
5 1.54_03 Sep 4, 2009
6 - add debugging to _rel2abs
7
8 1.54_02 Aug 19, 2009
9 - add extra sanity check to setcwd method. It seems that some
10 servers do not report an error when realpath is called on an
11 inexistent file (bug report by Ben Szulc)
12 - password authentication broken in AIX
13 - some documentation corrections
14 - more tests added
15
16 1.54_01 Jul 22, 2009
17 - yet another "Password not requested as expected" bug solved,
18 $pty->close_slave was being called too soon (bug report by
19 Tim Rayner)
120
221 1.53 Jul 6, 2009
322 - re-released as stable
00 --- #YAML:1.0
11 name: Net-SFTP-Foreign
2 version: 1.53
2 version: 1.55
33 abstract: Secure File Transfer Protocol client
44 license: ~
55 author:
+0
-2
debian/README.source less more
0 The +dfsg version is created by removing the non-free RFCs from the upstream
1 tarball. For automating this procedure debian/repack.sh can be used.
0 libnet-sftp-foreign-perl (1.55+dfsg-1) UNRELEASED; urgency=low
1
2 * New upstream release
3 * Added myself to Uploaders and Copyright
4 * Standards-Version 3.8.3 (no changes)
5 * Use new short debhelper rules format
6 * Remove README.source; it's rather self-explanatory
7
8 -- Jonathan Yu <jawnsy@cpan.org> Wed, 23 Sep 2009 15:08:01 -0400
9
010 libnet-sftp-foreign-perl (1.53+dfsg-1) unstable; urgency=low
111
212 [ Nathan Handler ]
55 Maintainer: Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>
66 Uploaders: Alejandro Garrido Mota <garridomota@gmail.com>,
77 gregor herrmann <gregoa@debian.org>, Antonio Radici <antonio@dyne.org>,
8 Ryan Niebur <ryanryan52@gmail.com>
9 Standards-Version: 3.8.2
8 Ryan Niebur <ryanryan52@gmail.com>, Jonathan Yu <jawnsy@cpan.org>
9 Standards-Version: 3.8.3
1010 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libnet-sftp-foreign-perl/
1111 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libnet-sftp-foreign-perl/
1212 Homepage: http://search.cpan.org/dist/Net-SFTP-Foreign/
1515 Architecture: all
1616 Depends: ${misc:Depends}, ${perl:Depends}, openssh-client | ssh-client
1717 Description: Net::SFTP::Foreign -- Secure File Transfer Protocol client
18 Net::SFTP::Foreign is a Perl client for the SFTP. It provides a subset
19 of the commands listed in the SSH File Transfer Protocol IETF draft,
20 which can be found at
21 http://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt
18 Net::SFTP::Foreign is a Perl client for the SFTP. It provides a subset of the
19 commands listed in the SSH File Transfer Protocol IETF draft, which can be
20 found at <URL:http://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt>
2221 .
23 Net::SFTP::Foreign uses any compatible ssh command installed on
24 your system (for instance, OpenSSH ssh) to establish the secure
25 connection to the remote server.
22 Net::SFTP::Foreign uses any compatible ssh command installed on your system
23 (for instance, OpenSSH ssh) to establish the secure connection to the remote
24 server.
00 Format-Specification:
11 http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
2 Upstream-Maintainer: Salvador Fandiño (sfandino@yahoo.com)
2 Upstream-Maintainer: Salvador Fandiño <sfandino@yahoo.com>
33 Upstream-Source: http://search.cpan.org/dist/Net-SFTP-Foreign/
44 Upstream-Name: Net-SFTP-Foreign
55 X-Comment: The non-free RFCs have been removed from the upstream tarball for the +dfsg
66 version.
77
88 Files: *
9 Copyright:
10 Copyright (c) 2005-2009 Salvador Fandiño (sfandino@yahoo.com).
11 Copyright (c) 2001 Benjamin Trott
12 Copyright (c) 2003 David Rolsky.
9 Copyright: 2005-2009, Salvador Fandiño <sfandino@yahoo.com>
10 2001, Benjamin Trott <cpan@stupidfool.org>
11 2003, David Rolsky <autarch@urth.org>
1312 .
1413 The _glob_to_regex method based on code (c) 2002 Richard Clamp.
1514 License-Alias: Perl
1615 License: GPL-1+ | Artistic
1716
1817 Files: debian/*
19 Copyright:
20 2008, Alejandro Garrido Mota <garridomota@gmail.com>
21 2008-2009, various members of the Debian Perl Group, cf. debian/changelog
18 Copyright: 2009, Jonathan Yu <jawnsy@cpan.org>
19 2009, Ryan Niebur <ryanryan52@gmail.com>
20 2009, Antonio Radici <antonio@dyne.org>
21 2008-2009, gregor herrmann <gregoa@debian.org>
22 2008, Roberto C. Sanchez <roberto@connexer.com>
23 2008, Alejandro Garrido Mota <garridomota@gmail.com>
2224 License: GPL-1+ | Artistic
2325
2426 License: GPL-1+
00 #!/usr/bin/make -f
11
2 get-orig-source:
3 uscan --verbose --force-download
4
5 build: build-stamp
6 build-stamp:
7 dh build
8 touch $@
9
10 clean:
2 %:
113 dh $@
12
13 install: install-stamp
14 install-stamp: build-stamp
15 dh install
16 touch $@
17
18 binary-arch:
19
20 binary-indep: install
21 dh $@
22
23 binary: binary-arch binary-indep
24
25 .PHONY: binary binary-arch binary-indep install clean build get-orig-source
99 512 -
1010 1024 - hexdump of sysreads
1111 2048 - hexdump of syswrites
12
12 4096 - _rel2abs
00 package Net::SFTP::Foreign;
11
2 our $VERSION = '1.53';
2 our $VERSION = '1.55';
33
44 use strict;
55 use warnings;
440440 exit -1;
441441 }
442442 _ipc_open2_bug_workaround $this_pid;
443 $pty->close_slave();
443 # $pty->close_slave();
444444 }
445445 else {
446446 $expect = Expect->new;
475475 $sftp->_conn_failed("$name interchange did not complete", $expect->error);
476476 return $sftp;
477477 }
478 $expect->close_slave();
478479 }
479480 else {
480481 _debug "ssh cmd: @open2_cmd\n" if ($debug and $debug & 1);
635636
636637 sub _rel2abs {
637638 my ($sftp, $path) = @_;
639 my $old = $path;
638640 my $cwd = $sftp->{cwd};
639641 if (defined $cwd and $path !~ m|^/|) {
640642 # carp "sftp->rel2abs($path) => $sftp->{cwd}/$path\n";
641643 $path =~ s|^(?:\./+)+||;
642 return ($cwd =~ m|/$| ? "$cwd$path" : "$cwd/$path");
643 }
644 $path = ($cwd =~ m|/$| ? "$cwd$path" : "$cwd/$path");
645 }
646 $debug and $debug & 4096 and _debug("_rel2abs: '$old' --> '$path'");
644647 return $path
645648 }
646649
739742 my ($sftp, $eid, $error, $errstr) = @_;
740743 if (my $msg = $sftp->_get_msg_and_check(SSH2_FXP_STATUS, $eid,
741744 $error, $errstr)) {
742
743745 my $status = $sftp->_set_status($msg->get_int32, $msg->get_str);
744746 return 1 if $status == SSH2_FX_OK;
745747
749751 }
750752
751753 sub setcwd {
752
753 @_ == 2 or croak 'Usage: $sftp->setcwd($path)';
754 @_ <= 2 or croak 'Usage: $sftp->setcwd($path)';
754755 ${^TAINT} and &_catch_tainted_args;
755756
756757 my ($sftp, $cwd) = @_;
757758 if (defined $cwd) {
758759 $cwd = $sftp->realpath($cwd);
759760 return undef unless defined $cwd;
760 $sftp->{cwd} = $cwd;
761 my $a = $sftp->stat($cwd)
762 or return undef;
763 if (S_ISDIR($a->perm)) {
764 return $sftp->{cwd} = $cwd;
765 }
766 else {
767 $sftp->_set_error(SFTP_ERR_REMOTE_BAD_OBJECT,
768 "Remote object '$cwd' is not a directory");
769 return undef;
770 }
761771 }
762772 else {
763773 delete $sftp->{cwd};
764 return $sftp->cwd;
774 return $sftp->cwd if defined wantarray;
765775 }
766776 }
767777
14951505 $sftp->status != SSH2_FX_OP_UNSUPPORTED and return undef;
14961506 }
14971507
1498 # we are optimistic and try to rename it whitout testing if a file
1499 # of the same name already exists
1508 # we are optimistic here and try to rename it without testing if a
1509 # file of the same name already exists first
15001510 $sftp->_rename($old, $new) and return 1;
15011511
15021512 if ($overwrite and $sftp->status == SSH2_FX_FAILURE) {
46144624
46154625 B<A>: Use the C<S_IS*> functions from L<Fcntl>. For instance:
46164626
4617 use Fcntl qw(IS_DIR);
4627 use Fcntl qw(S_ISDIR);
46184628 my $ls = $sftp->ls or die $sftp->error;
46194629 for my $entry (@$ls) {
46204630 if (S_ISDIR($entry->{a}->perm)) {
2020 plan skip_all => "sftp-server not found"
2121 unless defined $sscmd;
2222
23 plan tests => 717;
23 plan tests => 722;
2424
2525 use_ok('Net::SFTP::Foreign');
2626 use Net::SFTP::Foreign::Constants qw(:flags);
4848 ok (defined $rcwd, "realpath");
4949
5050 my @data = <DATA>;
51
52 ok ($sftp->setcwd("."), "setcwd");
53 ok (!$sftp->setcwd("miauu"), "setcwd to non existant dir");
54 ok ($sftp->stat("t/1_run.t"), "check that the file exists");
55 ok (!$sftp->setcwd("t/1_run.t"), "setcwd to file");
56 ok ($sftp->setcwd(), "setcwd reset");
5157
5258 for my $setcwd (0, 1) {
5359 my $orcwd = $rcwd;