Commit Graph

757 Commits

Author SHA1 Message Date
Hugh McMaster
9d61036651 ext/ldap: Use PKG_CHECK_MODULES to detect the libsasl2 library 2019-06-11 17:11:53 +02:00
Nikita Popov
0715aeeef2 Merge branch 'PHP-7.4' 2019-06-11 15:49:36 +02:00
Nikita Popov
8d3a2a4a12 Remove ext/ldap/tests/bug76248.phpt
I wasn't able to make this test work reliably in CI, and the thing
it's testing does not seem worth spending more time on it.
2019-06-11 15:47:01 +02:00
Nikita Popov
14692df82b Remove ldap zpp tests
Missed these in the zpp test purge -- they've been failing on master
for a while, but nobody compiles with ldap.
2019-06-11 10:09:40 +02:00
Peter Kokot
87cfcb0b7c Merge branch 'PHP-7.4'
* PHP-7.4:
  [ci skip] Migrate tests READMEs to Markdown
2019-05-12 22:03:35 +02:00
Peter Kokot
83e565e244 [ci skip] Migrate tests READMEs to Markdown 2019-05-12 22:03:10 +02:00
Peter Kokot
2cf90bb2f0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Normalize comments in *nix build system m4 files
2019-05-12 18:51:50 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Dmitry Stogov
2e4686b566 Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:16:47 +03:00
Dmitry Stogov
34db07567d Use ZEND_TRA_ASSIGN_REF_... macros for by reference arguments of internal functions. 2019-04-24 16:14:48 +03:00
Côme Chilliet
9d38510ab4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Updated NEWS
  Fix a NULL dereferencing crash in php-ldap
2019-04-15 10:21:27 +02:00
Côme Chilliet
f31435b855 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Updated NEWS
  Fix a NULL dereferencing crash in php-ldap
2019-04-15 10:20:12 +02:00
Côme Chilliet
ea0f26420d Fix a NULL dereferencing crash in php-ldap
This happens when parsing a control response to a VLV request which does
 not contain a "context" string.

See bug #77869
2019-04-15 10:16:29 +02:00
Peter Kokot
347128a12b Merge branch 'PHP-7.4'
* PHP-7.4:
  Sync AC_CHECK_SIZEOF m4 macro calls
2019-03-18 02:13:12 +01:00
Peter Kokot
ccc29473ec Sync AC_CHECK_SIZEOF m4 macro calls
- AC_CHECK_SIZEOF is now called mostly only in PHP_CHECK_STDINT_TYPES()
  macro except for some parts checking for the 32 or 64 bit architecture.
- SIZEOF_CHAR removed since it is always 1
- ZEND_BIN_ID is now of a more logical pattern `BIN_48888` on 64bit
  architectures and `BIN_44444` on 32bit instead of literal string
  `BIN_SIZEOF_CHAR48888` on 64bit and `BIN_SIZEOF_CHAR44444` on 32bit.
  The unneeded SIZEOF_CHAR part has been removed.
- XMLRPC_TYPE_CHECKS removed
- The `long long int` is the same as `long long` and redundant checks
  removed accordingly.
- Removed PHP_CHECK_64BIT macro. Checking if current platform is 64bit
  or not can be also done simply by using a check of the long type on
  place. This removes redundant m4 macro PHP_CHECK_64BIT.
2019-03-18 02:11:23 +01:00
Peter Kokot
6426420f61 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
2019-03-15 23:36:47 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Dmitry Stogov
5f09db3073 Merge branch 'PHP-7.4'
* PHP-7.4:
  Switch to use ZTS cache
2019-03-12 14:17:14 +03:00
Dmitry Stogov
f1b306fe11 Switch to use ZTS cache 2019-03-12 14:15:47 +03:00
Peter Kokot
d0fd9fe977 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add AS_HELP_STRING to *nix build configure options
2019-03-07 20:38:04 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Côme Chilliet
f0ddc93f46 Removed ldap_sort and LDAP_DEPRECATED build flag
ldap_sort was deprecated in PHP7, it is now removed.
This allows removing the LDAP_DEPRECATED flag when building against
 openldap.
2019-02-04 13:10:05 +01:00
Côme Chilliet
d93ce17959 Mark ldap_control_paged_result and ldap_control_paged_result_response as deprecated
These functions have serious limitations and may confuse users.
Same operations can be done using the new ldap control system in search
 operations.
2019-02-04 12:20:51 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Mizunashi Mana
e412195772 Fix a test for ldap extension 2018-11-03 17:37:47 +01:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski
67e0138c0d Future-proof email addresses... 2018-11-01 18:30:28 +02:00
Peter Kokot
d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Peter Kokot
b746e69887 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:32:30 +02:00
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Peter Kokot
1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:56:38 +02:00
Peter Kokot
1c850bfcca Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:55:24 +02:00
Peter Kokot
37c329d715 Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
Peter Kokot
3362620b5f Trim trailing whitespace in source code files 2018-10-13 14:16:33 +02:00
Nikita Popov
1d0252a1c0 Remove IS_EXT_MODULE defines
I'm not sure what this was used for, but it doesn't look to be
relevant anymore.
2018-09-16 11:09:51 +02:00
Peter Kokot
4371945b8b Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE
Autoconf 2.50 released in 2001 made several macros obsolete including
the AC_TRY_RUN, AC_TRY_COMPILE and AC_TRY_LINK:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2

These macros should be replaced with the current AC_FOO_IFELSE instead:
- AC_TRY_RUN with AC_RUN_IFELSE and AC_LANG_SOURCE
- AC_TRY_LINK with AC_LINK_IFELSE and AC_LANG_PROGRAM
- AC_TRY_COMPILE with AC_COMPILE_IFELSE and AC_LANG_PROGRAM

PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require
2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which
are all greater than above mentioned 2.50 version therefore systems
should be well supported by now.

This patch was created with the help of autoupdate script:
autoupdate <file>

Reference docs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
- https://www.gnu.org/software/autoconf/manual/autoconf-2.59/autoconf.pdf
2018-07-30 02:36:38 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Gabriel Caruso
8ca1f47a7a
Use variables that already received ZEND_NUM_ARGS() 2018-07-22 15:54:00 -03:00
Dmitry Stogov
265c3ed6cf Fixed incorrrecr zval_dtor() usage to replace value of argument passed by reference, that may lead to memory leaks. 2018-07-05 10:57:49 +03:00
Dmitry Stogov
4a475a4976 Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
2018-07-04 19:22:24 +03:00
Peter Kokot
cb64696ca6 Normalize the ldap extension version in phpinfo output
This patch normalizes the phpinfo output for the ldap extension and
removes the displayed Git attribute ident blob object name.
2018-06-04 17:06:41 +02:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Stanislav Malyshev
99f1d904a0 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 22:04:22 -07:00
Stanislav Malyshev
4c06d929c0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 22:03:33 -07:00
Stanislav Malyshev
95ee9efa57 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 22:00:24 -07:00
Stanislav Malyshev
5a18d7a0df Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 21:59:57 -07:00
Stanislav Malyshev
49782c5499 Fix bug #76248 - Malicious LDAP-Server Response causes Crash 2018-04-22 22:01:35 -07:00
Nikita Popov
ad87e2bd6a Merge branch 'PHP-7.2' 2018-03-23 18:57:58 +01:00
Gabriel Caruso
ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Gabriel Caruso
a2933e9ebb Fix some compile results warnings 2018-02-18 16:22:31 +01:00
Gabriel Caruso
a5f1a585e6 Removed unused variables 2018-02-11 22:46:33 +01:00
Joe
812303aa5e
Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #49876 lib path on 64bit distros
2018-02-08 10:43:10 +01:00
Joe
d803dcba3b
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #49876 lib path on 64bit distros
2018-02-08 10:42:42 +01:00
David Zuelke
8000334538
Fixed bug #49876 lib path on 64bit distros 2018-02-08 10:41:46 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
b0d3c1bf83 Add and fix SKIPIF sections 2018-02-04 17:26:37 +01:00
Gabriel Caruso
c6c9e71a5b Add missing SKIPIF sections 2018-02-03 13:54:34 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Kalle Sommer Nielsen
a7c23e27be Remove these ancient ldap parts for Windows thats no longer relevant 2017-10-23 03:13:53 +02:00
Côme Chilliet
9a4f3505ff Added support for VLV controls request and response 2017-09-21 10:05:42 +02:00
Côme Chilliet
6ac7d313c8 Added support for SORT controls
On an openldap server you need the sssvlv overlay for these to work
2017-09-21 10:05:42 +02:00
Côme Chilliet
76e9de681a Added skip when control are not supported by the test ldap server 2017-09-21 10:05:42 +02:00
Côme Chilliet
def30dbde2 Avoid memory leak when creating paged control value 2017-09-21 10:05:42 +02:00
Côme Chilliet
d76d57b887 Fixed ifdef for VLV controls (copy/paste error) 2017-09-21 10:05:42 +02:00
Côme Chilliet
c112b53a60 Added ldap_rename_ext and its test 2017-09-21 10:05:42 +02:00
Côme Chilliet
679442b1d1 Indexing controls by OID when parsing them 2017-09-21 10:05:42 +02:00
Côme Chilliet
9c7666d93a Avoid returning iscritical field when parsing response controls
As stated in RFC4511 Section 4.1.11, this field is always false in
 response controls and only makes sense in request controls
2017-09-21 10:05:42 +02:00
Côme Chilliet
d8a7214d8c Fixed ldap_parse_result comment 2017-09-21 10:05:42 +02:00
Côme Chilliet
ead53aba54 Added ldap_delete_ext and its test 2017-09-21 10:05:42 +02:00
Côme Chilliet
17e490a2e3 Added ldap_mod_*_ext methods for modification with controls 2017-09-21 10:05:42 +02:00
Côme Chilliet
32b51035be Added ldap_add_ext and preread/postread support and tests 2017-09-21 10:05:42 +02:00
Côme Chilliet
b36342453b Added ldap_bind_ext to pass controls and get result object
ldap_bind_ext allows to pass controls and get result object
 from bind operation
Also added a test for it, pretty basic as tests cannot depend upon
 ppolicy overlay
2017-09-21 10:05:41 +02:00
Côme Chilliet
9275e05d8e Improved a bit error handling to avoid passing commands with incomplete controls 2017-09-21 10:05:41 +02:00
Côme Chilliet
3a1ba93066 Added support and test for LDAP_CONTROL_VALUESRETURNFILTER 2017-09-21 10:05:41 +02:00
Côme Chilliet
b5ca0c1c78 Removed client controls alltogether
Client controls are ldap client lib specific and all the one
 I could find are ignoring client controls anyway.
2017-09-21 10:05:41 +02:00
Côme Chilliet
d377edb884 Fixed ldap_exop test since rebase remove client controls 2017-09-21 10:05:41 +02:00
Côme Chilliet
81b27abac0 Added support for controls in ldap_modify_batch 2017-09-21 10:05:41 +02:00
Côme Chilliet
2b52cb74da Added controls support to ldap_compare
Note: for functions like ldap_compare, ldap_delete, ldap_modify,
 a way to get the result object back will need to be added
 so that controls returned by the server may be analyzed.
2017-09-21 10:05:41 +02:00
Côme Chilliet
82cc72a3ba Added controls support to ldap_rename 2017-09-21 10:05:41 +02:00
Côme Chilliet
437c75abcb Fixed prototypes in comments 2017-09-21 10:05:41 +02:00
Côme Chilliet
59f32408f8 Using new control syntax for MANAGEDSAIT control when deleting references 2017-09-21 10:05:41 +02:00
Côme Chilliet
c8572da183 Fixed wrong argument number error tests 2017-09-21 10:05:41 +02:00
Côme Chilliet
93fbbbf5a6 Added controls support to ldap_delete 2017-09-21 10:05:40 +02:00
Côme Chilliet
5ee0fc9b56 Added support for controls in ldap_add, ldap_modify, ldap_mod_*
Also added workaround for a bug in ldap_create_assertion_control_value
Made sure failed control creation aborts the operation
And added test for assertion control on ldap_modify
2017-09-21 10:05:40 +02:00
Côme Chilliet
79cfa55cae Added a test for assertion control 2017-09-21 10:05:40 +02:00
Côme Chilliet
6d3a914641 Added a test for PROXY_AUTHZ control on ldap_exop 2017-09-21 10:05:40 +02:00
Côme Chilliet
02bd89a552 Added support for assert control value encoding 2017-09-21 10:05:40 +02:00
Côme Chilliet
5691d8bf49 Added controls support to ldap_exop 2017-09-21 10:05:40 +02:00
Côme Chilliet
8de071e0f7 Added controls support to ldap_search, ldap_list and ldap_read. 2017-09-21 10:05:40 +02:00
Côme Chilliet
5ccb31e49e Added controls support to ldap_parse_result and ldap_exop_passwd
Known controls are parsed to and from associative arrays.
Only ppolicy and paged results are implemented for now.
2017-09-21 10:05:40 +02:00
Côme Chilliet
26ccaa39b3 Merge branch 'PHP-7.2'
* PHP-7.2:
  Removing client controls attribute from ldap_exop signature
2017-09-07 16:33:42 +02:00
Côme Chilliet
e67379399a Removing client controls attribute from ldap_exop signature
Client controls will not get implemented in php-ldap as
 they are specific to each client ldap lib and most of the
 time unused any way. (servers controls on the other end are used
 and will get implemented)
2017-09-07 16:31:03 +02:00
Côme Chilliet
28630f7920 Fixed an error in ldap_exop introduced by last commit 2017-09-06 15:05:27 +02:00
Côme Chilliet
3fdeb27739 Improving a bit code quality in ldap_exop function
Ideas from 5b3f4c2fb9
The same can be done for the rest of the code,
 and synchronous/asynchronous version should be merged when implementing
 controls.
2017-09-06 12:56:51 +02:00
Côme Chilliet
f3f25a8446 Merge branch 'PHP-7.2'
* PHP-7.2:
  Added controls parameters to ldap_exop so that control support can be added later
2017-08-04 18:11:52 +02:00
Côme Chilliet
aa0e402acf Added controls parameters to ldap_exop so that control support can be added later 2017-08-04 18:10:49 +02:00
Côme Chilliet
afef1fe778 Fixed ldap tests when ldap server hash out passwords 2017-07-26 17:34:18 +02:00
Côme Chilliet
d51c4cd64f Fixed test for ldap_set_option server controls with empty array 2017-07-26 17:21:27 +02:00
Anatol Belski
572429473d Fix datatypes and warnings
Needs more testing yet.

use size_t

add range check and fix warning

more size_t fixes
2017-07-25 19:03:33 +02:00
Côme Chilliet
5e56d050e5 Added ldap_exop_refresh helper for EXOP REFRESH operation on dds overlay
ldap_exop_refresh(resource link, string dn, int ttl)
Returns FALSE on failure, newttl on success
2017-07-20 16:16:59 +02:00
Côme Chilliet
a3b42ea96b Using LDAP_CONTROL_MANAGEDSAIT constant in ldap tests instead of string oid 2017-07-20 12:37:44 +02:00
Côme Chilliet
a148ee8c7c Fixed removing all controls by passing an empty array to ldap_set_option 2017-07-11 16:18:33 +02:00
Côme Chilliet
ed8bfcc6ea Small fix in ext/ldap, Moved vars definitions to the beginning of the block using them 2017-07-10 11:33:08 +02:00
Côme Chilliet
274d84139b Added constants for known ldap controls OID and tests for ldap_get/set_option for controls
Also fixed existing tests which were expecting ldap_get_option to fail on controls
2017-07-05 16:41:52 +02:00
Côme Chilliet
3a09c1246c Added support for controls to ldap_get_option 2017-07-05 16:41:52 +02:00
Côme Chilliet
209c9ba384 Test ldap_exop_passwd with less parameters to be sure it works 2017-07-04 10:17:41 +02:00
Côme Chilliet
3207747b9e Changed API to avoid using passing result by reference
See discussion on internals ML
2017-07-04 10:03:27 +02:00
Côme Chilliet
13062efd02 Removed unused variables left over by LDAP EXOP patch 2017-07-03 12:23:34 +02:00
Côme Chilliet
e05d230e52 Removed TSRMLS_CC instances left over by LDAP EXOP patch 2017-07-03 12:08:24 +02:00
Côme Chilliet
bda80aa332 Swapped position of retoid and retdata as retoid is almost never used 2017-07-03 10:58:13 +02:00
Côme Chilliet
e9001cab46 Removed two step syntax for EXOP helpers, one call workflow is enough 2017-07-03 10:58:13 +02:00
Côme Chilliet
5020325a6f Improved ldap_exop test to encode&decode a passwd EXOP to test sending/recieving data 2017-07-03 10:58:13 +02:00
Côme Chilliet
413e9c84f6 Removed TODOs regarding implementing passwd and whoami exops based on ldap_exop 2017-07-03 10:58:13 +02:00
Côme Chilliet
9aa99cc34c Added constants for standard EXOPs 2017-07-03 10:58:13 +02:00
Côme Chilliet
4652c46245 Removed ldap_refresh function as I’m not sure how to fix/use/test it 2017-07-03 10:58:13 +02:00
Côme Chilliet
e832ce4b22 Fixed ldap_exop and ldap_parse_exop. Only tested them for whoami exop. (see test file) 2017-07-03 10:58:13 +02:00
Côme Chilliet
28530b2f1c Fixed ldap_parse_exop_whoami and ldap_parse_exop_passwd and added test for them 2017-07-03 10:58:13 +02:00
Côme Chilliet
fdafd68419 Fixed ldap_exop_whoami and added a test for it 2017-07-03 10:58:12 +02:00
Côme Chilliet
ae76c8ba2c Fixed ldap_exop_passwd and added tests for it 2017-07-03 10:58:12 +02:00
Côme Chilliet
def09c7cab Fixed building errors in LDAP EXOP 2017-07-03 10:58:12 +02:00
Côme Chilliet
a0920f2822 Added EXOP features based on patch from http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/databases/php-ldap/files/ldap-ctrl-exop56.patch 2017-07-03 10:58:12 +02:00
Nikita Popov
035a27cbc6 Only compute callback name in error cases
Mostly the callback name is only used to report an error. Try to
avoid calculating it if no error occurred.
2017-06-25 18:45:59 +02:00
David Caldwell
aef09760d1 ext/ldap/test: Test that ldap_connect() uses defaults from ldap.conf (openldap) 2017-05-30 17:30:32 +02:00
David Caldwell
747e93eabc ext/ldap: Allow default host from ldap.conf to work.
This fixes an regression introduced in
e7af0fe1eb. Previously, calling
ldap_connect() with no parameters would pass NULL to ldap_init(),
which causes it to use the default host specified in
/etc/ldap/ldap.conf (on Ubuntu).

When the code changed to use ldap_initialize(), it initialized a uri,
even if there were no parameters passed to ldap_connect(). Because of
this, there's no way to pass a NULL into ldap_initialize(), making it
impossible to use the default uri from ldap.conf.

This commit bypasses the uri creation when there is no host argument,
passing on a NULL to ldap_initialize() which restores the old PHP 5.5
behavior.
2017-05-30 17:30:32 +02:00
Côme Bernigaud
1bb295e659 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  ext/ldap/test: Test that ldap_connect() uses defaults from ldap.conf (openldap)
  ext/ldap: Allow default host from ldap.conf to work.

Conflicts:
	ext/ldap/ldap.c
2017-05-30 16:48:16 +02:00
David Caldwell
49d1cdc393 ext/ldap/test: Test that ldap_connect() uses defaults from ldap.conf (openldap) 2017-05-25 21:27:11 +00:00
David Caldwell
d51b8f915f ext/ldap: Allow default host from ldap.conf to work.
This fixes an regression introduced in
e7af0fe1eb. Previously, calling
ldap_connect() with no parameters would pass NULL to ldap_init(),
which causes it to use the default host specified in
/etc/ldap/ldap.conf (on Ubuntu).

When the code changed to use ldap_initialize(), it initialized a uri,
even if there were no parameters passed to ldap_connect(). Because of
this, there's no way to pass a NULL into ldap_initialize(), making it
impossible to use the default uri from ldap.conf.

This commit bypasses the uri creation when there is no host argument,
passing on a NULL to ldap_initialize() which restores the old PHP 5.5
behavior.
2017-05-25 00:47:11 +00:00
Xinchen Hui
0311dc8697 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed another part in ldap (bug #73933)
2017-01-19 12:24:04 +08:00
Xinchen Hui
5e09031144 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed another part in ldap (bug #73933)
2017-01-19 12:23:56 +08:00
Xinchen Hui
cad2598fcb Fixed another part in ldap (bug #73933) 2017-01-19 12:23:23 +08:00
Xinchen Hui
fafce65a05 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug #73933 (error/segfault with ldap_mod_replace and opcache)
2017-01-17 15:35:46 +08:00
Xinchen Hui
e180e45a18 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73933 (error/segfault with ldap_mod_replace and opcache)
2017-01-17 15:35:06 +08:00
Xinchen Hui
b28c2e20ca Fixed bug #73933 (error/segfault with ldap_mod_replace and opcache) 2017-01-17 15:34:19 +08:00
Anatol Belski
97ac819c2b Merge branch 'PHP-7.1'
* PHP-7.1:
  move various places to the centralized OpenSSL setup routine
  use the new API for opaque symbol in OpenSSL 1.1.x
  implement basic config support for OpenSSL 1.1.x
2017-01-08 00:39:53 +01:00
Anatol Belski
43b92ed5a8 move various places to the centralized OpenSSL setup routine 2017-01-08 00:25:47 +01:00
Joe Watkins
00062d2ea8
Merge branch 'PHP-7.1'
* PHP-7.1:
  Adapts the readme to the new test-possibility
2017-01-07 16:46:18 +00:00
Joe Watkins
201e56cd04
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Adapts the readme to the new test-possibility
2017-01-07 16:46:01 +00:00
Andreas Heigl
fc777296bf
Adapts the readme to the new test-possibility
This commit introduces a way to use a vagrant setup to test against a
known LDAP without the need to setup an LDAP on your own machine
2017-01-07 16:45:10 +00:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Nikita Popov
5af586bec5 Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
Kalle Sommer Nielsen
2104bea5d7 Remove Netware support
If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
2016-11-12 11:20:01 +01:00
Stanislav Malyshev
19866fb76c Fix various int size overflows.
Add function for detection of string zvals with length that does not fit
INT_MAX.
2016-09-12 21:04:23 -07:00
Anatol Belski
78c15e2744 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix leak
2016-08-29 18:08:17 +02:00
Anatol Belski
ca4eeedd36 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix leak
2016-08-29 18:05:47 +02:00
Anatol Belski
e2609a38d9 fix leak 2016-08-29 18:01:21 +02:00
Côme Bernigaud
c53aadbba3 Merge branch 'pull-request/1955'
* pull-request/1955:
  Add parenthesis to if statements
  Correctly add to the length of the final string
  Correctly add to the length of the final string
  Fix minor spacing issue
  Make LDAP_ESCAPE_DN compliant with RFC 4514
2016-07-07 05:11:56 +02:00
Aaron Piotrowski
24237027bc Merge branch 'throw-error-in-extensions' 2016-07-05 02:08:39 -05:00
Chad Sikorra
b1d82607e6 Add parenthesis to if statements 2016-06-29 07:37:48 -05:00
Chad Sikorra
f910ca259f Correctly add to the length of the final string 2016-06-26 17:29:07 -05:00
Chad Sikorra
e85a2e360c Correctly add to the length of the final string 2016-06-26 17:10:51 -05:00
Chad Sikorra
737ee1f2c9 Fix minor spacing issue 2016-06-26 09:31:07 -05:00
Chad Sikorra
63427c1768 Make LDAP_ESCAPE_DN compliant with RFC 4514 2016-06-25 21:16:45 -05:00
Côme Bernigaud
355c5954da Merge branch 'pull-request/1946' into PHP-7.1.0
* pull-request/1946:
  Add additional LDAP SASL constants
  Add tests for LDAP_OPT_* constants
  Add LDAP TLS Protocol Min constants
  Add tests for the LDAP CRL check option
  Add missing LDAP constants
2016-06-23 07:22:40 +02:00
Dmitry Stogov
323b2733f6 Fixed compilation warnings 2016-06-22 00:40:50 +03:00
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Chad Sikorra
4718eb05b4 Add additional LDAP SASL constants 2016-06-16 21:00:32 -05:00
Chad Sikorra
a1f2649048 Add tests for LDAP_OPT_* constants 2016-06-15 23:01:26 -05:00
Chad Sikorra
6415a86c9d Add LDAP TLS Protocol Min constants 2016-06-15 22:45:38 -05:00
Chad Sikorra
8880367773 Add tests for the LDAP CRL check option 2016-06-15 20:29:39 -05:00
Chad Sikorra
8e9e89610e Add missing LDAP constants 2016-06-14 23:32:59 -05:00
Aaron Piotrowski
771e5cc247 Replace zend_ce_error with NULL and replace more E_ERROR with thrown Error 2016-06-13 09:02:17 -05:00
Aaron Piotrowski
e3c681aa5c Merge branch 'master' into throw-error-in-extensions 2016-06-10 22:02:23 -05:00
Anatol Belski
86229f9943 fix SKIPIF sections 2016-03-09 14:28:38 +01:00
Edwin Hoksberg
ba96506676 LDAP - Added support to change the certificates verification 2016-03-01 04:59:30 +01:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Xinchen Hui
87958927b0 Fixed bug #71249 (ldap_mod_replace/ldap_mod_add store value as string "Array") 2016-01-01 07:06:58 -08:00
Côme Bernigaud
e6759644ec Revert "Added back support for undocummented host:port syntax"
This reverts commit 15876e85e5.
2015-11-24 03:45:21 +01:00
Côme Bernigaud
5a8bcf73ba Revert "Using default port in ldap_connect when NULL is passed (this was the behavior prior to 5.6.11)"
This reverts commit 391087ed28.
2015-11-24 03:45:17 +01:00
Xinchen Hui
9134f9e98f Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/mysql/php_mysql.c
2015-11-16 17:59:46 +08:00
Côme Bernigaud
15876e85e5 Added back support for undocummented host:port syntax 2015-11-16 04:50:12 +01:00
Xinchen Hui
fc611a134b Merge branch 'PHP-5.6' into PHP-7.0 2015-11-12 14:20:03 +08:00
Côme Bernigaud
391087ed28 Using default port in ldap_connect when NULL is passed (this was the behavior prior to 5.6.11)
Note that passing 0 will also result in default port.
2015-11-12 07:06:05 +01:00
Dmitry Stogov
560e4fa393 Removed or simplified incorrect SEPARATE_*() macros usage. 2015-09-29 11:17:43 +03:00
Dmitry Stogov
719664dec2 fixed compilation error 2015-09-10 20:24:11 +03:00
Xinchen Hui
bb4c0c0703 Merge branch 'PHP-5.6' 2015-09-10 19:56:18 +08:00
Côme Bernigaud
059dd18c37 Added support of LDAP_OPT_TIMEOUT, fixes #69574 2015-09-09 18:02:10 +02:00
Côme Bernigaud
fb9d934d51 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug in LDAP extensions' saving TIMELIMIT and DEREF
2015-09-09 11:05:29 +02:00
Côme Bernigaud
a483a79c85 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug in LDAP extensions' saving TIMELIMIT and DEREF
2015-09-09 10:34:46 +02:00
Tyson Andre
c3fc65eb7c Fix bug in LDAP extensions' saving TIMELIMIT and DEREF
LDAP_OPT_TIMELIMIT and LDAP_OPT_DEREF's original values weren't
saved properly because of a bug introduced when copy and pasting.

This lead to the original timeout being changed
when specifying a temporary override (e.g. for ldap_search(..., $timeout))
2015-09-08 18:42:02 -07:00
Côme Bernigaud
8acda9cad5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Patch from Rainer Jung to provide Solaris LDAP support

Conflicts:
	ext/ldap/ldap.c
2015-08-18 17:26:46 +02:00
Côme Bernigaud
40befb943c Patch from Rainer Jung to provide Solaris LDAP support 2015-08-18 16:52:44 +02:00
Anatol Belski
91f985b2f9 fix config.w32 2015-07-23 07:39:25 +02:00
Anatol Belski
3d38db3576 fix C99 compat 2015-07-23 07:39:16 +02:00
Anatol Belski
73c0fc0df4 move the define to the right place
thanks Kalle )
2015-07-06 19:43:35 +02:00
Aaron Piotrowski
fb4e3085cb Add missing include 2015-07-06 10:06:47 -05:00
Côme Bernigaud
da6e286dbb Merge branch 'PHP-5.6'
* PHP-5.6:
  Attempt at falling back on ldap_find_control for Mac OS
2015-07-06 14:56:20 +02:00
Côme Bernigaud
022068342b Attempt at falling back on ldap_find_control for Mac OS 2015-07-06 14:54:04 +02:00
Côme Bernigaud
a09dcb0e13 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated README, added test to create LDAP base if missing and ease tests
2015-07-06 14:28:01 +02:00