diff options
author | Michael Adam <obnox@samba.org> | 2011-05-11 15:58:48 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-05-12 11:48:30 +0200 |
commit | daf5f29d4933c89bb8815e34206c976945683ed3 (patch) | |
tree | c26df3f303a4f9d0c8b27063fb47544ef7ef3b55 /source3/registry | |
parent | 1a6ac6a9444c826fe68fd4c55dbef226c8d3b056 (diff) | |
download | samba-daf5f29d4933c89bb8815e34206c976945683ed3.tar.gz samba-daf5f29d4933c89bb8815e34206c976945683ed3.tar.bz2 samba-daf5f29d4933c89bb8815e34206c976945683ed3.zip |
s3:registry: recreate the sorted subkeys cache when storing keys
This is to avoid turning the next read operation into a write op.
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_backend_db.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 28439ab914..cd57868efa 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -834,22 +834,9 @@ static WERROR regdb_store_keys_internal2(struct db_context *db, W_ERROR_NOT_OK_GOTO_DONE(werr); /* - * Delete a sorted subkey cache for regdb_key_exists, will be - * recreated automatically + * recreate the sorted subkey cache for regdb_key_exists() */ - keyname = talloc_asprintf(ctx, "%s\\%s", REG_SORTED_SUBKEYS_PREFIX, - keyname); - if (keyname == NULL) { - werr = WERR_NOMEM; - goto done; - } - - werr = ntstatus_to_werror(dbwrap_delete_bystring(db, keyname)); - - /* don't treat WERR_NOT_FOUND as an error here */ - if (W_ERROR_EQUAL(werr, WERR_NOT_FOUND)) { - werr = WERR_OK; - } + werr = ntstatus_to_werror(create_sorted_subkeys(keyname)); done: TALLOC_FREE(ctx); |