s3:registry: use fill_subkey_cache to check exsistence in regkey_open_onelevel().
authorMichael Adam <obnox@samba.org>
Mon, 23 Apr 2012 14:07:21 +0000 (16:07 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 10 May 2012 09:15:45 +0000 (11:15 +0200)
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
(cherry picked from commit af9d70fbce541c382a5fc54b1cc1af9b0b60a692)

source3/registry/reg_api.c

index 62cc45fcc6f8abb71abb8c9f1a584342d428c5c9..42fc4cb17d659e305f6462fccf3f63b3845ee442 100644 (file)
@@ -137,7 +137,6 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx,
        WERROR          result = WERR_OK;
        struct registry_key *regkey;
        struct registry_key_handle *key;
-       struct regsubkey_ctr    *subkeys = NULL;
 
        DEBUG(7,("regkey_open_onelevel: name = [%s]\n", name));
 
@@ -203,21 +202,13 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx,
                goto done;
        }
 
-       /* check if the path really exists; failed is indicated by -1 */
-       /* if the subkey count failed, bail out */
+       /* FIXME: Existence is currently checked by fetching the subkeys */
 
-       result = regsubkey_ctr_init(key, &subkeys);
+       result = fill_subkey_cache(regkey);
        if (!W_ERROR_IS_OK(result)) {
                goto done;
        }
 
-       if ( fetch_reg_keys( key, subkeys ) == -1 )  {
-               result = WERR_BADFILE;
-               goto done;
-       }
-
-       TALLOC_FREE( subkeys );
-
        if ( !regkey_access_check( key, access_desired, &key->access_granted,
                                   token ) ) {
                result = WERR_ACCESS_DENIED;