summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-05-11 15:27:01 +0200
committerVolker Lendecke <vl@samba.org>2011-05-12 11:48:30 +0200
commit1a6ac6a9444c826fe68fd4c55dbef226c8d3b056 (patch)
tree601cf3d4f61839ed1ab10b72dd2542636505b382 /source3/registry
parentb1eac2daf38703a2e206ec3b4d577889f6d3f5c0 (diff)
downloadsamba-1a6ac6a9444c826fe68fd4c55dbef226c8d3b056.tar.gz
samba-1a6ac6a9444c826fe68fd4c55dbef226c8d3b056.tar.bz2
samba-1a6ac6a9444c826fe68fd4c55dbef226c8d3b056.zip
s3:registry: add create_sorted_subkeys() to delete and recreate the sorted subkeys key
This is to be used from other places than the key_exists() code path.
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_backend_db.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index b99ef916a5..28439ab914 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -48,6 +48,8 @@ static int regdb_fetch_values_internal(struct db_context *db, const char* key,
static bool regdb_store_values_internal(struct db_context *db, const char *key,
struct regval_ctr *values);
+static NTSTATUS create_sorted_subkeys(const char *key);
+
/* List the deepest path into the registry. All part components will be created.*/
/* If you want to have a part of the path controlled by the tdb and part by
@@ -1424,6 +1426,25 @@ static NTSTATUS create_sorted_subkeys_internal(const char *key,
return status;
}
+static NTSTATUS create_sorted_subkeys(const char *key)
+{
+ char *sorted_subkeys_keyname;
+ NTSTATUS status;
+
+ sorted_subkeys_keyname = talloc_asprintf(talloc_tos(), "%s\\%s",
+ REG_SORTED_SUBKEYS_PREFIX,
+ key);
+ if (sorted_subkeys_keyname == NULL) {
+ status = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
+
+ status = create_sorted_subkeys_internal(key, sorted_subkeys_keyname);
+
+done:
+ return status;
+}
+
struct scan_subkey_state {
char *name;
bool scanned;