From 7cbdb48475b0340154fad60cb4b7cc53dc2bbcfd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 29 Dec 2007 23:00:49 +0100 Subject: Remove tiny code duplication ndr_size_security_descriptor does the same as sec_desc_size (This used to be commit bc3bd7a8e7c6e9e27acb195c86abb92c0f53112f) --- source3/registry/reg_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index b3d024d7b4..bc4508ff94 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -378,7 +378,7 @@ WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys, return err; } - *secdescsize = sec_desc_size(secdesc); + *secdescsize = ndr_size_security_descriptor(secdesc, 0); TALLOC_FREE(mem_ctx); *last_changed_time = 0; -- cgit From feb4d82724657c5567d9ebefef7242a2a48496e2 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 31 Dec 2007 03:25:54 +0100 Subject: Fix a permissions error in reg_deletekey_recursive(). Michael (This used to be commit 4a56d3d7075bd8bbd5e139c9433789ab29f6a70e) --- source3/registry/reg_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index bc4508ff94..bb410e646b 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -729,7 +729,7 @@ WERROR reg_deletekey_recursive_internal(TALLOC_CTX *ctx, } /* recurse through subkeys first */ - werr = reg_openkey(mem_ctx, parent, path, REG_KEY_WRITE, &key); + werr = reg_openkey(mem_ctx, parent, path, REG_KEY_ALL, &key); if (!W_ERROR_IS_OK(werr)) { goto done; } -- cgit From d35bda0ffd5bea57087dba9a6da8c20df8fa165c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 14 Jan 2008 18:31:11 +0100 Subject: Add detection for need of update to the registry db. This only detects if the tdb sequence number has changed since the data has last been read. Michael (This used to be commit 3f081ebeadf30a7943723703ecae479e0412c60c) --- source3/registry/reg_api.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index bb410e646b..8bbdb6abd3 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -27,7 +27,9 @@ static WERROR fill_value_cache(struct registry_key *key) { if (key->values != NULL) { - return WERR_OK; + if (!reg_values_need_update(key->key, key->values)) { + return WERR_OK; + } } if (!(key->values = TALLOC_ZERO_P(key, REGVAL_CTR))) { @@ -44,7 +46,9 @@ static WERROR fill_value_cache(struct registry_key *key) static WERROR fill_subkey_cache(struct registry_key *key) { if (key->subkeys != NULL) { - return WERR_OK; + if (!reg_subkeys_need_update(key->key, key->subkeys)) { + return WERR_OK; + } } if (!(key->subkeys = TALLOC_ZERO_P(key, REGSUBKEY_CTR))) { -- cgit From 8a010763347d8f9833fe1eb2ae11e85b71f8d499 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 15 Jan 2008 14:55:04 +0100 Subject: Remove some trailing spaces. Michael (This used to be commit 1941c365b50d48fc90f0f98059b8cccf6c7a1a06) --- source3/registry/reg_api.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 8bbdb6abd3..1479e7ad0a 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -1,4 +1,4 @@ -/* +/* * Unix SMB/CIFS implementation. * Virtual Windows Registry Layer * Copyright (C) Volker Lendecke 2006 @@ -7,12 +7,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ @@ -140,7 +140,7 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx, result = WERR_BADFILE; goto done; } - + /* check if the path really exists; failed is indicated by -1 */ /* if the subkey count failed, bail out */ @@ -153,7 +153,7 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx, result = WERR_BADFILE; goto done; } - + TALLOC_FREE( subkeys ); if ( !regkey_access_check( key, access_desired, &key->access_granted, @@ -302,7 +302,7 @@ WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key, SAFE_FREE(val); return WERR_NOMEM; } - + *pval = val; return WERR_OK; } @@ -494,7 +494,6 @@ WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent, TALLOC_FREE(mem_ctx); return err; } - WERROR reg_deletekey(struct registry_key *parent, const char *path) { @@ -712,8 +711,8 @@ WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path, } /* - * Utility function to delete a registry key with all its subkeys. - * Note that reg_deletekey returns ACCESS_DENIED when called on a + * Utility function to delete a registry key with all its subkeys. + * Note that reg_deletekey returns ACCESS_DENIED when called on a * key that has subkeys. */ WERROR reg_deletekey_recursive_internal(TALLOC_CTX *ctx, @@ -739,7 +738,7 @@ WERROR reg_deletekey_recursive_internal(TALLOC_CTX *ctx, } while (W_ERROR_IS_OK(werr = reg_enumkey(mem_ctx, key, 0, - &subkey_name, NULL))) + &subkey_name, NULL))) { werr = reg_deletekey_recursive_internal(mem_ctx, key, subkey_name, -- cgit From 982c71fcd284664b474f3ab8d77bc3c28c572f34 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 15 Jan 2008 14:56:00 +0100 Subject: Use the proper boolean functions. Michael (This used to be commit beaa83f32bd367f1b6ec72ef80a8a258d662f523) --- source3/registry/reg_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 1479e7ad0a..d1657c8cf6 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -742,7 +742,7 @@ WERROR reg_deletekey_recursive_internal(TALLOC_CTX *ctx, { werr = reg_deletekey_recursive_internal(mem_ctx, key, subkey_name, - True); + true); if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -770,12 +770,12 @@ WERROR reg_deletekey_recursive(TALLOC_CTX *ctx, struct registry_key *parent, const char *path) { - return reg_deletekey_recursive_internal(ctx, parent, path, True); + return reg_deletekey_recursive_internal(ctx, parent, path, true); } WERROR reg_deletesubkeys_recursive(TALLOC_CTX *ctx, struct registry_key *parent, const char *path) { - return reg_deletekey_recursive_internal(ctx, parent, path, False); + return reg_deletekey_recursive_internal(ctx, parent, path, false); } -- cgit From 1a15320dcdf72884a4250d535e46315bcf1aa9ee Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 17 Jan 2008 00:16:58 +0100 Subject: Make utility function reg_deletekey_recursive_internal() static. Michael (This used to be commit 3e661273229bcf021276cc0b71350acf8d8fed7c) --- source3/registry/reg_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index d1657c8cf6..cef14e2ca1 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -715,10 +715,10 @@ WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path, * Note that reg_deletekey returns ACCESS_DENIED when called on a * key that has subkeys. */ -WERROR reg_deletekey_recursive_internal(TALLOC_CTX *ctx, - struct registry_key *parent, - const char *path, - bool del_key) +static WERROR reg_deletekey_recursive_internal(TALLOC_CTX *ctx, + struct registry_key *parent, + const char *path, + bool del_key) { TALLOC_CTX *mem_ctx = NULL; WERROR werr = WERR_OK; -- cgit From b6eaf05479fb757da5e8a717c02a6f6c44c42ab5 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 17 Jan 2008 00:57:53 +0100 Subject: Add some sectioning comments to reg_api.c Michael (This used to be commit d3c9c273740b42e5da101f53d4df3aee70cdacf7) --- source3/registry/reg_api.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index cef14e2ca1..744e5eb6e3 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -24,6 +24,11 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY + +/********************************************************************** + * Helper functions + **********************************************************************/ + static WERROR fill_value_cache(struct registry_key *key) { if (key->values != NULL) { @@ -186,6 +191,11 @@ WERROR reg_openhive(TALLOC_CTX *mem_ctx, const char *hive, pkey); } + +/********************************************************************** + * The API functions + **********************************************************************/ + WERROR reg_openkey(TALLOC_CTX *mem_ctx, struct registry_key *parent, const char *name, uint32 desired_access, struct registry_key **pkey) @@ -627,6 +637,11 @@ WERROR reg_deletevalue(struct registry_key *key, const char *name) return WERR_OK; } + +/********************************************************************** + * Higher level utility functions + **********************************************************************/ + WERROR reg_deleteallvalues(struct registry_key *key) { WERROR err; -- cgit From 99b195a6aa39bdf3f327fe1c7b1295032c3c3caa Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 17 Jan 2008 10:19:12 +0100 Subject: Move reg_create_path() and reg_delete_path() to reg_api.c Michael (This used to be commit 4d82cc586c089a16d1d2db214f5e198062890b58) --- source3/registry/reg_api.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 744e5eb6e3..83c5f1a634 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -794,3 +794,98 @@ WERROR reg_deletesubkeys_recursive(TALLOC_CTX *ctx, { return reg_deletekey_recursive_internal(ctx, parent, path, false); } + +/* + * Utility function to create a registry key without opening the hive + * before. Assumes the hive already exists. + */ + +WERROR reg_create_path(TALLOC_CTX *mem_ctx, const char *orig_path, + uint32 desired_access, + const struct nt_user_token *token, + enum winreg_CreateAction *paction, + struct registry_key **pkey) +{ + struct registry_key *hive; + char *path, *p; + WERROR err; + + if (!(path = SMB_STRDUP(orig_path))) { + return WERR_NOMEM; + } + + p = strchr(path, '\\'); + + if ((p == NULL) || (p[1] == '\0')) { + /* + * No key behind the hive, just return the hive + */ + + err = reg_openhive(mem_ctx, path, desired_access, token, + &hive); + if (!W_ERROR_IS_OK(err)) { + SAFE_FREE(path); + return err; + } + SAFE_FREE(path); + *pkey = hive; + *paction = REG_OPENED_EXISTING_KEY; + return WERR_OK; + } + + *p = '\0'; + + err = reg_openhive(mem_ctx, path, + (strchr(p+1, '\\') != NULL) ? + SEC_RIGHTS_ENUM_SUBKEYS : SEC_RIGHTS_CREATE_SUBKEY, + token, &hive); + if (!W_ERROR_IS_OK(err)) { + SAFE_FREE(path); + return err; + } + + err = reg_createkey(mem_ctx, hive, p+1, desired_access, pkey, paction); + SAFE_FREE(path); + TALLOC_FREE(hive); + return err; +} + +/* + * Utility function to create a registry key without opening the hive + * before. Will not delete a hive. + */ + +WERROR reg_delete_path(const struct nt_user_token *token, + const char *orig_path) +{ + struct registry_key *hive; + char *path, *p; + WERROR err; + + if (!(path = SMB_STRDUP(orig_path))) { + return WERR_NOMEM; + } + + p = strchr(path, '\\'); + + if ((p == NULL) || (p[1] == '\0')) { + SAFE_FREE(path); + return WERR_INVALID_PARAM; + } + + *p = '\0'; + + err = reg_openhive(NULL, path, + (strchr(p+1, '\\') != NULL) ? + SEC_RIGHTS_ENUM_SUBKEYS : SEC_RIGHTS_CREATE_SUBKEY, + token, &hive); + if (!W_ERROR_IS_OK(err)) { + SAFE_FREE(path); + return err; + } + + err = reg_deletekey(hive, p+1); + SAFE_FREE(path); + TALLOC_FREE(hive); + return err; +} -- cgit From fcb47f5ea91d497a3921cf5617e30da50638deab Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 17 Jan 2008 10:30:56 +0100 Subject: Comment out unused reg_create_path() and reg_delete_path(). These functions are unused. Comment them out for now. Michael (This used to be commit 0cb8399d7c6f228b38c918f8c6c77fd31c346f89) --- source3/registry/reg_api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 83c5f1a634..ee138b284d 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -795,7 +795,10 @@ WERROR reg_deletesubkeys_recursive(TALLOC_CTX *ctx, return reg_deletekey_recursive_internal(ctx, parent, path, false); } -/* +#if 0 +/* these two functions are unused. */ + +/** * Utility function to create a registry key without opening the hive * before. Assumes the hive already exists. */ @@ -889,3 +892,4 @@ WERROR reg_delete_path(const struct nt_user_token *token, TALLOC_FREE(hive); return err; } +#endif /* #if 0 */ -- cgit From da4ecfc0faed73599412b10d081c86fb748ec0d4 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 17 Jan 2008 11:02:15 +0100 Subject: Add reg_api functions reg_getkeysecurity() and reg_setkeysecurity(). These are wrappers around the lower level functions regkey_get_secdesc() and regkey_set_secdesc(). Next step towards hiding reg_frontend from the surface. Michael (This used to be commit 7251a24b489a008243091279d96157cacec35b62) --- source3/registry/reg_api.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index ee138b284d..4ba5073cb0 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -637,6 +637,17 @@ WERROR reg_deletevalue(struct registry_key *key, const char *name) return WERR_OK; } +WERROR reg_getkeysecurity(TALLOC_CTX *mem_ctx, struct registry_key *key, + struct security_descriptor **psecdesc) +{ + return regkey_get_secdesc(mem_ctx, key->key, psecdesc); +} + +WERROR reg_setkeysecurity(struct registry_key *key, + struct security_descriptor *psecdesc) +{ + return regkey_set_secdesc(key->key, psecdesc); +} /********************************************************************** * Higher level utility functions -- cgit From 138f7ec45165cd842112627c52891e973a3ff21e Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 17 Jan 2008 11:07:28 +0100 Subject: Add a comment header comparing winreg.idl and reg_api.c. Michael (This used to be commit 15163926a8ae1116a0f0986f35fc16bcf9ce6ce2) --- source3/registry/reg_api.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 4ba5073cb0..085f52b33d 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -19,6 +19,48 @@ /* Attempt to wrap the existing API in a more winreg.idl-like way */ +/* + * Here is a list of winreg.idl functions and corresponding implementations + * provided here: + * + * 0x00 winreg_OpenHKCR + * 0x01 winreg_OpenHKCU + * 0x02 winreg_OpenHKLM + * 0x03 winreg_OpenHKPD + * 0x04 winreg_OpenHKU + * 0x05 winreg_CloseKey + * 0x06 winreg_CreateKey reg_createkey + * 0x07 winreg_DeleteKey reg_deletekey + * 0x08 winreg_DeleteValue reg_deletevalue + * 0x09 winreg_EnumKey reg_enumkey + * 0x0a winreg_EnumValue reg_enumvalue + * 0x0b winreg_FlushKey + * 0x0c winreg_GetKeySecurity reg_getkeysecurity + * 0x0d winreg_LoadKey + * 0x0e winreg_NotifyChangeKeyValue + * 0x0f winreg_OpenKey reg_openkey + * 0x10 winreg_QueryInfoKey reg_queryinfokey + * 0x11 winreg_QueryValue reg_queryvalue + * 0x12 winreg_ReplaceKey + * 0x13 winreg_RestoreKey + * 0x14 winreg_SaveKey + * 0x15 winreg_SetKeySecurity reg_setkeysecurity + * 0x16 winreg_SetValue reg_setvalue + * 0x17 winreg_UnLoadKey + * 0x18 winreg_InitiateSystemShutdown + * 0x19 winreg_AbortSystemShutdown + * 0x1a winreg_GetVersion + * 0x1b winreg_OpenHKCC + * 0x1c winreg_OpenHKDD + * 0x1d winreg_QueryMultipleValues + * 0x1e winreg_InitiateSystemShutdownEx + * 0x1f winreg_SaveKeyEx + * 0x20 winreg_OpenHKPT + * 0x21 winreg_OpenHKPN + * 0x22 winreg_QueryMultipleValues2 + * + */ + #include "includes.h" #undef DBGC_CLASS -- cgit From 7f8e4bc68ea727ab999c3f60927adbc8acc5a651 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 17 Jan 2008 11:09:08 +0100 Subject: Add my (C) to reg_api.c - Michael (This used to be commit 81d6a1fbed5e685376637af8e8bcd70ab2701aa0) --- source3/registry/reg_api.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 085f52b33d..a4c88e2e88 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -2,6 +2,7 @@ * Unix SMB/CIFS implementation. * Virtual Windows Registry Layer * Copyright (C) Volker Lendecke 2006 + * Copyright (C) Michael Adam 2007-2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -- cgit From 32a8e740785147256c008730a69ae6d60a294884 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 17 Jan 2008 11:22:01 +0100 Subject: Add a reg_getversion() function to reg_api and use it in srv_winreg_nt.c. Michael (This used to be commit 903223b160eef6ba6ff19a8bfef19e5fe7008631) --- source3/registry/reg_api.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index a4c88e2e88..18435ff033 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -50,7 +50,7 @@ * 0x17 winreg_UnLoadKey * 0x18 winreg_InitiateSystemShutdown * 0x19 winreg_AbortSystemShutdown - * 0x1a winreg_GetVersion + * 0x1a winreg_GetVersion reg_getversion * 0x1b winreg_OpenHKCC * 0x1c winreg_OpenHKDD * 0x1d winreg_QueryMultipleValues @@ -692,6 +692,16 @@ WERROR reg_setkeysecurity(struct registry_key *key, return regkey_set_secdesc(key->key, psecdesc); } +WERROR reg_getversion(uint32_t *version) +{ + if (version == NULL) { + return WERR_INVALID_PARAM; + } + + *version = 0x00000005; /* Windows 2000 registry API version */ + return WERR_OK; +} + /********************************************************************** * Higher level utility functions **********************************************************************/ -- cgit From 1ea809383ef310f442bae7b5d4591f9aa655ad60 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 18 Jan 2008 08:15:27 +0100 Subject: Fix typo in debug message. Michael (This used to be commit d7a8d7ffbd724a59aa3fc4bdeca6be5d5a0e7258) --- source3/registry/reg_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 18435ff033..788af28d5d 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -183,7 +183,7 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx, /* Look up the table of registry I/O operations */ if ( !(key->hook = reghook_cache_find( key->name )) ) { - DEBUG(0,("reg_open_onelevel: Failed to assigned a " + DEBUG(0,("reg_open_onelevel: Failed to assign a " "REGISTRY_HOOK to [%s]\n", key->name )); result = WERR_BADFILE; goto done; -- cgit From 33f3eeaa00974860dfc45962d5fd34cf05396c76 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Jan 2008 17:35:25 +0100 Subject: Fix some "set but never used" warnings (This used to be commit 4a6dadc5178f4861e9c032321939db3b639734b5) --- source3/registry/reg_api.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'source3/registry/reg_api.c') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 788af28d5d..9c4009368d 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -453,7 +453,6 @@ WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent, TALLOC_CTX *mem_ctx; char *path, *end; WERROR err; - REGSUBKEY_CTR *subkeys; if (!(mem_ctx = talloc_new(ctx))) return WERR_NOMEM; @@ -517,11 +516,6 @@ WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent, * Actually create the subkey */ - if (!(subkeys = TALLOC_ZERO_P(mem_ctx, REGSUBKEY_CTR))) { - err = WERR_NOMEM; - goto done; - } - err = fill_subkey_cache(create_parent); if (!W_ERROR_IS_OK(err)) goto done; -- cgit