1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00
Commit Graph

118687 Commits

Author SHA1 Message Date
George Peter Banyard 418bb5ebda Fix [-Wundef] warning in Sysvshm extension 2020-05-18 00:37:16 +02:00
George Peter Banyard 046ff29958 Fix [-Wundef] warnings in LDAP extension 2020-05-18 00:37:15 +02:00
George Peter Banyard f717ec608d Adjust bogus checks in FPM as HAVE_FPM_LQ is always defined
Drop checks for FPM status as per review

Closes GH-5530
2020-05-17 22:04:35 +02:00
George Peter Banyard 35e0a91db7 Fix [-Wundef] warnings in libxml extension 2020-05-16 15:31:23 +02:00
George Peter Banyard 68164f40ce Fix [-Wundef] warning in MBString extension 2020-05-16 15:31:20 +02:00
George Peter Banyard c19887496e Fix [-Wundef] warning in IMAP extension 2020-05-16 15:31:18 +02:00
George Peter Banyard 2cf24ff923 Fix [-Wundef] warning in GetText extension 2020-05-16 15:31:17 +02:00
George Peter Banyard 8a18116dba Fix [-Wundef] warning in FTP extension 2020-05-16 15:31:17 +02:00
George Peter Banyard fb5114c675 Fix [-Wundef] warning in Filter extension 2020-05-16 15:31:16 +02:00
George Peter Banyard e37501e6c7 Fix [-Wundef] warning in EXIF extension 2020-05-16 15:31:16 +02:00
George Peter Banyard 62b1d2cb69 Fix [-Wundef] warning in DOM extension 2020-05-16 15:31:15 +02:00
George Peter Banyard 93b51f4e26 Fix [-Wundef] warning in cURL extension 2020-05-16 15:31:13 +02:00
George Peter Banyard b35addc585 Fix [-Wundef] warning in CType extension 2020-05-16 15:31:13 +02:00
George Peter Banyard 0e016f2843 Fix [-Wundef] warning in BZip2 extension 2020-05-16 15:31:12 +02:00
George Peter Banyard 2bb1cc4ba9 Fix [-Wundef] warning in BCMath extension 2020-05-16 15:31:11 +02:00
George Peter Banyard b91c2845cf Drop check for HAVE_NSLDAP
This constant is never defined thus useless
2020-05-16 00:40:37 +02:00
George Peter Banyard 197cac65fd Use ZEND_FCI_INITIALIZED macro
Instead of manually checking that the fci.size is different than 0
2020-05-16 00:36:15 +02:00
Nikita Popov 00ef092335 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79600
2020-05-15 11:05:00 +02:00
Nikita Popov d87b0685b5 Fixed bug #79600
Missed unsetting of DO_INIT in one case.
2020-05-15 11:04:40 +02:00
Nikita Popov 406c95758d Remove some uses of zend_inline_hash_func
There's no need to force-inline the hashing for all of these.
2020-05-15 10:14:22 +02:00
Dmitry Stogov ba0731cd53 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  fixed typo of bug id (#79599)
  master doesn't been affected since we are not passing errcontext now
  Fixed bug #97599 (coredump in set_error_handler)
  Fix #79557: extension_dir = ./ext now use current directory for base
  Fix #79596: MySQL FLOAT truncates to int some locales
  [ci skip] Fix NEWS
2020-05-15 10:44:14 +03:00
Xinchen Hui c91f349717 Merge branch 'PHP-7.4'
* PHP-7.4:
  fixed typo of bug id (#79599)
2020-05-15 15:44:02 +08:00
Xinchen Hui 3a3241ced7 fixed typo of bug id (#79599) 2020-05-15 15:43:38 +08:00
Xinchen Hui 653652b2b6 master doesn't been affected since we are not passing errcontext now 2020-05-15 15:40:53 +08:00
Xinchen Hui 0ece5638a4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #97599 (coredump in set_error_handler)

Conflicts:
	Zend/zend.c
2020-05-15 15:40:43 +08:00
Xinchen Hui 446d189aa0 Merge branch 'PHP-7.4' of git.php.net:/php-src into PHP-7.4
* 'PHP-7.4' of git.php.net:/php-src:
  Fix #79557: extension_dir = ./ext now use current directory for base
  Fix #79596: MySQL FLOAT truncates to int some locales
  [ci skip] Fix NEWS
2020-05-15 15:36:51 +08:00
Xinchen Hui ccd41e0833 Fixed bug #97599 (coredump in set_error_handler) 2020-05-15 15:36:00 +08:00
Christoph M. Becker 4631b4e813 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79557: extension_dir = ./ext now use current directory for base
2020-05-15 09:24:07 +02:00
Christoph M. Becker 8c6d006b55 Fix #79557: extension_dir = ./ext now use current directory for base
For some reason, `ImageLoad()` fails to load images with a relative
path starting with `.\`  or `./`.  We work around this issue by
stripping those leading characters.
2020-05-15 09:23:18 +02:00
Christoph M. Becker 2393692937 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79596: MySQL FLOAT truncates to int some locales
2020-05-15 09:13:22 +02:00
Christoph M. Becker 844a1245ef Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79596: MySQL FLOAT truncates to int some locales
2020-05-15 09:11:44 +02:00
Christoph M. Becker d1cd489a53 Fix #79596: MySQL FLOAT truncates to int some locales
We must not do locale aware float to string conversion here; instead
we using our `snprintf()` implementation with the `F` specifier.
2020-05-15 09:09:41 +02:00
Christoph M. Becker 3771d6f8a1 Merge branch 'PHP-7.4'
* PHP-7.4:
  [ci skip] Fix NEWS
2020-05-15 08:59:55 +02:00
Christoph M. Becker f4c9f8b17b [ci skip] Fix NEWS
We add the missing release dates, the NEWS regarding the latest CVE
fixes, and move the entry for bug #79536 to 7.4.7 because it didn't
make it into 7.4.6.
2020-05-15 08:53:58 +02:00
Dmitry Stogov e5e25d6352 Added HALT symbol 2020-05-15 01:06:47 +03:00
Christoph M. Becker f6ae728f56 Remove unused variable 2020-05-14 17:55:31 +02:00
Máté Kocsis 93640db4d5 Improve error message for deprecated methods 2020-05-14 17:23:31 +02:00
Bob Weinand 4bc1cf2928 Remove generated zend_jit_x86.c upon make distclean 2020-05-14 16:59:54 +02:00
Christoph M. Becker 5a17694304 Merge branch 'PHP-7.4'
* PHP-7.4:
  Check compatibility with proper runtime DLL
2020-05-14 15:59:34 +02:00
Christoph M. Becker bfcee2c746 Check compatibility with proper runtime DLL
In practise, this likely does not matter, because usually these DLLs
are installed side by side, but still we should check the proper DLL.
2020-05-14 15:57:55 +02:00
Nikita Popov e696732850 Merge branch 'PHP-7.4'
* PHP-7.4:
  Canonicalize bison error during ini parsing
2020-05-14 14:16:22 +02:00
Nikita Popov 3978d3a957 Canonicalize bison error during ini parsing
Bison 3.6 seems to use "end of file" rather than "$end" for this.
Force the same on older bison versions to be consistent.
2020-05-14 14:15:56 +02:00
Máté Kocsis 68527a7834 Add stubs for some SAPIs
For apache2handler, fpm, litespeed, phpdbg, specifically.
Partially implements GH-5295
2020-05-14 13:35:12 +02:00
Dmitry Stogov 161ee110bf Tracing JIT support for delayed call chain 2020-05-14 14:21:46 +03:00
Máté Kocsis 9198faa67f Convert resource to object in Sysvmsg
Closes GH-5546
2020-05-14 12:56:06 +02:00
Nikita Popov 75bac16788 Avoid duplicating the proc_open cleanup logic
Use a slightly ugly "goto unreachable" pattern to share this code,
so we don't have to duplicate cleanup logic for the success and
the failure cases.
2020-05-14 10:35:33 +02:00
Alex Dowad dc1496e4a3 Further refactoring of proc_open.c
This time a number of comments have been added to make it easy for new devs to understand
what is going on. Also adjusted error message to use colons rather than dashes.
2020-05-14 10:25:52 +02:00
Alex Dowad b983580dd7 Don't leak memory if wrong resource type is passed to proc_open
proc_open can accept stream resources in the descriptorspec, like this:

    proc_open("command", array(0 => $resource), $pipes);

Previously, if a resource which was *not* of type "stream" was passed, proc_open would
return without freeing dynamically allocated memory. It's fixed now.
2020-05-14 10:25:37 +02:00
Alex Dowad a84cd96e86 Add PTY support to proc_open (again after 16 long years)
Back in 2004, a feature was added to proc_open which allowed it to open a PTY,
connecting specific FDs in the child process to the slave end of the PTY and returning
the master end of the PTY (wrapped as a PHP stream) in the `$pipes` array. However,
this feature was disabled just about a month later. Little information is available
about why this was done, but from talking to the original implementer, it seems there
were portability problems with some rare flavors of Unix.

Re-enable this feature with a simplified implementation which uses openpty(). No
attempt is made to support PTYs if the platform does not have openpty(). The configure
script checks if linking with -lutil is necessary to use openpty(), but if anything
else is required, like including some special header or linking with some other library,
PTY support will be disabled.

The original PTY support for proc_open automatically daemonized the child process
(disassociating it from the TTY session and process group of the parent). However,
I don't think this is a good idea. Just because a user opens a child process in a
PTY, it doesn't mean they want it to continue running even when the parent process
is killed. Of course, if the child process is some kind of server, it will likely
daemonize itself; but we have no reason to preempt that decision.

It turns out that since 2015, there has been one test case for PTY support in
proc_open() in the test suite. This test was added in GitHub PR #1588
(https://github.com/php/php-src/pull/1588). That PR mentioned that the PHP
binary in the Debian/Ubuntu repositories is patched to *enable* PTY support. Checking
the Debian PHP repository (https://salsa.debian.org/php-team/php.git) shows that this
is still true. Debian's patch does not modify the implementation from 2004 in any
way; it just removes the #if 0 line which disables it.

Naturally, the test case is skipped if PTY support is not enabled. This means that ever
since it was added, every test run against the 'vanilla' PHP codebase has skipped it.

Interestingly, the test case which was added in 2015 fails on my Linux Mint PC... both
with this simplified implementation *and* when enabling the original implementation.
Investigation reveals the reason: when the child process using the slave end of the
PTY exits and its FDs are all closed, and all buffered data is read from the master
end of the PTY, any further attempt to read from the master end fails with EIO. The
test case seems to expect that reading from the master end will always return an
empty string if no data is available.

Likely this is because PHP's fread() was updated to report errors from the underlying
system calls only recently.

One way out of this dilemma: IF at least one FD referring to the slave end of the PTY is
kept open *in the parent process*, the failure with EIO will not occur even after the child
process exits. However, that would raise another issue: we would need a way to ensure the FD
will be closed eventually in long-running programs.

Another discovery made while testing this code is that fread() does not always return
all the data written to the slave end of the PTY in a single call, even if the data was
written with a single syscall and it is only a few bytes long.

Specifically, when the child process in the test case writes "foo\n" to the PTY, the parent
sometimes receives "foo" (3 bytes) and sometimes "foo\r\n" (5 bytes). (The "\r" is from the
TTY line discipline converting "\n" to "\r\n".) A second call to fread() does return the
remaining bytes, though sometimes all the data is read in the first call, and by the time
the second call is made, the child process has already exited. It seems that liberal use
of the @ operator is needed when using fread() on pipes.

Thanks to Nikita Popov for suggesting that we should just use openpty() rather than
grantpt(), unlockpt(), etc.
2020-05-14 10:25:37 +02:00
Nikita Popov ae5ca5459f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix lcov genhtml: ERROR: cannot read [file]
  Properly detect CRC32 APIs on aarch64 from configure
2020-05-14 09:39:03 +02:00