dsdb: make the ATTRIBUTE NOT FOUND more clear
authorMatthieu Patou <mat@matws.net>
Sat, 4 Sep 2010 22:56:30 +0000 (02:56 +0400)
committerMatthieu Patou <mat@matws.net>
Sun, 5 Sep 2010 08:29:20 +0000 (12:29 +0400)
source4/dsdb/common/util.c
source4/dsdb/samdb/ldb_modules/objectclass.c

index fc117b9fa3b987edfca5cb439f48e4b30d461c83..c409adbbe32930991573724da1a288c8724c8e67 100644 (file)
@@ -1644,6 +1644,8 @@ int samdb_reference_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_
        *dn = ldb_msg_find_attr_as_dn(ldb, mem_ctx, res->msgs[0], attribute);
        if (!*dn) {
                talloc_free(res);
+               ldb_asprintf_errstring(ldb, "Cannot find dn of attribute %s of %s", attribute,
+                                       ldb_dn_get_linearized(base));
                return LDB_ERR_NO_SUCH_ATTRIBUTE;
        }
 
index cd45963f37ad9ce97dfe1c31e91ee297bd4706df..005f0f282002bda750fda166a359f0a717cfb505 100644 (file)
@@ -1005,6 +1005,9 @@ static int objectclass_do_mod(struct oc_context *ac)
                        }
                        if (!found) {
                                /* we cannot delete a not existing object class */
+                               ldb_asprintf_errstring(ldb, "Cannot delete this %.*s ",
+                                              (int)oc_el_change->values[i].length, (const char *)oc_el_change->values[i].data);
+
                                talloc_free(mem_ctx);
                                return LDB_ERR_NO_SUCH_ATTRIBUTE;
                        }