Commit graph

813 commits

Author SHA1 Message Date
Niels Dossche
bfa2cfc9ed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix NULL deref on high modification key
2025-04-16 11:38:38 +02:00
Niels Dossche
c905d59106
Fix NULL deref on high modification key
We should re-index in the loop.

Closes GH-18331.
2025-04-16 11:37:49 +02:00
Remi Collet
bcee2af398
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  NEWS for GH-17940
  Fix #17776 LDAP_OPT_X_TLS_REQUIRE_CERT can't be overridden
2025-04-10 17:13:37 +02:00
Remi Collet
389de7c6bf
Fix #17776 LDAP_OPT_X_TLS_REQUIRE_CERT can't be overridden 2025-04-10 17:07:15 +02:00
Niels Dossche
6717947ffe
Fix GH-18015: Error messages for ldap_mod_replace are confusing
Closes GH-18053.
2025-03-15 00:42:07 +01:00
Niels Dossche
e3a23069c9
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17704: ldap_search fails when $attributes contains a non-packed array with numerical keys
2025-02-06 23:31:30 +01:00
Niels Dossche
2fb88b2d80
Fix GH-17704: ldap_search fails when $attributes contains a non-packed array with numerical keys
Closes GH-17710.
2025-02-06 23:31:01 +01:00
Niels Dossche
726c96fbef
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Backport fix GH-17280: ldap_search() fails when $attributes array has holes
2024-12-29 12:19:33 +01:00
Niels Dossche
26f3bec63e
Backport fix GH-17280: ldap_search() fails when $attributes array has holes
Backport of GH-17284 to fix GH-17280 on lower branches.

Closes GH-17287.
2024-12-29 12:19:05 +01:00
Jakub Zelenka
7c96af42b7
Merge branch 'PHP-8.3' into PHP-8.4 2024-11-20 11:14:04 +01:00
Jakub Zelenka
ffff27f734
Merge branch 'PHP-8.2' into PHP-8.3 2024-11-20 11:12:19 +01:00
Niels Dossche
fba659abb9
Fix GHSA-g665-fm4p-vhff: OOB access in ldap_escape 2024-11-20 11:06:12 +01:00
Christoph M. Becker
6b754d9e81
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Skip tests if ldap_set_rebind_proc() is not available
2024-11-07 13:24:00 +01:00
Christoph M. Becker
fb6d500457
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Skip tests if ldap_set_rebind_proc() is not available
2024-11-07 13:22:54 +01:00
Christoph M. Becker
d276ea54f4
Skip tests if ldap_set_rebind_proc() is not available
This is already done by ldap_set_rebind_proc_error.phpt, but not by the
other two affected tests.

Closes GH-16708.
2024-11-07 13:22:17 +01:00
Gina Peter Banyard
747860ccf0
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  NEWS entries for LDAP bug fixes
  ext/ldap: Fix GH-16136 (Memory leak in php_ldap_do_modify())
  ext/ldap: Fix GH-16132 (Freeing pointer not allocated by ZMM)
2024-09-30 22:24:39 +01:00
Gina Peter Banyard
10b5d4beb5
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  NEWS entries for LDAP bug fixes
  ext/ldap: Fix GH-16136 (Memory leak in php_ldap_do_modify())
  ext/ldap: Fix GH-16132 (Freeing pointer not allocated by ZMM)
2024-09-30 22:24:08 +01:00
Gina Peter Banyard
21260318c6
ext/ldap: Fix GH-16136 (Memory leak in php_ldap_do_modify()) 2024-09-30 22:23:01 +01:00
Gina Peter Banyard
c910e78c39
ext/ldap: Fix GH-16132 (Freeing pointer not allocated by ZMM)
Closes GH-16134
2024-09-30 22:23:01 +01:00
Gina Peter Banyard
16b272da14
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  ext/ldap: Fix GH-16101 (Segfaults in php_ldap_do_search() when LDAPs is not a list)
2024-09-28 19:54:40 +01:00
Gina Peter Banyard
0f2fe67b2a
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/ldap: Fix GH-16101 (Segfaults in php_ldap_do_search() when LDAPs is not a list)
2024-09-28 19:54:06 +01:00
Gina Peter Banyard
19bba83715
ext/ldap: Fix GH-16101 (Segfaults in php_ldap_do_search() when LDAPs is not a list)
Closes GH-16102
2024-09-28 19:52:47 +01:00
Gina Peter Banyard
18f61ad47d
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  ext/ldap: Fix GH-16032 (Various NULL pointer dereferencements in ldap_modify_batch())
2024-09-25 23:27:12 +01:00
Gina Peter Banyard
459486a7db
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/ldap: Fix GH-16032 (Various NULL pointer dereferencements in ldap_modify_batch())
2024-09-25 23:26:31 +01:00
Gina Peter Banyard
f4c45ee376
ext/ldap: Fix GH-16032 (Various NULL pointer dereferencements in ldap_modify_batch())
We check that the "attrib" and "modtype" keys are present in each array.
If not we throw a ValueError, in line with what other validation failure cases do.

Closes GH-16057
2024-09-25 23:23:56 +01:00
DanielEScherzer
5dd0575698
Generated arginfo header files: combine preprocessor conditional blocks (#15736)
When functions' or class methods' availability is based on some preprocessor
condition, the generated arginfo header files wrap the declarations in the
preprocessor `#if` conditional blocks, one per declaration, even if they are in
the same conditional block based on comments in the stub file. Instead of
having multiple conditional blocks one after the other with the same condition,
combine them into a single conditional block.
2024-09-04 13:04:22 +02:00
DanielEScherzer
53cb89670c
Generated arginfo header files: remove empty zend_function_entry arrays (#15705)
When a class (or enum) has no methods, rather than using an array that only
contains `ZEND_FE_END`, use `NULL` for the functions. The implementation of
class registration for internal classes, `do_register_internal_class()` in
zend_API.c, already skips classes where the functions are `NULL`. By removing
these unneeded arrays, we can reduce the size of the header files, while also
removing an unneeded call to zend_register_functions() for each internal class
with no extra methods.
2024-09-03 23:19:53 +02:00
Peter Kokot
1b757c8d3c
Autotools: Replace backticks command substitutions with $(...) (#15639)
This is a follow-up of previous backticks replacement commits. This
replaces backticks command substitutions in remaining ext config M4
files, phpize, and configure.ac with the recommended $(...).

Note that $(...) still does not work on some obsolete shells that ship
with Solaris 10, for example. Elsewhere they should work. However, for
these obsolete shells Autoconf also re-executes the shell script under
the supported shell so it can make them work regardless.

Additionally, few comments CS are also adjusted to not cause confusion
when searching for backticks usages and one indentation sync done.

As of Autoconf 2.72 the backticks in macro help texts are also replaced
with single quotes.
2024-08-30 00:40:49 +02:00
Máté Kocsis
8d12f666ae
Fix registration of internal readonly child classes (#15459)
Currently, internal classes are registered with the following code:

INIT_CLASS_ENTRY(ce, "InternalClass", class_InternalClass_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ...;

This has worked well so far, except if InternalClass is readonly. It is because some inheritance checks are run by zend_register_internal_class_ex before ZEND_ACC_READONLY_CLASS is added to ce_flags.

The issue is fixed by adding a zend_register_internal_class_with_flags() zend API function that stubs can use from now on. This function makes sure to add the flags before running any checks. Since the new API is not available in lower PHP versions, gen_stub.php has to keep support for the existing API for PHP 8.3 and below.
2024-08-24 12:36:54 +02:00
Gina Peter Bnayard
5853cdb73d Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
Gina Peter Bnayard
e7c4d54d65 Use new helper function for "cannot be empty" ValueErrors 2024-08-21 21:12:17 +01:00
Peter Kokot
bb35da336d
Autotools: Sync CS in extensions (#15343)
- Redundant double quotes removed
- AS_* macros used
- Few nits adjusted here and there
2024-08-11 17:42:26 +02:00
Peter Kokot
d6a75e19d1
Sync preprocessor macros help texts (#15218)
This partially syncs help texts a bit further for:
- ext/ffi
- ext/ldap
- ext/opcache
- ext/pcre
- ext/pdo_mysql
- ext/readline
- ext/standard
2024-08-04 12:52:16 +02:00
Peter Kokot
dcdcb3cbfe
Autotools: Replace AC_MSG_ERROR with AC_MSG_FAILURE (#15209)
This replaces the AC_MSG_ERROR with AC_MSG_FAILURE, where appropriate.

The AC_MSG_ERROR outputs given message and exits the configure step. The
AC_MSG_FAILURE does the same but also automatically outputs additional
message "See 'config.log' for more details." which might help directing
the user where to look further.

The AC_MSG_ERROR is used for errors where current test step isn't logged
in the config.log and wouldn't make sense, and AC_MSG_FAILURE is mostly
used in cases of library checks, compilation tests, headers checked with
AC_CHECK_HEADER* and similar tests that are also logged in the
config.log.

AC_MSG_ERROR([Sanity check failed.]) output:

```
configure: error: Sanity check failed.
```

AC_MSG_FAILURE([Sanity check failed.]) output:

```
configure: error: in '/path/to/php-src':
configure: error: Sanity check failed.
See 'config.log' for more details
```
2024-08-04 07:36:37 +02:00
Peter Kokot
f66feaec0f
Sync HAVE_<extension> help texts (#15167)
This syncs all help texts of extension preprocessor macros to the same
style "Define to 1 if the PHP extension '<ext>' is available.".
[skip ci]
2024-08-02 01:41:47 +02:00
Peter Kokot
1ceadaed52
Autotools: Normalize and quote all PHP_NEW_EXTENSION arguments (#15144)
This adds Autoconf quote characters to all PHP_NEW_EXTENSION arguments
and syncs the CS across the php-src Autotools build system.
2024-07-29 00:14:59 +02:00
Peter Kokot
ff4b99e260
Autotools: Quote PHP_ADD_LIB* arguments (#15112)
Following previous CS syncs, this quotes arguments in PHP_ADD_LIB* M4
macros:
- PHP_ADD_LIBRARY
- PHP_ADD_LIBRARY_WITH_PATH
- PHP_ADD_LIBPATH
2024-07-26 23:26:55 +02:00
Peter Kokot
97afc86437
Autotools: Quote M4 arguments (#15045)
- AC_MSG_CHECKING
- AC_MSG_RESULT
- AC_MSG_WARN
- AC_MSG_ERROR
- AC_MSG_NOTICE
2024-07-21 01:52:17 +02:00
Peter Kokot
68ae477796
Autotools: Quote M4 arguments (#15033)
- PHP_ADD_INCLUDE
- PHP_EVAL_INCLINE
- PHP_EVAL_LIBLINE
2024-07-20 07:21:44 +02:00
Christoph M. Becker
f590b34530
Drop support for OpenSSL < 1.1.0 on Windows
PR #13498 bumped the required OpenSSL version to 1.1.1, but apparently
only for non Windows system.  We catch up somewhat by dropping support
for OpenSSL < 1.1.0 on Windows; besides completely removing detection
of old OpenSSL versions in `SETUP_OPENSSL`, we also ensure that all
bundled extension using this function do no longer accept OpenSSL <
1.1.0, to avoid to still be able to build these extensions with older
`phpize` scripts.

We do not cater to `--phar-native-ssl` yet; that might better be
addressed by #14578.

Closes GH-14973.
2024-07-17 12:22:59 +02:00
Peter Kokot
d7cd155e8d
Autotools: Refactor cache variables in configure.ac and ext/ldap (#14784)
- Cache variables ac_cv_ renamed on few places to php_cv_
- Over-quoted arguments reduced
- AS_VAR_IF and CS synced
2024-07-03 21:57:51 +02:00
Peter Kokot
bee84c0468
Autotools: Quote PHP_SUBST arguments in extensions (#14748) 2024-07-02 06:56:18 +02:00
Peter Kokot
2041c133ac
Normalize AC_CHECK_FUNC* first argument (#14700)
The m4_normalize is for Autoconf < 2.70 (on 2.70 and later versions a
blank-or-newline separated items can be expanded without using
backslash-newline).

This also syncs the 1st argument quotes.
2024-06-28 22:40:24 +02:00
Arnaud Le Blanc
11accb5cdf
Preferably include from build dir (#13516)
* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

    -I$(top_builddir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/main
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM
    -I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

    -I$(top_builddir)/main
    -I$(top_builddir)
    -I$(top_srcdir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
2024-06-26 00:26:43 +02:00
Peter Kokot
271f91169e
Remove WINDOWS symbol from ext/ldap/ldap.c (#14468)
The WINDOWS symbol was used up to commit
f79688e848 where it got undefined when
condition `#if WIN32|WINNT` was met. Then the condition was replaced
with simpler PHP_WIN32 (which today implies also 64-bit platforms) and
WINDOWS is undefined in this file when targeting Windows platform.
Conditions otherwise also work on Windows anyway because of the
LDAP_API_VERSION check.
2024-06-07 23:27:22 +02:00
haszi
9864d91ea6
Fix typo in LDAP stub (#14313)
Co-authored-by: haszi <haszika80@gmail.com>
2024-05-25 13:31:54 +02:00
Máté Kocsis
3876225763
Fix casing of NULL default values 2024-04-27 23:45:55 +02:00
Peter Kokot
a6fdd8fb19
Update ext/ldap sanity check (#13946)
The ldap_bind_s() has been deprecated and isn't used in the code in
favor of ldap_sasl_bind_s(). PHP falls back to deprecated
ldap_simple_bind_s() if for some reason ldap_sasl_bind_s() isn't
available and this check likewise.
2024-04-12 10:20:26 +02:00
Máté Kocsis
f2e199e878
Implement "support doc comments for internal classes and functions" (#13266)
Fixes #13130
2024-02-25 08:41:31 +01:00
Ilija Tovilo
fd47cd8b69
[skip ci] Fix ldap skipif 2024-02-19 10:16:13 +01:00