summaryrefslogtreecommitdiff
path: root/source3/registry/reg_backend_db.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/registry/reg_backend_db.c')
-rw-r--r--source3/registry/reg_backend_db.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index 64c466db81..fad6c08b5e 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -1298,8 +1298,18 @@ static WERROR regdb_create_subkey_internal(struct db_context *db,
W_ERROR_NOT_OK_GOTO_DONE(werr);
if (regsubkey_ctr_key_exists(subkeys, subkey)) {
- werr = WERR_OK;
- goto done;
+ char *newkey;
+
+ newkey = talloc_asprintf(mem_ctx, "%s\\%s", key, subkey);
+ if (newkey == NULL) {
+ werr = WERR_NOMEM;
+ goto done;
+ }
+
+ if (regdb_key_exists(db, newkey)) {
+ werr = WERR_OK;
+ goto done;
+ }
}
talloc_free(subkeys);