public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Evans" <grknight@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-ssh2/, dev-php/pecl-ssh2/files/
Date: Wed,  5 Jul 2017 02:28:59 +0000 (UTC)	[thread overview]
Message-ID: <1499221656.e8e572057cf5e76ae91507d103caf29096eedf52.grknight@gentoo> (raw)

commit:     e8e572057cf5e76ae91507d103caf29096eedf52
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  5 02:27:36 2017 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Wed Jul  5 02:27:36 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8e57205

dev-php/pecl-ssh2: Revbump to include upstream patch for 5.6; wrt bug 603290

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 dev-php/pecl-ssh2/files/0.13-parse_url-fix.patch | 49 ++++++++++++++++++++++++
 dev-php/pecl-ssh2/pecl-ssh2-0.13-r3.ebuild       | 31 +++++++++++++++
 2 files changed, 80 insertions(+)

diff --git a/dev-php/pecl-ssh2/files/0.13-parse_url-fix.patch b/dev-php/pecl-ssh2/files/0.13-parse_url-fix.patch
new file mode 100644
index 00000000000..c9c052fd32d
--- /dev/null
+++ b/dev-php/pecl-ssh2/files/0.13-parse_url-fix.patch
@@ -0,0 +1,49 @@
+From 093906ec1c065e86ad1cd4dabbc89b1ccae11938 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Thu, 10 Nov 2016 09:16:02 +0100
+Subject: [PATCH] fix for PHP 7.0.13 where php_url_parse fails
+
+---
+ ssh2_fopen_wrappers.c | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/ssh2_fopen_wrappers.c b/ssh2_fopen_wrappers.c
+index 8472ddd..89b34eb 100644
+--- a/ssh2_fopen_wrappers.c
++++ b/ssh2_fopen_wrappers.c
+@@ -198,10 +198,20 @@ php_url *php_ssh2_fopen_wraper_parse_path(	char *path, char *type, php_stream_co
+ 	php_url *resource;
+ 	zval *methods = NULL, *callbacks = NULL, zsession, **tmpzval;
+ 	long resource_id;
+-	char *s, *username = NULL, *password = NULL, *pubkey_file = NULL, *privkey_file = NULL;
++	char *h, *s, *username = NULL, *password = NULL, *pubkey_file = NULL, *privkey_file = NULL;
+ 	int username_len = 0, password_len = 0;
+ 
+-	resource = php_url_parse(path);
++	h = strstr(path, "Resource id #");
++	if (h) {
++		/* Starting with 5.6.28, 7.0.13 need to be clean, else php_url_parse will fail */
++		char *tmp = estrdup(path);
++
++		strncpy(tmp + (h-path), h + sizeof("Resource id #")-1, strlen(tmp)-sizeof("Resource id #"));
++		resource = php_url_parse(tmp);
++		efree(tmp);
++	} else {
++		resource = php_url_parse(path);
++	}
+ 	if (!resource || !resource->path) {
+ 		return NULL;
+ 	}
+@@ -232,9 +242,6 @@ php_url *php_ssh2_fopen_wraper_parse_path(	char *path, char *type, php_stream_co
+ 
+ 	/* Look for a resource ID to reuse a session */
+ 	s = resource->host;
+-	if (strncmp(resource->host, "Resource id #", sizeof("Resource id #") - 1) == 0) {
+-		s = resource->host + sizeof("Resource id #") - 1;
+-	}
+ 	if (is_numeric_string(s, strlen(s), &resource_id, NULL, 0) == IS_LONG) {
+ 		php_ssh2_sftp_data *sftp_data;
+ 
+-- 
+2.1.4
+

diff --git a/dev-php/pecl-ssh2/pecl-ssh2-0.13-r3.ebuild b/dev-php/pecl-ssh2/pecl-ssh2-0.13-r3.ebuild
new file mode 100644
index 00000000000..ad10daaf227
--- /dev/null
+++ b/dev-php/pecl-ssh2/pecl-ssh2-0.13-r3.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PHP_EXT_NAME="ssh2"
+
+USE_PHP="php5-6 php7-0 php7-1"
+
+inherit php-ext-pecl-r3
+
+USE_PHP="php5-6"
+
+DESCRIPTION="PHP bindings for the libssh2 library"
+LICENSE="PHP-3.01"
+SLOT="0"
+IUSE=""
+KEYWORDS="~amd64 ~x86"
+DEPEND="net-libs/libssh2"
+RDEPEND="${DEPEND}"
+PDEPEND="php_targets_php7-0? ( dev-php/pecl-ssh2:7 )
+	php_targets_php7-1? ( dev-php/pecl-ssh2:7 )"
+
+src_prepare(){
+	if use php_targets_php5-6 ; then
+		local PATCHES=( "${FILESDIR}/0.13-parse_url-fix.patch" )
+		php-ext-source-r3_src_prepare
+	else
+		default_src_prepare
+	fi
+}


             reply	other threads:[~2017-07-05  2:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05  2:28 Brian Evans [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-06-07 14:14 [gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-ssh2/, dev-php/pecl-ssh2/files/ Thomas Deutschmann
2021-09-23 14:44 Brian Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499221656.e8e572057cf5e76ae91507d103caf29096eedf52.grknight@gentoo \
    --to=grknight@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox