From 240d6217dd4d75a69b3f57f9668aa81ed042a6cf Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 30 Sep 2011 15:42:31 +0200 Subject: [PATCH] s3:registry: improve regdb_create_subkey_internal() to always complete incomlete keys Originally, this function did not create the key's subkey list record if only the record was listed in the subkeylist of its parent key. Now this is fixed. Pair-Programmed-With: Gregor Beck --- source3/registry/reg_backend_db.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 64c466db811..fad6c08b5e0 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);