diff options
author | Michael Adam <obnox@samba.org> | 2011-07-04 13:14:43 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-07-04 20:02:08 +0200 |
commit | 747c67cf309a5127e78bd78f0d17e3fc094115d2 (patch) | |
tree | d9a712d4fdbc93a345e5ddf478172ba7644b12a4 /source3/registry | |
parent | 144c8d77d8dcde0b85cef28b6515360aa0c55b85 (diff) | |
download | samba-747c67cf309a5127e78bd78f0d17e3fc094115d2.tar.gz samba-747c67cf309a5127e78bd78f0d17e3fc094115d2.tar.bz2 samba-747c67cf309a5127e78bd78f0d17e3fc094115d2.zip |
s3:registry: add regdb_create_basekey()
Function to create a base key in the registry db, i.e. one that
has no parent key.
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_backend_db.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 84ac57216b..e5386f7d91 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -50,6 +50,7 @@ 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); +static WERROR regdb_create_basekey(struct db_context *db, const char *key); /* List the deepest path into the registry. All part components will be created.*/ @@ -1188,6 +1189,41 @@ static WERROR regdb_create_subkey(const char *key, const char *subkey) } /** + * create a base key + */ + +struct regdb_create_basekey_context { + const char *key; +}; + +static NTSTATUS regdb_create_basekey_action(struct db_context *db, + void *private_data) +{ + WERROR werr; + struct regdb_create_basekey_context *create_ctx; + + create_ctx = (struct regdb_create_basekey_context *)private_data; + + werr = regdb_store_subkey_list(db, NULL, create_ctx->key); + + return werror_to_ntstatus(werr); +} + +static WERROR regdb_create_basekey(struct db_context *db, const char *key) +{ + WERROR werr; + struct regdb_create_subkey_context create_ctx; + + create_ctx.key = key; + + werr = ntstatus_to_werror(dbwrap_trans_do(db, + regdb_create_basekey_action, + &create_ctx)); + + return werr; +} + +/** * create a subkey of a given key */ |