diff options
Diffstat (limited to 'source4/lib/registry/reg_backend_dir.c')
-rw-r--r-- | source4/lib/registry/reg_backend_dir.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/lib/registry/reg_backend_dir.c b/source4/lib/registry/reg_backend_dir.c index 89f9280585..41a0da58c0 100644 --- a/source4/lib/registry/reg_backend_dir.c +++ b/source4/lib/registry/reg_backend_dir.c @@ -34,9 +34,16 @@ static WERROR reg_dir_add_key(TALLOC_CTX *mem_ctx, struct registry_key *parent, return WERR_INVALID_PARAM; } -static WERROR reg_dir_del_key(struct registry_key *k) +static WERROR reg_dir_del_key(struct registry_key *k, const char *name) { - return (rmdir((char *)k->backend_data) == 0)?WERR_OK:WERR_GENERAL_FAILURE; + char *child = talloc_asprintf(NULL, "%s/%s", (char *)k->backend_data, name); + WERROR ret; + + if (rmdir(child) == 0) ret = WERR_OK; else ret = WERR_GENERAL_FAILURE; + + talloc_destroy(child); + + return ret; } static WERROR reg_dir_open_key(TALLOC_CTX *mem_ctx, struct registry_key *p, const char *name, struct registry_key **subkey) |