diff options
author | Michael Adam <obnox@samba.org> | 2011-09-30 15:42:31 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-12 03:49:05 +0200 |
commit | 240d6217dd4d75a69b3f57f9668aa81ed042a6cf (patch) | |
tree | 020df6077a11e06efc18c54b53b34210cfe93045 | |
parent | 9d688cd7be2d21af1f881a3e65549bff03619c46 (diff) | |
download | samba-240d6217dd4d75a69b3f57f9668aa81ed042a6cf.tar.gz samba-240d6217dd4d75a69b3f57f9668aa81ed042a6cf.tar.bz2 samba-240d6217dd4d75a69b3f57f9668aa81ed042a6cf.zip |
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 <gbeck@sernet.de>
-rw-r--r-- | source3/registry/reg_backend_db.c | 14 |
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); |