1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

schema: Rework dsdb_schema_set_indices_and_attributes() db operations

Commit ec9b1e881c did not fully fix this.

There is no value in using dsdb_replace(), we are under the read lock
and replace just confuses things further.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett 2017-09-11 15:22:23 +12:00 committed by Stefan Metzmacher
parent 51be27522c
commit 5d9bb80a02
2 changed files with 9 additions and 10 deletions

View File

@ -1,2 +0,0 @@
^samba.tests.dsdb_schema_attributes.samba.tests.dsdb_schema_attributes.SchemaAttributesTestCase.test_modify_at_indexlist
^samba.tests.dsdb_schema_attributes.samba.tests.dsdb_schema_attributes.SchemaAttributesTestCase.test_modify_at_attributes

View File

@ -175,11 +175,11 @@ int dsdb_schema_set_indices_and_attributes(struct ldb_context *ldb,
}
if (mod_msg->num_elements > 0) {
/*
* Do the replace with the constructed message,
* to avoid needing a lock between this search
* and the replace
* Do the replace with the difference, as we
* are under the read lock and we wish to do a
* delete of any removed/renamed attributes
*/
ret = dsdb_replace(ldb, msg, 0);
ret = dsdb_modify(ldb, mod_msg, 0);
}
talloc_free(mod_msg);
}
@ -235,12 +235,13 @@ int dsdb_schema_set_indices_and_attributes(struct ldb_context *ldb,
* @SAMBA_FEATURES_SUPPORTED
*/
} else if (mod_msg->num_elements > 0) {
/*
* Do the replace with the constructed message,
* to avoid needing a lock between this search
* and the replace
* Do the replace with the difference, as we
* are under the read lock and we wish to do a
* delete of any removed/renamed attributes
*/
ret = dsdb_replace(ldb, msg_idx, 0);
ret = dsdb_modify(ldb, mod_msg, 0);
}
talloc_free(mod_msg);
}