[SCM] Samba Shared Repository - branch v4-0-test updated -
release-4-0-0alpha5-502-gd60977c
Andrew Bartlett
abartlet at samba.org
Thu Sep 11 10:51:47 GMT 2008
The branch, v4-0-test has been updated
via d60977cc7f89f89f34187f310c91d1ab7db6ccf2 (commit)
from 02d6645efc84179efd652dd29ab32f62ae310147 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test
- Log -----------------------------------------------------------------
commit d60977cc7f89f89f34187f310c91d1ab7db6ccf2
Author: Andrew Bartlett <abartlet at samba.org>
Date: Thu Sep 11 20:51:26 2008 +1000
Remove the complexity of transactions from the attributes-setting code.
I think it is just too complex and error prone to init and cancel
transactions during the module init code. Instead, this isn't prone
to races as it will always achieve a steady state (eventually), and
most cases will never do the write.
Andrew Bartlett
-----------------------------------------------------------------------
Summary of changes:
source/dsdb/schema/schema_set.c | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/dsdb/schema/schema_set.c b/source/dsdb/schema/schema_set.c
index 0ca26c0..3f5ddd8 100644
--- a/source/dsdb/schema/schema_set.c
+++ b/source/dsdb/schema/schema_set.c
@@ -115,24 +115,17 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
}
- ret = ldb_transaction_start(ldb);
- if (ret != LDB_SUCCESS) {
- return ret;
- }
-
/* Try to avoid churning the attributes too much - we only want to do this if they have changed */
ret = ldb_search_exp_fmt(ldb, mem_ctx, &res, msg->dn, LDB_SCOPE_BASE, NULL, "dn=%s", ldb_dn_get_linearized(msg->dn));
if (ret == LDB_ERR_NO_SUCH_OBJECT) {
ret = ldb_add(ldb, msg);
} else if (ret != LDB_SUCCESS) {
talloc_free(mem_ctx);
- ldb_transaction_cancel(ldb);
return ret;
} else {
if (res->count != 1) {
talloc_free(mem_ctx);
- ldb_transaction_cancel(ldb);
return LDB_ERR_NO_SUCH_OBJECT;
}
@@ -149,10 +142,8 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
if (ret == LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS) {
/* We might be on a read-only DB */
talloc_free(mem_ctx);
- ret = ldb_transaction_cancel(ldb);
return ret;
} else if (ret != LDB_SUCCESS) {
- ldb_transaction_cancel(ldb);
return ret;
}
@@ -163,12 +154,10 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
ret = ldb_add(ldb, msg_idx);
} else if (ret != LDB_SUCCESS) {
talloc_free(mem_ctx);
- ldb_transaction_cancel(ldb);
return ret;
} else {
if (res_idx->count != 1) {
talloc_free(mem_ctx);
- ldb_transaction_cancel(ldb);
return LDB_ERR_NO_SUCH_OBJECT;
}
@@ -183,11 +172,7 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
if (ret == LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS) {
/* We might be on a read-only DB */
talloc_free(mem_ctx);
- return ldb_transaction_cancel(ldb);
- } else if (ret == LDB_SUCCESS) {
- ret = ldb_transaction_commit(ldb);
- } else {
- ldb_transaction_cancel(ldb);
+ ret = LDB_SUCCESS;
}
talloc_free(mem_ctx);
return ret;
--
Samba Shared Repository
More information about the samba-cvs
mailing list