Report mem leaks to stderr if no Win debugger is present
Formerly, we sent output regarding memory leaks always to the debugger
on Windows, but this appears to be not useful especially for the PHPTs,
which usually are not run under a debugger, and so important info will
not be available there.
David Carlier [Wed, 29 Aug 2018 20:04:32 +0000 (21:04 +0100)]
Support fixed address mmap without replacement
Reapply changes for Zend fixed mapping but only for FreeBSD.
Other BSD might expose some day a similar flag (private
for OpenBSD for the moment for example).
The Linux's part could be brought back but not before 7.4,
at this time, distributions with kernel > 4.17 will be
more widely available.
Peter Kokot [Wed, 5 Sep 2018 00:53:12 +0000 (02:53 +0200)]
Remove HAVE_STDDEF_H
The `<stddef.h>` header file is part of the standard C89 headers [1] and
on current systems there is no need for a manual check if header is
present.
Since PHP requires at least C89 the `HAVE_STDDEF_H` symbol isn't defined
by Autoconf anywhere else anymore [2] and accross the PHP source code
the header is included unconditionally already.
This patch syncs this also for the bundled libmbfl which is maintaned as
a fork in php-src.
Peter Kokot [Sat, 1 Sep 2018 01:56:52 +0000 (03:56 +0200)]
Remove AC_FUNC_UTIME_NULL
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems, including the AC_FUNC_UTIME_NULL.
This macro checks if `utime(file, NULL)` sets file's timestamp to the
current time and defines the `HAVE_UTIME_NULL` symbol. This check was
relevant on very old systems (for example, 4.3BSD released in 1986) and
today can be omitted for systems with utime since it should be well
supported by now. [2]
Peter Kokot [Mon, 3 Sep 2018 19:35:01 +0000 (21:35 +0200)]
Remove AC_FUNC_MEMCMP
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_FUNC_MEMCMP`.
On some old systems such as SunOS 4.1.3 (EOL in 2003) and NeXT x86
OpenStep (discontinued) the `memcmp` function wasn't present or it
didn't work properly. [2]
On current systems including at least Solaris 10+ this check is not
relevant anymore.
Peter Kokot [Mon, 3 Sep 2018 22:17:21 +0000 (00:17 +0200)]
Remove AC_HEADER_DIRENT
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_DIRENT`.
This macro checks which header defines the `DIR` type. If `<dirent.h>`
is available it defines the `HAVE_DIRENT_H` symbol. Since the `<dirent.h>`
header is already checked in the `configure.ac`, this check is not needed
anymore. This macro also additionally checks for SCO Xenix (discontinued,
latest release 1989) dir and x libraries. [2]
Commit 6ed790685f9ddae11834f36b0ba4fea58afc805a introduced also
`<sys/dir.h>`. This header exists from times of UNIX System V and
provided definition of DIR type on these systems such as 4.3BSD.
Today `<sys/dir.h>` is kept for backwards compatibility and includes
the `<dirent.h>` on current systems. With `dirent.h>` present this
include is no longer required.
??= is a trigraph for #, so it needs to be escaped. To stay
consistent I'm escaping all question marks in this literal, even
though one of the latter two would suffice.
Update grammar and clarify wording in couple places
On line 512, I clarified the sentence which uses effect, previously the sentence was awkward.
On line 656, the wrong word is used, I changed affect to effect.
Peter Kokot [Sat, 1 Sep 2018 04:40:53 +0000 (06:40 +0200)]
Remove AC_HEADER_TIME
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_TIME`.
This macro checks if both `<sys/time.h>` and `<time.h>` can be included
at the same time and defines the `TIME_WITH_SYS_TIME` and
`HAVE_SYS_TIME_H` symbols. On current system such check is not relevant
anymore because in case both headers are present both can be also
included at the same time.
Peter Kokot [Sat, 1 Sep 2018 02:18:46 +0000 (04:18 +0200)]
Remove AC_C_CONST
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems, including the `AC_C_CONST`.
The `const` keyword is used in C since C89. On old systems some compilers
lacked the `const` and this macro defined it to be empty. This check was
relevant on systems with compilers before C89 and on current systems it
can be omitted. [2]
PHP also requires at least C89 so `const` is always available.
Fix #75696: posix_getgrnam fails to print details of group
According to the POSIX specification of `getgrnam_r()` the result of
`sysconf(_SC_GETGR_R_SIZE_MAX)` is an initial value suggested for the
size of the buffer, and `ERANGE` signals that insufficient storage was
supplied. So if we get `ERANGE`, we try again with a buffer twice as
big, and so on, instead of failing.
Anatol Belski [Fri, 31 Aug 2018 22:14:23 +0000 (00:14 +0200)]
Fixed bug #76829 Incorrect validation of domain on idn_to_utf8() function
As stated by RFC 5890, U-Labels might be up to 252 Unicode code points
long. This can be fixed in 7.1+ as well, but there might potentially be
issues in some existing apps expecting the output to be max 255 octets
long. Thus it seems to be safer to not to touch stable branches.
Gabriel Caruso [Fri, 31 Aug 2018 11:39:18 +0000 (08:39 -0300)]
Revert changes in test file
This reverts changes made in 2f700384 and 4fcaebba. This test is
supposed to run
only on Windows indeed, as in a Unix environment with a mail server
configured,
an email will be send. On Windows, only emptying the SMTP ini directives
is enough.
Anatol Belski [Mon, 6 Aug 2018 20:35:11 +0000 (22:35 +0200)]
Fix stack underflow in phar
The checks can issue reads below and above the temporary buffer. A read
itself doesn't seem dangerous, but the condition result can be
arbitrary. Such reads have to be avoided. Likely this patch should be
backported.