attr = dsdb_attribute_by_lDAPDisplayName(ac->schema,
msg->elements[i].name);
if (attr == NULL) {
+ if (ldb_request_get_control(ac->req, LDB_CONTROL_RELAX_OID) &&
+ ac->req->operation != LDB_ADD) {
+ /* we allow this for dbcheck to fix
+ broken attributes */
+ goto no_attribute;
+ }
ldb_asprintf_errstring(ldb, "objectclass_attrs: attribute '%s' on entry '%s' was not found in the schema!",
msg->elements[i].name,
ldb_dn_get_linearized(msg->dn));
msg->elements[i].name = attr->lDAPDisplayName;
}
+no_attribute:
if (ac->req->operation == LDB_ADD) {
ret = ldb_build_add_req(&child_req, ldb, ac,
msg, ac->req->controls,
attr = dsdb_attribute_by_lDAPDisplayName(ac->schema,
msg->elements[i].name);
if (attr == NULL) {
+ if (ldb_request_get_control(ac->req, LDB_CONTROL_RELAX_OID)) {
+ /* allow this to make it possible for dbcheck
+ to remove bad attributes */
+ continue;
+ }
return ldb_operr(ldb);
}
const struct dsdb_schema *schema,
uint64_t *seq_num,
const struct GUID *our_invocation_id,
- NTTIME now)
+ NTTIME now,
+ struct ldb_request *req)
{
uint32_t i;
const struct dsdb_attribute *a;
a = dsdb_attribute_by_lDAPDisplayName(schema, el->name);
if (a == NULL) {
+ if (ldb_request_get_control(req, LDB_CONTROL_RELAX_OID)) {
+ /* allow this to make it possible for dbcheck
+ to remove bad attributes */
+ return LDB_SUCCESS;
+ }
+
DEBUG(0,(__location__ ": Unable to find attribute %s in schema\n",
el->name));
return LDB_ERR_OPERATIONS_ERROR;
struct ldb_message_element *old_el;
old_el = ldb_msg_find_element(res->msgs[0], msg->elements[i].name);
ret = replmd_update_rpmd_element(ldb, msg, &msg->elements[i], old_el, &omd, schema, seq_num,
- our_invocation_id, now);
+ our_invocation_id, now, req);
if (ret != LDB_SUCCESS) {
return ret;
}