Commit graph

540 commits

Author SHA1 Message Date
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
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
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
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
Steve Wall
f6016c702f ext/ldap: Add LDAP_OPT_X_TLS_PROTOCOL_MAX and LDAP_OPT_X_TLS_PROTOCOL_TLS1_3
close GH-13405.
2024-02-15 21:43:46 +00:00
Máté Kocsis
682c2366be Deprecate calling ldap_exop() with more than 4 arguments 2023-12-04 22:27:59 +01:00
Máté Kocsis
1d41eb3014 Deprecate calling ldap_connect() with more than 2 arguments 2023-12-04 22:27:59 +01:00
Máté Kocsis
b3bd55f244 Implement ldap_exop_sync 2023-07-18 12:59:21 +02:00
Máté Kocsis
72aada3c7c Implement ldap_connect_wallet() 2023-07-18 12:59:21 +02:00
Andreas Heigl
69a8b63ecf
Deprecate ldap_connect with two parameters (#5177)
* Deprecate ldap_connect with two parameters

ldap_connect should be called with an LDAP-URI as parameter and not with
2 parameters as that allows much more flexibility like differentiating
between ldap and ldaps or setting multiple ldap-servers.

This change requires one to add null as second parameter in case the
underlying library is Oracle and one wants to add wallet-details.

* Modify all ldap-tests to use ldap_connect right

All tests are using ldap_connect now with an URI and not with host and
port as two separarte parameters.

* Verify deprecation of ldap_connect w/h 2 params

This adds a test to verify that calling ldap_connect with 2 parameters
triggers a deprecation notice

* Remove empty test

`ldap_control_paged_result()` is removed as of PHP 8.0.0, so this test
needs to be removed as well.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
2023-07-10 10:44:01 +01:00
George Peter Banyard
d5ad75108e
More usage of known zend_str instead of C string (#11381) 2023-06-08 13:03:29 +01:00
Máté Kocsis
7936c8085e
Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
Christoph M. Becker
cea0fc04d1
Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10112: LDAP\Connection::__construct() refers to ldap_create()
2022-12-16 14:38:09 +01:00
Christoph M. Becker
018fbd0a68
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10112: LDAP\Connection::__construct() refers to ldap_create()
2022-12-16 14:37:39 +01:00
Christoph M. Becker
b8ac2071b8
Fix GH-10112: LDAP\Connection::__construct() refers to ldap_create()
There is no `ldap_create()`, but rather `ldap_connect()`.

Closes GH-10115.
2022-12-16 14:36:30 +01:00
Bob Weinand
a01dd9feda Revert "Port all internally used classes to use default_object_handlers"
This reverts commit 94ee4f9834.

The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.
2022-09-14 11:13:23 +02:00
Bob Weinand
94ee4f9834 Port all internally used classes to use default_object_handlers
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Tim Düsterhus
788b7a0c6c Mark parameter in ext/ldap as sensitive 2022-06-13 11:09:12 +02:00
Máté Kocsis
e7c30c059c
Declare ext/ldap constants in stubs (#8717) 2022-06-06 21:30:10 +02:00
Tim Starling
c96be7b8f2 Use ASCII lower case for misc case folding
Use ASCII case conversion instead of locale-dependent case conversion in
the following places:

* grapheme_stripos() and grapheme_strripos() in the "fast" path
* ldap_get_entries()
* oci_pconnect() for case folding of parameters when constructing a key
  into the connection or session pool
* SoapClient: case folding of function names
* get_meta_tags(): case conversion of property names
* http stream wrapper: header names
* phpinfo(): anchor names
* php_verror(): docref URLs
* rfc1867.c: Content-Type boundary parameter name
* streams.c: stream protocol names

Using locale-dependent case folding for these cases is either
unnecessary or actively incorrect. These functions could have
misbehaved when used with certain locales (e.g. Turkish).

Closes GH-7511.
2021-09-24 09:20:08 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
George Peter Banyard
a6a95e3f51
Do not reuse errno as local variable name
errno is a global variable/macro which is implementation defined,
and should not be reused.

This fixes some [-Wstrict-prototypes] warnings.
2021-05-12 15:32:16 +01:00
Ayesh Karunaratne
e0b947a8da
Move resource-object classes of LDAP to \LDAP namespaces (#6963)
Another change as per accepted [namespaces in bundled extensions RFC](https://wiki.php.net/rfc/namespaces_in_bundled_extensions).

Related: #6925, #5945, #6960
2021-05-09 22:20:21 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Máté Kocsis
cd40fc3cb1
Convert resources to objects in ext/ldap
Closes GH-6770
2021-03-21 10:43:25 +01:00
Máté Kocsis
66f16f4eb2
Merge branch 'PHP-8.0'
* Fix crash in LDAP search functions during argument validation
* Fix ldap_next_entry() parameter name
2021-03-16 09:34:41 +01:00
Máté Kocsis
b03438ba3a
Fix crash in LDAP search functions during argument validation 2021-03-16 09:31:37 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Nikita Popov
422d1665a2 Make convert_to_*_ex simple aliases of convert_to_*
Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
since PHP 7.

The only difference that was still left is that _ex checked whether
the type is the same first, but the usage of these macros did not
actually distinguish on whether such an inlined check is valuable
or not in a given context.

Also drop the unused convert_to_explicit_type macros.
2021-01-14 12:11:11 +01:00
Côme Chilliet
15a3eca3ef Change $controls parameter to default to null in ext/ldap
It appeared that not passing $controls and passing [] caused different
 behaviors, when not passing it the controls set through ldap_set_option
 would be used, when passing [] they would not.

So, this parameter is now nullable and defaults to null to have a
 consistent behavior.
2020-10-15 11:48:47 +02:00
Côme Chilliet
550a4f2fa8 Remove deprecated functions from php-ldap
Remove ldap_control_paged_result and ldap_control_paged_result_response
 which have been deprecated in PHP 7.4, in favor of new $controls
 parameters for ldap request functions.
2020-10-01 10:15:27 +02:00