cvs: php4 /ext/ldap ldap.c

From: Date: Fri, 04 Aug 2000 17:18:55 +0000
Subject: cvs: php4 /ext/ldap ldap.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1036@lists.php.net to get a copy of this message
sniper Fri Aug 4 10:18:55 2000 EDT Modified files: /php4/ext/ldap ldap.c Log: - This should fix bug #5964 # Could someone please check this out..it works as intented for me at least. # But I don't have any Windoze machines available to test this there. Index: php4/ext/ldap/ldap.c diff -u php4/ext/ldap/ldap.c:1.57 php4/ext/ldap/ldap.c:1.58 --- php4/ext/ldap/ldap.c:1.57 Wed Aug 2 06:11:46 2000 +++ php4/ext/ldap/ldap.c Fri Aug 4 10:18:54 2000 @@ -22,7 +22,7 @@ */ -/* $Id: ldap.c,v 1.57 2000/08/02 13:11:46 sniper Exp $ */ +/* $Id: ldap.c,v 1.58 2000/08/04 17:18:54 sniper Exp $ */ #define IS_EXT_MODULE #include "php.h" @@ -49,7 +49,7 @@ ZEND_DECLARE_MODULE_GLOBALS(ldap) - +static unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; static int le_result, le_result_entry, le_ber_entry; static int le_link; @@ -71,8 +71,8 @@ PHP_FE(ldap_first_entry, NULL) PHP_FE(ldap_next_entry, NULL) PHP_FE(ldap_get_entries, NULL) - PHP_FE(ldap_first_attribute, NULL) - PHP_FE(ldap_next_attribute, NULL) + PHP_FE(ldap_first_attribute, third_argument_force_ref) + PHP_FE(ldap_next_attribute, third_argument_force_ref) PHP_FE(ldap_get_attributes, NULL) PHP_FE(ldap_get_values, NULL) PHP_FE(ldap_get_values_len, NULL) @@ -192,7 +192,7 @@ 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,v 1.57 2000/08/02 13:11:46 sniper Exp $" ); + php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.58 2000/08/04 17:18:54 sniper Exp $" ); php_info_print_table_row(2, "Total Links", maxl ); #if HAVE_NSLDAP @@ -806,7 +806,7 @@ char *attribute; LDAPLS_FETCH(); - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link,&result,&berp) == FAILURE || ParameterPassedByReference(ht,3)==0 ) { + if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link,&result,&berp) == FAILURE) { WRONG_PARAM_COUNT; } @@ -852,11 +852,17 @@ ldap_result_entry = _get_ldap_result_entry(result); if (ldap_result_entry == NULL) RETURN_FALSE; - ber = _get_ber_entry(berp); + if((ber = _get_ber_entry(berp)) == NULL) { + RETURN_FALSE; + } if ((attribute = ldap_next_attribute(ldap, ldap_result_entry, ber)) == NULL) { RETURN_FALSE; } else { + /* brep is passed by ref so we do not have to account for memory */ + (*berp)->type=IS_LONG; + (*berp)->value.lval=zend_list_insert(ber,le_ber_entry); + RETVAL_STRING(attribute,1); #ifdef WINDOWS ldap_memfree(attribute);

« previous php.cvs (#1036) next »