* 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
0 | 0 | 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) | |
1 | 20 | |
2 | 21 | 1.53 Jul 6, 2009 |
3 | 22 | - re-released as stable |
0 | 0 | --- #YAML:1.0 |
1 | 1 | name: Net-SFTP-Foreign |
2 | version: 1.53 | |
2 | version: 1.55 | |
3 | 3 | abstract: Secure File Transfer Protocol client |
4 | 4 | license: ~ |
5 | 5 | author: |
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 | ||
0 | 10 | libnet-sftp-foreign-perl (1.53+dfsg-1) unstable; urgency=low |
1 | 11 | |
2 | 12 | [ Nathan Handler ] |
5 | 5 | Maintainer: Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org> |
6 | 6 | Uploaders: Alejandro Garrido Mota <garridomota@gmail.com>, |
7 | 7 | 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 | |
10 | 10 | Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libnet-sftp-foreign-perl/ |
11 | 11 | Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libnet-sftp-foreign-perl/ |
12 | 12 | Homepage: http://search.cpan.org/dist/Net-SFTP-Foreign/ |
15 | 15 | Architecture: all |
16 | 16 | Depends: ${misc:Depends}, ${perl:Depends}, openssh-client | ssh-client |
17 | 17 | 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> | |
22 | 21 | . |
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. |
0 | 0 | Format-Specification: |
1 | 1 | 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> | |
3 | 3 | Upstream-Source: http://search.cpan.org/dist/Net-SFTP-Foreign/ |
4 | 4 | Upstream-Name: Net-SFTP-Foreign |
5 | 5 | X-Comment: The non-free RFCs have been removed from the upstream tarball for the +dfsg |
6 | 6 | version. |
7 | 7 | |
8 | 8 | 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> | |
13 | 12 | . |
14 | 13 | The _glob_to_regex method based on code (c) 2002 Richard Clamp. |
15 | 14 | License-Alias: Perl |
16 | 15 | License: GPL-1+ | Artistic |
17 | 16 | |
18 | 17 | 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> | |
22 | 24 | License: GPL-1+ | Artistic |
23 | 25 | |
24 | 26 | License: GPL-1+ |
0 | 0 | #!/usr/bin/make -f |
1 | 1 | |
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 | %: | |
11 | 3 | 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 |
0 | 0 | package Net::SFTP::Foreign; |
1 | 1 | |
2 | our $VERSION = '1.53'; | |
2 | our $VERSION = '1.55'; | |
3 | 3 | |
4 | 4 | use strict; |
5 | 5 | use warnings; |
440 | 440 | exit -1; |
441 | 441 | } |
442 | 442 | _ipc_open2_bug_workaround $this_pid; |
443 | $pty->close_slave(); | |
443 | # $pty->close_slave(); | |
444 | 444 | } |
445 | 445 | else { |
446 | 446 | $expect = Expect->new; |
475 | 475 | $sftp->_conn_failed("$name interchange did not complete", $expect->error); |
476 | 476 | return $sftp; |
477 | 477 | } |
478 | $expect->close_slave(); | |
478 | 479 | } |
479 | 480 | else { |
480 | 481 | _debug "ssh cmd: @open2_cmd\n" if ($debug and $debug & 1); |
635 | 636 | |
636 | 637 | sub _rel2abs { |
637 | 638 | my ($sftp, $path) = @_; |
639 | my $old = $path; | |
638 | 640 | my $cwd = $sftp->{cwd}; |
639 | 641 | if (defined $cwd and $path !~ m|^/|) { |
640 | 642 | # carp "sftp->rel2abs($path) => $sftp->{cwd}/$path\n"; |
641 | 643 | $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'"); | |
644 | 647 | return $path |
645 | 648 | } |
646 | 649 | |
739 | 742 | my ($sftp, $eid, $error, $errstr) = @_; |
740 | 743 | if (my $msg = $sftp->_get_msg_and_check(SSH2_FXP_STATUS, $eid, |
741 | 744 | $error, $errstr)) { |
742 | ||
743 | 745 | my $status = $sftp->_set_status($msg->get_int32, $msg->get_str); |
744 | 746 | return 1 if $status == SSH2_FX_OK; |
745 | 747 | |
749 | 751 | } |
750 | 752 | |
751 | 753 | sub setcwd { |
752 | ||
753 | @_ == 2 or croak 'Usage: $sftp->setcwd($path)'; | |
754 | @_ <= 2 or croak 'Usage: $sftp->setcwd($path)'; | |
754 | 755 | ${^TAINT} and &_catch_tainted_args; |
755 | 756 | |
756 | 757 | my ($sftp, $cwd) = @_; |
757 | 758 | if (defined $cwd) { |
758 | 759 | $cwd = $sftp->realpath($cwd); |
759 | 760 | 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 | } | |
761 | 771 | } |
762 | 772 | else { |
763 | 773 | delete $sftp->{cwd}; |
764 | return $sftp->cwd; | |
774 | return $sftp->cwd if defined wantarray; | |
765 | 775 | } |
766 | 776 | } |
767 | 777 | |
1495 | 1505 | $sftp->status != SSH2_FX_OP_UNSUPPORTED and return undef; |
1496 | 1506 | } |
1497 | 1507 | |
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 | |
1500 | 1510 | $sftp->_rename($old, $new) and return 1; |
1501 | 1511 | |
1502 | 1512 | if ($overwrite and $sftp->status == SSH2_FX_FAILURE) { |
4614 | 4624 | |
4615 | 4625 | B<A>: Use the C<S_IS*> functions from L<Fcntl>. For instance: |
4616 | 4626 | |
4617 | use Fcntl qw(IS_DIR); | |
4627 | use Fcntl qw(S_ISDIR); | |
4618 | 4628 | my $ls = $sftp->ls or die $sftp->error; |
4619 | 4629 | for my $entry (@$ls) { |
4620 | 4630 | if (S_ISDIR($entry->{a}->perm)) { |
20 | 20 | plan skip_all => "sftp-server not found" |
21 | 21 | unless defined $sscmd; |
22 | 22 | |
23 | plan tests => 717; | |
23 | plan tests => 722; | |
24 | 24 | |
25 | 25 | use_ok('Net::SFTP::Foreign'); |
26 | 26 | use Net::SFTP::Foreign::Constants qw(:flags); |
48 | 48 | ok (defined $rcwd, "realpath"); |
49 | 49 | |
50 | 50 | 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"); | |
51 | 57 | |
52 | 58 | for my $setcwd (0, 1) { |
53 | 59 | my $orcwd = $rcwd; |