From a0bda2124e74d55f10685938f97ac7fc4abb126d Mon Sep 17 00:00:00 2001 From: Cédric Krier Date: Fri, 30 Jun 2006 10:26:10 +0000 Subject: net-libs/libssh2 - bug 113844 thanks to Joe svn path=/sunrise/; revision=387 --- net-libs/libssh2/ChangeLog | 7 ++++ net-libs/libssh2/Manifest | 24 ++++++++++++ net-libs/libssh2/files/digest-libssh2-0.14 | 3 ++ .../libssh2/files/libssh2-0.14-banner-wait.patch | 23 +++++++++++ .../files/libssh2-0.14-channel-failure.patch | 24 ++++++++++++ .../libssh2/files/libssh2-0.14-configure.patch | 12 ++++++ .../libssh2/files/libssh2-0.14-peer-shutdown.patch | 44 ++++++++++++++++++++++ net-libs/libssh2/libssh2-0.14.ebuild | 31 +++++++++++++++ 8 files changed, 168 insertions(+) create mode 100644 net-libs/libssh2/ChangeLog create mode 100644 net-libs/libssh2/Manifest create mode 100644 net-libs/libssh2/files/digest-libssh2-0.14 create mode 100644 net-libs/libssh2/files/libssh2-0.14-banner-wait.patch create mode 100644 net-libs/libssh2/files/libssh2-0.14-channel-failure.patch create mode 100644 net-libs/libssh2/files/libssh2-0.14-configure.patch create mode 100644 net-libs/libssh2/files/libssh2-0.14-peer-shutdown.patch create mode 100644 net-libs/libssh2/libssh2-0.14.ebuild diff --git a/net-libs/libssh2/ChangeLog b/net-libs/libssh2/ChangeLog new file mode 100644 index 000000000..6af30b4ad --- /dev/null +++ b/net-libs/libssh2/ChangeLog @@ -0,0 +1,7 @@ +# ChangeLog for net-libs/libssh2 +# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + + 30 Jun 2006; Cedric Krier ChangeLog: + New Ebuild for bug 113844 thanks to Joe + diff --git a/net-libs/libssh2/Manifest b/net-libs/libssh2/Manifest new file mode 100644 index 000000000..801f0bf1a --- /dev/null +++ b/net-libs/libssh2/Manifest @@ -0,0 +1,24 @@ +AUX libssh2-0.14-banner-wait.patch 675 RMD160 833419dd74233e52a37416d1f94c746b921f13c9 SHA1 726f10577f1815a6b04ef99bdf6d012f86a92a02 SHA256 662c068446bc8ac8d8949fe678f89915e6237edb43fff7bdba4340abf9d3f954 +MD5 2d8553d8736bc8d6ff6cb9676213e604 files/libssh2-0.14-banner-wait.patch 675 +RMD160 833419dd74233e52a37416d1f94c746b921f13c9 files/libssh2-0.14-banner-wait.patch 675 +SHA256 662c068446bc8ac8d8949fe678f89915e6237edb43fff7bdba4340abf9d3f954 files/libssh2-0.14-banner-wait.patch 675 +AUX libssh2-0.14-channel-failure.patch 700 RMD160 1393b9e07a8760fb75c95c37604044b4181acc2e SHA1 d0eb800c79488254b5ac46a689164e1e7434d61d SHA256 121d8a0385d36f8a4c01d746719d1745a04cafb8a3a6e47c637d1395e89c1617 +MD5 0728a2e31d88031c7749ea00ef41ca6b files/libssh2-0.14-channel-failure.patch 700 +RMD160 1393b9e07a8760fb75c95c37604044b4181acc2e files/libssh2-0.14-channel-failure.patch 700 +SHA256 121d8a0385d36f8a4c01d746719d1745a04cafb8a3a6e47c637d1395e89c1617 files/libssh2-0.14-channel-failure.patch 700 +AUX libssh2-0.14-configure.patch 545 RMD160 47f83facd1be7198145a535c1ae88c459408aa8f SHA1 f68fd70d04a6522a4fb8b294d67b243f329f0962 SHA256 af8d0c9afdeb20501f6062dbedaa044a7eff42ef23ffe18d71d9fc2abff341db +MD5 6218c61615c2fd494c519a7b4dd73da0 files/libssh2-0.14-configure.patch 545 +RMD160 47f83facd1be7198145a535c1ae88c459408aa8f files/libssh2-0.14-configure.patch 545 +SHA256 af8d0c9afdeb20501f6062dbedaa044a7eff42ef23ffe18d71d9fc2abff341db files/libssh2-0.14-configure.patch 545 +AUX libssh2-0.14-peer-shutdown.patch 1191 RMD160 086e212748aedcb002c5e120e7a55e2fa796310a SHA1 765dff3df921bf26528a2818251f030fcd631a92 SHA256 d902d7777621e34d454ec8a109358427536890298256308e5f38cf96e251ff52 +MD5 31b32dafdb60efbedba5276dae01ef18 files/libssh2-0.14-peer-shutdown.patch 1191 +RMD160 086e212748aedcb002c5e120e7a55e2fa796310a files/libssh2-0.14-peer-shutdown.patch 1191 +SHA256 d902d7777621e34d454ec8a109358427536890298256308e5f38cf96e251ff52 files/libssh2-0.14-peer-shutdown.patch 1191 +DIST libssh2-0.14.tar.gz 140033 RMD160 65efe90d2879ecc0eeb094aa1582196ef6847408 SHA1 6b0f80a6e307298af862ece5d19e423b99adc705 SHA256 5f18347bd3d45c5b79162b91221a764f18ed3c30f0a7cab8c03baa680131b653 +EBUILD libssh2-0.14.ebuild 681 RMD160 8ea06669e3158591bf0bcf1d0bce005f936efafc SHA1 0b61814ef1a4237500a7cbde41930faef5b3c5ae SHA256 67280f29480ebe67817ca6c125e34a9a4fb016999431160b1f82a7d54e8e393c +MD5 8f83e6776c123de37ad7ced0780654df libssh2-0.14.ebuild 681 +RMD160 8ea06669e3158591bf0bcf1d0bce005f936efafc libssh2-0.14.ebuild 681 +SHA256 67280f29480ebe67817ca6c125e34a9a4fb016999431160b1f82a7d54e8e393c libssh2-0.14.ebuild 681 +MD5 c8951a6fa1ca4566ff9c90fd255852f1 files/digest-libssh2-0.14 238 +RMD160 dddd50f456ee3994fe6d9a3a2ff53d41ac2a1003 files/digest-libssh2-0.14 238 +SHA256 120ecefa51c9a10354b6bb424d14b5d0bbe37110f6506ff8316cce171461660b files/digest-libssh2-0.14 238 diff --git a/net-libs/libssh2/files/digest-libssh2-0.14 b/net-libs/libssh2/files/digest-libssh2-0.14 new file mode 100644 index 000000000..05d6c9d9d --- /dev/null +++ b/net-libs/libssh2/files/digest-libssh2-0.14 @@ -0,0 +1,3 @@ +MD5 7a44b7b38295d80bd8f80254ee135930 libssh2-0.14.tar.gz 140033 +RMD160 65efe90d2879ecc0eeb094aa1582196ef6847408 libssh2-0.14.tar.gz 140033 +SHA256 5f18347bd3d45c5b79162b91221a764f18ed3c30f0a7cab8c03baa680131b653 libssh2-0.14.tar.gz 140033 diff --git a/net-libs/libssh2/files/libssh2-0.14-banner-wait.patch b/net-libs/libssh2/files/libssh2-0.14-banner-wait.patch new file mode 100644 index 000000000..6b9b8edef --- /dev/null +++ b/net-libs/libssh2/files/libssh2-0.14-banner-wait.patch @@ -0,0 +1,23 @@ +diff -urb libssh2-0.11/src/session.c libssh2-0.11-jmk/src/session.c +--- libssh2-0.11/src/session.c 2005-06-27 17:24:29.000000000 -0500 ++++ libssh2-0.11-jmk/src/session.c 2005-11-10 20:27:34.000000000 -0600 +@@ -95,12 +95,19 @@ + { + char banner[256]; + int banner_len = 0; ++ int wait_count = 0; + + while ((banner_len < sizeof(banner)) && + ((banner_len == 0) || (banner[banner_len-1] != '\n'))) { + char c = '\0'; + int ret; + ++ wait_count++; ++ ++ /* If server is not responding, don't wait in loop forever */ ++ if (wait_count > 1000) ++ return 1; ++ + ret = recv(session->socket_fd, &c, 1, LIBSSH2_SOCKET_RECV_FLAGS(session)); + + if ((ret < 0) && (ret != EAGAIN)) { diff --git a/net-libs/libssh2/files/libssh2-0.14-channel-failure.patch b/net-libs/libssh2/files/libssh2-0.14-channel-failure.patch new file mode 100644 index 000000000..9833635a3 --- /dev/null +++ b/net-libs/libssh2/files/libssh2-0.14-channel-failure.patch @@ -0,0 +1,24 @@ +--- libssh2-0.12/src/packet.c 2006-01-30 18:27:07.000000000 +0100 ++++ libssh2-0.12-ced/src/packet.c 2006-01-30 17:56:18.000000000 +0100 +@@ -515,6 +515,21 @@ + LIBSSH2_FREE(session, data); + return 0; + } ++ { ++ unsigned char packet[1]; ++ ++ *packet = SSH_MSG_CHANNEL_FAILURE; ++ ++ if (libssh2_packet_write(session, packet, 1)) { ++ libssh2_error(session, LIBSSH2_ERROR_SOCKET_SEND, "Unable to send channel failure", 0); ++ } ++ ++#ifdef LIBSSH2_DEBUG_CONNECTION ++ _libssh2_debug(session, LIBSSH2_DBG_CONN, "Channel request failure"); ++#endif ++ LIBSSH2_FREE(session, data); ++ return 0; ++ } + } + break; + case SSH_MSG_CHANNEL_CLOSE: diff --git a/net-libs/libssh2/files/libssh2-0.14-configure.patch b/net-libs/libssh2/files/libssh2-0.14-configure.patch new file mode 100644 index 000000000..69352d57f --- /dev/null +++ b/net-libs/libssh2/files/libssh2-0.14-configure.patch @@ -0,0 +1,12 @@ +diff -ur libssh2-0.14~/configure libssh2-0.14/configure +--- libssh2-0.14~/configure 2006-06-30 10:18:14.000000000 +0200 ++++ libssh2-0.14/configure 2006-06-30 10:20:16.000000000 +0200 +@@ -3739,7 +3739,7 @@ + found_openssl=yes + pkgcfg_openssl=yes + OPENSSL_LIBLINE=`$PKG_CONFIG --libs openssl` +- OPENSSL_INCLINE=`$PKG_CONFIG --variable=includedir openssl` ++ OPENSSL_INCLINE="-I`$PKG_CONFIG --variable=includedir openssl`" + echo "$as_me:$LINENO: result: Using paths from pkg-config" >&5 + echo "${ECHO_T}Using paths from pkg-config" >&6 + fi diff --git a/net-libs/libssh2/files/libssh2-0.14-peer-shutdown.patch b/net-libs/libssh2/files/libssh2-0.14-peer-shutdown.patch new file mode 100644 index 000000000..213729bc5 --- /dev/null +++ b/net-libs/libssh2/files/libssh2-0.14-peer-shutdown.patch @@ -0,0 +1,44 @@ +--- libssh2-0.12/src/packet.c 2006-01-30 18:27:07.000000000 +0100 ++++ libssh2-0.12-ced/src/packet.c 2006-02-01 15:50:36.000000000 +0100 +@@ -744,10 +744,36 @@ + if (should_block) { + read_len = libssh2_blocking_read(session, block, blocksize); + } else { ++#ifdef HAVE_SELECT ++ fd_set read_socket; ++ struct timeval timeout; ++ int retval; ++ ++ FD_ZERO(&read_socket); ++ FD_SET(session->socket_fd, &read_socket); ++ ++ timeout.tv_sec = 0; ++ timeout.tv_usec = 0; ++ ++ retval = select(session->socket_fd + 1, &read_socket, NULL, NULL, &timeout); ++ ++ if (retval <= 0) ++ return 0; ++#endif + read_len = recv(session->socket_fd, block, 1, LIBSSH2_SOCKET_RECV_FLAGS(session)); ++#ifdef HAVE_SELECT ++ /*The return value will be 0 when the peer has performed an orderly shutdown */ ++ if (read_len == 0) { ++ session->socket_state = LIBSSH2_SOCKET_DISCONNECTED; ++ return 0; ++ } ++ else if (read_len < 0) ++ return -1; ++#else + if (read_len <= 0) { + return 0; + } ++#endif + read_len += libssh2_blocking_read(session, block + read_len, blocksize - read_len); + } + if (read_len < blocksize) { +@@ -1176,3 +1202,4 @@ + } + } + /* }}} */ ++ diff --git a/net-libs/libssh2/libssh2-0.14.ebuild b/net-libs/libssh2/libssh2-0.14.ebuild new file mode 100644 index 000000000..ccf3219b6 --- /dev/null +++ b/net-libs/libssh2/libssh2-0.14.ebuild @@ -0,0 +1,31 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit eutils + +DESCRIPTION="Library implementing the SSH2 protocol." +HOMEPAGE="http://www.libssh2.org" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~x86" +IUSE="" +DEPEND="dev-libs/openssl sys-libs/zlib" + +src_unpack() { + unpack ${A} + cd ${S} + + epatch "${FILESDIR}/${P}-configure.patch" + epatch "${FILESDIR}/${P}-banner-wait.patch" + epatch "${FILESDIR}/${P}-channel-failure.patch" + epatch "${FILESDIR}/${P}-peer-shutdown.patch" +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + + dodoc README +} -- cgit v1.2.3-65-gdbad