[gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-ssh2/, dev-php/pecl-ssh2/files/
commit: 41c7e35cc617c5b79089ab4af123f2b5bac1f1b2 Author: Brian Evans gentoo org> AuthorDate: Thu Sep 23 14:41:24 2021 + Commit: Brian Evans gentoo org> CommitDate: Thu Sep 23 14:41:24 2021 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41c7e35c dev-php/pecl-ssh2: Drop old Signed-off-by: Brian Evans gentoo.org> dev-php/pecl-ssh2/Manifest | 3 - ...1.1.2-fix-php_url-fields-usage-for-php7-3.patch | 302 - dev-php/pecl-ssh2/pecl-ssh2-1.1.2.ebuild | 36 --- dev-php/pecl-ssh2/pecl-ssh2-1.2.ebuild | 33 --- 4 files changed, 374 deletions(-) diff --git a/dev-php/pecl-ssh2/Manifest b/dev-php/pecl-ssh2/Manifest index 4a420e281de..0d800ebf183 100644 --- a/dev-php/pecl-ssh2/Manifest +++ b/dev-php/pecl-ssh2/Manifest @@ -1,4 +1 @@ -DIST pecl-ssh2-1.1.2-fix-php7-port.patch 27860 BLAKE2B 23054187608bdcf79f53ce638e37c646f44297aa7d1e8f7a7c85fd922977ab835b915d541fbae327a30d2e863b503ed4822a82c1b242346290ceb94d49c97020 SHA512 1c2ecc990323a77fb2b69be0d6649f96dd7ad2d06c62f4fcb79a9ef4f89e066d463301668a044d37d717c99837c5d7d3f621f61119543445bd05c3229d9270e9 -DIST pecl-ssh2-1.2.tar.gz 32447 BLAKE2B 3a9d0f205097a381d07fb9dd5ab4dcb8e361f555dbc633abb8fa895c83024b70e85cd87602da1ceeb1018a7b07c474720b02810ef0689e9294fc33b129b6c738 SHA512 7b7d311cd5f88835e124d70a0295468f75d0fa6936a58808c936d1a185bb630b9e02c21f49b4bd777194a7b104aa3ff85c4fbf480f43d5906787e532ba2d3e04 -DIST ssh2-1.1.2.tgz 32057 BLAKE2B 88ffb3fb608687a086bbe345677982e944210791acc100312ba56ac7c35188a52cde5529d78caf473d19710e9965fba853ea9ff046715413a0b488ae2d8b690c SHA512 36793191448745b8a9b3cc628fe9fb431480792c7a2ff0bf2eccd58cda1cf944933be1d301c455d4a6f3dabf7e04ffef248bc402a8ff99bfafcba0deddb25c36 DIST ssh2-1.3.1.tgz 33838 BLAKE2B 05976ad143563fd9d51be3f8e23b5b22099e351d6f252b612aa1dcb56648dc337b623d2cddf7b9079f3e07c879ca69215a1987cd6f4326f97ba134e13c6d28e7 SHA512 c74d4f699853148b53cdca0eaf8837bfdbdd21d185761606acadf2442e84dbefdb00cde207e0ce4794ae1e4f8692a38ed903b6d11fdc57bca7b54a4250da9a76 diff --git a/dev-php/pecl-ssh2/files/pecl-ssh2-1.1.2-fix-php_url-fields-usage-for-php7-3.patch b/dev-php/pecl-ssh2/files/pecl-ssh2-1.1.2-fix-php_url-fields-usage-for-php7-3.patch deleted file mode 100644 index 1f135256422..000 --- a/dev-php/pecl-ssh2/files/pecl-ssh2-1.1.2-fix-php_url-fields-usage-for-php7-3.patch +++ /dev/null @@ -1,302 +0,0 @@ -From a8835aab2c15e794fce13bd927295719e384ad2d Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Thu, 28 Jun 2018 07:10:35 +0200 -Subject: [PATCH] fix php_url fields usage for PHP 7.3 - - php_ssh2.h| 8 - ssh2_fopen_wrappers.c | 55 --- - ssh2_sftp.c | 20 +-- - 3 files changed, 53 insertions(+), 30 deletions(-) - -diff --git a/php_ssh2.h b/php_ssh2.h -index 734b795..d010ff9 100644 a/php_ssh2.h -+++ b/php_ssh2.h -@@ -166,6 +166,14 @@ extern php_stream_wrapper php_ssh2_sftp_wrapper; - extern int le_ssh2_session; - extern int le_ssh2_sftp; - -+#if PHP_VERSION_ID < 70300 -+#define SSH2_URL_STR(a) (a) -+#define SSH2_URL_LEN(a) strlen(a) -+#else -+#define SSH2_URL_STR(a) ZSTR_VAL(a) -+#define SSH2_URL_LEN(a) ZSTR_LEN(a) -+#endif -+ - #endif/* PHP_SSH2_H */ - - /* -diff --git a/ssh2_fopen_wrappers.c b/ssh2_fopen_wrappers.c -index 2f96ca4..f2f3475 100644 a/ssh2_fopen_wrappers.c -+++ b/ssh2_fopen_wrappers.c -@@ -215,7 +215,7 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre - php_url *resource; - zval *methods = NULL, *callbacks = NULL, zsession, *tmpzval; - zend_long resource_id; -- char *h, *s, *username = NULL, *password = NULL, *pubkey_file = NULL, *privkey_file = NULL; -+ char *h, *username = NULL, *password = NULL, *pubkey_file = NULL, *privkey_file = NULL; - int username_len = 0, password_len = 0; - - h = strstr(path, "Resource id #"); -@@ -233,13 +233,13 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre - return NULL; - } - -- if (strncmp(resource->scheme, "ssh2.", sizeof("ssh2.") - 1)) { -+ if (strncmp(SSH2_URL_STR(resource->scheme), "ssh2.", sizeof("ssh2.") - 1)) { - /* Not an ssh wrapper */ - php_url_free(resource); - return NULL; - } - -- if (strcmp(resource->scheme + sizeof("ssh2.") - 1, type)) { -+ if (strcmp(SSH2_URL_STR(resource->scheme) + sizeof("ssh2.") - 1, type)) { - /* Wrong ssh2. wrapper type */ - php_url_free(resource); - return NULL; -@@ -253,13 +253,27 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre - Find resource->path in the path string, then copy the entire string from the original path. - This includes ?query#fragment in the path string - */ -+// TODO
[gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-ssh2/, dev-php/pecl-ssh2/files/
commit: 99a7b03f4133a1c6f8d5b68fa244762a3c41737a Author: Thomas Deutschmann gentoo org> AuthorDate: Fri Jun 7 14:07:30 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Fri Jun 7 14:13:36 2019 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99a7b03f dev-php/pecl-ssh2: add PHP 7.3 support Package-Manager: Portage-2.3.67, Repoman-2.3.14 Signed-off-by: Thomas Deutschmann gentoo.org> .../files/pecl-ssh2-1.1.2-fix-php7-port.patch | 746 + ...1.1.2-fix-php_url-fields-usage-for-php7-3.patch | 302 + dev-php/pecl-ssh2/pecl-ssh2-1.1.2.ebuild | 15 +- dev-php/pecl-ssh2/pecl-ssh2-.ebuild| 10 +- 4 files changed, 1063 insertions(+), 10 deletions(-) diff --git a/dev-php/pecl-ssh2/files/pecl-ssh2-1.1.2-fix-php7-port.patch b/dev-php/pecl-ssh2/files/pecl-ssh2-1.1.2-fix-php7-port.patch new file mode 100644 index 000..9d4f9bd166e --- /dev/null +++ b/dev-php/pecl-ssh2/files/pecl-ssh2-1.1.2-fix-php7-port.patch @@ -0,0 +1,746 @@ +From 073067ba96ac99ed5696d27f13ca6c8124986e74 Mon Sep 17 00:00:00 2001 +From: Jan-E +Date: Thu, 28 Jun 2018 08:43:48 +0200 +Subject: [PATCH] @dstogov Fixed PHP7 port. Restored commented reference + counting. + +--- + php_ssh2.h| 14 +++--- + ssh2.c| 26 +- + ssh2_fopen_wrappers.c | 129 ++ + ssh2_sftp.c | 59 ++- + 4 files changed, 102 insertions(+), 126 deletions(-) + +diff --git a/php_ssh2.h b/php_ssh2.h +index d010ff9..2bbaa26 100644 +--- a/php_ssh2.h b/php_ssh2.h +@@ -73,14 +73,14 @@ typedef struct _php_ssh2_sftp_data { + LIBSSH2_SESSION *session; + LIBSSH2_SFTP *sftp; + +- int session_rsrcid; ++ zend_resource *session_rsrc; + } php_ssh2_sftp_data; + + typedef struct _php_ssh2_listener_data { + LIBSSH2_SESSION *session; + LIBSSH2_LISTENER *listener; + +- int session_rsrcid; ++ zend_resource *session_rsrc; + } php_ssh2_listener_data; + + #include "libssh2_publickey.h" +@@ -89,7 +89,7 @@ typedef struct _php_ssh2_pkey_subsys_data { + LIBSSH2_SESSION *session; + LIBSSH2_PUBLICKEY *pkey; + +- int session_rsrcid; ++ zend_resource *session_rsrc; + } php_ssh2_pkey_subsys_data; + + #define SSH2_FETCH_NONAUTHENTICATED_SESSION(session, zsession) \ +@@ -118,8 +118,8 @@ typedef struct _php_ssh2_channel_data { + char is_blocking; + long timeout; + +- /* Resource ID */ +- int session_rsrcid; ++ /* Resource */ ++ zend_resource *session_rsrc; + + /* Allow one stream to be closed while the other is kept open */ + unsigned char *refcount; +@@ -151,8 +151,8 @@ PHP_FUNCTION(ssh2_sftp_realpath); + LIBSSH2_SESSION *php_ssh2_session_connect(char *host, int port, zval *methods, zval *callbacks); + void php_ssh2_sftp_dtor(zend_resource *rsrc); + php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stream_context *context, +- LIBSSH2_SESSION **psession, int *presource_id, +- LIBSSH2_SFTP **psftp, int *psftp_rsrcid); ++ LIBSSH2_SESSION **psession, zend_resource **presource, ++ LIBSSH2_SFTP **psftp, zend_resource **psftp_rsrc); + + extern php_stream_ops php_ssh2_channel_stream_ops; + +diff --git a/ssh2.c b/ssh2.c +index e73867e..849766b 100644 +--- a/ssh2.c b/ssh2.c +@@ -772,9 +772,8 @@ PHP_FUNCTION(ssh2_forward_listen) + + data = emalloc(sizeof(php_ssh2_listener_data)); + data->session = session; +- data->session_rsrcid = Z_LVAL_P(zsession); +- //TODO Sean-Der +- //zend_list_addref(data->session_rsrcid); ++ data->session_rsrc = Z_RES_P(zsession); ++ Z_ADDREF_P(zsession); + data->listener = listener; + + RETURN_RES(zend_register_resource(data, le_ssh2_listener)); +@@ -810,7 +809,7 @@ PHP_FUNCTION(ssh2_forward_accept) + channel_data->channel = channel; + channel_data->streamid = 0; + channel_data->is_blocking = 0; +- channel_data->session_rsrcid = data->session_rsrcid; ++ channel_data->session_rsrc = data->session_rsrc; + channel_data->refcount = NULL; + + stream = php_stream_alloc(_ssh2_channel_stream_ops, channel_data, 0, "r+"); +@@ -820,8 +819,12 @@ PHP_FUNCTION(ssh2_forward_accept) + libssh2_channel_free(channel); + RETURN_FALSE; + } +- //TODO Sean-Der +- //zend_list_addref(channel_data->session_rsrcid); ++ ++#if PHP_VERSION_ID < 70300 ++ GC_REFCOUNT(channel_data->session_rsrc)++; ++#else ++ GC_ADDREF(channel_data->session_rsrc); ++#endif + +
[gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-ssh2/, dev-php/pecl-ssh2/files/
commit: e8e572057cf5e76ae91507d103caf29096eedf52 Author: Brian Evans gentoo org> AuthorDate: Wed Jul 5 02:27:36 2017 + Commit: Brian Evans gentoo org> CommitDate: Wed Jul 5 02:27:36 2017 + 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 000..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+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), _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 000..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 +}