summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-10-14 09:27:56 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-10-27 18:52:29 +0200
commit45b4b8264abd80ed0fe39cbaec202ad8742a17a5 (patch)
tree58e2db15758b66f519cbde79a8cf467aeed3f778 /source4/dsdb/samdb/ldb_modules
parent3fe747538bc79633ed7039c6c001902bacecef04 (diff)
downloadsamba-45b4b8264abd80ed0fe39cbaec202ad8742a17a5.tar.gz
samba-45b4b8264abd80ed0fe39cbaec202ad8742a17a5.tar.bz2
samba-45b4b8264abd80ed0fe39cbaec202ad8742a17a5.zip
s4:repl_meta_data LDB module - always return the original LDB result codes on failure
And add "ldb_operr()" before the "return ret" to point out the position where it failed (for "add_time_element" and "add_uint64_element") Reworked after a suggestion by abartlet.
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 090e28fdf5..46094f5f0d 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -2362,12 +2362,14 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req)
ret = add_time_element(msg, "whenChanged", t);
if (ret != LDB_SUCCESS) {
talloc_free(ac);
+ ldb_operr(ldb);
return ret;
}
ret = add_uint64_element(ldb, msg, "uSNChanged", ac->seq_num);
if (ret != LDB_SUCCESS) {
talloc_free(ac);
+ ldb_operr(ldb);
return ret;
}
}
@@ -2609,12 +2611,14 @@ static int replmd_rename_callback(struct ldb_request *req, struct ldb_reply *are
ret = add_time_element(msg, "whenChanged", t);
if (ret != LDB_SUCCESS) {
talloc_free(ac);
+ ldb_operr(ldb);
return ret;
}
ret = add_uint64_element(ldb, msg, "uSNChanged", ac->seq_num);
if (ret != LDB_SUCCESS) {
talloc_free(ac);
+ ldb_operr(ldb);
return ret;
}
@@ -4725,15 +4729,18 @@ linked_attributes[0]:
/* we only change whenChanged and uSNChanged if the seq_num
has changed */
- if (add_time_element(msg, "whenChanged", t) != LDB_SUCCESS) {
+ ret = add_time_element(msg, "whenChanged", t);
+ if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
- return ldb_operr(ldb);
+ ldb_operr(ldb);
+ return ret;
}
- if (add_uint64_element(ldb, msg, "uSNChanged",
- seq_num) != LDB_SUCCESS) {
+ ret = add_uint64_element(ldb, msg, "uSNChanged", seq_num);
+ if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
- return ldb_operr(ldb);
+ ldb_operr(ldb);
+ return ret;
}
old_el = ldb_msg_find_element(msg, attr->lDAPDisplayName);