summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-08-21 16:42:03 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-08-21 16:42:03 +1000
commit3d3fc7bdaaf41eb81ec7d653a68a3e4168c6177b (patch)
treea70dfef560a5df348beef47e588e5e7d096e541b /source4/dsdb
parent53a35b265566b94f882ea09b26cb049fa89b8759 (diff)
downloadsamba-3d3fc7bdaaf41eb81ec7d653a68a3e4168c6177b.tar.gz
samba-3d3fc7bdaaf41eb81ec7d653a68a3e4168c6177b.tar.bz2
samba-3d3fc7bdaaf41eb81ec7d653a68a3e4168c6177b.zip
Stop every ldb startup doing a write to the database.
Something in the search stack adds a distinguisedName record, which isn't in the message we generate. So we compare, fail and rewrite the record - every time ldb starts up... Andrew Bartlett (This used to be commit 44775d1ed4a4b8edc66a06e2b3710aba6a0dd019)
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/schema/schema_set.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index f4daf66794..0ca26c0fc7 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -114,6 +114,7 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
return ret;
}
+
ret = ldb_transaction_start(ldb);
if (ret != LDB_SUCCESS) {
return ret;
@@ -136,6 +137,9 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
}
ret = LDB_SUCCESS;
+ /* Annoyingly added to our search results */
+ ldb_msg_remove_attr(res->msgs[0], "distinguishedName");
+
mod_msg = ldb_msg_diff(ldb, res->msgs[0], msg);
if (mod_msg->num_elements > 0) {
ret = ldb_modify(ldb, mod_msg);
@@ -168,6 +172,9 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
return LDB_ERR_NO_SUCH_OBJECT;
}
+ /* Annoyingly added to our search results */
+ ldb_msg_remove_attr(res_idx->msgs[0], "distinguishedName");
+
mod_msg = ldb_msg_diff(ldb, res_idx->msgs[0], msg_idx);
if (mod_msg->num_elements > 0) {
ret = ldb_modify(ldb, mod_msg);