Commit Graph

136818 Commits

Author SHA1 Message Date
Peter Kokot
5586d0c7de
Autotools: Refactor ptrace check for PHP-FPM (#14907)
- This syncs CS and wraps ptrace function check in a single
  AC_CACHE_CHECK for optional edge case cross-compiling adjustments
- Overquoted arguments are reduced (first the compilation check if
  ptrace in proper form is available on the system and then the run
  check if ptrace works as expected)
- The cache variable php_cv_have_mach_vm_read is renamed to
  php_cv_func_mach_vm_read.
2024-07-11 00:09:08 +02:00
Peter Kokot
d59691c02f
Autotools: Move php_shtool variable initialization to PHP_INIT_BUILD_SYSTEM (#14904)
As this script is still needed across the PHP build system its path can
be also set on once place for both phpize usage and regular php-src's
configure.ac.
2024-07-10 21:15:02 +02:00
David Carlier
17cf7b381a
ext/pcntl adding Pcntl namespace for Qos class.
Close GH-14892
2024-07-10 19:15:04 +01:00
Niels Dossche
71defce4be
Merge branch 'PHP-8.3'
* PHP-8.3:
  ext/gd/tests/gh10614.phpt: skip if no PNG support
2024-07-10 19:51:17 +02:00
Niels Dossche
361644b78d
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/gd/tests/gh10614.phpt: skip if no PNG support
2024-07-10 19:51:11 +02:00
Michael Orlitzky
09957ab9a8
ext/gd/tests/gh10614.phpt: skip if no PNG support
This test uses imagecreatefrompng(), which won't be there if libgd was
built without PNG support.

Closes GH-14905.
2024-07-10 19:50:48 +02:00
Tim Düsterhus
29f98e7485
Replace @deprecated by #[\Deprecated] for internal functions / class constants (#14750)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-07-10 16:47:31 +02:00
Michael
6bb960092a
[skip ci] Fix some typos (#14893) 2024-07-10 00:11:36 +01:00
David CARLIER
93c3ebd209
ext/gd minor corrections concerning image format id for errors. (#14887) 2024-07-09 20:07:07 +01:00
Peter Kokot
9185f613e0
Autotools: Use FPM_EXTRA_LIBS for ACL library (#14881)
- ACL user/group check wrapped in AC_CACHE_CHECK
- instead of appending -lacl to global LIBS variable, this adds it as
  needed only to FPM_EXTRA_LIBS as it was already used in the BUILD_FPM
  invocation
2024-07-09 18:42:31 +02:00
Julien Voisin
c2cbbd9b98
zend_alloc: remove duplicate zend_mm_alloc_large definition (#14880)
The two parts of the #if condition are the same.
2024-07-09 06:46:00 +01:00
Niels Dossche
19813b5b7e
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14741: Segmentation fault in Zend/zend_types.h
2024-07-09 00:57:35 +02:00
Niels Dossche
4c95cb37f5
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14741: Segmentation fault in Zend/zend_types.h
2024-07-09 00:57:28 +02:00
Niels Dossche
eb8c3cb79a
Fix GH-14741: Segmentation fault in Zend/zend_types.h
The create_obj handler of InternalIterator is overwritten, but not the
clone_obj handler. This is not allowed.
In PHP 8.2 this didn't cause a segfault because the standard object
handler was used for the clone instead of the internal handler.
So then it allocates and frees the object using the standard object handlers.
In 8.3 however, the object is created using the standard object handler and
freed using the custom handler, resulting in the buffer overflow.
Even though bisect points to 1e1ea4f this only reveals the bug.

Closes GH-14882.
2024-07-09 00:56:53 +02:00
Calvin Buckley
64c7c4c33c Merge branch 'PHP-8.3'
* PHP-8.3:
  Declare that this test needs iconv extension
2024-07-08 18:39:36 -03:00
Calvin Buckley
192c102bde Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Declare that this test needs iconv extension
2024-07-08 18:38:59 -03:00
Calvin Buckley
43e3f577b9 Declare that this test needs iconv extension
Otherwise it would fail with the usual recommended ./configure
invocation used for RMs testing (i.e. --disable-all).
2024-07-08 18:37:52 -03:00
David CARLIER
479707b4d3
tsrm_realpath_r for win32 mountpoints copy little optimisations. (#14852) 2024-07-08 20:31:12 +01:00
Peter Kokot
9e94d2b040
Autotools: Refactor builtin checks (#14835)
This creates a single M4 macro PHP_CHECK_BUILTIN and removes other
PHP_CHECK_BUILTIN_* macros. Checks are wrapped in AC_CACHE_CHECK and
PHP_HAVE_BUILTIN_* CPP macro definitions are defined to 1 if builtin
is found and undefined if not.

This also changes all PHP_HAVE_BUILTIN_ symbols to be either undefined
or defined (to value 1) and syncs all #if/ifdef/defined usages of them
in the php-src code. This way it is simpler to use them because they
don't need to be defined to value 0 on Windows, for example. This is
done as previous usages in php-src were mixed and on many places they
were only checked with ifdef.
2024-07-08 21:25:16 +02:00
Peter Kokot
745ae8ddd8
Autotools: Remove obsolete crypt link override due to OpenSSL (#14863)
OpenSSL versions before 0.9.7 provided its own crypt() function (and
des_* functions) in its Crypto library that interfered with the
implementation relying on crypt() from some other crypt library. This is
at this point obsolete as crypt and other functions that caused clashes
were removed in OpenSSL version 1.1.0.

In OpenSSL 0.9.7 des_old.c and des_old.h files were provided for BC.

In OpenSSL 0.9.8 crypt() function was renamed to _ossl_old_crypt and the
crypt macro definition was commented out in the des_old.h header.

In OpenSSL 1.1.0 the old DES API was removed, meaning OpenSSL's crypto
library no longer provides crypt() function as it used to.

References:
- Some further historic notes on this:
  https://www.openldap.org/faq/data/cache/1041.html
- OpenSSL Git commit history and changelogs
2024-07-08 20:24:28 +02:00
Calvin Buckley
3618382d07
Handle BSD checksum and file utilities (#14690)
* Handle BSD checksum utilities

The BSDs have different checksum utilities than GNU systems do. If we
don't see the GNU checksum utilities installed, use the BSD ones, as
their output is compatible enough.

Addresses part of GH-14688.

* Prefer GNU touch

BSD touch at least in macOS does not handle local timezone in the
timestamp (like 2024-06-27T10:26:23-03:00). As such, try GNU touch (as
ports systems almost always prefix with g if coreutils is installed) and
prefer that if available. It's not the end of the world though if GNU
touch isn't available, as BSD touch on some systems may support it, and
if it doesn't, then it's just timestamps, nothing too serious.
2024-07-08 13:27:47 -03:00
David Carlier
23a55babb4
ext/gd: checking imagescale/imagefilter invalid values.
close GH-14598
2024-07-08 16:59:40 +01:00
Niels Dossche
8825235348
Reapply "Stop using reserved names in dom"
This reverts commit dda96768ec.
2024-07-08 17:27:39 +02:00
Peter Kokot
7fda12218a
Autotools: Move Apache warning to SAPI's config.m4 (#14872)
This uses AC_CONFIG_COMMANDS macro to conditionally output the warning
message at the end of configure phase if non-threaded Apache
installation has been found and PHP is built without --enable-zts.

Variables set in the 2nd argument (init-cmds) are for the command
invocation scope as the first argument doesn't have any knowledge of
configure variables as described in the Autoconf docs.

This is moved as it is related only to apache2handler SAPI and also
now warning is displayed a bit nicer at the end of the configure phase
after files are generated. This also enables outputting warning when
using config.status script.
2024-07-08 17:17:33 +02:00
Peter Kokot
1f847a0bdf
Check Apache HTTP Server command-line utility (#14173)
The Apache HTTP server command-line tool (/usr/sbin/apache2) might be
part of a separate package, such as apache2-bin or similar. If not
installed, the configure script can still find the apxs tool, but
previously didn't check for the HTTP server tool separately. Otherwise,
configure syntax errors (integer expression expected) are thrown when
checking for the Apache version.
2024-07-08 17:15:09 +02:00
Peter Kokot
05b9345b08
Autotools: Remove unused DEBUG_CFLAGS variable (#12659)
This removes the unused DEBUG_CFLAGS variable from configure.ac. It has
been once set in the build files similarly to Zend.m4 but was then
removed and simplified.

CS synced and DEBUG_CFLAGS checked and appended with AS_VAR_* macros.
2024-07-08 17:05:57 +02:00
Niels Dossche
33289dfa5c
Revert "Remove unnecessary include statements from dom"
This reverts commit dd795022fa.
2024-07-08 16:26:50 +02:00
Niels Dossche
dda96768ec
Revert "Stop using reserved names in dom"
This reverts commit 013bc53f0c.

This somehow breaks the Windows build. Will investigate later.
2024-07-08 16:07:32 +02:00
Niels Dossche
ff770d023a
Throw an exception when using the namespace axis in XPath in modern DOM (#14871)
This was specified in https://wiki.php.net/rfc/dom_additions_84, under
the "NamespaceInfo" section, but was not implemented yet.
2024-07-08 15:15:38 +02:00
Niels Dossche
013bc53f0c Stop using reserved names in dom 2024-07-08 06:09:04 -07:00
Niels Dossche
c98a7c1195 Add parenthesis to macro arguments in dom_properties.h 2024-07-08 06:09:04 -07:00
Niels Dossche
ae0ba1a5c6 Add parenthesis to macro arguments in internal_helpers.h 2024-07-08 06:09:04 -07:00
Niels Dossche
3303c15754 Make some pointers const in php_dom.h 2024-07-08 06:09:04 -07:00
Niels Dossche
dd795022fa Remove unnecessary include statements from dom 2024-07-08 06:09:04 -07:00
Niels Dossche
c695b1dc88
Improve error message for too long file in ext/tidy (#14870)
As suggested in https://github.com/php/php-src/pull/14862#discussion_r1667788025
2024-07-08 15:06:57 +02:00
Peter Kokot
2f97ad9c10
[skip ci] Add link to FPM docs in FPM man page (#14853)
This removes obsolete link to php-fpm.org and redundant manual link in
favor of a dedicated FPM chapters.

Can be tested with:

    man sapi/fpm/php-fpm.8.in
2024-07-08 14:59:45 +02:00
Peter Kokot
083493be57
Fix AS_VAR_* checks (#14868)
AS_VAR_SET_IF doesn't behave the same as "test -n" and/or "test -z",
which becomes an issue for Apache's ZTS automatic enabling and CFLAGS
edge case where it would be explicitly set to empty value. It is safer
to use AS_VAR_IF instead of AS_VAR_SET_IF in these cases.
2024-07-08 14:20:58 +02:00
Niels Dossche
0b3c506b18
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix memory leak in tidy_repair_file()
2024-07-08 13:31:25 +02:00
Peter Kokot
300d092449
Autotools: Refactor phpdbg POSIX Threads checks (#14865)
- AS_VAR_IF, AS_VAR_APPEND used and CS synced
- Added one missing AC_MSG_RESULT to properly put the configure output
  log on each line
- AH_TEMPLATE used for HAVE_USERFAULTFD_WRITEFAULT to have help text on
  lesser places
- Redundant terminating semicolons removed
- Redundant PTHREADS_CHECK call removed as it is already done in
  configure.ac and before including SAPI M4 stubs
- Redundant CFLAGS and LIBS storing and restoring removed
2024-07-08 13:26:53 +02:00
Niels Dossche
b8077e46ed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix memory leak in tidy_repair_file()
2024-07-08 13:25:10 +02:00
Niels Dossche
c34def581a
Fix memory leak in tidy_repair_file()
When dealing with a file, we must free the contents if the function
fails. While here, also fix the error message because previously it
sounded like the filename was too long while in fact the file itself
is too large.

Closes GH-14862.
2024-07-08 13:24:32 +02:00
Peter Kokot
3d8bd8fe4f
Remove unused HAVE_PHPDBG (#14864)
This is not defined on Windows and isn't used. Also phpdbg doesn't
install any headers to the public usage.
2024-07-08 00:42:05 +02:00
Peter Kokot
1bdf9aa38d
Remove support for EOL Apache 2.0 and 2.2 in favor of 2.4+ (#14664)
Apache 2.2 has been marked as EOL in December 2017 and doesn't receive
security patches any longer. Also, most *nix distributions and packages
mostly support 2.4 as minimum by now.

On Windows, this removes the configure option --enable-apache2-2handler
and merges the --enable-apache2handler and --enable-apache2-4handler
into a single option with favoring the --enable-apache2handler.

- The upstream MODULE_MAGIC_NUMBER is deprecated in favor of
  MODULE_MAGIC_NUMBER_MAJOR in apache2/ap_mmn.h
- The initial upstream MODULE_MAGIC_NUMBER_MAJOR was 20111025 in Apache
  2.4.0
- The upstream APLOG_USE_MODULE is always available since Apache 2.3.6
- The upstream CORE_PRIVATE is unnecessary and ignored since Apache
  2.4.0

See:
https://forum.apachehaus.com/news-general-discussion/apache-2-2-users-your-time-is-running-out/

Discussion: https://news-web.php.net/php.internals/124067
2024-07-08 00:07:55 +02:00
Peter Kokot
80e0c0aaf4
Autotools: Refactor dmalloc check (#14726)
- AS_VAR_APPEND used for enabling Dmalloc check-funcs token
- CS synced
2024-07-07 23:35:50 +02:00
Peter Kokot
e9254494ff
Autotools: Simplify POSIX Threads check (#14855)
The PTHREADS_CHECK is using cache variables so it is run only once early
during the configuration phase, before including SAPI and other M4
files. This removes the TSRM_CHECK_PTHREADS macro and moves the POSIX
Threads check after the PHP_THREAD_SAFETY variable is set in
configure.ac.

The check and error throw in PHP_BUILD_THREAD_SAFE is also joing into
this single check.

This removes the redundant tsrm.m4 file and PHP_CONFIGURE_PART call for
TSRM as it doesn't run any configuration checks anymore.
2024-07-07 22:44:44 +02:00
Peter Kokot
9def76ebbc
Autotools: Refactor crypt check in ext/standard (#14856)
- AH_TEMPLATE sets the CPP macro help text on a single place
- AC_DEFINE can be used instead of AC_DEFINE_UNQUOTED
- AS_VAR_IF used and CS synced
- crypt() function is at this point required as all required algorithm
  checks are depending on it and error is thrown if not found when using
  external crypt library
2024-07-07 21:46:44 +02:00
Peter Kokot
2acd4c2bbc
Autotools: Sync HAVE_ERASE_EMPTY_LINE help text (#14857)
HAVE_ERASE_EMPTY_LINE always gets the last AC_DEFINE help text, so it is
simpler to have the same help message for both definitions (readline and
editline). First text never got into header via autoheader anyway.
2024-07-07 21:31:31 +02:00
David CARLIER
1db75d42bb
ext/sockets: socket_get_option/socket_set_option SO_LINGER_SEC. (#14858)
9672cd9469 follow-up.
2024-07-07 14:23:01 +01:00
Niels Dossche
23391f1fe7
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
2024-07-07 13:18:42 +02:00
Niels Dossche
d3992b6d09
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
2024-07-07 13:18:35 +02:00