summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--64.patch31
-rw-r--r--php-pecl-taint.spec27
2 files changed, 51 insertions, 7 deletions
diff --git a/64.patch b/64.patch
new file mode 100644
index 0000000..4238991
--- /dev/null
+++ b/64.patch
@@ -0,0 +1,31 @@
+From 389dfe16c97c0ba517fe94f49766cc74e6ed3327 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Wed, 27 Jun 2018 17:17:59 +0200
+Subject: [PATCH] fix -Wformat warning
+
+---
+ taint.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/taint.c b/taint.c
+index e4b0765..f404cc4 100644
+--- a/taint.c
++++ b/taint.c
+@@ -248,7 +248,7 @@ static zval *php_taint_fetch_dimension_address_inner(HashTable *ht, const zval *
+ hval = zend_dval_to_lval(Z_DVAL_P(dim));
+ goto num_index;
+ case IS_RESOURCE:
+- zend_error(E_NOTICE, "Resource ID#%pd used as offset, casting to integer (%pd)", Z_RES_HANDLE_P(dim), Z_RES_HANDLE_P(dim));
++ zend_error(E_NOTICE, "Resource ID#%d used as offset, casting to integer (%d)", Z_RES_HANDLE_P(dim), Z_RES_HANDLE_P(dim));
+ hval = Z_RES_HANDLE_P(dim);
+ goto num_index;
+ case IS_FALSE:
+@@ -610,7 +610,7 @@ static void php_taint_error(const char *fname, const char *format, ...) /* {{{ *
+ vspprintf(&buffer, 0, format, args);
+ spprintf(&msg, 0, "%s() [%s]: %s", get_active_function_name(), fname, buffer);
+ efree(buffer);
+- zend_error(TAINT_G(error_level), msg);
++ zend_error(TAINT_G(error_level), "%s", msg);
+ efree(msg);
+ va_end(args);
+ } /* }}} */
diff --git a/php-pecl-taint.spec b/php-pecl-taint.spec
index fe91515..c1540b2 100644
--- a/php-pecl-taint.spec
+++ b/php-pecl-taint.spec
@@ -11,20 +11,20 @@
%scl_package php-pecl-taint
%endif
-%global gh_commit 24b5e87988ce0b01098ee0b617a13f32264ee0be
+%global gh_commit 4b76d9f1a4189d25dd9dbf9681732a4e0a9b0b48
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner laruence
%global gh_project taint
-#global gh_date 20150910
+%global gh_date 20180627
%global pecl_name taint
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global ini_name 40-%{pecl_name}.ini
Summary: XSS code sniffer
Name: %{?sub_prefix}php-pecl-taint
-Version: 2.0.4
+Version: 2.0.5
%if 0%{?gh_date:1}
-Release: 0.9.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 0.1.%{gh_date}.%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
%else
Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
@@ -33,9 +33,14 @@ Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
License: PHP
URL: https://github.com/%{gh_owner}/%{gh_project}
-BuildRequires: %{?dtsprefix}gcc
+Patch0: https://patch-diff.githubusercontent.com/raw/laruence/taint/pull/64.patch
+
+BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel > 7
BuildRequires: %{?scl_prefix}php-pear
+BuildRequires: %{?scl_prefix}php-pdo
+BuildRequires: %{?scl_prefix}php-pdo_sqlite
+BuildRequires: %{?scl_prefix}php-sqlite3
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
@@ -94,6 +99,7 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1 -b .pr64
# When this file will be removed, clean the description.
[ -f EXPERIMENTAL ] || exit 1
@@ -171,9 +177,11 @@ cd NTS
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
+DEP="-d extension=pdo.so -d extension=pdo_sqlite.so -d extension=sqlite3.so"
+
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
+TEST_PHP_ARGS="-n $DEP -d %{buildroot}%{php_extdir}/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php --show-diff || : ignore
@@ -188,7 +196,7 @@ rm tests/004.phpt
: Upstream test suite for ZTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
+TEST_PHP_ARGS="-n $DEP -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php --show-diff
@@ -230,6 +238,11 @@ fi
%changelog
+* Wed Jun 27 2018 Remi Collet <remi@remirepo.net> - 2.0.5-0.1.20180627.4b76d9f
+- update to 2.0.5-dev for PHP 7.3
+- add patch for -Wformat errors from
+ https://github.com/laruence/taint/pull/64
+
* Wed Aug 9 2017 Remi Collet <remi@remirepo.net> - 2.0.4-1
- Update to 2.0.4