summarylogtreecommitdiffstats
path: root/debian-php-7.4.patch
blob: 74ca1cf5f48a5ad6335e9c15a5b11c345d41ea34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274

diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 25a5f7f..93c47af 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -55,7 +55,7 @@
  * */
 #ifdef PHP_CAN_SUPPORT_PROC_OPEN
 
-#if 0 && HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_SYS_IOCTL_H && HAVE_TERMIOS_H
+#if HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_SYS_IOCTL_H && HAVE_TERMIOS_H
 # include <sys/ioctl.h>
 # include <termios.h>
 # define PHP_CAN_DO_PTS	1
diff --git a/php.ini-development b/php.ini-development
index 23a35a2..0292501 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -304,6 +304,12 @@
 ; or per-virtualhost web server configuration file.
 ; Note: disables the realpath cache
 ; http://php.net/open-basedir
+
+; NOTE: this is considered a "broken" security measure.
+;       Applications relying on this feature will not receive full
+;       support by the security team.  For more information please
+;       see /usr/share/doc/php-common/README.Debian.security
+;
 ;open_basedir =
 
 ; This directive allows you to disable certain functions.
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index 9581a57..21d3f11 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -51,6 +51,10 @@
 #include "php_tcadb.h"
 #include "php_lmdb.h"
 
+#ifdef DB4_INCLUDE_FILE
+#include DB4_INCLUDE_FILE
+#endif
+
 /* {{{ arginfo */
 ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_popen, 0, 0, 2)
 	ZEND_ARG_INFO(0, path)
@@ -558,6 +562,10 @@
 
 	php_info_print_table_start();
  	php_info_print_table_row(2, "DBA support", "enabled");
+#ifdef DB_VERSION_STRING
+ 	php_info_print_table_row(2, "libdb header version", DB_VERSION_STRING);
+ 	php_info_print_table_row(2, "libdb library version", db_version(NULL, NULL, NULL));
+#endif
 	if (handlers.s) {
 		smart_str_0(&handlers);
 		php_info_print_table_row(2, "Supported handlers", ZSTR_VAL(handlers.s));
--- /dev/null
+++ b/tests/func/null-new_val.phpt
@@ -0,0 +1,10 @@
+--TEST--
+ini_restore strcmp NULL new_val
+--FILE--
+<?php
+
+ini_set('error_log','ini_set_works');
+ini_restore('error_log');
+
+?>
+--EXPECT--
diff --git a/ext/dba/config.m4 b/ext/dba/config.m4
index 51bdd84..79136d5 100644
diff --git a/sapi/fpm/php-fpm.8.in b/sapi/fpm/php-fpm.8.in
index 972c242..002c44b 100644
--- a/sapi/fpm/php-fpm.8.in
+++ b/sapi/fpm/php-fpm.8.in
@@ -139,22 +139,8 @@
 .TP
 .B php.ini
 The standard php configuration file.
-.SH EXAMPLES
-For any unix systems which use init.d for their main process manager, you should use the init script provided to start and stop the php-fpm daemon.
-.P
-.PD 1
-.RS
-sudo /etc/init.d/php-fpm start
-.RE
-.TP
-For any unix systems which use systemd for their main process manager, you should use the unit file provided to start and stop the php-fpm daemon.
-.P
-.PD 1
-.RS
-sudo systemctl start php-fpm.service
-.RE
-.TP
-If your installation has no appropriate init script, launch php-fpm with no arguments. It will launch as a daemon (background process) by default. The file @php_fpm_localstatedir@/run/php-fpm.pid determines whether php-fpm is already up and running. Once started, php-fpm then responds to several POSIX signals:
+.SH SIGNAL
+Once started, php-fpm then responds to several POSIX signals:
 .P
 .PD 0
 .RS
@@ -168,10 +154,6 @@
 .RE
 .PD 1
 .P
-.SH TIPS
-The PHP-FPM CGI daemon will work well with most popular webservers, including Apache2, lighttpd and nginx.
-.PD 1
-.P
 .SH SEE ALSO
 The PHP-FPM website:
 .PD 0
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 4d10e68..f74a936 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -713,7 +713,13 @@
 
 				switch (value) {
 					case PHP_STREAM_MMAP_SUPPORTED:
-						return fd == -1 ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK;
+						if (fd == -1)
+							return PHP_STREAM_OPTION_RETURN_ERR;
+						/* Don't mmap large files */
+						do_fstat(data, 1);
+						if (data->sb.st_size > 4 * 1024 * 1024)
+							return PHP_STREAM_OPTION_RETURN_ERR;
+						return PHP_STREAM_OPTION_RETURN_OK;
 
 					case PHP_STREAM_MMAP_MAP_RANGE:
 						if (do_fstat(data, 1) != 0) {
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index 21d3f11..ac2d212 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -999,7 +999,7 @@
 		}
 	}
 
-	if (error || hptr->open(info, &error) != SUCCESS) {
+	if (error || (hptr->open)(info, &error) != SUCCESS) {
 		dba_close(info);
 		php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", hptr->name, error?": ":"", error?error:"");
 		FREENOW;
diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c
index bc0fdac..1b1b5c9 100644
--- a/ext/dba/dba_db3.c
+++ b/ext/dba/dba_db3.c
@@ -93,9 +93,9 @@
 	    dbp->set_errcall(dbp, php_dba_db3_errcall_fcn);
 		if(
 #if (DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1))
-			(err=dbp->open(dbp, 0, info->path, NULL, type, gmode, filemode)) == 0) {
+			(err=(dbp->open)(dbp, 0, info->path, NULL, type, gmode, filemode)) == 0) {
 #else
-			(err=dbp->open(dbp, info->path, NULL, type, gmode, filemode)) == 0) {
+			(err=(dbp->open)(dbp, info->path, NULL, type, gmode, filemode)) == 0) {
 #endif
 			dba_db3_data *data;
 
diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c
index ee296b9..22ca32d 100644
--- a/ext/dba/dba_db4.c
+++ b/ext/dba/dba_db4.c
@@ -122,9 +122,9 @@
 	    dbp->set_errcall(dbp, php_dba_db4_errcall_fcn);
 	    if (
 #if (DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1))
-			(err=dbp->open(dbp, 0, info->path, NULL, type, gmode, filemode)) == 0) {
+			(err=(dbp->open)(dbp, 0, info->path, NULL, type, gmode, filemode)) == 0) {
 #else
-			(err=dbp->open(dbp, info->path, NULL, type, gmode, filemode)) == 0) {
+			(err=(dbp->open)(dbp, info->path, NULL, type, gmode, filemode)) == 0) {
 #endif
 			dba_db4_data *data;
 
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 9060dcb..2678751 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -47,6 +47,18 @@
 int le_deflate;
 int le_inflate;
 
+/*
+ * zlib include files can define the following preprocessor defines which rename
+ * the corresponding PHP functions to gzopen64, gzseek64 and gztell64 and thereby
+ * breaking some software, most notably PEAR's Archive_Tar, which halts execution
+ * without error message on gzip compressed archivesa.
+ *
+ * This only seems to happen on 32bit systems with large file support.
+ */
+#undef gzopen
+#undef gzseek
+#undef gztell
+
 ZEND_DECLARE_MODULE_GLOBALS(zlib);
 
 /* {{{ Memory management wrappers */
diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt
index 6fd6f4d..9be9dc6 100644
--- a/ext/standard/tests/strings/setlocale_variation2.phpt
+++ b/ext/standard/tests/strings/setlocale_variation2.phpt
@@ -59,6 +59,7 @@
 //try different locale names
 $failure_locale = array();
 $success_count = 0;
+$expected = 0;
 
 echo "-- Test setlocale() with all available locale in the system --\n";
 // gather all locales installed in the system(stored $all_system_locales),
@@ -68,6 +69,10 @@
   if(setlocale(LC_ALL,$value )){
    $success_count++;
   }
+  else if ($value == 'no_NO.ISO-8859-1') {
+    // ignore this one, see rhbz #971416
+   $expected++;
+  }
   else{
    //failure values are put in to an array $failure_locale
    $failure_locale[] = $value;
@@ -76,11 +81,11 @@
 
 echo "No of locales found on the machine = ".count($all_system_locales)."\n";
 echo "No of setlocale() success = ".$success_count."\n";
-echo "Expected no of failures = 0\n";
+echo "Expected no of failures = $expected\n";
 echo "Test ";
 // check if there were any failure of setlocale() function earlier, if any
 // failure then dump the list of failing locales
-if($success_count != count($all_system_locales)){
+if(($success_count + $expected) != count($all_system_locales)){
   echo "FAILED\n";
   echo "Names of locale() for which setlocale() failed ...\n";
   var_dump($failure_locale);
@@ -96,6 +101,6 @@
 -- Test setlocale() with all available locale in the system --
 No of locales found on the machine = %d
 No of setlocale() success = %d
-Expected no of failures = 0
+Expected no of failures = %d
 Test PASSED
 Done
diff --git a/ext/pcre/tests/grep2.phpt b/ext/pcre/tests/grep2.phpt
index 4c6f9b1..a6247cc 100644
--- a/ext/pcre/tests/grep2.phpt
+++ b/ext/pcre/tests/grep2.phpt
@@ -44,12 +44,6 @@
   string(1) "1"
 }
 bool(true)
-array(3) {
-  [5]=>
-  string(1) "a"
-  ["xyz"]=>
-  string(2) "q6"
-  [6]=>
-  string(3) "h20"
+array(0) {
 }
-bool(false)
+bool(true)
diff --git a/ext/pcre/tests/match_flags3.phpt b/ext/pcre/tests/match_flags3.phpt
index 6511c71..05c62a0 100644
--- a/ext/pcre/tests/match_flags3.phpt
+++ b/ext/pcre/tests/match_flags3.phpt
@@ -41,5 +41,5 @@
   }
 }
 
-Warning: preg_match(): Compilation failed: %s name must start with a non-digit at offset %d in %smatch_flags3.php on line %d
+Warning: preg_match(): Numeric named subpatterns are not allowed in %smatch_flags3.php on line %d
 bool(false)