diff options
-rw-r--r-- | 0828b70df7606b599785b3de1c15248d3e463b95.patch | 103 | ||||
-rw-r--r-- | 90c105136d52d53a06617002209a158091b09686.patch | 36 | ||||
-rw-r--r-- | PHPINFO | 10 | ||||
-rw-r--r-- | REFLECTION | 2 | ||||
-rw-r--r-- | f1a5b6dea1982dab03c810edd321ca57907d41fe.patch | 45 | ||||
-rw-r--r-- | f8dd503c70464c6585a2b2a18d7a3457ce9241a4.patch | 33 | ||||
-rw-r--r-- | php-pecl-oauth.spec | 35 |
7 files changed, 252 insertions, 12 deletions
diff --git a/0828b70df7606b599785b3de1c15248d3e463b95.patch b/0828b70df7606b599785b3de1c15248d3e463b95.patch new file mode 100644 index 0000000..040983c --- /dev/null +++ b/0828b70df7606b599785b3de1c15248d3e463b95.patch @@ -0,0 +1,103 @@ +From 0828b70df7606b599785b3de1c15248d3e463b95 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@php.net> +Date: Thu, 28 Jun 2018 10:46:29 +0200 +Subject: [PATCH] fix for PHP 7.3: fields of php_url struct change from char * + to zend_string * + +--- + oauth.c | 20 ++++++++++---------- + php_oauth.h | 10 ++++++++++ + provider.c | 2 +- + 3 files changed, 21 insertions(+), 11 deletions(-) + +diff --git a/oauth.c b/oauth.c +index 198e2cb..27f158f 100644 +--- a/oauth.c ++++ b/oauth.c +@@ -577,14 +577,14 @@ zend_string *oauth_generate_sig_base(php_so_object *soo, const char *http_method + php_url_free(urlparts); + return NULL; + } +- php_strtolower(urlparts->scheme, strlen(urlparts->scheme)); +- php_strtolower(urlparts->host, strlen(urlparts->host)); +- smart_string_appends(&sbuf, urlparts->scheme); ++ php_strtolower(OAUTH_URL_STR(urlparts->scheme), OAUTH_URL_LEN(urlparts->scheme)); ++ php_strtolower(OAUTH_URL_STR(urlparts->host), OAUTH_URL_LEN(urlparts->host)); ++ smart_string_appends(&sbuf, OAUTH_URL_STR(urlparts->scheme)); + smart_string_appends(&sbuf, "://"); +- smart_string_appends(&sbuf, urlparts->host); ++ smart_string_appends(&sbuf, OAUTH_URL_STR(urlparts->host)); + +- if (urlparts->port && ((!strcmp("http", urlparts->scheme) && OAUTH_HTTP_PORT != urlparts->port) +- || (!strcmp("https", urlparts->scheme) && OAUTH_HTTPS_PORT != urlparts->port))) { ++ if (urlparts->port && ((!strcmp("http", OAUTH_URL_STR(urlparts->scheme)) && OAUTH_HTTP_PORT != urlparts->port) ++ || (!strcmp("https", OAUTH_URL_STR(urlparts->scheme)) && OAUTH_HTTPS_PORT != urlparts->port))) { + spprintf(&s_port, 0, "%d", urlparts->port); + smart_string_appendc(&sbuf, ':'); + smart_string_appends(&sbuf, s_port); +@@ -593,7 +593,7 @@ zend_string *oauth_generate_sig_base(php_so_object *soo, const char *http_method + + if (urlparts->path) { + smart_string squery = {0}; +- smart_string_appends(&sbuf, urlparts->path); ++ smart_string_appends(&sbuf, OAUTH_URL_STR(urlparts->path)); + smart_string_0(&sbuf); + + array_init(¶ms); +@@ -608,7 +608,7 @@ zend_string *oauth_generate_sig_base(php_so_object *soo, const char *http_method + } + + if (urlparts->query) { +- query = estrdup(urlparts->query); ++ query = estrdup(OAUTH_URL_STR(urlparts->query)); + oauth_parse_str(query, ¶ms); + efree(query); + } +@@ -1364,11 +1364,11 @@ static void oauth_apply_url_redirect(smart_string *surl, const char *location) / + /* rebuild url from scratch */ + smart_string_free(surl); + if (urlparts->scheme) { +- smart_string_appends(surl, urlparts->scheme); ++ smart_string_appends(surl, OAUTH_URL_STR(urlparts->scheme)); + smart_string_appends(surl, "://"); + } + if (urlparts->host) { +- smart_string_appends(surl, urlparts->host); ++ smart_string_appends(surl, OAUTH_URL_STR(urlparts->host)); + } + if (urlparts->port) { + smart_string_appendc(surl, ':'); +diff --git a/php_oauth.h b/php_oauth.h +index cc7da09..02d68d8 100644 +--- a/php_oauth.h ++++ b/php_oauth.h +@@ -332,6 +332,16 @@ zend_string *soo_sign(php_so_object *soo, char *message, zval *cs, zval *ts, con + oauth_sig_context *oauth_create_sig_context(const char *sigmethod); + zend_string *oauth_url_encode(char *url, int url_len); + ++ ++// Compatibility macros ++#if PHP_VERSION_ID < 70300 ++#define OAUTH_URL_STR(a) (a) ++#define OAUTH_URL_LEN(a) strlen(a) ++#else ++#define OAUTH_URL_STR(a) ZSTR_VAL(a) ++#define OAUTH_URL_LEN(a) ZSTR_LEN(a) ++#endif ++ + #endif + + /** +diff --git a/provider.c b/provider.c +index 0170ee1..41eb3be 100644 +--- a/provider.c ++++ b/provider.c +@@ -132,7 +132,7 @@ static int oauth_provider_token_required(zval *provider_obj, char* uri) + if (reqtoken_path[0]=='/') { + /* match against relative url */ + php_url *urlparts = php_url_parse_ex(uri, strlen(uri)); +- uri_matched = urlparts && 0==strncmp(urlparts->path, reqtoken_path, strlen(reqtoken_path)); ++ uri_matched = urlparts && 0==strncmp(OAUTH_URL_STR(urlparts->path), reqtoken_path, strlen(reqtoken_path)); + php_url_free(urlparts); + } else { + /* match against full uri */ diff --git a/90c105136d52d53a06617002209a158091b09686.patch b/90c105136d52d53a06617002209a158091b09686.patch new file mode 100644 index 0000000..52ce9a7 --- /dev/null +++ b/90c105136d52d53a06617002209a158091b09686.patch @@ -0,0 +1,36 @@ +From 90c105136d52d53a06617002209a158091b09686 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@php.net> +Date: Thu, 28 Jun 2018 10:51:06 +0200 +Subject: [PATCH] fix -Wformat and -Wint-in-bool-context warnigngs + +--- + provider.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/provider.c b/provider.c +index 41eb3be..16d0eed 100644 +--- a/provider.c ++++ b/provider.c +@@ -864,11 +864,11 @@ SOP_METHOD(setParam) + sop = fetch_sop_object(pthis); + + if (!param_val) { +- RETURN_BOOL(SUCCESS == zend_hash_str_del(sop->custom_params, param_key, param_key_len) ? IS_TRUE : IS_FALSE); ++ RETURN_BOOL(SUCCESS == zend_hash_str_del(sop->custom_params, param_key, param_key_len)); + } else { + Z_TRY_ADDREF_P(param_val); + +- RETURN_BOOL(NULL != zend_hash_str_add(sop->custom_params, param_key, param_key_len, param_val) ? IS_TRUE : IS_FALSE); ++ RETURN_BOOL(NULL != zend_hash_str_add(sop->custom_params, param_key, param_key_len, param_val)); + } + } + /* }}} */ +@@ -1048,7 +1048,7 @@ SOP_METHOD(reportProblem) + default: + http_code = OAUTH_ERR_INTERNAL_ERROR; + out = emalloc(48); +- snprintf(out, 48, "oauth_problem=unknown_problem&code=%d", lcode); ++ snprintf(out, 48, "oauth_problem=unknown_problem&code=%lu", lcode); + out_malloced = 1; + } + @@ -0,0 +1,10 @@ + +OAuth + +OAuth support => enabled +PLAINTEXT support => enabled +RSA-SHA1 support => enabled +HMAC-SHA1 support => enabled +Request engine support => php_streams, curl +source version => $Id$ +version => 2.0.2 @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #71 OAuth version 2.0.2 ] { +Extension [ <persistent> extension #119 OAuth version 2.0.2 ] { - Constants [32] { Constant [ string OAUTH_SIG_METHOD_HMACSHA1 ] { HMAC-SHA1 } diff --git a/f1a5b6dea1982dab03c810edd321ca57907d41fe.patch b/f1a5b6dea1982dab03c810edd321ca57907d41fe.patch new file mode 100644 index 0000000..03d5335 --- /dev/null +++ b/f1a5b6dea1982dab03c810edd321ca57907d41fe.patch @@ -0,0 +1,45 @@ +From f1a5b6dea1982dab03c810edd321ca57907d41fe Mon Sep 17 00:00:00 2001 +From: Adam Saponara <as@php.net> +Date: Fri, 24 Feb 2017 17:20:51 -0500 +Subject: [PATCH] Fix bug #74163: Segfault in oauth_compare_value + +Credit to @russpos for finding this bug +--- + oauth.c | 4 ++-- + tests/oauth_sbs.phpt | 4 ++++ + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/oauth.c b/oauth.c +index 62522bd..198e2cb 100644 +--- a/oauth.c ++++ b/oauth.c +@@ -374,8 +374,8 @@ static int oauth_strcmp(zval *first, zval *second) + static int oauth_compare_value(const void *a, const void *b) + { + Bucket *f, *s; +- f = *(Bucket **)a; +- s = *(Bucket **)b; ++ f = (Bucket *)a; ++ s = (Bucket *)b; + + return oauth_strcmp(&f->val, &s->val); + } +diff --git a/tests/oauth_sbs.phpt b/tests/oauth_sbs.phpt +index a49d2b4..4e9269e 100644 +--- a/tests/oauth_sbs.phpt ++++ b/tests/oauth_sbs.phpt +@@ -21,6 +21,8 @@ echo "-- putting oauth_signature inside by mistake --\n"; + echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/',array('oauth_signature'=>'hello world')),"\n"; + echo "-- merging url query and extra params --\n"; + echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/script?arg1=1',array('arg2' => '2')),"\n"; ++echo "-- with array value --\n"; ++echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/script',array('arg2' => [1, 2, 3])),"\n"; + + ?> + --EXPECTF-- +@@ -44,3 +46,5 @@ GET&http%3A%2F%2F127.0.0.1%3A12342%2F&test%3D + GET&http%3A%2F%2F127.0.0.1%3A12342%2F& + -- merging url query and extra params -- + GET&http%3A%2F%2F127.0.0.1%3A12342%2Fscript&arg1%3D1%26arg2%3D2 ++-- with array value -- ++GET&http%3A%2F%2F127.0.0.1%3A12342%2Fscript&arg2%3D1%26arg2%3D2%26arg2%3D3 diff --git a/f8dd503c70464c6585a2b2a18d7a3457ce9241a4.patch b/f8dd503c70464c6585a2b2a18d7a3457ce9241a4.patch new file mode 100644 index 0000000..d1da4bc --- /dev/null +++ b/f8dd503c70464c6585a2b2a18d7a3457ce9241a4.patch @@ -0,0 +1,33 @@ +From f8dd503c70464c6585a2b2a18d7a3457ce9241a4 Mon Sep 17 00:00:00 2001 +From: "Christoph M. Becker" <cmbecker69@gmx.de> +Date: Sat, 24 Feb 2018 15:14:03 +0100 +Subject: [PATCH] Fix #73434: Null byte at end of array keys in + getLastResponseInfo +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In PHP 7, the terminating NUL has to be excluded from the keys. +Otherwise, the userland developer might even accidentally overwrite the +terminating NUL … +--- + php_oauth.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/php_oauth.h b/php_oauth.h +index 02d68d8..e0ee8cd 100644 +--- a/php_oauth.h ++++ b/php_oauth.h +@@ -294,9 +294,9 @@ zend_string *oauth_generate_sig_base(php_so_object *soo, const char *http_method + smart_string_free(&(a)->curl_info); + + /* this and code that uses it is from ext/curl/interface.c */ +-#define CAAL(s, v) add_assoc_long_ex(&info, s, sizeof(s), (long) v); +-#define CAAD(s, v) add_assoc_double_ex(&info, s, sizeof(s), (double) v); +-#define CAAS(s, v) add_assoc_string_ex(&info, s, sizeof(s), (char *) (v ? v : "")); ++#define CAAL(s, v) add_assoc_long_ex(&info, s, sizeof(s) - 1, (long) v); ++#define CAAD(s, v) add_assoc_double_ex(&info, s, sizeof(s) - 1, (double) v); ++#define CAAS(s, v) add_assoc_string_ex(&info, s, sizeof(s) - 1, (char *) (v ? v : "")); + + #define ADD_DEBUG_INFO(a, k, s, t) \ + if(s.len) { \ diff --git a/php-pecl-oauth.spec b/php-pecl-oauth.spec index ac8e8a8..2f5cfd4 100644 --- a/php-pecl-oauth.spec +++ b/php-pecl-oauth.spec @@ -19,18 +19,23 @@ Name: %{?sub_prefix}php-pecl-oauth Version: 2.0.2 -Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Summary: PHP OAuth consumer extension -Group: Development/Languages License: BSD URL: http://pecl.php.net/package/oauth Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz +BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-pear BuildRequires: pcre-devel BuildRequires: libcurl-devel +Patch0: https://github.com/php/pecl-web_services-oauth/commit/f1a5b6dea1982dab03c810edd321ca57907d41fe.patch +Patch1: https://github.com/php/pecl-web_services-oauth/commit/0828b70df7606b599785b3de1c15248d3e463b95.patch +Patch2: https://github.com/php/pecl-web_services-oauth/commit/90c105136d52d53a06617002209a158091b09686.patch +Patch3: https://github.com/php/pecl-web_services-oauth/commit/f8dd503c70464c6585a2b2a18d7a3457ce9241a4.patch + Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} %{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} @@ -46,12 +51,6 @@ Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{rele %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} # Other third party repo stuff -Obsoletes: php53-pecl-%{pecl_name} <= %{version} -Obsoletes: php53u-pecl-%{pecl_name} <= %{version} -Obsoletes: php54-pecl-%{pecl_name} <= %{version} -Obsoletes: php54w-pecl-%{pecl_name} <= %{version} -Obsoletes: php55u-pecl-%{pecl_name} <= %{version} -Obsoletes: php55w-pecl-%{pecl_name} <= %{version} Obsoletes: php56u-pecl-%{pecl_name} <= %{version} Obsoletes: php56w-pecl-%{pecl_name} <= %{version} Obsoletes: php70u-pecl-%{pecl_name} <= %{version} @@ -93,12 +92,19 @@ sed -e 's/role="test"/role="src"/' \ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ -i package.xml +cd NTS +%patch0 -p1 -b .up0 +%patch1 -p1 -b .up1 +%patch2 -p1 -b .up2 +%patch3 -p1 -b .up3 + # Sanity check, really often broken -extver=$(sed -n '/#define PHP_OAUTH_VERSION/{s/.* //;s/".*$//;p}' NTS/php_oauth.h) +extver=$(sed -n '/#define PHP_OAUTH_VERSION/{s/.* //;s/".*$//;p}' php_oauth.h) if test "x${extver}" != "x%{version}"; then : Error: Upstream extension version is ${extver}, expecting %{version}. exit 1 fi +cd .. cat >%{ini_name} << 'EOF' ; Enable %{pecl_name} extension module @@ -112,6 +118,8 @@ cp -pr NTS ZTS %build +%{?dtsenable} + cd NTS %{_bindir}/phpize %configure --with-php-config=%{_bindir}/php-config @@ -126,6 +134,8 @@ make %{?_smp_mflags} %install +%{?dtsenable} + make install -C NTS INSTALL_ROOT=%{buildroot} # Drop in the bit of configuration @@ -146,7 +156,7 @@ do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done -%if 0%{?fedora} < 24 +%if 0%{?fedora} < 24 && 0%{?rhel} < 8 # when pear installed alone, after us %triggerin -- %{?scl_prefix}php-pear if [ -x %{__pecl} ] ; then @@ -195,7 +205,10 @@ fi %changelog -* Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 2.0.2-4.7.0 +* Thu Jun 28 2018 Remi Collet <remi@remirepo.net> - 2.0.2-5 +- add upstream patches for PHP 7.3 + +* Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 2.0.2-4 - rebuild for PHP 7.2.0beta1 new API * Thu Dec 1 2016 Remi Collet <remi@fedoraproject.org> - 2.0.2-3 |