Author: abartlet
Date: 2005-12-28 11:34:19 +0000 (Wed, 28 Dec 2005)
New Revision: 12540

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

Log:
Provide more information in the ldb error string.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2005-12-28 09:31:43 UTC 
(rev 12539)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2005-12-28 11:34:19 UTC 
(rev 12540)
@@ -577,7 +577,7 @@
                        if (msg->elements[i].num_values == 0) {
                                if (msg_delete_attribute(module, ldb, msg2, 
                                                         msg->elements[i].name) 
!= 0) {
-                                       err_string = talloc_strdup(module, "No 
such attribute");
+                                       err_string = talloc_asprintf(module, 
"No such attribute: %s", msg->elements[i].name);
                                        if (err_string) 
ldb_set_errstring(module, err_string);
                                        ret = LDB_ERR_NO_SUCH_ATTRIBUTE;
                                        goto failed;
@@ -589,7 +589,7 @@
                                                       msg2, 
                                                       msg->elements[i].name,
                                                       
&msg->elements[i].values[j]) != 0) {
-                                       err_string = talloc_strdup(module, "No 
such attribute");
+                                       err_string = talloc_asprintf(module, 
"No such attribute: %s", msg->elements[i].name);
                                        if (err_string) 
ldb_set_errstring(module, err_string);
                                        ret = LDB_ERR_NO_SUCH_ATTRIBUTE;
                                        goto failed;
@@ -600,7 +600,9 @@
                        }
                        break;
                default:
-                       err_string = talloc_strdup(module, "Invalid ldb_modify 
flags");
+                       err_string = talloc_asprintf(module, "Invalid 
ldb_modify flags on %s: 0x%x", 
+                                                    msg->elements[i].name, 
+                                                    msg->elements[i].flags & 
LDB_FLAG_MOD_MASK);
                        if (err_string) ldb_set_errstring(module, err_string);
                        ret = LDB_ERR_PROTOCOL_ERROR;
                        goto failed;

Reply via email to