diff options
Diffstat (limited to 'ext/ldap')
| -rw-r--r-- | ext/ldap/ldap.c | 27 | ||||
| -rw-r--r-- | ext/ldap/php_ldap.h | 4 | ||||
| -rw-r--r-- | ext/ldap/tests/ldap_bind_basic.phpt | 3 | ||||
| -rw-r--r-- | ext/ldap/tests/ldap_bind_variation.phpt | 3 | ||||
| -rw-r--r-- | ext/ldap/tests/ldap_get_entries_variation.phpt | 5 | ||||
| -rw-r--r-- | ext/ldap/tests/ldap_mod_del_basic.phpt | 5 | ||||
| -rw-r--r-- | ext/ldap/tests/ldap_search_error.phpt | 5 | ||||
| -rw-r--r-- | ext/ldap/tests/ldap_start_tls_basic.phpt | 3 |
8 files changed, 34 insertions, 21 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 4a8941cf1..c13912496 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -23,7 +23,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ldap.c 287897 2009-08-30 15:33:59Z iliaa $ */ +/* $Id: ldap.c 293036 2010-01-03 09:23:27Z sebastian $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -225,7 +225,7 @@ PHP_MINFO_FUNCTION(ldap) php_info_print_table_start(); php_info_print_table_row(2, "LDAP Support", "enabled"); - php_info_print_table_row(2, "RCS Version", "$Id: ldap.c 287897 2009-08-30 15:33:59Z iliaa $"); + php_info_print_table_row(2, "RCS Version", "$Id: ldap.c 293036 2010-01-03 09:23:27Z sebastian $"); if (LDAPG(max_links) == -1) { snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links)); @@ -936,21 +936,21 @@ PHP_FUNCTION(ldap_get_entries) ldap = ld->link; num_entries = ldap_count_entries(ldap, ldap_result); + array_init(return_value); + add_assoc_long(return_value, "count", num_entries); + if (num_entries == 0) { - RETURN_NULL(); + return; } - num_entries = 0; ldap_result_entry = ldap_first_entry(ldap, ldap_result); if (ldap_result_entry == NULL) { + zval_dtor(return_value); RETURN_FALSE; } - array_init(return_value); - add_assoc_long(return_value, "count", num_entries); - + num_entries = 0; while (ldap_result_entry != NULL) { - MAKE_STD_ZVAL(tmp1); array_init(tmp1); @@ -1583,14 +1583,17 @@ PHP_FUNCTION(ldap_get_option) #ifdef LDAP_OPT_NETWORK_TIMEOUT case LDAP_OPT_NETWORK_TIMEOUT: { - struct timeval *timeout; + struct timeval *timeout = NULL; if (ldap_get_option(ld->link, LDAP_OPT_NETWORK_TIMEOUT, (void *) &timeout)) { if (timeout) { ldap_memfree(timeout); } RETURN_FALSE; - } + } + if (!timeout) { + RETURN_FALSE; + } zval_dtor(retval); ZVAL_LONG(retval, timeout->tv_sec); ldap_memfree(timeout); @@ -1908,6 +1911,7 @@ PHP_FUNCTION(ldap_first_reference) resultentry->id = Z_LVAL_P(result); zend_list_addref(resultentry->id); resultentry->data = entry; + resultentry->ber = NULL; } } /* }}} */ @@ -1936,6 +1940,7 @@ PHP_FUNCTION(ldap_next_reference) resultentry_next->id = resultentry->id; zend_list_addref(resultentry->id); resultentry_next->data = entry_next; + resultentry_next->ber = NULL; } } /* }}} */ diff --git a/ext/ldap/php_ldap.h b/ext/ldap/php_ldap.h index c30218a70..fc4e3e8f2 100644 --- a/ext/ldap/php_ldap.h +++ b/ext/ldap/php_ldap.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ldap.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_ldap.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_LDAP_H #define PHP_LDAP_H diff --git a/ext/ldap/tests/ldap_bind_basic.phpt b/ext/ldap/tests/ldap_bind_basic.phpt index bac8d0d11..b0babaef1 100644 --- a/ext/ldap/tests/ldap_bind_basic.phpt +++ b/ext/ldap/tests/ldap_bind_basic.phpt @@ -4,7 +4,8 @@ ldap_bind() - Basic anonymous binding Patrick Allaert <patrickallaert@php.net> # Belgian PHP Testfest 2009 --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php require_once dirname(__FILE__) .'/skipif.inc'; ?> +<?php require_once dirname(__FILE__) .'/skipifbindfailure.inc'; ?> --FILE-- <?php require "connect.inc"; diff --git a/ext/ldap/tests/ldap_bind_variation.phpt b/ext/ldap/tests/ldap_bind_variation.phpt index 64abf6cbb..24102f7a3 100644 --- a/ext/ldap/tests/ldap_bind_variation.phpt +++ b/ext/ldap/tests/ldap_bind_variation.phpt @@ -4,7 +4,8 @@ ldap_bind() - Advanced binding Patrick Allaert <patrickallaert@php.net> # Belgian PHP Testfest 2009 --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php require_once dirname(__FILE__) .'/skipif.inc'; ?> +<?php require_once dirname(__FILE__) .'/skipifbindfailure.inc'; ?> --FILE-- <?php require "connect.inc"; diff --git a/ext/ldap/tests/ldap_get_entries_variation.phpt b/ext/ldap/tests/ldap_get_entries_variation.phpt index 92c49740c..cb0f306d5 100644 --- a/ext/ldap/tests/ldap_get_entries_variation.phpt +++ b/ext/ldap/tests/ldap_get_entries_variation.phpt @@ -29,5 +29,8 @@ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); remove_dummy_data($link); ?> --EXPECT-- -NULL +array(1) { + ["count"]=> + int(0) +} ===DONE=== diff --git a/ext/ldap/tests/ldap_mod_del_basic.phpt b/ext/ldap/tests/ldap_mod_del_basic.phpt index 0d002bd15..c7daba44d 100644 --- a/ext/ldap/tests/ldap_mod_del_basic.phpt +++ b/ext/ldap/tests/ldap_mod_del_basic.phpt @@ -36,5 +36,8 @@ remove_dummy_data($link); ?> --EXPECT-- bool(true) -NULL +array(1) { + ["count"]=> + int(0) +} ===DONE=== diff --git a/ext/ldap/tests/ldap_search_error.phpt b/ext/ldap/tests/ldap_search_error.phpt index c03bd2ca8..7e9461343 100644 --- a/ext/ldap/tests/ldap_search_error.phpt +++ b/ext/ldap/tests/ldap_search_error.phpt @@ -4,9 +4,8 @@ ldap_search() - operation that should fail Davide Mendolia <idaf1er@gmail.com> Belgian PHP Testfest 2009 --SKIPIF-- -<?php -require_once('skipif.inc'); -?> +<?php require_once dirname(__FILE__) .'/skipif.inc'; ?> +<?php require_once dirname(__FILE__) .'/skipifbindfailure.inc'; ?> --FILE-- <?php include "connect.inc"; diff --git a/ext/ldap/tests/ldap_start_tls_basic.phpt b/ext/ldap/tests/ldap_start_tls_basic.phpt index 3ae50bef5..efc43569d 100644 --- a/ext/ldap/tests/ldap_start_tls_basic.phpt +++ b/ext/ldap/tests/ldap_start_tls_basic.phpt @@ -4,7 +4,8 @@ ldap_start_tls() - Basic ldap_start_tls test Patrick Allaert <patrickallaert@php.net> # Belgian PHP Testfest 2009 --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php require_once dirname(__FILE__) .'/skipif.inc'; ?> +<?php require_once dirname(__FILE__) .'/skipifbindfailure.inc'; ?> --FILE-- <?php require "connect.inc"; |
