From: Andrew Bartlett Date: Fri, 28 Feb 2020 20:30:15 +0000 (+1300) Subject: dsdb: Add debugging for a contrived situation where a non-schema attribute is on... X-Git-Tag: ldb-2.2.0~1533 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84172ae7cbcc9ccc3a20ac942d4749b28df0f7f5;p=thirdparty%2Fsamba.git dsdb: Add debugging for a contrived situation where a non-schema attribute is on the record I had to modify the backend DB to produce this error, but I would like a clear error anyway. Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Mon Mar 2 04:14:22 UTC 2020 on sn-devel-184 --- diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index db3a3e8c023..589323ca320 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -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; }