From ce31144456aba8023ba780fe9114d2325323b639 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 1 Sep 2018 08:45:30 +0200 Subject: update to 0.4.0 open https://github.com/nbs-system/snuffleupagus/issues/236 Could not start (invalid configuration) --- 185.patch | 58 -------------------------------------------------- PHPINFO | 3 ++- REFLECTION | 5 ++++- php-snuffleupagus.spec | 31 ++++++++++++++++++--------- 4 files changed, 27 insertions(+), 70 deletions(-) delete mode 100644 185.patch diff --git a/185.patch b/185.patch deleted file mode 100644 index 55bf200..0000000 --- a/185.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 221b40a82ee5a683e066d10e0e5a6a132661b999 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 29 Jun 2018 08:20:19 +0200 -Subject: [PATCH 1/2] relax test to pass with 7.3 - ---- - src/tests/harden_rand_noargs.phpt | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/tests/harden_rand_noargs.phpt b/src/tests/harden_rand_noargs.phpt -index 643a453..fdf8124 100644 ---- a/src/tests/harden_rand_noargs.phpt -+++ b/src/tests/harden_rand_noargs.phpt -@@ -46,13 +46,13 @@ Warning: rand() expects exactly 2 parameters, 3 given in %s/tests/harden_rand_no - - Warning: mt_rand() expects exactly 2 parameters, 3 given in %s/tests/harden_rand_noargs.php on line %d - --Warning: rand() expects parameter 1 to be integer, string given in %s/tests/harden_rand_noargs.php on line %d -+Warning: rand() expects parameter 1 to be in%s, string given in %s/tests/harden_rand_noargs.php on line %d - --Warning: mt_rand() expects parameter 1 to be integer, string given in %s/tests/harden_rand_noargs.php on line %d -+Warning: mt_rand() expects parameter 1 to be in%s, string given in %s/tests/harden_rand_noargs.php on line %d - --Warning: rand() expects parameter 2 to be integer, string given in %s/tests/harden_rand_noargs.php on line %d -+Warning: rand() expects parameter 2 to be in%s, string given in %s/tests/harden_rand_noargs.php on line %d - --Warning: mt_rand() expects parameter 2 to be integer, string given in %s/tests/harden_rand_noargs.php on line %d -+Warning: mt_rand() expects parameter 2 to be in%s, string given in %s/tests/harden_rand_noargs.php on line %d - - Warning: rand() expects exactly 2 parameters, 3 given in %s/tests/harden_rand_noargs.php on line %d - - -From 5c1c20eec0588cd5425987df01a0ac2acd1b24aa Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 29 Jun 2018 08:21:17 +0200 -Subject: [PATCH 2/2] skip test with 7.3 as samesite is broken + add TODO - ---- - src/sp_cookie_encryption.c | 5 +++-- - src/tests/samesite_cookies.phpt | 5 ++++- - 2 files changed, 7 insertions(+), 3 deletions(-) - -diff --git a/src/tests/samesite_cookies.phpt b/src/tests/samesite_cookies.phpt -index d010963..3247432 100644 ---- a/src/tests/samesite_cookies.phpt -+++ b/src/tests/samesite_cookies.phpt -@@ -1,7 +1,10 @@ - --TEST-- - Cookie samesite - --SKIPIF-- -- -+= 70300) die("skip BROKEN with 7.3"); -+?> - --INI-- - sp.configuration_file={PWD}/config/config_samesite_cookies.ini - --COOKIE-- diff --git a/PHPINFO b/PHPINFO index ca19e23..68d7b12 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,8 +2,9 @@ snuffleupagus snuffleupagus support => enabled -Version => 0.2.1 +Version => 0.4.0 Valid config => yes Directive => Local Value => Master Value sp.configuration_file => /etc/php.d/snuffleupagus-*.rules => /etc/php.d/snuffleupagus-*.rules +sp.allow_broken_configuration => 0 => 0 diff --git a/REFLECTION b/REFLECTION index 76bc407..d15a667 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,9 +1,12 @@ -Extension [ extension #197 snuffleupagus version 0.2.1 ] { +Extension [ extension #138 snuffleupagus version 0.4.0 ] { - INI { Entry [ sp.configuration_file ] Current = '/etc/php.d/snuffleupagus-*.rules' } + Entry [ sp.allow_broken_configuration ] + Current = '0' + } } } diff --git a/php-snuffleupagus.spec b/php-snuffleupagus.spec index f0a8ec5..bc44d07 100644 --- a/php-snuffleupagus.spec +++ b/php-snuffleupagus.spec @@ -14,10 +14,11 @@ %global sub_prefix %{scl_prefix} %scl_package php-snuffleupagus %else +%global _root_bindir %{_bindir} %global pkg_name %{name} %endif -%global gh_commit a9ee27231e057e3b30a424d7dec8f92ac8beac11 +%global gh_commit 721adb907fa4636693695024d3ed7ca8602db261 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner nbs-system %global gh_project snuffleupagus @@ -30,22 +31,23 @@ Summary: Security module for php7 Name: %{?sub_prefix}php-snuffleupagus -Version: 0.2.1 +Version: 0.4.0 %if 0%{?gh_date} -Release: 3%{gh_date}.%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{gh_date}.%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %else -Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %endif License: LGPLv3 Group: Development/Languages URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pkg_name}-%{version}-%{gh_short}.tar.gz -Patch0: https://patch-diff.githubusercontent.com/raw/nbs-system/snuffleupagus/pull/185.patch - BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel > 7 BuildRequires: pcre-devel +# For tests/upload_validation_real.phpt +BuildRequires: %{_root_bindir}/python +BuildRequires: %{?scl_prefix}php-vld Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} @@ -88,12 +90,8 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -n %{gh_project}-%{gh_commit} -%patch0 -p1 -b .pr185 cd src -# Only RPM build flags -sed -e '/^CFLAGS/d' -i config.m4 - # Sanity check, really often broken grep PHP_SNUFFLEUPAGUS_VERSION php_snuffleupagus.h extver=$(sed -n '/#define PHP_SNUFFLEUPAGUS_VERSION/{s/.* "//;s/".*$//;p}' php_snuffleupagus.h) @@ -115,6 +113,7 @@ extension = %{pecl_name}.so ; Path to rules configuration files, glob or comma separated list sp.configuration_file = '%{php_inidir}/%{pecl_name}-*.rules' +;sp.allow_broken_configuration = 0 EOF cat << 'EOF' | tee %{pecl_name}-default.rules @@ -162,10 +161,16 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %check +%if 0%{?rhel} == 6 +# TODO : need investigation +rm src/tests/stream_wrapper.phpt +%endif + cd src : Minimal load test for NTS extension %{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ + --define sp.allow_broken_configuration=1 \ --modules | grep %{pecl_name} : Upstream test suite for NTS extension @@ -180,6 +185,7 @@ cd ../ZTS : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ + --define sp.allow_broken_configuration=1 \ --modules | grep %{pecl_name} : Upstream test suite for ZTS extension @@ -207,6 +213,11 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Sat Sep 1 2018 Remi Collet - 0.4.0-1 +- update to 0.4.0 +- open https://github.com/nbs-system/snuffleupagus/issues/236 + Could not start (invalid configuration) + * Thu Aug 16 2018 Remi Collet - 0.2.1-4 - rebuild for 7.3.0beta2 new ABI -- cgit