1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

s4:dsdb/objectclass_attrs: call dsdb_attribute_from_ldb() without a prefixmap

We may not have a prefix mapping for the new attribute definition,
it will be added later.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12128

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit fa580f255ca0878b99946cda3f95913ff37f6d54)
This commit is contained in:
Stefan Metzmacher 2016-08-08 13:02:21 +02:00
parent 6143e5ec2b
commit 5902a362b3

View File

@ -437,13 +437,25 @@ static int attr_handler2(struct oc_context *ac)
struct dsdb_attribute *att = talloc(ac, struct dsdb_attribute);
const struct dsdb_syntax *attrSyntax;
WERROR status;
struct dsdb_schema *tmp_schema = NULL;
status= dsdb_attribute_from_ldb(ac->schema, msg, att);
/*
* We temporary remove the prefix map from the schema,
* a new prefix map is added by dsdb_create_prefix_mapping()
* via the "schema_data" module.
*/
tmp_schema = dsdb_schema_copy_shallow(ac, ldb, ac->schema);
if (tmp_schema == NULL) {
return ldb_module_oom(ac->module);
}
TALLOC_FREE(tmp_schema->prefixmap);
status= dsdb_attribute_from_ldb(tmp_schema, msg, att);
if (!W_ERROR_IS_OK(status)) {
ldb_set_errstring(ldb,
"objectclass: failed to translate the schemaAttribute to a dsdb_attribute");
return LDB_ERR_UNWILLING_TO_PERFORM;
}
TALLOC_FREE(tmp_schema);
attrSyntax = dsdb_syntax_for_attribute(att);
if (!attrSyntax) {