summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-09-19 09:17:35 +0200
committerRemi Collet <remi@remirepo.net>2017-09-19 09:17:35 +0200
commit824933da5fe84784984fb9e2b9bdf39f9c18a3d5 (patch)
tree85a0a4f5ec416300dcea78aaff4c18b183b9c84d
parent8070c3b6d9828e48cd3419cd3bc4e7ab8bc3e26f (diff)
add upstream patch to fix segfaults
-rw-r--r--22786c74700c1f0da7747ccea128e6400f0ce289.patch46
-rw-r--r--802d36c6f158e04eace2a816e38f05b8471b4f64.patch38
-rw-r--r--a782883c301e1f778f0f6c7b4891b66e283ae3bb.patch31
-rw-r--r--php-pecl-seaslog.spec10
4 files changed, 124 insertions, 1 deletions
diff --git a/22786c74700c1f0da7747ccea128e6400f0ce289.patch b/22786c74700c1f0da7747ccea128e6400f0ce289.patch
new file mode 100644
index 0000000..6043250
--- /dev/null
+++ b/22786c74700c1f0da7747ccea128e6400f0ce289.patch
@@ -0,0 +1,46 @@
+From 22786c74700c1f0da7747ccea128e6400f0ce289 Mon Sep 17 00:00:00 2001
+From: neeke <neeke@php.net>
+Date: Tue, 19 Sep 2017 14:27:06 +0800
+Subject: [PATCH] Fixed #152 (Segfault in cli)
+
+---
+ src/Request.c | 23 +++++++++++++++++------
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/src/Request.c b/src/Request.c
+index 57f14f0..1817219 100644
+--- a/src/Request.c
++++ b/src/Request.c
+@@ -180,15 +180,26 @@ static int seaslog_init_request_variable(TSRMLS_D)
+
+ static void seaslog_clear_request_variable(TSRMLS_D)
+ {
+- SEASLOG_ZVAL_PTR_DTOR(SEASLOG_G(request_variable)->request_uri);
+-
+- if( SEASLOG_G(request_variable)->request_method )
++ if(SEASLOG_G(request_variable)->request_uri)
++ {
++ SEASLOG_ZVAL_PTR_DTOR(SEASLOG_G(request_variable)->request_uri);
++ }
++
++ if(SEASLOG_G(request_variable)->request_method)
+ {
+ SEASLOG_ZVAL_PTR_DTOR(SEASLOG_G(request_variable)->request_method);
+ }
+-
+- efree(SEASLOG_G(request_variable)->domain_port);
+- efree(SEASLOG_G(request_variable)->client_ip);
++
++ if(SEASLOG_G(request_variable)->domain_port)
++ {
++ efree(SEASLOG_G(request_variable)->domain_port);
++ }
++
++ if(SEASLOG_G(request_variable)->client_ip)
++ {
++ efree(SEASLOG_G(request_variable)->client_ip);
++ }
++
+ efree(SEASLOG_G(request_variable));
+ }
+
diff --git a/802d36c6f158e04eace2a816e38f05b8471b4f64.patch b/802d36c6f158e04eace2a816e38f05b8471b4f64.patch
new file mode 100644
index 0000000..50d2285
--- /dev/null
+++ b/802d36c6f158e04eace2a816e38f05b8471b4f64.patch
@@ -0,0 +1,38 @@
+From 79fb94b4cbca994f0f24fb13dbc4796253d21db0 Mon Sep 17 00:00:00 2001
+From: xbruce <xbruce@xbrucedeMacBook-Pro.local>
+Date: Tue, 19 Sep 2017 11:29:03 +0800
+Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dphp7.1=E7=89=88=E6=9C=ACcli?=
+ =?UTF-8?q?=E4=B8=8B=E8=BF=90=E8=A1=8C=E4=B8=8D=E6=AD=A3=E5=B8=B8=E7=9A=84?=
+ =?UTF-8?q?bug!=20=E5=8E=9F=E5=9B=A0=EF=BC=9A=E8=B6=85=E5=85=A8=E5=B1=80?=
+ =?UTF-8?q?=E5=8F=98=E9=87=8F$=5FSERVER=E4=B8=AD=E4=B8=8D=E5=AD=98?=
+ =?UTF-8?q?=E5=9C=A8SUDO=5FCOMMAND=E5=AF=BC=E8=87=B4SEASLOG=5FG(request=5F?=
+ =?UTF-8?q?variable)->request=5Fmethod=E4=B8=BA=E7=A9=BA=E8=BF=9B=E8=80=8C?=
+ =?UTF-8?q?=E5=AF=BC=E8=87=B4seaslog=5Fclear=5Frequest=5Fvariable=E5=87=BD?=
+ =?UTF-8?q?=E6=95=B0=E4=B8=ADSEASLOG=5FZVAL=5FPTR=5FDTOR(SEASLOG=5FG(reque?=
+ =?UTF-8?q?st=5Fvariable)->request=5Fmethod);=E5=A4=B1=E8=B4=A5?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+---
+ src/Request.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/Request.c b/src/Request.c
+index cc53db1..755ba2c 100644
+--- a/src/Request.c
++++ b/src/Request.c
+@@ -193,7 +193,12 @@ static int seaslog_init_request_variable(TSRMLS_D)
+ static void seaslog_clear_request_variable(TSRMLS_D)
+ {
+ SEASLOG_ZVAL_PTR_DTOR(SEASLOG_G(request_variable)->request_uri);
+- SEASLOG_ZVAL_PTR_DTOR(SEASLOG_G(request_variable)->request_method);
++
++ if( SEASLOG_G(request_variable)->request_method )
++ {
++ SEASLOG_ZVAL_PTR_DTOR(SEASLOG_G(request_variable)->request_method);
++ }
++
+ efree(SEASLOG_G(request_variable)->domain_port);
+ efree(SEASLOG_G(request_variable)->client_ip);
+ efree(SEASLOG_G(request_variable));
diff --git a/a782883c301e1f778f0f6c7b4891b66e283ae3bb.patch b/a782883c301e1f778f0f6c7b4891b66e283ae3bb.patch
new file mode 100644
index 0000000..9253355
--- /dev/null
+++ b/a782883c301e1f778f0f6c7b4891b66e283ae3bb.patch
@@ -0,0 +1,31 @@
+From a782883c301e1f778f0f6c7b4891b66e283ae3bb Mon Sep 17 00:00:00 2001
+From: neeke <neeke@php.net>
+Date: Tue, 19 Sep 2017 14:24:12 +0800
+Subject: [PATCH] update to #152
+
+---
+ src/Request.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/Request.c b/src/Request.c
+index 91eafa4..d34eb5d 100644
+--- a/src/Request.c
++++ b/src/Request.c
+@@ -136,8 +136,7 @@ static int seaslog_init_request_variable(TSRMLS_D)
+ if (!strncmp(sapi_module.name, "cli", sizeof("cli") - 1))
+ {
+ SEASLOG_G(request_variable)->request_uri = seaslog_request_query(SEASLOG_GLOBAL_VARS_SERVER, ZEND_STRL("SCRIPT_NAME") TSRMLS_CC);
+-
+- SEASLOG_G(request_variable)->request_method = seaslog_request_query(SEASLOG_GLOBAL_VARS_SERVER, ZEND_STRL("SUDO_COMMAND") TSRMLS_CC);
++ SEASLOG_G(request_variable)->request_method = seaslog_request_query(SEASLOG_GLOBAL_VARS_SERVER, ZEND_STRL("SHELL") TSRMLS_CC);
+
+ SEASLOG_G(request_variable)->domain_port_len = spprintf(&SEASLOG_G(request_variable)->domain_port, 0, "cli");
+ SEASLOG_G(request_variable)->client_ip_len = spprintf(&SEASLOG_G(request_variable)->client_ip, 0, "local");
+@@ -149,7 +148,6 @@ static int seaslog_init_request_variable(TSRMLS_D)
+ SEASLOG_ZVAL_PTR_DTOR(domain);
+
+ SEASLOG_G(request_variable)->request_uri = seaslog_request_query(SEASLOG_GLOBAL_VARS_SERVER, ZEND_STRL("REQUEST_URI") TSRMLS_CC);
+-
+ SEASLOG_G(request_variable)->request_method = seaslog_request_query(SEASLOG_GLOBAL_VARS_SERVER, ZEND_STRL("REQUEST_METHOD") TSRMLS_CC);
+
+ client_ip = seaslog_request_query(SEASLOG_GLOBAL_VARS_SERVER, ZEND_STRL("HTTP_X_REAL_IP") TSRMLS_CC);
diff --git a/php-pecl-seaslog.spec b/php-pecl-seaslog.spec
index 1b990fb..915765a 100644
--- a/php-pecl-seaslog.spec
+++ b/php-pecl-seaslog.spec
@@ -32,6 +32,10 @@ Group: Development/Languages
URL: http://pecl.php.net/package/%{proj_name}
Source0: http://pecl.php.net/get/%{proj_name}-%{version}.tgz
+Patch1: 802d36c6f158e04eace2a816e38f05b8471b4f64.patch
+Patch2: a782883c301e1f778f0f6c7b4891b66e283ae3bb.patch
+Patch3: 22786c74700c1f0da7747ccea128e6400f0ce289.patch
+
BuildRequires: %{?scl_prefix}php-devel
BuildRequires: %{?scl_prefix}php-pear
@@ -110,6 +114,9 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch1 -p1 -b .up1
+%patch2 -p1 -b .up2
+%patch3 -p1 -b .up3
: Sanity check, really often broken
extver=$(sed -n '/#define SEASLOG_VERSION /{s/.* "//;s/".*$//;p}' include/SeasLog.h)
@@ -249,7 +256,8 @@ fi
* Tue Sep 19 2017 Remi Collet <remi@remirepo.net> - 1.7.5-1
- Update to 1.7.5
- Update license from Apache License 2.0 to PHP License 3.01
-- open https://github.com/Neeke/SeasLog/issues/152 segfault
+- add upstream patch to fix various segfaults
+ https://github.com/Neeke/SeasLog/issues/152
* Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 1.6.9-2
- rebuild for PHP 7.2.0beta1 new API