]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dsdb: Add debugging for a contrived situation where a non-schema attribute is on...
authorAndrew Bartlett <abartlet@samba.org>
Fri, 28 Feb 2020 20:30:15 +0000 (09:30 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 2 Mar 2020 04:14:21 +0000 (04:14 +0000)
I had to modify the backend DB to produce this error, but
I would like a clear error anyway.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Mar  2 04:14:22 UTC 2020 on sn-devel-184

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index db3a3e8c023ee861494577881fc9a59cca4e1735..589323ca320efe4cf73e8709e3e10edad254945d 100644 (file)
@@ -4601,6 +4601,17 @@ static int replmd_delete_internals(struct ldb_module *module, struct ldb_request
                        el = &old_msg->elements[i];
                        sa = dsdb_attribute_by_lDAPDisplayName(schema, el->name);
                        if (!sa) {
+                               const char *old_dn_str
+                                       = ldb_dn_get_linearized(old_dn);
+
+                               ldb_asprintf_errstring(ldb,
+                                                      __location__
+                                                      ": Attribute %s "
+                                                      "not found in schema "
+                                                      "when deleting %s. "
+                                                      "Existing record is invalid",
+                                                      el->name,
+                                                      old_dn_str);
                                talloc_free(tmp_ctx);
                                return LDB_ERR_OPERATIONS_ERROR;
                        }