Author: gd
Date: 2005-08-23 13:58:05 +0000 (Tue, 23 Aug 2005)
New Revision: 9522

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9522

Log:
Give better error-message when "NDS Universal Password" change fails.

Guenther

Modified:
   branches/SAMBA_3_0/source/passdb/pdb_nds.c
   trunk/source/passdb/pdb_nds.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/pdb_nds.c
===================================================================
--- branches/SAMBA_3_0/source/passdb/pdb_nds.c  2005-08-23 13:26:44 UTC (rev 
9521)
+++ branches/SAMBA_3_0/source/passdb/pdb_nds.c  2005-08-23 13:58:05 UTC (rev 
9522)
@@ -714,9 +714,13 @@
        if (rc == LDAP_SUCCESS) {
                DEBUG(5,("NDS Universal Password changed for user %s\n", 
object_dn));
        } else {
+               char *ld_error = NULL;
+               ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &ld_error);
+               
                /* This will fail if Universal Password is not enabled for the 
user's context */
-               DEBUG(3,("NDS Universal Password could not be changed for user 
%s: %d\n",
-                                object_dn, rc));
+               DEBUG(3,("NDS Universal Password could not be changed for user 
%s: %s (%s)\n",
+                                object_dn, ldap_err2string(rc), 
ld_error?ld_error:"unknown"));
+               SAFE_FREE(ld_error);
        }
 
        /* Set eDirectory Password */

Modified: trunk/source/passdb/pdb_nds.c
===================================================================
--- trunk/source/passdb/pdb_nds.c       2005-08-23 13:26:44 UTC (rev 9521)
+++ trunk/source/passdb/pdb_nds.c       2005-08-23 13:58:05 UTC (rev 9522)
@@ -714,9 +714,13 @@
        if (rc == LDAP_SUCCESS) {
                DEBUG(5,("NDS Universal Password changed for user %s\n", 
object_dn));
        } else {
+               char *ld_error = NULL;
+               ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &ld_error);
+               
                /* This will fail if Universal Password is not enabled for the 
user's context */
-               DEBUG(3,("NDS Universal Password could not be changed for user 
%s: %d\n",
-                                object_dn, rc));
+               DEBUG(3,("NDS Universal Password could not be changed for user 
%s: %s (%s)\n",
+                                object_dn, ldap_err2string(rc), 
ld_error?ld_error:"unknown"));
+               SAFE_FREE(ld_error);
        }
 
        /* Set eDirectory Password */

Reply via email to