Name Date Size #Lines LOC

..30-Sep-2024-

CONFLICTSH A D25-Sep-20245 21

README.mdH A D25-Sep-20244.2 KiB147106

bug48441.phptH A D25-Sep-20242.7 KiB172166

bug72021.phptH A D25-Sep-2024291 1513

bug73933.phptH A D25-Sep-2024688 2822

bug77958.phptH A D25-Sep-20241.1 KiB5650

connect.incH A D25-Sep-20243.1 KiB9184

gh16032-1.phptH A D26-Sep-2024633 2723

gh16032-2.phptH A D26-Sep-2024624 2723

gh16101.phptH A D28-Sep-2024584 2622

gh16132-1.phptH A D30-Sep-2024734 2925

gh16132-2.phptH A D30-Sep-2024765 2925

gh16136.phptH A D30-Sep-2024784 3127

ldap_add_basic.phptH A D25-Sep-20241.4 KiB8378

ldap_add_error.phptH A D25-Sep-20242.6 KiB116102

ldap_add_ext.phptH A D25-Sep-20241.8 KiB9590

ldap_bind_basic.phptH A D25-Sep-2024406 2018

ldap_bind_error.phptH A D25-Sep-2024734 2924

ldap_bind_ext.phptH A D25-Sep-20241.7 KiB7672

ldap_bind_variation.phptH A D25-Sep-2024415 2018

ldap_compare_basic.phptH A D25-Sep-2024691 3128

ldap_compare_error.phptH A D25-Sep-2024773 3531

ldap_connect_basic.phptH A D25-Sep-2024278 1816

ldap_connect_error.phptH A D25-Sep-2024538 2622

ldap_connect_ldap_conf.confH A D25-Sep-202430 21

ldap_connect_ldap_conf.phptH A D25-Sep-2024488 2423

ldap_connect_variation.phptH A D25-Sep-2024740 4337

ldap_constructor.phptH A D25-Sep-2024297 1614

ldap_controls.phptH A D25-Sep-20244.4 KiB167159

ldap_count_entries_basic.phptH A D25-Sep-2024642 2825

ldap_count_references_basic.phptH A D25-Sep-20241.2 KiB3836

ldap_delete_basic.phptH A D25-Sep-2024829 4035

ldap_delete_error.phptH A D25-Sep-2024943 4640

ldap_delete_ext.phptH A D25-Sep-20241.5 KiB7267

ldap_deprectate_connect_with_two_parameters.phptH A D25-Sep-2024257 1311

ldap_dn2ufn.phptH A D25-Sep-2024508 2922

ldap_err2str_basic.phptH A D25-Sep-2024251 1413

ldap_errno_basic.phptH A D25-Sep-2024567 3027

ldap_error_basic.phptH A D25-Sep-2024590 3027

ldap_escape_all.phptH A D25-Sep-2024198 1511

ldap_escape_both.phptH A D25-Sep-2024231 1511

ldap_escape_dn.phptH A D25-Sep-2024193 1511

ldap_escape_filter.phptH A D25-Sep-2024205 1511

ldap_escape_ignore.phptH A D25-Sep-2024218 1612

ldap_exop.phptH A D25-Sep-20242.6 KiB9586

ldap_exop_passwd.phptH A D25-Sep-20241 KiB4338

ldap_exop_passwd_error.phptH A D25-Sep-20241,015 4034

ldap_exop_refresh.phptH A D25-Sep-20241 KiB4339

ldap_exop_whoami.phptH A D25-Sep-2024541 3025

ldap_explode_dn.phptH A D25-Sep-20241.5 KiB8574

ldap_first_attribute_basic.phptH A D25-Sep-2024744 3128

ldap_first_attribute_error.phptH A D25-Sep-2024481 2119

ldap_first_entry_basic.phptH A D25-Sep-2024792 3835

ldap_first_reference_basic.phptH A D25-Sep-20241.2 KiB4341

ldap_free_result_basic.phptH A D25-Sep-2024636 2825

ldap_get_attributes_basic.phptH A D25-Sep-2024990 5451

ldap_get_dn_basic.phptH A D25-Sep-2024687 3128

ldap_get_entries_basic.phptH A D25-Sep-20241 KiB6359

ldap_get_entries_variation.phptH A D25-Sep-2024699 3632

ldap_get_option_basic.phptH A D25-Sep-2024439 2421

ldap_get_option_controls.phptH A D25-Sep-20242.6 KiB113108

ldap_get_option_package_basic.phptH A D25-Sep-2024485 2018

ldap_get_option_variation.phptH A D25-Sep-20242.3 KiB108103

ldap_get_values_len_basic.phptH A D25-Sep-2024744 3633

ldap_get_values_len_error.phptH A D25-Sep-2024830 3127

ldap_list_basic.phptH A D25-Sep-20242.4 KiB151148

ldap_mod_add_basic.phptH A D25-Sep-20241.4 KiB7973

ldap_mod_add_error.phptH A D25-Sep-20241.4 KiB6348

ldap_mod_del_basic.phptH A D25-Sep-2024781 4337

ldap_mod_del_error.phptH A D25-Sep-2024989 4233

ldap_mod_ext.phptH A D25-Sep-20243.5 KiB174168

ldap_mod_replace_basic.phptH A D25-Sep-20241 KiB5953

ldap_mod_replace_error.phptH A D25-Sep-2024977 4032

ldap_modify_basic.phptH A D25-Sep-20241.4 KiB8377

ldap_modify_batch_basic.phptH A D25-Sep-20242 KiB109103

ldap_modify_batch_error.phptH A D25-Sep-20241.9 KiB8468

ldap_modify_error.phptH A D25-Sep-20241.4 KiB6348

ldap_next_attribute_basic.phptH A D25-Sep-2024909 3835

ldap_next_attribute_error.phptH A D25-Sep-2024856 3229

ldap_next_entry_basic.phptH A D25-Sep-2024887 4138

ldap_next_reference_basic.phptH A D25-Sep-20241.5 KiB4947

ldap_option_reqcert_basic.phptH A D25-Sep-2024585 2420

ldap_option_reqcert_error.phptH A D25-Sep-2024581 2420

ldap_parse_reference_basic.phptH A D25-Sep-20241.2 KiB4543

ldap_parse_result_basic.phptH A D25-Sep-20241.2 KiB4643

ldap_parse_result_controls.phptH A D25-Sep-20241.2 KiB4743

ldap_read_basic.phptH A D25-Sep-20241.1 KiB6562

ldap_read_variation1.phptH A D25-Sep-2024287 2221

ldap_rename_basic.phptH A D25-Sep-20241.2 KiB6259

ldap_rename_error.phptH A D25-Sep-2024340 1715

ldap_rename_ext.phptH A D25-Sep-20241.8 KiB8177

ldap_sasl_bind_basic.phptH A D25-Sep-2024927 3834

ldap_sasl_bind_error.phptH A D25-Sep-20241.8 KiB5845

ldap_search_basic.phptH A D25-Sep-20243.1 KiB195191

ldap_search_error.phptH A D25-Sep-20241.7 KiB6755

ldap_search_overrides.phptH A D25-Sep-20243.7 KiB216212

ldap_search_paged_result_controls.phptH A D25-Sep-20242 KiB10197

ldap_search_sort_controls.phptH A D25-Sep-20244.2 KiB209204

ldap_search_variation1.phptH A D25-Sep-2024972 5753

ldap_search_variation2.phptH A D25-Sep-20241.3 KiB8177

ldap_search_variation3.phptH A D25-Sep-20241.8 KiB110104

ldap_search_variation4.phptH A D25-Sep-20241 KiB5652

ldap_search_variation5.phptH A D25-Sep-20242 KiB108102

ldap_search_variation6.phptH A D25-Sep-20243.9 KiB248243

ldap_set_option_basic.phptH A D25-Sep-2024439 2219

ldap_set_option_cafiles_basic.phptH A D25-Sep-2024787 4037

ldap_set_option_ciphersuite_basic.phptH A D25-Sep-2024430 2118

ldap_set_option_crlcheck_basic.phptH A D25-Sep-2024831 4037

ldap_set_option_crlcheck_error.phptH A D25-Sep-2024316 1615

ldap_set_option_error.phptH A D25-Sep-20241.3 KiB4439

ldap_set_option_keepalive_basic.phptH A D25-Sep-2024552 3128

ldap_set_option_reqcert_basic.phptH A D25-Sep-2024677 3734

ldap_set_option_reqcert_error.phptH A D25-Sep-2024335 1615

ldap_set_option_tls_protocol_max_basic.phptH A D25-Sep-2024850 4340

ldap_set_option_tls_protocol_max_basic_tls13.phptH A D25-Sep-2024906 4643

ldap_set_option_tls_protocol_min_basic.phptH A D25-Sep-2024723 3734

ldap_set_option_tls_protocol_min_basic_tls13.phptH A D25-Sep-2024906 4643

ldap_set_option_variation.phptH A D25-Sep-20242.5 KiB121117

ldap_set_rebind_proc_basic.phptH A D07-Nov-2024871 3732

ldap_set_rebind_proc_error.phptH A D25-Sep-20241.1 KiB4540

ldap_start_tls_basic.phptH A D25-Sep-2024418 2018

ldap_unbind_basic.phptH A D25-Sep-2024382 2017

ldap_unbind_variation.phptH A D07-Nov-2024874 3731

skipifbindfailure.incH A D25-Sep-2024349 1410

skipifcontrol.incH A D25-Sep-2024443 1412

README.md

1# The ldap extension tests
2
3To ease testing LDAP-Setups we've created a vagrant-setup.
4
5## Prerequisites
6
7You will need [vagrant](https://www.vagrantup.com) on your box.
8
9## Usage
10
11To use it follow these steps:
12
13* Create a `Vagrantfile` with the following content.
14* Go to that directory and run "vagrant up"
15
16```Vagrantfile
17$setup = <<<SETUP
18apt-get update
19
20DEBIAN_FRONTEND=noninteractive aptitude install -q -y slapd ldap-utils
21
22export SLAPPASS=`slappasswd -s password`
23
24echo "dn: olcDatabase={1}hdb,cn=config
25changetype: modify
26replace: olcSuffix
27olcSuffix: dc=nodomain
28-
29replace: olcRootDN
30olcRootDN: dc=admin,dc=nodomain
31-
32replace: olcRootPW
33olcRootPW: ${SLAPPASS}" | ldapmodify -Y EXTERNAL -H ldapi:///
34
35echo "dn: dc=nodomain
36objectClass: dcObject
37objectClass: organization
38o: Example
39dc: example
40
41dn: ou=extldap,dc=nodomain
42objectClass: organizationalUnit
43ou: extldap" | ldapadd -c -x -H ldap://localhost:389 -D "dc=admin,dc=nodomain" -w password
44SETUP
45
46Vagrant.configure(2) do |config|
47  config.vm.box = "ubuntu/trusty64"
48  config.vm.network "private_network", ip: "192.168.33.10"
49  config.vm.provision "shell", inline: $setup
50end
51```
52
53Now you will have a virtual machine up and running on IP-Address `192.168.10.33`
54listening on port 369 for incoming LDAP-connections. The machine is already
55configured to execute the LDAP-Tests.
56
57The next step is to go into the PHP-Source-directory. Configure and make the
58source as appropriate.
59
60Before running the LDAP-Tests you need to set some environment-variables:
61
62```bash
63export LDAP_TEST_PASSWD="password"
64export LDAP_TEST_BASE="ou=extldap,dc=nodomain"
65export LDAP_TEST_USER="dc=admin,dc=nodomain"
66export LDAP_TEST_HOST=192.168.33.10
67```
68
69Now you can run the test-suite by calling `make test`. To test only the
70LDAP-Tests, run `make test TESTS=ext/ldap`.
71
72CAVEAT: The current setup does not (yet) test secure connections.
73
74## Old README
75
76Most tests here rely on the availability of an LDAP server configured with TLS.
77
78### Client/Server configuration
79
80OpenLDAP 2.4.31 has been used with the configuration below.
81
82Notes:
83
841. A self signed certificate can be generated using:
85
86    ```bash
87    openssl req -newkey rsa:1024 -x509 -nodes -out server.pem -keyout server.pem -days 3650
88    ```
89
90    It is used for testing ldap_start_tls(), which also requires
91    `TLS_REQCERT never` in client configuration.
92
932. An empty LDAP structure is required for the tests to be PASSed (except for
94    base and admin)
95
96If you use a debian based distribution, prefer the use of `dpkg-reconfigure`.
97Otherwise you may alter these configuration files:
98
99#### (/etc/openldap/)slapd.conf
100
101```txt
102TLSCACertificateFile /etc/openldap/ssl/server.pem
103TLSCertificateFile /etc/openldap/ssl/server.pem
104TLSCertificateKeyFile /etc/openldap/ssl/server.pem
105TLSVerifyClient never
106
107# hdb is used instead of bdb as it enables the usage of referrals & aliases
108database        hdb
109suffix          "dc=my-domain,dc=com"
110checkpoint      32      30
111rootdn          "cn=Manager,dc=my-domain,dc=com"
112rootpw          secret
113directory       /var/lib/openldap-data
114index   objectClass     eq
115
116authz-regexp
117    uid=Manager,cn=digest-md5,cn=auth
118    cn=Manager,dc=my-domain,dc=com
119```
120
121#### (/etc/openldap/)ldap.conf
122
123```txt
124TLS_REQCERT never
125```
126
127#### Tests configuration
128
129The following environment variables may be defined:
130
131```txt
132LDAP_TEST_HOST (default: localhost)                        Host to connect to
133LDAP_TEST_PORT (default: 389)                              Port to connect to
134LDAP_TEST_BASE (default: dc=my-domain,dc=com)              Base to use. May be the ldap root or a subtree. (ldap_search_variation6 will fail if a subtree is used)
135LDAP_TEST_USER (default: cn=Manager,dc=my-domain,dc=com)   DN used for binding
136LDAP_TEST_SASL_USER (default: Manager)                     SASL user used for SASL binding
137LDAP_TEST_PASSWD (default: secret)                         Password used for plain and SASL binding
138LDAP_TEST_OPT_PROTOCOL_VERSION (default: 3)                Version of LDAP protocol to use
139LDAP_TEST_SKIP_BIND_FAILURE (default: true)                Whether to fail the test or not in case binding fails
140```
141
142## Credits
143
144* Davide Mendolia (idaf1er@gmail.com)
145* Patrick Allaert (patrick.allaert@gmail.com)
146* Côme Bernigaud (mcmic@php.net)
147