summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/registry/reg_backend_db.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index 43963db3c2..fe15b4e461 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -1368,14 +1368,31 @@ static bool scan_parent_subkeys(struct db_context *db, const char *parent,
if (state.scanned) {
result = state.found;
} else {
+ res = db->transaction_start(db);
+ if (res != 0) {
+ DEBUG(0, ("error starting transacion\n"));
+ goto fail;
+ }
+
if (!create_sorted_subkeys(path, key)) {
+ res = db->transaction_cancel(db);
+ if (res != 0) {
+ smb_panic("Failed to cancel transaction.");
+ }
goto fail;
}
+
res = db->parse_record(db, string_term_tdb_data(key),
parent_subkey_scanner, &state);
if ((res == 0) && (state.scanned)) {
result = state.found;
}
+
+ res = db->transaction_commit(db);
+ if (res != 0) {
+ DEBUG(0, ("error committing transaction\n"));
+ result = false;
+ }
}
fail: