Name Date Size #Lines LOC

..05-Dec-2019-

READMEH A D05-Dec-20194.3 KiB12997

bug48441.phptH A D05-Dec-20192.8 KiB170164

bug48696.phptH A D05-Dec-2019296 1613

bug72021.phptH A D05-Dec-2019321 1513

bug73933.phptH A D05-Dec-2019691 3124

bug76248.phptH A D05-Dec-20191.2 KiB4139

connect.incH A D05-Dec-20192.5 KiB7569

ldap_add_basic.phptH A D05-Dec-20191.4 KiB8479

ldap_add_error.phptH A D05-Dec-20192.9 KiB137116

ldap_bind_basic.phptH A D05-Dec-2019482 2119

ldap_bind_error.phptH A D05-Dec-2019948 3629

ldap_bind_variation.phptH A D05-Dec-2019491 2119

ldap_compare_basic.phptH A D05-Dec-2019740 3229

ldap_compare_error.phptH A D05-Dec-20191.4 KiB5646

ldap_connect_basic.phptH A D05-Dec-2019334 1917

ldap_connect_error.phptH A D05-Dec-2019738 3227

ldap_connect_ldap_conf.phptH A D05-Dec-2019603 2726

ldap_connect_variation.phptH A D05-Dec-2019780 4034

ldap_control_paged_results_variation1.phptH A D05-Dec-20191 KiB5753

ldap_control_paged_results_variation2.phptH A D05-Dec-20191.3 KiB7369

ldap_control_paged_results_variation3.phptH A D05-Dec-20191.8 KiB10197

ldap_count_entries_basic.phptH A D05-Dec-2019697 2926

ldap_count_entries_error.phptH A D05-Dec-2019606 2421

ldap_delete_basic.phptH A D05-Dec-2019850 4136

ldap_delete_error.phptH A D05-Dec-20191.4 KiB6352

ldap_dn2ufn.phptH A D05-Dec-2019686 3425

ldap_err2str_basic.phptH A D05-Dec-2019301 1615

ldap_err2str_error.phptH A D05-Dec-2019675 2924

ldap_errno_basic.phptH A D05-Dec-2019584 3128

ldap_errno_error.phptH A D05-Dec-2019512 2421

ldap_error_basic.phptH A D05-Dec-2019607 3128

ldap_error_error.phptH A D05-Dec-2019512 2421

ldap_escape_all.phptH A D05-Dec-2019226 1511

ldap_escape_both.phptH A D05-Dec-2019261 1511

ldap_escape_dn.phptH A D05-Dec-2019223 1511

ldap_escape_filter.phptH A D05-Dec-2019235 1511

ldap_escape_ignore.phptH A D05-Dec-2019246 1612

ldap_explode_dn.phptH A D05-Dec-20191.8 KiB9580

ldap_first_attribute_basic.phptH A D05-Dec-2019796 3229

ldap_first_attribute_error.phptH A D05-Dec-2019618 2421

ldap_first_entry_basic.phptH A D05-Dec-2019846 3835

ldap_first_entry_error.phptH A D05-Dec-2019743 2824

ldap_first_reference_basic.phptH A D05-Dec-20191.3 KiB4442

ldap_first_reference_error.phptH A D05-Dec-2019775 2824

ldap_free_result_basic.phptH A D05-Dec-2019691 2926

ldap_free_result_error.phptH A D05-Dec-2019604 2421

ldap_get_attributes_basic.phptH A D05-Dec-20191 KiB5552

ldap_get_attributes_error.phptH A D05-Dec-2019617 2421

ldap_get_dn_basic.phptH A D05-Dec-2019739 3229

ldap_get_dn_error.phptH A D05-Dec-2019569 2421

ldap_get_entries_basic.phptH A D05-Dec-20191.1 KiB6460

ldap_get_entries_error.phptH A D05-Dec-2019819 3427

ldap_get_entries_variation.phptH A D05-Dec-2019736 3733

ldap_get_option_basic.phptH A D05-Dec-2019491 2623

ldap_get_option_error.phptH A D05-Dec-2019960 4134

ldap_get_option_package_basic.phptH A D05-Dec-2019543 2220

ldap_get_option_variation.phptH A D05-Dec-20191.7 KiB7267

ldap_get_values_len_basic.phptH A D05-Dec-2019796 3734

ldap_get_values_len_error.phptH A D05-Dec-20191.3 KiB4638

ldap_list_basic.phptH A D05-Dec-20192.5 KiB151148

ldap_list_error.phptH A D05-Dec-2019851 3629

ldap_mod_add_basic.phptH A D05-Dec-20191.4 KiB8074

ldap_mod_add_error.phptH A D05-Dec-20192 KiB8463

ldap_mod_del_basic.phptH A D05-Dec-2019812 4438

ldap_mod_del_error.phptH A D05-Dec-20191.6 KiB6348

ldap_mod_replace_basic.phptH A D05-Dec-20191.1 KiB6054

ldap_mod_replace_error.phptH A D05-Dec-20191.6 KiB6147

ldap_modify_basic.phptH A D05-Dec-20191.4 KiB8478

ldap_modify_batch_basic.phptH A D05-Dec-20191.9 KiB110104

ldap_modify_batch_error.phptH A D05-Dec-20192.5 KiB10583

ldap_modify_error.phptH A D05-Dec-20191.9 KiB8463

ldap_next_attribute_basic.phptH A D05-Dec-2019952 3936

ldap_next_attribute_error.phptH A D05-Dec-20191.2 KiB4136

ldap_next_entry_basic.phptH A D05-Dec-2019938 4138

ldap_next_entry_error.phptH A D05-Dec-2019741 2824

ldap_next_reference_basic.phptH A D05-Dec-20191.5 KiB5048

ldap_next_reference_error.phptH A D05-Dec-2019773 2824

ldap_option_reqcert_basic.phptH A D05-Dec-2019650 2521

ldap_option_reqcert_error.phptH A D05-Dec-2019645 2521

ldap_parse_reference_basic.phptH A D05-Dec-20191.2 KiB4644

ldap_parse_reference_error.phptH A D05-Dec-2019816 3229

ldap_parse_result_basic.phptH A D05-Dec-20191.2 KiB4845

ldap_parse_result_error.phptH A D05-Dec-2019411 1817

ldap_read_basic.phptH A D05-Dec-20191.1 KiB6562

ldap_read_error.phptH A D05-Dec-2019851 3629

ldap_rename_basic.phptH A D05-Dec-20191.3 KiB6360

ldap_rename_error.phptH A D05-Dec-2019512 2220

ldap_sasl_bind_basic.phptH A D05-Dec-2019684 2826

ldap_sasl_bind_error.phptH A D05-Dec-20191.7 KiB5441

ldap_search_basic.phptH A D05-Dec-20193.2 KiB195191

ldap_search_error.phptH A D05-Dec-20191.6 KiB6246

ldap_search_overrides.phptH A D05-Dec-20193.7 KiB216212

ldap_search_variation1.phptH A D05-Dec-20191,016 5753

ldap_search_variation2.phptH A D05-Dec-20191.3 KiB8177

ldap_search_variation3.phptH A D05-Dec-20191.8 KiB109103

ldap_search_variation4.phptH A D05-Dec-20191.1 KiB5652

ldap_search_variation5.phptH A D05-Dec-20192 KiB106100

ldap_search_variation6.phptH A D05-Dec-20194 KiB243238

ldap_set_option_basic.phptH A D05-Dec-2019497 2421

ldap_set_option_cafiles_basic.phptH A D05-Dec-2019815 4239

ldap_set_option_ciphersuite_basic.phptH A D05-Dec-2019488 2320

ldap_set_option_crlcheck_basic.phptH A D05-Dec-2019844 4138

ldap_set_option_crlcheck_error.phptH A D05-Dec-2019374 1817

ldap_set_option_error.phptH A D05-Dec-20191.7 KiB6754

ldap_set_option_keepalive_basic.phptH A D05-Dec-2019589 3330

ldap_set_option_reqcert_basic.phptH A D05-Dec-2019660 3734

ldap_set_option_reqcert_error.phptH A D05-Dec-2019412 1817

ldap_set_option_tls_protocol_min_basic.phptH A D05-Dec-2019754 3936

ldap_set_option_variation.phptH A D05-Dec-20191.8 KiB8581

ldap_set_rebind_proc_basic.phptH A D05-Dec-2019820 3530

ldap_set_rebind_proc_error.phptH A D05-Dec-20191.3 KiB5144

ldap_sort_basic.phptH A D05-Dec-20193.5 KiB202199

ldap_sort_error.phptH A D05-Dec-20191.3 KiB4635

ldap_sort_variation.phptH A D05-Dec-20193.5 KiB202199

ldap_start_tls_basic.phptH A D05-Dec-2019494 2119

ldap_start_tls_error.phptH A D05-Dec-2019679 2824

ldap_unbind_basic.phptH A D05-Dec-2019429 2118

ldap_unbind_error.phptH A D05-Dec-20191 KiB4334

ldap_unbind_variation.phptH A D05-Dec-2019798 3529

skipif.incH A D05-Dec-201986 65

skipifbindfailure.incH A D05-Dec-2019339 1410

README

1To ease testing LDAP-Setups we've created a vagrant-setup.
2
3Prerequisits:
4=============
5
6You will need vagrant on your box. Get it from https://www.vagrantup.com
7
8Usage:
9======
10
11To use it follow these steps:
12
13* Create a Vagrant-file with the following content.
14* Go to that directory and run "vagrant up"
15
16```
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 listening on port 369 for incomming LDAP-connections. The machine is already configured to execute the LDAP-Tests
54
55The next step is to go into the PHP-Source-directory. Configure and make the source as appropriate.
56
57Before running the LDAP-Tests you need to set some environment-variables:
58
59export LDAP_TEST_PASSWD="password"
60export LDAP_TEST_BASE="ou=extldap,dc=nodomain"
61export LDAP_TEST_USER="dc=admin,dc=nodomain"
62export LDAP_TEST_HOST=192.168.33.10
63
64Now you can run the test-suite by calling "make test". To test only the LDAP-Tests, run "make test TESTS=ext/ldap"
65
66CAVEAT: The current setup does not (yet) test secure connections.
67
68
69========
70OLD README
71
72Most tests here relies on the availability of an LDAP server configured with TLS.
73
74Client/Server configuration:
75===========================================================
76OpenLDAP 2.4.31 has been used with the configuration below.
77
78Notes:
791.  A self signed certificate can be generated using:
80    $ openssl req -newkey rsa:1024 -x509 -nodes -out server.pem -keyout server.pem -days 3650
81    It is used for testing ldap_start_tls(), which also requires "TLS_REQCERT never" in client configuration
822.  An empty LDAP structure is required for the tests to be PASSed (except for base and admin)
83
84If you use a debian based distribution, prefer the use of dpkg-reconfigure.
85Otherwise you may alter these configuration files:
86
87	(/etc/openldap/)slapd.conf:
88-----------------------------------------------------------
89TLSCACertificateFile /etc/openldap/ssl/server.pem
90TLSCertificateFile /etc/openldap/ssl/server.pem
91TLSCertificateKeyFile /etc/openldap/ssl/server.pem
92TLSVerifyClient never
93
94# hdb is used instead of bdb as it enables the usage of referrals & aliases
95database        hdb
96suffix          "dc=my-domain,dc=com"
97checkpoint      32      30
98rootdn          "cn=Manager,dc=my-domain,dc=com"
99rootpw          secret
100directory       /var/lib/openldap-data
101index   objectClass     eq
102
103authz-regexp
104	uid=Manager,cn=digest-md5,cn=auth
105	cn=Manager,dc=my-domain,dc=com
106
107
108(/etc/openldap/)ldap.conf:
109-----------------------------------------------------------
110TLS_REQCERT never
111
112Tests configuration:
113===========================================================
114The following environment variables may be defined:
115LDAP_TEST_HOST (default: localhost)                        Host to connect to
116LDAP_TEST_PORT (default: 389)                              Port to connect to
117LDAP_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)
118LDAP_TEST_USER (default: cn=Manager,dc=my-domain,dc=com)   DN used for binding
119LDAP_TEST_SASL_USER (default: Manager)                     SASL user used for SASL binding
120LDAP_TEST_PASSWD (default: secret)                         Password used for plain and SASL binding
121LDAP_TEST_OPT_PROTOCOL_VERSION (default: 3)                Version of LDAP protocol to use
122LDAP_TEST_SKIP_BIND_FAILURE (default: true)                Whether to fail the test or not in case binding fails
123
124Credits:
125===========================================================
126Davide Mendolia <idaf1er@gmail.com>
127Patrick Allaert <patrick.allaert@gmail.com>
128Côme Bernigaud <mcmic@php.net>
129