r33028 - in /branches/upstream/libnet-ssh2-perl/current: Changes MANIFEST META.yml Makefile.PL SSH2.xs TODO lib/Net/SSH2.pm t/Net-SSH2.t typemap
ryan52-guest at users.alioth.debian.org
ryan52-guest at users.alioth.debian.org
Sat Apr 11 05:05:43 UTC 2009
Author: ryan52-guest
Date: Sat Apr 11 05:05:38 2009
New Revision: 33028
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=33028
Log:
[svn-upgrade] Integrating new upstream version, libnet-ssh2-perl (0.19)
Added:
branches/upstream/libnet-ssh2-perl/current/TODO
Modified:
branches/upstream/libnet-ssh2-perl/current/Changes
branches/upstream/libnet-ssh2-perl/current/MANIFEST
branches/upstream/libnet-ssh2-perl/current/META.yml
branches/upstream/libnet-ssh2-perl/current/Makefile.PL
branches/upstream/libnet-ssh2-perl/current/SSH2.xs
branches/upstream/libnet-ssh2-perl/current/lib/Net/SSH2.pm
branches/upstream/libnet-ssh2-perl/current/t/Net-SSH2.t
branches/upstream/libnet-ssh2-perl/current/typemap
Modified: branches/upstream/libnet-ssh2-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-ssh2-perl/current/Changes?rev=33028&op=diff
==============================================================================
--- branches/upstream/libnet-ssh2-perl/current/Changes (original)
+++ branches/upstream/libnet-ssh2-perl/current/Changes Sat Apr 11 05:05:38 2009
@@ -2,6 +2,9 @@
Developer/maintainer: David B. Robins <dbrobins at cpan.org>.
Project started 2005-10-23 in Redmond, Washington, USA.
+
+0.19 2009-04-11 01:03:39
+ - Updated for perl 5.10 and 5.6 compatibility.
0.18 2007-11-10 dbr (svn revision 56)
- Note version change: synced to libssh2. Should be compatible with
Modified: branches/upstream/libnet-ssh2-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-ssh2-perl/current/MANIFEST?rev=33028&op=diff
==============================================================================
--- branches/upstream/libnet-ssh2-perl/current/MANIFEST (original)
+++ branches/upstream/libnet-ssh2-perl/current/MANIFEST Sat Apr 11 05:05:38 2009
@@ -17,3 +17,4 @@
fallback/const-c.inc
fallback/const-xs.inc
META.yml Module meta-data (added by MakeMaker)
+TODO
Modified: branches/upstream/libnet-ssh2-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-ssh2-perl/current/META.yml?rev=33028&op=diff
==============================================================================
--- branches/upstream/libnet-ssh2-perl/current/META.yml (original)
+++ branches/upstream/libnet-ssh2-perl/current/META.yml Sat Apr 11 05:05:38 2009
@@ -1,13 +1,24 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Net-SSH2
-version: 0.18
-version_from: lib/Net/SSH2.pm
-installdirs: site
+--- #YAML:1.0
+name: Net-SSH2
+version: 0.19
+abstract: Support for the SSH 2 protocol via libssh2.
+author:
+ - David B. Robins <dbrobins at cpan.org>
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
requires:
- File::Basename: 0
- IO::File: 0
- Socket: 0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+ File::Basename: 0
+ IO::File: 0
+ Socket: 0
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.50
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: branches/upstream/libnet-ssh2-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-ssh2-perl/current/Makefile.PL?rev=33028&op=diff
==============================================================================
--- branches/upstream/libnet-ssh2-perl/current/Makefile.PL (original)
+++ branches/upstream/libnet-ssh2-perl/current/Makefile.PL Sat Apr 11 05:05:38 2009
@@ -16,7 +16,7 @@
# try to find libSSH2 if we're not given a location
unless($lib and $inc) {
for my $prefix($Config{siteprefixexp},$Config{prefixexp},
- '/usr','/usr/local','/opt') {
+ '/usr','/usr/local','/opt',$ENV{HOME}) {
$lib ||= "$prefix/lib"
if -f "$prefix/lib/libssh2$Config{_a}" or
-f "$prefix/lib/libssh2.$Config{so}";
Modified: branches/upstream/libnet-ssh2-perl/current/SSH2.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-ssh2-perl/current/SSH2.xs?rev=33028&op=diff
==============================================================================
--- branches/upstream/libnet-ssh2-perl/current/SSH2.xs (original)
+++ branches/upstream/libnet-ssh2-perl/current/SSH2.xs Sat Apr 11 05:05:38 2009
@@ -173,13 +173,15 @@
/* libssh2 allocator thunks */
LIBSSH2_ALLOC_FUNC(local_alloc) {
- return Perl_malloc(count);
+ void *buf;
+ New(0, buf, count, char);
+ return buf;
}
LIBSSH2_REALLOC_FUNC(local_realloc) {
- return Perl_realloc(ptr, count);
+ return Renew(ptr, count, char);
}
LIBSSH2_FREE_FUNC(local_free) {
- Perl_mfree(ptr);
+ Safefree(ptr);
}
/* set Net:SSH2-specific error message */
@@ -349,8 +351,8 @@
/* single prompt, no echo: assume it's a password request */
pv_password = SvPV(ss->sv_tmp, len_password);
- responses[0].text = Perl_malloc(len_password);
- memcpy(responses[0].text, pv_password, len_password);
+ New(0, responses[0].text, len_password, char);
+ Copy(pv_password, responses[0].text, len_password, char);
responses[0].length = len_password;
}
@@ -383,8 +385,8 @@
for (i = 0; i < count; ++i) {
STRLEN len_response;
const char* pv_response = SvPV(ST(i), len_response);
- responses[i].text = Perl_malloc(len_response);
- memcpy(responses[i].text, pv_response, len_response);
+ New(0, responses[i].text, len_response, char);
+ Copy(pv_response, responses[i].text, len_response, char);
responses[i].length = len_response;
}
@@ -409,8 +411,8 @@
if (count > 0) {
STRLEN len_password;
const char* pv_password = SvPV(ST(0), len_password);
- *newpw = Perl_malloc(len_password);
- memcpy(*newpw, pv_password, len_password);
+ New(0, *newpw, len_password, char);
+ Copy(pv_password, *newpw, len_password, char);
*newpw_len = len_password;
}
@@ -759,7 +761,7 @@
count = split_comma(sp, auth);
else
PUSHs(sv_2mortal(newSVpv(auth, 0)));
- Perl_mfree(auth);
+ Safefree(auth);
XSRETURN(count);
void
@@ -786,7 +788,7 @@
if (!password || !SvPOK(password)) {
char* auth = libssh2_userauth_list(ss->session,
pv_username, len_username);
- Perl_mfree(auth);
+ Safefree(auth);
XSRETURN_IV(!auth && libssh2_userauth_authenticated(ss->session));
}
@@ -986,7 +988,10 @@
debug("%s::poll: timeout = %d, array[%d]\n", class, timeout, count);
if (!count) // some architectures return null for malloc(0)
XSRETURN_IV(0);
- if (!(pollfd = Perl_malloc(sizeof(LIBSSH2_POLLFD) * count))) {
+
+ New(0, pollfd, count, LIBSSH2_POLLFD);
+
+ if (!pollfd) {
set_error(ss, 0, "out of memory allocating pollfd structures");
XSRETURN_EMPTY;
}
@@ -1006,7 +1011,7 @@
debug("- [%d] = channel\n", i);
pollfd[i].type = LIBSSH2_POLLFD_CHANNEL;
pollfd[i].fd.channel =
- ((SSH2_CHANNEL*)SvIVX(SvRV(*handle)))->channel;
+ ((SSH2_CHANNEL*)SvIVX(GvSV((GV*)SvRV(*handle))))->channel;
} else if(strEQ(package, "Net::SSH2::Listener")) {
debug("- [%d] = listener\n", i);
pollfd[i].type = LIBSSH2_POLLFD_LISTENER;
@@ -1046,7 +1051,7 @@
debug("- [%d] revents %d\n", i, pollfd[i].revents);
}
- Perl_mfree(pollfd);
+ Safefree(pollfd);
if (changed < 0)
XSRETURN_EMPTY;
XSRETURN_IV(changed);
@@ -1707,7 +1712,8 @@
pv_blob = SvPV(blob, len_blob);
num_attrs = items - 4;
- if (!(attrs = Perl_malloc(sizeof(*attrs) * num_attrs))) {
+ New(0, attrs, num_attrs, libssh2_publickey_attribute);
+ if (!attrs) {
set_error(pk->ss, 0, "out of memory allocating attribute structures");
XSRETURN_EMPTY;
}
@@ -1740,7 +1746,7 @@
success = !libssh2_publickey_add_ex(pk->pkey,
pv_name, len_name, pv_blob, len_blob, overwrite, num_attrs, attrs);
- Perl_mfree(attrs);
+ Safefree(attrs);
XSRETURN_IV(!success);
void
Added: branches/upstream/libnet-ssh2-perl/current/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-ssh2-perl/current/TODO?rev=33028&op=file
==============================================================================
--- branches/upstream/libnet-ssh2-perl/current/TODO (added)
+++ branches/upstream/libnet-ssh2-perl/current/TODO Sat Apr 11 05:05:38 2009
@@ -1,0 +1,3 @@
+Polling sometimes doesn't work.
+Segfaults on exit sometimes.
+sftp is incredibly slow.
Modified: branches/upstream/libnet-ssh2-perl/current/lib/Net/SSH2.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-ssh2-perl/current/lib/Net/SSH2.pm?rev=33028&op=diff
==============================================================================
--- branches/upstream/libnet-ssh2-perl/current/lib/Net/SSH2.pm (original)
+++ branches/upstream/libnet-ssh2-perl/current/lib/Net/SSH2.pm Sat Apr 11 05:05:38 2009
@@ -189,7 +189,7 @@
our @EXPORT_OK = @{$EXPORT_TAGS{all}};
-our $VERSION = '0.18';
+our $VERSION = '0.19';
# methods
Modified: branches/upstream/libnet-ssh2-perl/current/t/Net-SSH2.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-ssh2-perl/current/t/Net-SSH2.t?rev=33028&op=diff
==============================================================================
--- branches/upstream/libnet-ssh2-perl/current/t/Net-SSH2.t (original)
+++ branches/upstream/libnet-ssh2-perl/current/t/Net-SSH2.t Sat Apr 11 05:05:38 2009
@@ -31,8 +31,15 @@
my ($version2, $vernum, $banner) = $ssh2->version();
is($version, $version2, 'list version match');
my $major = int($version);
-ok(($vernum >> 8) == ($major << 8) + ($version - $major) * 100,
- 'decimal version matches');
+
+if ($major > 0) {
+ ok(($vernum >> 8) == ($major << 8) + ($version - $major) * 10,
+ 'decimal version matches');
+} else {
+ ok(($vernum >> 8) == ($major << 8) + ($version - $major) * 100,
+ 'decimal version matches');
+}
+
is($banner, "SSH-2.0-libssh2_$version", "banner is $banner");
# (2) timeout
@@ -85,7 +92,9 @@
# (2) authenticate
@auth = $pass ? (password => $pass) : (interact => 1);
-my $type = $ssh2->auth(username => $user, @auth);
+my $type = $ssh2->auth(username => $user, @auth,
+ publickey => "$ENV{HOME}/.ssh/id_dsa.pub",
+ privatekey => "$ENV{HOME}/.ssh/id_dsa");
ok($type, "authenticated via: $type");
SKIP: { # SKIP-auth
skip '- failed to authenticate with server', 37 unless $ssh2->auth_ok;
@@ -178,7 +187,8 @@
$fh = $sftp->open($altname);
isa_ok($fh, 'Net::SSH2::File', 'opened file');
scalar <$fh> for 1..2;
-chomp(my $line = <$fh>);
+my $line = <$fh>;
+chomp $line;
is($line, '# THIS LINE WILL BE READ BY A TEST BELOW', "read '$line'");
#undef $fh; # don't undef it, ensure reference counts work properly
@@ -194,7 +204,8 @@
my @poll = { handle => $chan, events => ['in'] };
ok($ssh2->poll(250, \@poll), 'got poll response');
ok($poll[0]->{revents}->{in}, 'got input event');
-chomp($line = <$chan>);
+$line = <$chan>;
+chomp $line;
is($line, '/', "got result '/'");
$line = <$chan>;
ok(!$line, 'no more lines');
Modified: branches/upstream/libnet-ssh2-perl/current/typemap
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-ssh2-perl/current/typemap?rev=33028&op=diff
==============================================================================
--- branches/upstream/libnet-ssh2-perl/current/typemap (original)
+++ branches/upstream/libnet-ssh2-perl/current/typemap Sat Apr 11 05:05:38 2009
@@ -29,11 +29,15 @@
const char* name = form("_GEN_%ld", (long)net_ch_gensym++);
SvUPGRADE((SV*)gv, SVt_PVGV);
SvUPGRADE((SV*)io, SVt_PVIO);
- SvIVX(gv) = PTR2IV($var);
gv_init(gv, gv_stashpv("Net::SSH2::Channel", 0/*create*/),
name, strlen(name), 0/*multi*/);
+ GvSV(gv) = newSViv(PTR2IV($var));
GvIOp(gv) = io;
- sv_magic((SV*)io, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+ if (PERL_VERSION > 6) {
+ sv_magic((SV*)io, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+ } else {
+ sv_magic((SV*)gv, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+ }
}
O_LISTENER
@@ -49,11 +53,15 @@
const char* name = form("_GEN_%ld", (long)net_fi_gensym++);
SvUPGRADE((SV*)gv, SVt_PVGV);
SvUPGRADE((SV*)io, SVt_PVIO);
- SvIVX(gv) = PTR2IV($var);
gv_init(gv, gv_stashpv("Net::SSH2::File", 0/*create*/),
name, strlen(name), 0/*multi*/);
+ GvSV(gv) = newSViv(PTR2IV($var));
GvIOp(gv) = io;
- sv_magic((SV*)io, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+ if (PERL_VERSION > 6) {
+ sv_magic((SV*)io, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+ } else {
+ sv_magic((SV*)gv, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+ }
}
O_DIR
@@ -80,7 +88,7 @@
O_CHANNEL
if(sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVGV))
- $var = ($type)SvIVX((SV*)SvRV($arg));
+ $var = ($type)SvIVX(GvSV((GV*)SvRV($arg)));
else
croak(\"${Package}::$func_name() - invalid channel object\");
@@ -98,7 +106,7 @@
O_FILE
if(sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVGV))
- $var = ($type)SvIVX((SV*)SvRV($arg));
+ $var = ($type)SvIVX(GvSV((GV*)SvRV($arg)));
else
croak(\"${Package}::$func_name() - invalid SFTP file object\");
More information about the Pkg-perl-cvs-commits
mailing list