diff options
author | Lars Wendler <polynomial-c@gentoo.org> | 2014-01-09 07:56:12 +0000 |
---|---|---|
committer | Lars Wendler <polynomial-c@gentoo.org> | 2014-01-09 07:56:12 +0000 |
commit | 9081758aff0332962595d845b66a247e1b77a506 (patch) | |
tree | 16ee9b8c8918bb19cd68d37be4b4644e307aa13a /net-libs/libssh | |
parent | Fix homepage (diff) | |
download | gentoo-2-9081758aff0332962595d845b66a247e1b77a506.tar.gz gentoo-2-9081758aff0332962595d845b66a247e1b77a506.tar.bz2 gentoo-2-9081758aff0332962595d845b66a247e1b77a506.zip |
Reintroduced gcrypt USE flag. Added kerberos USE flag to control gssapi feature. Removed old
(Portage version: 2.2.8/cvs/Linux x86_64, signed Manifest commit with key 0x981CA6FC)
Diffstat (limited to 'net-libs/libssh')
-rw-r--r-- | net-libs/libssh/ChangeLog | 11 | ||||
-rw-r--r-- | net-libs/libssh/files/libssh-0.6.0-libgcrypt-1.6.0.patch | 80 | ||||
-rw-r--r-- | net-libs/libssh/files/libssh-0.6.0_rc3-memleak_fix.patch | 20 | ||||
-rw-r--r-- | net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch | 37 | ||||
-rw-r--r-- | net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-2.patch | 94 | ||||
-rw-r--r-- | net-libs/libssh/libssh-0.6.0.ebuild | 12 | ||||
-rw-r--r-- | net-libs/libssh/libssh-0.6.0_rc3-r1.ebuild | 83 | ||||
-rw-r--r-- | net-libs/libssh/metadata.xml | 2 |
8 files changed, 100 insertions, 239 deletions
diff --git a/net-libs/libssh/ChangeLog b/net-libs/libssh/ChangeLog index ebfc3cb39e3d..bb35f034add9 100644 --- a/net-libs/libssh/ChangeLog +++ b/net-libs/libssh/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for net-libs/libssh # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libssh/ChangeLog,v 1.96 2014/01/08 12:29:58 polynomial-c Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libssh/ChangeLog,v 1.97 2014/01/09 07:56:12 polynomial-c Exp $ + + 09 Jan 2014; Lars Wendler <polynomial-c@gentoo.org> + -libssh-0.6.0_rc3-r1.ebuild, libssh-0.6.0.ebuild, + +files/libssh-0.6.0-libgcrypt-1.6.0.patch, + -files/libssh-0.6.0_rc3-memleak_fix.patch, + -files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch, + -files/libssh-0.6.0_rc3-x2goclient_crash_fix-2.patch, metadata.xml: + Reintroduced gcrypt USE flag. Added kerberos USE flag to control gssapi + feature. Removed old. *libssh-0.6.0 (08 Jan 2014) diff --git a/net-libs/libssh/files/libssh-0.6.0-libgcrypt-1.6.0.patch b/net-libs/libssh/files/libssh-0.6.0-libgcrypt-1.6.0.patch new file mode 100644 index 000000000000..cfa11c18dc79 --- /dev/null +++ b/net-libs/libssh/files/libssh-0.6.0-libgcrypt-1.6.0.patch @@ -0,0 +1,80 @@ +From 57ef959aa3e785658d68c91a7e7ba78cc5dc75f6 Mon Sep 17 00:00:00 2001 +From: Aris Adamantiadis <aris@0xbadc0de.be> +Date: Wed, 08 Jan 2014 15:58:49 +0000 +Subject: threads: support libgcrypt 1.6 hack + +Not 100% satisfied of this patch, but the way libgcrypt handles +threading in 1.6 is not compatible with custom handlers. The +new code basicaly uses pthreads in every case. This will probably +not work on windows. +--- +diff --git a/doc/threading.dox b/doc/threading.dox +index a11c82f..95eee6b 100644 +--- a/doc/threading.dox ++++ b/doc/threading.dox +@@ -61,5 +61,6 @@ implement the following methods : + - mutex_destroy + - thread_id + ++libgcrypt 1.6 and bigger backend does not support custom callback. Using anything else than pthreads (ssh_threads_get_pthread()) here will fail. + Good luck ! + */ +diff --git a/include/libssh/callbacks.h b/include/libssh/callbacks.h +index a841f2e..9aa8bab 100644 +--- a/include/libssh/callbacks.h ++++ b/include/libssh/callbacks.h +@@ -801,6 +801,8 @@ struct ssh_threads_callbacks_struct { + * + * @see ssh_threads_callbacks_struct + * @see SSH_THREADS_PTHREAD ++ * @bug libgcrypt 1.6 and bigger backend does not support custom callback. ++ * Using anything else than pthreads here will fail. + */ + LIBSSH_API int ssh_threads_set_callbacks(struct ssh_threads_callbacks_struct + *cb); +diff --git a/src/threads.c b/src/threads.c +index 107c65d..7f3a304 100644 +--- a/src/threads.c ++++ b/src/threads.c +@@ -59,8 +59,28 @@ struct ssh_threads_callbacks_struct *ssh_threads_get_noop(void) { + static struct ssh_threads_callbacks_struct *user_callbacks =&ssh_threads_noop; + + #ifdef HAVE_LIBGCRYPT ++#if (GCRYPT_VERSION_NUMBER >= 0x010600) ++/* libgcrypt >= 1.6 does not support custom callbacks */ ++GCRY_THREAD_OPTION_PTHREAD_IMPL; + +-/* Libgcrypt specific way of handling thread callbacks */ ++static int libgcrypt_thread_init(void){ ++ if(user_callbacks == NULL) ++ return SSH_ERROR; ++ if(user_callbacks == &ssh_threads_noop) ++ return SSH_OK; ++ if (strcmp(user_callbacks->type, "threads_pthread") == 0){ ++ gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); ++ return SSH_OK; ++ } else { ++ /* not supported */ ++ SSH_LOG(SSH_LOG_WARN, "Custom thread handlers not supported with libgcrypt >=1.6, using pthreads"); ++ gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); ++ return SSH_OK; ++ } ++} ++ ++#else ++/* Libgcrypt < 1.6 specific way of handling thread callbacks */ + + static struct gcry_thread_cbs gcrypt_threads_callbacks; + +@@ -79,7 +99,8 @@ static int libgcrypt_thread_init(void){ + gcry_control(GCRYCTL_SET_THREAD_CBS, &gcrypt_threads_callbacks); + return SSH_OK; + } +-#else ++#endif /* GCRYPT_VERSION_NUMBER */ ++#else /* HAVE_LIBGCRYPT */ + + /* Libcrypto specific stuff */ + +-- +cgit v0.9.1 diff --git a/net-libs/libssh/files/libssh-0.6.0_rc3-memleak_fix.patch b/net-libs/libssh/files/libssh-0.6.0_rc3-memleak_fix.patch deleted file mode 100644 index 46ce6925134d..000000000000 --- a/net-libs/libssh/files/libssh-0.6.0_rc3-memleak_fix.patch +++ /dev/null @@ -1,20 +0,0 @@ -From f3e37000632cb380516bdb9d26fba4dc4e41d6f7 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider <asn@cryptomilk.org> -Date: Sun, 05 Jan 2014 22:05:13 +0000 -Subject: session: Fix a possible memory leak. - ---- -diff --git a/src/session.c b/src/session.c -index 171779c..3a607d0 100644 ---- a/src/session.c -+++ b/src/session.c -@@ -255,6 +255,7 @@ void ssh_free(ssh_session session) { - ssh_list_free(session->opts.identity); - } - -+ SAFE_FREE(session->auth_auto_state); - SAFE_FREE(session->serverbanner); - SAFE_FREE(session->clientbanner); - SAFE_FREE(session->banner); --- -cgit v0.9.1 diff --git a/net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch b/net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch deleted file mode 100644 index 8b4c7aeab589..000000000000 --- a/net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 8f162e3b13aa85aaa1257b775e1dc5d103f45570 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider <asn@cryptomilk.org> -Date: Sun, 22 Dec 2013 21:08:45 +0000 -Subject: poll: Correctly free ssh_event_fd_wrapper. - -This is allocated by ssh_event_add_fd. ---- -(limited to 'src/poll.c') - -diff --git a/src/poll.c b/src/poll.c -index 2fce52a..4d92e3f 100644 ---- a/src/poll.c -+++ b/src/poll.c -@@ -852,12 +852,18 @@ int ssh_event_remove_fd(ssh_event event, socket_t fd) { - for (i = 0; i < used; i++) { - if(fd == event->ctx->pollfds[i].fd) { - ssh_poll_handle p = event->ctx->pollptrs[i]; -- struct ssh_event_fd_wrapper *pw = p->cb_data; -+ if (p->cb == ssh_event_fd_wrapper_callback) { -+ struct ssh_event_fd_wrapper *pw = p->cb_data; -+ SAFE_FREE(pw); -+ } - -- ssh_poll_ctx_remove(event->ctx, p); -- free(pw); -+ /* -+ * The free function calls ssh_poll_ctx_remove() and decrements -+ * event->ctx->polls_used. -+ */ - ssh_poll_free(p); - rc = SSH_OK; -+ - /* restart the loop */ - used = event->ctx->polls_used; - i = 0; --- -cgit v0.9.1 diff --git a/net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-2.patch b/net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-2.patch deleted file mode 100644 index b38955eff7d5..000000000000 --- a/net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-2.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 41fe03e0d61b14bc41ad658cf2d582802237323a Mon Sep 17 00:00:00 2001 -From: Aris Adamantiadis <aris@0xbadc0de.be> -Date: Sun, 05 Jan 2014 21:33:45 +0000 -Subject: poll: fix poll_handles ownerships - ---- -diff --git a/src/poll.c b/src/poll.c -index 4d92e3f..f79e165 100644 ---- a/src/poll.c -+++ b/src/poll.c -@@ -64,6 +64,7 @@ - - struct ssh_poll_handle_struct { - ssh_poll_ctx ctx; -+ ssh_session session; - union { - socket_t fd; - size_t idx; -@@ -790,6 +791,10 @@ int ssh_event_add_session(ssh_event event, ssh_session session) { - p = session->default_poll_ctx->pollptrs[i]; - ssh_poll_ctx_remove(session->default_poll_ctx, p); - ssh_poll_ctx_add(event->ctx, p); -+ /* associate the pollhandler with a session so we can put it back -+ * at ssh_event_free() -+ */ -+ p->session = session; - } - #ifdef WITH_SERVER - iterator = ssh_list_get_iterator(event->sessions); -@@ -852,6 +857,10 @@ int ssh_event_remove_fd(ssh_event event, socket_t fd) { - for (i = 0; i < used; i++) { - if(fd == event->ctx->pollfds[i].fd) { - ssh_poll_handle p = event->ctx->pollptrs[i]; -+ if (p->session != NULL){ -+ /* we cannot free that handle, it's owned by its session */ -+ continue; -+ } - if (p->cb == ssh_event_fd_wrapper_callback) { - struct ssh_event_fd_wrapper *pw = p->cb_data; - SAFE_FREE(pw); -@@ -886,7 +895,6 @@ int ssh_event_remove_session(ssh_event event, ssh_session session) { - ssh_poll_handle p; - register size_t i, used; - int rc = SSH_ERROR; -- socket_t session_fd; - #ifdef WITH_SERVER - struct ssh_iterator *iterator; - #endif -@@ -895,14 +903,15 @@ int ssh_event_remove_session(ssh_event event, ssh_session session) { - return SSH_ERROR; - } - -- session_fd = ssh_get_fd(session); - used = event->ctx->polls_used; - for(i = 0; i < used; i++) { -- if(session_fd == event->ctx->pollfds[i].fd) { -- p = event->ctx->pollptrs[i]; -+ p = event->ctx->pollptrs[i]; -+ if(p->session == session){ - ssh_poll_ctx_remove(event->ctx, p); -+ p->session = NULL; - ssh_poll_ctx_add(session->default_poll_ctx, p); - rc = SSH_OK; -+ used = 0; - } - } - #ifdef WITH_SERVER -@@ -929,10 +938,23 @@ int ssh_event_remove_session(ssh_event event, ssh_session session) { - * - */ - void ssh_event_free(ssh_event event) { -- if(event == NULL) { -+ int used, i; -+ ssh_poll_handle p; -+ if(event == NULL) { - return; - } - if(event->ctx != NULL) { -+ used = event->ctx->polls_used; -+ for(i = 0; i < used; i++) { -+ p = event->ctx->pollptrs[i]; -+ if(p->session != NULL){ -+ ssh_poll_ctx_remove(event->ctx, p); -+ ssh_poll_ctx_add(p->session->default_poll_ctx, p); -+ p->session = NULL; -+ used = 0; -+ } -+ } -+ - ssh_poll_ctx_free(event->ctx); - } - #ifdef WITH_SERVER --- -cgit v0.9.1 diff --git a/net-libs/libssh/libssh-0.6.0.ebuild b/net-libs/libssh/libssh-0.6.0.ebuild index 377ba76a9cd7..97545d3a6be9 100644 --- a/net-libs/libssh/libssh-0.6.0.ebuild +++ b/net-libs/libssh/libssh-0.6.0.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libssh/libssh-0.6.0.ebuild,v 1.1 2014/01/08 12:29:58 polynomial-c Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libssh/libssh-0.6.0.ebuild,v 1.2 2014/01/09 07:56:12 polynomial-c Exp $ EAPI=5 @@ -14,12 +14,14 @@ SRC_URI="https://red.libssh.org/attachments/download/71/${MY_P}.tar.xz -> ${P}.t LICENSE="LGPL-2.1" KEYWORDS="~amd64 ~arm ~hppa ~x86 ~amd64-linux ~x86-linux" SLOT="0/4" # subslot = soname major version -IUSE="debug doc examples pcap +sftp ssh1 server static-libs test zlib" +IUSE="debug doc examples gcrypt kerberos pcap +sftp ssh1 server static-libs test zlib" # Maintainer: check IUSE-defaults at DefineOptions.cmake RDEPEND=" zlib? ( >=sys-libs/zlib-1.2 ) - >=dev-libs/openssl-0.9.8 + !gcrypt? ( >=dev-libs/openssl-0.9.8 ) + gcrypt? ( >=dev-libs/libgcrypt-1.5 ) + kerberos? ( virtual/krb5 ) " DEPEND="${RDEPEND} doc? ( app-doc/doxygen ) @@ -32,6 +34,7 @@ S=${WORKDIR}/${MY_P} PATCHES=( "${FILESDIR}/${PN}-0.5.0-tests.patch" + "${FILESDIR}/${PN}-0.6.0-libgcrypt-1.6.0.patch" ) src_prepare() { @@ -47,6 +50,8 @@ src_configure() { local mycmakeargs=( $(cmake-utils_use_with debug DEBUG_CALLTRACE) $(cmake-utils_use_with debug DEBUG_CRYPTO) + $(cmake-utils_use_with gcrypt) + $(cmake-utils_use_with kerberos gssapi) $(cmake-utils_use_with pcap) $(cmake-utils_use_with server) $(cmake-utils_use_with sftp) @@ -55,7 +60,6 @@ src_configure() { $(cmake-utils_use_with test STATIC_LIB) $(cmake-utils_use_with test TESTING) $(cmake-utils_use_with zlib) - -DWITH_GCRYPT=OFF ) cmake-utils_src_configure diff --git a/net-libs/libssh/libssh-0.6.0_rc3-r1.ebuild b/net-libs/libssh/libssh-0.6.0_rc3-r1.ebuild deleted file mode 100644 index a7a300a171bc..000000000000 --- a/net-libs/libssh/libssh-0.6.0_rc3-r1.ebuild +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libssh/libssh-0.6.0_rc3-r1.ebuild,v 1.1 2014/01/06 13:35:00 polynomial-c Exp $ - -EAPI=5 - -MY_P=${PN}-${PV/_rc/rc} -inherit eutils cmake-utils multilib - -DESCRIPTION="Access a working SSH implementation by means of a library" -HOMEPAGE="http://www.libssh.org/" -SRC_URI="https://red.libssh.org/attachments/download/68/${MY_P}.tar.gz -> ${P}.tar.gz" - -LICENSE="LGPL-2.1" -KEYWORDS="~amd64 ~arm ~hppa ~x86 ~amd64-linux ~x86-linux" -SLOT="0/4" # subslot = soname major version -IUSE="debug doc examples pcap +sftp ssh1 server static-libs test zlib" -# Maintainer: check IUSE-defaults at DefineOptions.cmake - -RDEPEND=" - zlib? ( >=sys-libs/zlib-1.2 ) - >=dev-libs/openssl-0.9.8 -" -DEPEND="${RDEPEND} - doc? ( app-doc/doxygen ) - test? ( dev-util/cmocka ) -" - -DOCS=( AUTHORS README ChangeLog ) - -S=${WORKDIR}/${MY_P} - -PATCHES=( - "${FILESDIR}/${PN}-0.5.0-tests.patch" - "${FILESDIR}/${P}-x2goclient_crash_fix-1.patch" - "${FILESDIR}/${P}-x2goclient_crash_fix-2.patch" - "${FILESDIR}/${P}-memleak_fix.patch" -) - -src_prepare() { - # just install the examples do not compile them - sed -i \ - -e '/add_subdirectory(examples)/s/^/#DONOTWANT/' \ - CMakeLists.txt || die - - cmake-utils_src_prepare -} - -src_configure() { - local mycmakeargs=( - $(cmake-utils_use_with debug DEBUG_CALLTRACE) - $(cmake-utils_use_with debug DEBUG_CRYPTO) - $(cmake-utils_use_with pcap) - $(cmake-utils_use_with server) - $(cmake-utils_use_with sftp) - $(cmake-utils_use_with ssh1) - $(cmake-utils_use_with static-libs STATIC_LIB) - $(cmake-utils_use_with test STATIC_LIB) - $(cmake-utils_use_with test TESTING) - $(cmake-utils_use_with zlib) - -DWITH_GCRYPT=OFF - ) - - cmake-utils_src_configure -} - -src_compile() { - cmake-utils_src_compile - use doc && cmake-utils_src_compile doc -} - -src_install() { - cmake-utils_src_install - - use doc && dohtml -r "${CMAKE_BUILD_DIR}"/doc/html/* - - use static-libs || rm -f "${D}"/usr/$(get_libdir)/libssh{,_threads}.a - - if use examples; then - docinto examples - dodoc examples/*.{c,h,cpp} - fi -} diff --git a/net-libs/libssh/metadata.xml b/net-libs/libssh/metadata.xml index 1b2d5d48a323..c2c255c6361d 100644 --- a/net-libs/libssh/metadata.xml +++ b/net-libs/libssh/metadata.xml @@ -5,6 +5,8 @@ <herd>kde</herd> <longdescription>access a working SSH implementation by means of a library</longdescription> <use> + <flag name='gcrypt'>Prefer <pkg>dev-libs/libgcrypt</pkg> over + <pkg>dev-libs/openssl</pkg> for encryption</flag> <flag name='pcap'>Build with PCAP output support</flag> <flag name='sftp'>Build with SFTP support</flag> <flag name='ssh1'>Build with SSH1 support</flag> |