summarylogtreecommitdiffstats
path: root/debian-php-7.3.33.patch
blob: 000ca3b7e5b3eabf7a15509a4c13a9e07ea9efd8 (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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310

diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 612cdf0..7edba08 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -56,7 +56,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 990e095..c768f17 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -302,6 +302,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 for security reasons.
diff --git a/ext/dba/config.m4 b/ext/dba/config.m4
index 86fa480..ef13306 100644
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index c7bea22..0aca1a5 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)
@@ -556,6 +560,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/build/build.mk b/build/build.mk
index 1ce958f..b8c7492 100644
--- a/build/build.mk
+++ b/build/build.mk
@@ -63,6 +63,5 @@
 	@if (test ! -f '.git/info/exclude' || grep -s "git-ls-files" .git/info/exclude); then \
 		(echo "Rebuild .git/info/exclude" && echo '*.o' > .git/info/exclude && git svn propget svn:ignore | grep -v config.nice >> .git/info/exclude); \
 	fi; \
-	git clean -X -f -d;
 
 .PHONY: $(ALWAYS) snapshot
diff --git a/ext/dba/config.m4 b/ext/dba/config.m4
index ef13306..84ab6a9 100644
diff --git a/sapi/fpm/php-fpm.8.in b/sapi/fpm/php-fpm.8.in
index 86edaa8..19e66a0 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 131f77c..018ff2f 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -691,7 +691,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 0aca1a5..715f57c 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -991,7 +991,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 e59ecc2..1eda914 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 b793020..96f6a67 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 f4283c8..f8a73b8 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 fad3298..3449b28 100644
--- a/ext/standard/tests/strings/setlocale_variation2.phpt
+++ b/ext/standard/tests/strings/setlocale_variation2.phpt
@@ -55,6 +55,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),
@@ -64,6 +65,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;
@@ -72,11 +77,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);
@@ -92,6 +97,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)
diff --git a/sapi/fpm/tests/tester.inc b/sapi/fpm/tests/tester.inc
index c07fabe..48cfdcc 100644
--- a/sapi/fpm/tests/tester.inc
+++ b/sapi/fpm/tests/tester.inc
@@ -860,7 +860,17 @@
     {
         $port = $this->getPort($type, $pool, true);
         if ($type === 'uds') {
-            return $this->getFile($port . '.sock');
+            $address = $this->getFile($port . '.sock');
+
+            // Socket max path length is 108 on Linux and 104 on BSD,
+            // so we use the latter
+            if (strlen($address) <= 104) {
+                return $address;
+            }
+
+            return sys_get_temp_dir().'/'.
+                hash('crc32', dirname($address)).'-'.
+                basename($address);
         }
 
         return $this->getHost($type) . ':' . $port;