This test fails intermittently due to taskill reporting failure to kill
the process (because it already has been terminated). We increase the
sleep time, to hopefully prevent that from happening again.
We check that the given microsecond fraction is in the valid range
[0, 1000000[, and otherwise mark it as invalid. We also drop the
useless do loop; a plain block is sufficient here.
Nikita Popov [Fri, 3 Jan 2020 10:51:46 +0000 (11:51 +0100)]
Remove unnecessary strncpy in zip
This causes a warning on GCC 9 and is unnecessary to boot: We
only use "cwd" for the open_basedir check, so we can just as well
pass in the original string.
Nikita Popov [Fri, 3 Jan 2020 10:14:45 +0000 (11:14 +0100)]
Fixed bug #71876
This is a backport of fcdc0a6db0ae63fbed9e3828137b899b844623ce
to the PHP-7.3 branch. We need to make sure that OnUpdateString
is also called for a NULL value, otherwise the reset of the encoding
at the end of the request will not work.
Nikita Popov [Thu, 2 Jan 2020 14:50:44 +0000 (15:50 +0100)]
Fixed bug #79055
Fix file cache serialization of property types. I'm changing the
overall type serialization format to perform additional adjustments
in order to yield a plausible pointer for zend_type, rather than
using an entirely separate serialization format, as was previously
done. That would have been annoying to extend to the case of CE
pointers.
Nikita Popov [Thu, 2 Jan 2020 13:56:39 +0000 (14:56 +0100)]
Fix file cache run_time_cache unserialization
If the script was serialized as file_cache_only (thus non-immutable)
and then gets unserialized into SHM, we need to allocate a new
run_time_cache slot and can't use the serialized arena pointer.
Nikita Popov [Thu, 2 Jan 2020 10:11:01 +0000 (11:11 +0100)]
Populate hashtable of __sleep() properties
Instead of populating a hashtable of property names and then
directly serializing.
This has the advantage of a) detecting duplicate properties more
precisely and b) gives us the ability to discard values without
rewriting the serialization string after the fact for GH-5027.
Nikita Popov [Mon, 30 Dec 2019 17:01:55 +0000 (18:01 +0100)]
Switch php_hash_fetch_ops() to use zend_string
This has two advantages: If the string is already lowercase, we
do not need to copy it, and it will hopefully match the interned
string name of the hash, making the comparison more efficient.
Tyson Andre [Mon, 30 Dec 2019 16:15:22 +0000 (11:15 -0500)]
Always delete tempfile created by ftruncate test.
The ftruncate() test will fill up the disk when the disk has less than
2GB of space left, on some systems.
I think it expands the file to less than 2GB, then returns an error code,
and the file remains at the larger size.
Because the disk is full, the `--CLEAN--` script can't be saved to
`ftruncate_bug76422.clean.php` to be executed, and the cleanup can't be run.
Subsequent tests also fail to run.
Nikita Popov [Mon, 30 Dec 2019 22:06:12 +0000 (23:06 +0100)]
Make url_stats in resolve_path quiet
These stats are used to check whether the file exists -- they
should not generate errors. Having the flag set is particularly
important for custom stream wrappers.
Fix #78790: mysqli_get_client_info() expects exactly 0 parameters, 1 given
Although the `mysqli` parameter is unused, it had been accepted so far,
and the documentation even claims that parameter would be required. To
not break BC, we allow it again.
Fix #79040: Warning Opcode handlers are unusable due to ASLR
We must not use the same shared memory OPcache instance for different
SAPIs, since their memory layout is different. To avoid this, we add
the SAPI name (truncated to at most 20 characters) to the names of the
memory base file, the mutex and the file mapping.
Wouter Wijsman [Tue, 17 Dec 2019 08:13:41 +0000 (09:13 +0100)]
Add FILTER_VALIDATE_BOOL as alias for FILTER_VALIDATE_BOOLEAN
Both filters are equivalent, but FILTER_VALIDATE_BOOL uses our
canonical name for the type (the only one permitted in type
declarations for example), so the new name is preferred long
term.
The old name may be deprecated in the future, but no specific
timeline is planned.
See bug #79031. The semantics of serialize locking aren't quite
correct right now, and the use of the lock in this particular
place makes us hit the issue in a common case. I'm reverting this
commit for PHP 7.4 and will try to fix this properly for PHP 8,
as I believe it will require ABI breakage.
Nikita Popov [Fri, 27 Dec 2019 16:31:27 +0000 (17:31 +0100)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Handle empty password fast path in caching_sha2_password
Handle error response during caching_sha2_password auth
Add support for caching_sha2_password in change user authentication
Fix unix socket check during caching_sha2_password
Support auth switch request during caching sha2 auth
Nikita Popov [Fri, 27 Dec 2019 16:26:42 +0000 (17:26 +0100)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Don't use PASSWORD() function in test
Specify explicit row order in PDO MySQL test
Skip bug77956.phpt if local_infile disabled on server
Don't check TIMESTAMP NOT NULL in fetch_field_flags test
Don't test the RENAME DATABASE query
Make GeomFromText tests compatible with MySQL 8
Nikita Popov [Fri, 27 Dec 2019 13:02:18 +0000 (14:02 +0100)]
Don't check TIMESTAMP NOT NULL in fetch_field_flags test
The behavior of this is very dependent on the MySQL vendor, MySQL
version and MySQL configuration, in particular the
explicit_defaults_for_timestamp variable.
I don't think it's worthwhile to try and model this exactly, so
drop the test.
Actually, `max_fd` is not used on Windows, since `PHP_SAFE_MAX_FD` and
`select` ignore it; so it makes no sense to calculate it in the loop.
Even worse, since `php_socket_t` is unsigned on Windows, it will never
be modified during the loop, because `SOCK_ERR` is already the largest
representable value of that type.
Therefore we skip the loop on Windows, and add a clarifying comment.