diff options
author | Remi Collet <remi@remirepo.net> | 2018-06-28 11:52:49 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2018-06-28 11:52:49 +0200 |
commit | 4a510a44ed6ac32ba1f571ad46fbc790144f7ac7 (patch) | |
tree | 70c0b04b9a0b25d2b1d61ebbbb5af34f67ee51ca | |
parent | 6695f4307ff4353ed469d2aaec190059cf57d85b (diff) |
add patch for [-Werror=format-security] from https://github.com/datastax/php-driver/pull/126
-rw-r--r-- | 126.patch | 66 | ||||
-rw-r--r-- | PHPINFO | 11 | ||||
-rw-r--r-- | REFLECTION | 90 | ||||
-rw-r--r-- | php-pecl-cassandra.spec | 21 |
4 files changed, 133 insertions, 55 deletions
diff --git a/126.patch b/126.patch new file mode 100644 index 0000000..dadc618 --- /dev/null +++ b/126.patch @@ -0,0 +1,66 @@ +From 0d6814525ebf7c8d45ad951f07aea9b6d54ccad7 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Thu, 28 Jun 2018 11:34:58 +0200 +Subject: [PATCH 1/2] fix build error [-Werror=format-security] + +--- + ext/src/FutureSession.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ext/src/FutureSession.c b/ext/src/FutureSession.c +index 408297c1..3c622f6e 100644 +--- a/ext/src/FutureSession.c ++++ b/ext/src/FutureSession.c +@@ -37,7 +37,7 @@ PHP_METHOD(FutureSession, get) + + if (self->exception_message) { + zend_throw_exception_ex(exception_class(self->exception_code), +- self->exception_code TSRMLS_CC, self->exception_message); ++ self->exception_code TSRMLS_CC, "%s", self->exception_message); + return; + } + +@@ -71,7 +71,7 @@ PHP_METHOD(FutureSession, get) + } + + zend_throw_exception_ex(exception_class(self->exception_code), +- self->exception_code TSRMLS_CC, self->exception_message); ++ self->exception_code TSRMLS_CC, "%s", self->exception_message); + return; + } + + +From fd60ca80f16f7cff098cc637c91cf9188a033c2e Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Thu, 28 Jun 2018 11:44:56 +0200 +Subject: [PATCH 2/2] fix some build warnings [-WFormat] + +--- + ext/php_driver.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/ext/php_driver.c b/ext/php_driver.c +index b9663f8d..14b7a31d 100644 +--- a/ext/php_driver.c ++++ b/ext/php_driver.c +@@ -325,7 +325,7 @@ throw_invalid_argument(zval *object, + if (cls_name) { + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + "%s must be %s, an instance of %.*s given", +- object_name, expected_type, cls_len, cls_name); ++ object_name, expected_type, (int)cls_len, cls_name); + #if PHP_MAJOR_VERSION >= 7 + zend_string_release(str); + #else +@@ -367,7 +367,11 @@ PHP_INI_MH(OnUpdateLogLevel) + } else { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, + PHP_DRIVER_NAME " | Unknown log level '%s', using 'ERROR'", ++#if PHP_MAJOR_VERSION >= 7 ++ ZSTR_VAL(new_value)); ++#else + new_value); ++#endif + cass_log_set_level(CASS_LOG_ERROR); + } + } @@ -0,0 +1,11 @@ + +cassandra + +Cassandra support => enabled +C/C++ driver version => 2.8.0 +Persistent Clusters => 0 +Persistent Sessions => 0 + +Directive => Local Value => Master Value +cassandra.log => cassandra.log => cassandra.log +cassandra.log_level => ERROR => ERROR @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #77 cassandra version 1.3.2 ] { +Extension [ <persistent> extension #78 cassandra version 1.3.2 ] { - Dependencies { Dependency [ spl (Required) ] @@ -3176,50 +3176,50 @@ Extension [ <persistent> extension #77 cassandra version 1.3.2 ] { Class [ <internal:cassandra> final class Cassandra ] { - Constants [44] { - Constant [ integer CONSISTENCY_ANY ] { 0 } - Constant [ integer CONSISTENCY_ONE ] { 1 } - Constant [ integer CONSISTENCY_TWO ] { 2 } - Constant [ integer CONSISTENCY_THREE ] { 3 } - Constant [ integer CONSISTENCY_QUORUM ] { 4 } - Constant [ integer CONSISTENCY_ALL ] { 5 } - Constant [ integer CONSISTENCY_LOCAL_QUORUM ] { 6 } - Constant [ integer CONSISTENCY_EACH_QUORUM ] { 7 } - Constant [ integer CONSISTENCY_SERIAL ] { 8 } - Constant [ integer CONSISTENCY_LOCAL_SERIAL ] { 9 } - Constant [ integer CONSISTENCY_LOCAL_ONE ] { 10 } - Constant [ integer VERIFY_NONE ] { 0 } - Constant [ integer VERIFY_PEER_CERT ] { 1 } - Constant [ integer VERIFY_PEER_IDENTITY ] { 2 } - Constant [ integer BATCH_LOGGED ] { 0 } - Constant [ integer BATCH_UNLOGGED ] { 1 } - Constant [ integer BATCH_COUNTER ] { 2 } - Constant [ integer LOG_DISABLED ] { 0 } - Constant [ integer LOG_CRITICAL ] { 1 } - Constant [ integer LOG_ERROR ] { 2 } - Constant [ integer LOG_WARN ] { 3 } - Constant [ integer LOG_INFO ] { 4 } - Constant [ integer LOG_DEBUG ] { 5 } - Constant [ integer LOG_TRACE ] { 6 } - Constant [ string TYPE_TEXT ] { text } - Constant [ string TYPE_ASCII ] { ascii } - Constant [ string TYPE_VARCHAR ] { varchar } - Constant [ string TYPE_BIGINT ] { bigint } - Constant [ string TYPE_SMALLINT ] { smallint } - Constant [ string TYPE_TINYINT ] { tinyint } - Constant [ string TYPE_BLOB ] { blob } - Constant [ string TYPE_BOOLEAN ] { boolean } - Constant [ string TYPE_COUNTER ] { counter } - Constant [ string TYPE_DECIMAL ] { decimal } - Constant [ string TYPE_DOUBLE ] { double } - Constant [ string TYPE_FLOAT ] { float } - Constant [ string TYPE_INT ] { int } - Constant [ string TYPE_TIMESTAMP ] { timestamp } - Constant [ string TYPE_UUID ] { uuid } - Constant [ string TYPE_VARINT ] { varint } - Constant [ string TYPE_TIMEUUID ] { timeuuid } - Constant [ string TYPE_INET ] { inet } - Constant [ string VERSION ] { 1.3.2 } - Constant [ string CPP_DRIVER_VERSION ] { 2.7.0 } + Constant [ public integer CONSISTENCY_ANY ] { 0 } + Constant [ public integer CONSISTENCY_ONE ] { 1 } + Constant [ public integer CONSISTENCY_TWO ] { 2 } + Constant [ public integer CONSISTENCY_THREE ] { 3 } + Constant [ public integer CONSISTENCY_QUORUM ] { 4 } + Constant [ public integer CONSISTENCY_ALL ] { 5 } + Constant [ public integer CONSISTENCY_LOCAL_QUORUM ] { 6 } + Constant [ public integer CONSISTENCY_EACH_QUORUM ] { 7 } + Constant [ public integer CONSISTENCY_SERIAL ] { 8 } + Constant [ public integer CONSISTENCY_LOCAL_SERIAL ] { 9 } + Constant [ public integer CONSISTENCY_LOCAL_ONE ] { 10 } + Constant [ public integer VERIFY_NONE ] { 0 } + Constant [ public integer VERIFY_PEER_CERT ] { 1 } + Constant [ public integer VERIFY_PEER_IDENTITY ] { 2 } + Constant [ public integer BATCH_LOGGED ] { 0 } + Constant [ public integer BATCH_UNLOGGED ] { 1 } + Constant [ public integer BATCH_COUNTER ] { 2 } + Constant [ public integer LOG_DISABLED ] { 0 } + Constant [ public integer LOG_CRITICAL ] { 1 } + Constant [ public integer LOG_ERROR ] { 2 } + Constant [ public integer LOG_WARN ] { 3 } + Constant [ public integer LOG_INFO ] { 4 } + Constant [ public integer LOG_DEBUG ] { 5 } + Constant [ public integer LOG_TRACE ] { 6 } + Constant [ public string TYPE_TEXT ] { text } + Constant [ public string TYPE_ASCII ] { ascii } + Constant [ public string TYPE_VARCHAR ] { varchar } + Constant [ public string TYPE_BIGINT ] { bigint } + Constant [ public string TYPE_SMALLINT ] { smallint } + Constant [ public string TYPE_TINYINT ] { tinyint } + Constant [ public string TYPE_BLOB ] { blob } + Constant [ public string TYPE_BOOLEAN ] { boolean } + Constant [ public string TYPE_COUNTER ] { counter } + Constant [ public string TYPE_DECIMAL ] { decimal } + Constant [ public string TYPE_DOUBLE ] { double } + Constant [ public string TYPE_FLOAT ] { float } + Constant [ public string TYPE_INT ] { int } + Constant [ public string TYPE_TIMESTAMP ] { timestamp } + Constant [ public string TYPE_UUID ] { uuid } + Constant [ public string TYPE_VARINT ] { varint } + Constant [ public string TYPE_TIMEUUID ] { timeuuid } + Constant [ public string TYPE_INET ] { inet } + Constant [ public string VERSION ] { 1.3.2 } + Constant [ public string CPP_DRIVER_VERSION ] { 2.8.0 } } - Static properties [0] { diff --git a/php-pecl-cassandra.spec b/php-pecl-cassandra.spec index 5c02d2b..3aa308a 100644 --- a/php-pecl-cassandra.spec +++ b/php-pecl-cassandra.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-cassandra # -# Copyright (c) 2015-2017 Remi Collet +# Copyright (c) 2015-2018 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -32,9 +32,8 @@ Summary: DataStax PHP Driver for Apache Cassandra Name: %{?sub_prefix}php-pecl-%{pecl_name} Version: 1.3.2 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: ASL 2.0 -Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} # Pull sources from github to get tests @@ -44,6 +43,8 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/ Source: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz %endif +Patch0: https://patch-diff.githubusercontent.com/raw/datastax/php-driver/pull/126.patch + BuildRequires: %{?scl_prefix}php-devel >= 5.6 BuildRequires: %{?scl_prefix}php-pear BuildRequires: cassandra-cpp-driver-devel >= 2.7.0 @@ -66,12 +67,6 @@ Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{releas %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} %if "%{php_version}" > "7.0" @@ -118,6 +113,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p2 -b .pr126 + # Sanity check, really often broken extver=$(sed -n '/#define PHP_DRIVER_VERSION /{s/.* "//;s/".*$//;p}' version.h) if test "x${extver}" != "x%{version}%{?prever}"; then @@ -182,7 +179,7 @@ do install -Dpm 644 NTS/$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 @@ -251,6 +248,10 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Thu Jun 28 2018 Remi Collet <remi@remirepo.net> - 1.3.2-2 +- add patch for [-Werror=format-security] from + https://github.com/datastax/php-driver/pull/126 + * Tue Aug 15 2017 Remi Collet <remi@remirepo.net> - 1.3.2-1 - Update to 1.3.2 - raise dependency on cassandra-cpp-driver 2.7.0 |