Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-gmake3
[tridge/samba.git] / source4 / lib / registry / local.c
index 14b42797babe0efd409a6f719aa732eb36bdcbd5..47d6d4cd32692224316e7d6f7fd7b489878d9480 100644 (file)
@@ -5,7 +5,7 @@
 
    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
-   the Free Software Foundation; either version 2 of the License, or
+   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,
@@ -22,7 +22,6 @@
 #include "lib/util/dlinklist.h"
 #include "lib/registry/registry.h"
 #include "system/filesys.h"
-#include "build.h"
 
 struct reg_key_path {
        uint32_t predefined_key;
@@ -30,16 +29,13 @@ struct reg_key_path {
 };
 
 struct registry_local {
-       struct registry_context registry;
+       const struct registry_operations *ops;
 
        struct mountpoint {
                struct reg_key_path path;
                struct hive_key *key;
                struct mountpoint *prev, *next;
        } *mountpoints;
-
-       struct auth_session_info *session_info;
-       struct cli_credentials *credentials;
 };
 
 struct local_key {
@@ -140,7 +136,7 @@ WERROR local_get_predefined_key(struct registry_context *ctx,
        }
 
        if (mp == NULL)
-               return WERR_NOT_FOUND;
+               return WERR_BADFILE;
 
        *key = reg_import_hive_key(ctx, mp->key,
                                   mp->path.predefined_key,
@@ -266,13 +262,17 @@ static WERROR local_get_key_info(TALLOC_CTX *mem_ctx,
                                 const char **classname,
                                 uint32_t *num_subkeys,
                                 uint32_t *num_values,
-                                NTTIME *last_change_time)
+                                NTTIME *last_change_time,
+                                uint32_t *max_subkeynamelen,
+                                uint32_t *max_valnamelen,
+                                uint32_t *max_valbufsize)
 {
        const struct local_key *local = (const struct local_key *)key;
 
        return hive_key_get_info(mem_ctx, local->hive_key,
                                 classname, num_subkeys, num_values,
-                                last_change_time);
+                                last_change_time, max_subkeynamelen, 
+                                max_valnamelen, max_valbufsize);
 }
 
 const static struct registry_operations local_ops = {
@@ -290,18 +290,14 @@ const static struct registry_operations local_ops = {
        .get_key_info = local_get_key_info,
 };
 
-WERROR reg_open_local(TALLOC_CTX *mem_ctx, struct registry_context **ctx,
-                     struct auth_session_info *session_info,
-                     struct cli_credentials *credentials)
+WERROR reg_open_local(TALLOC_CTX *mem_ctx, struct registry_context **ctx)
 {
        struct registry_local *ret = talloc_zero(mem_ctx,
                                                 struct registry_local);
 
        W_ERROR_HAVE_NO_MEMORY(ret);
 
-       ret->registry.ops = &local_ops;
-       ret->session_info = session_info;
-       ret->credentials = credentials;
+       ret->ops = &local_ops;
 
        *ctx = (struct registry_context *)ret;