From 54f13031bc18e1102ac0b0210d1951a1428b0c06 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 1 Oct 2018 07:43:08 +0200 Subject: v2.0.3 --- 0828b70df7606b599785b3de1c15248d3e463b95.patch | 103 ------------------------- 90c105136d52d53a06617002209a158091b09686.patch | 36 --------- PHPINFO | 2 +- REFLECTION | 2 +- f1a5b6dea1982dab03c810edd321ca57907d41fe.patch | 45 ----------- f8dd503c70464c6585a2b2a18d7a3457ce9241a4.patch | 33 -------- php-pecl-oauth.spec | 17 ++-- 7 files changed, 8 insertions(+), 230 deletions(-) delete mode 100644 0828b70df7606b599785b3de1c15248d3e463b95.patch delete mode 100644 90c105136d52d53a06617002209a158091b09686.patch delete mode 100644 f1a5b6dea1982dab03c810edd321ca57907d41fe.patch delete mode 100644 f8dd503c70464c6585a2b2a18d7a3457ce9241a4.patch diff --git a/0828b70df7606b599785b3de1c15248d3e463b95.patch b/0828b70df7606b599785b3de1c15248d3e463b95.patch deleted file mode 100644 index 040983c..0000000 --- a/0828b70df7606b599785b3de1c15248d3e463b95.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 0828b70df7606b599785b3de1c15248d3e463b95 Mon Sep 17 00:00:00 2001 -From: Remi Collet -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 deleted file mode 100644 index 52ce9a7..0000000 --- a/90c105136d52d53a06617002209a158091b09686.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 90c105136d52d53a06617002209a158091b09686 Mon Sep 17 00:00:00 2001 -From: Remi Collet -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; - } - diff --git a/PHPINFO b/PHPINFO index 23f6a00..a9d7fae 100644 --- a/PHPINFO +++ b/PHPINFO @@ -7,4 +7,4 @@ RSA-SHA1 support => enabled HMAC-SHA1 support => enabled Request engine support => php_streams, curl source version => $Id$ -version => 2.0.2 +version => 2.0.3 diff --git a/REFLECTION b/REFLECTION index 6af95d7..de8dc29 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #119 OAuth version 2.0.2 ] { +Extension [ extension #118 OAuth version 2.0.3 ] { - Constants [32] { Constant [ string OAUTH_SIG_METHOD_HMACSHA1 ] { HMAC-SHA1 } diff --git a/f1a5b6dea1982dab03c810edd321ca57907d41fe.patch b/f1a5b6dea1982dab03c810edd321ca57907d41fe.patch deleted file mode 100644 index 03d5335..0000000 --- a/f1a5b6dea1982dab03c810edd321ca57907d41fe.patch +++ /dev/null @@ -1,45 +0,0 @@ -From f1a5b6dea1982dab03c810edd321ca57907d41fe Mon Sep 17 00:00:00 2001 -From: Adam Saponara -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 deleted file mode 100644 index d1da4bc..0000000 --- a/f8dd503c70464c6585a2b2a18d7a3457ce9241a4.patch +++ /dev/null @@ -1,33 +0,0 @@ -From f8dd503c70464c6585a2b2a18d7a3457ce9241a4 Mon Sep 17 00:00:00 2001 -From: "Christoph M. Becker" -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 76b2c04..f26bcfe 100644 --- a/php-pecl-oauth.spec +++ b/php-pecl-oauth.spec @@ -18,8 +18,8 @@ %global ini_name 40-%{pecl_name}.ini Name: %{?sub_prefix}php-pecl-oauth -Version: 2.0.2 -Release: 7%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 2.0.3 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Summary: PHP OAuth consumer extension License: BSD URL: http://pecl.php.net/package/oauth @@ -31,11 +31,6 @@ 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}} @@ -97,10 +92,7 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 -b .up0 -%patch1 -p1 -b .up1 -%patch2 -p1 -b .up2 -%patch3 -p1 -b .up3 +sed -e '/PHP_OAUTH_VERSION/s/2.0.3-dev/2.0.3/' -i php_oauth.h # Sanity check, really often broken extver=$(sed -n '/#define PHP_OAUTH_VERSION/{s/.* //;s/".*$//;p}' php_oauth.h) @@ -209,6 +201,9 @@ fi %changelog +* Mon Oct 1 2018 Remi Collet - 2.0.3-1 +- update to 2.0.3 + * Thu Aug 16 2018 Remi Collet - 2.0.2-7 - rebuild for 7.3.0beta2 new ABI -- cgit