mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
s4-ldb: canonicalise the message on ldb_add
This canonicalise avoids a problem with an add that has multiple elements with the same el->name. That is allowed by MS servers, and by ldb, but it breaks things like the tdb backend and the repl_meta_data RPMD handling. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
7cb858e151
commit
20869a0bf0
@ -779,6 +779,15 @@ int ldb_request(struct ldb_context *ldb, struct ldb_request *req)
|
||||
ret = module->ops->search(module, req);
|
||||
break;
|
||||
case LDB_ADD:
|
||||
/* we have to canonicalise here, as so many places
|
||||
* in modules and backends assume we don't have two
|
||||
* elements with the same name */
|
||||
req->op.add.message = ldb_msg_canonicalize(ldb, req->op.add.message);
|
||||
if (!req->op.add.message) {
|
||||
ldb_oom(ldb);
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
talloc_steal(req, req->op.add.message);
|
||||
FIRST_OP(ldb, add);
|
||||
ret = module->ops->add(module, req);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user