jani            Tue Jul 17 08:40:24 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/ext/ldap   ldap.c 
  Log:
  MFH:- Fixed bug #42015 (ldap_rename() gets server error "DSA is unwilling to 
perform")
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.835&r2=1.2027.2.547.2.836&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.835 php-src/NEWS:1.2027.2.547.2.836
--- php-src/NEWS:1.2027.2.547.2.835     Fri Jul 13 14:00:04 2007
+++ php-src/NEWS        Tue Jul 17 08:40:24 2007
@@ -59,6 +59,8 @@
 - Fixed PECL bug #11216 (crash in ZipArchive::addEmptyDir when a directory 
   already exists). (Pierre)
 
+- Fixed bug #42015 (ldap_rename(): server error "DSA is unwilling to perform").
+  (bob at mroczka dot com, Jani)
 - Fixed bug #41964 (strtotime returns a timestamp for non-time string of
   pattern '(A|a) .+'). (Derick)
 - Fixed bug #41961 (Ensure search for hidden private methods does not stray
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.161.2.3.2.9&r2=1.161.2.3.2.10&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.161.2.3.2.9 
php-src/ext/ldap/ldap.c:1.161.2.3.2.10
--- php-src/ext/ldap/ldap.c:1.161.2.3.2.9       Fri Jul 13 10:55:43 2007
+++ php-src/ext/ldap/ldap.c     Tue Jul 17 08:40:24 2007
@@ -23,7 +23,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: ldap.c,v 1.161.2.3.2.9 2007/07/13 10:55:43 jani Exp $ */
+/* $Id: ldap.c,v 1.161.2.3.2.10 2007/07/17 08:40:24 jani Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -322,7 +322,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.161.2.3.2.9 
2007/07/13 10:55:43 jani Exp $");
+       php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 
1.161.2.3.2.10 2007/07/17 08:40:24 jani Exp $");
 
        if (LDAPG(max_links) == -1) {
                snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -2076,6 +2076,7 @@
        zval **link, **dn, **newrdn, **newparent, **deleteoldrdn;
        ldap_linkdata *ld;
        int rc;
+       char *newp = NULL;
        
        if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &link, &dn, 
&newrdn, &newparent, &deleteoldrdn) == FAILURE) {
                WRONG_PARAM_COUNT;
@@ -2088,10 +2089,12 @@
        convert_to_string_ex(newparent);
        convert_to_boolean_ex(deleteoldrdn);
 
+       newp = (Z_STRLEN_PP(newparent) > 0) ?  Z_STRVAL_PP(newparent) : NULL;
+
 #if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10
-       rc = ldap_rename_s(ld->link, Z_STRVAL_PP(dn), Z_STRVAL_PP(newrdn), 
Z_STRVAL_PP(newparent), Z_BVAL_PP(deleteoldrdn), NULL, NULL);
+       rc = ldap_rename_s(ld->link, Z_STRVAL_PP(dn), Z_STRVAL_PP(newrdn), 
newp, Z_BVAL_PP(deleteoldrdn), NULL, NULL);
 #else
-       if (Z_STRLEN_PP(newparent) != 0) {
+       if (newp != NULL) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "You are using old 
LDAP API, newparent must be the empty string, can only modify RDN");
                RETURN_FALSE;
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to