summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/config.mk10
-rw-r--r--source4/lib/registry/dir.c2
-rw-r--r--source4/lib/registry/hive.c4
-rw-r--r--source4/lib/registry/hive.h209
-rw-r--r--source4/lib/registry/local.c2
-rw-r--r--source4/lib/registry/patchfile.c1
-rw-r--r--source4/lib/registry/patchfile.h55
-rw-r--r--source4/lib/registry/patchfile_dotreg.c3
-rw-r--r--source4/lib/registry/patchfile_preg.c3
-rw-r--r--source4/lib/registry/regf.c2
-rw-r--r--source4/lib/registry/registry.h218
-rw-r--r--source4/lib/registry/registry.i1
-rw-r--r--source4/lib/registry/registry.pc.in4
-rw-r--r--source4/lib/registry/registry_wrap.c1
-rw-r--r--source4/lib/registry/tests/generic.c2
-rw-r--r--source4/lib/registry/tests/hive.c2
-rw-r--r--source4/lib/registry/tests/registry.c2
-rw-r--r--source4/lib/registry/tools/regpatch.c1
18 files changed, 232 insertions, 290 deletions
diff --git a/source4/lib/registry/config.mk b/source4/lib/registry/config.mk
index 16e9c62c57..ce19d8512e 100644
--- a/source4/lib/registry/config.mk
+++ b/source4/lib/registry/config.mk
@@ -33,7 +33,7 @@ registry_OBJ_FILES = $(addprefix lib/registry/, interface.o util.o samba.o \
patchfile_dotreg.o patchfile_preg.o patchfile.o regf.o \
hive.o local.o ldb.o dir.o rpc.o)
-PUBLIC_HEADERS += $(addprefix lib/registry/, registry.h hive.h patchfile.h)
+PUBLIC_HEADERS += lib/registry/registry.h
[SUBSYSTEM::registry_common]
PUBLIC_DEPENDENCIES = registry
@@ -46,7 +46,7 @@ registry_common_OBJ_FILES = lib/registry/tools/common.o
[BINARY::regdiff]
INSTALLDIR = BINDIR
PRIVATE_DEPENDENCIES = \
- LIBSAMBA-CONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS
+ LIBSAMBA-HOSTCONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS
# End BINARY regdiff
################################################
@@ -59,7 +59,7 @@ MANPAGES += lib/registry/man/regdiff.1
[BINARY::regpatch]
INSTALLDIR = BINDIR
PRIVATE_DEPENDENCIES = \
- LIBSAMBA-CONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS \
+ LIBSAMBA-HOSTCONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS \
registry_common
# End BINARY regpatch
################################################
@@ -73,7 +73,7 @@ MANPAGES += lib/registry/man/regpatch.1
[BINARY::regshell]
INSTALLDIR = BINDIR
PRIVATE_DEPENDENCIES = \
- LIBSAMBA-CONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS \
+ LIBSAMBA-HOSTCONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS \
SMBREADLINE registry_common
# End BINARY regshell
################################################
@@ -87,7 +87,7 @@ MANPAGES += lib/registry/man/regshell.1
[BINARY::regtree]
INSTALLDIR = BINDIR
PRIVATE_DEPENDENCIES = \
- LIBSAMBA-CONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS \
+ LIBSAMBA-HOSTCONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS \
registry_common
# End BINARY regtree
################################################
diff --git a/source4/lib/registry/dir.c b/source4/lib/registry/dir.c
index dc3717e886..449ee0f6ee 100644
--- a/source4/lib/registry/dir.c
+++ b/source4/lib/registry/dir.c
@@ -18,7 +18,7 @@
*/
#include "includes.h"
-#include "hive.h"
+#include "registry.h"
#include "system/dir.h"
#include "system/filesys.h"
diff --git a/source4/lib/registry/hive.c b/source4/lib/registry/hive.c
index ad6a6421ab..2a9b1a59ce 100644
--- a/source4/lib/registry/hive.c
+++ b/source4/lib/registry/hive.c
@@ -6,7 +6,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,
@@ -20,7 +20,7 @@
*/
#include "includes.h"
-#include "hive.h"
+#include "registry.h"
#include "system/filesys.h"
#include "param/param.h"
diff --git a/source4/lib/registry/hive.h b/source4/lib/registry/hive.h
deleted file mode 100644
index 87f335663d..0000000000
--- a/source4/lib/registry/hive.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- Registry hive interface
- Copyright (C) Jelmer Vernooij 2003-2007.
-
- 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
- (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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __REGISTRY_HIVE_H__
-#define __REGISTRY_HIVE_H__
-
-#include <talloc.h>
-#include "libcli/util/werror.h"
-#include "librpc/gen_ndr/security.h"
-#include "libcli/util/ntstatus.h"
-
-/**
- * This file contains the hive API. This API is generally used for
- * reading a specific file that contains just one hive.
- *
- * Good examples are .DAT (NTUSER.DAT) files.
- *
- * This API does not have any notification support (that
- * should be provided by the registry implementation), nor
- * does it understand what predefined keys are.
- */
-
-struct hive_key {
- const struct hive_operations *ops;
-};
-
-struct hive_operations {
- const char *name;
-
- /**
- * Open a specific subkey
- */
- WERROR (*enum_key) (TALLOC_CTX *mem_ctx,
- const struct hive_key *key, uint32_t idx,
- const char **name,
- const char **classname,
- NTTIME *last_mod_time);
-
- /**
- * Open a subkey by name
- */
- WERROR (*get_key_by_name) (TALLOC_CTX *mem_ctx,
- const struct hive_key *key, const char *name,
- struct hive_key **subkey);
-
- /**
- * Add a new key.
- */
- WERROR (*add_key) (TALLOC_CTX *ctx,
- const struct hive_key *parent_key, const char *name,
- const char *classname,
- struct security_descriptor *desc,
- struct hive_key **key);
- /**
- * Remove an existing key.
- */
- WERROR (*del_key) (const struct hive_key *key, const char *name);
-
- /**
- * Force write of a key to disk.
- */
- WERROR (*flush_key) (struct hive_key *key);
-
- /**
- * Retrieve a registry value with a specific index.
- */
- WERROR (*enum_value) (TALLOC_CTX *mem_ctx,
- struct hive_key *key, int idx,
- const char **name, uint32_t *type,
- DATA_BLOB *data);
-
- /**
- * Retrieve a registry value with the specified name
- */
- WERROR (*get_value_by_name) (TALLOC_CTX *mem_ctx,
- struct hive_key *key, const char *name,
- uint32_t *type, DATA_BLOB *data);
-
- /**
- * Set a value on the specified registry key.
- */
- WERROR (*set_value) (struct hive_key *key, const char *name,
- uint32_t type, const DATA_BLOB data);
-
- /**
- * Remove a value.
- */
- WERROR (*delete_value) (struct hive_key *key, const char *name);
-
- /* Security Descriptors */
-
- /**
- * Change the security descriptor on a registry key.
- *
- * This should return WERR_NOT_SUPPORTED if the underlying
- * format does not have a mechanism for storing
- * security descriptors.
- */
- WERROR (*set_sec_desc) (struct hive_key *key,
- const struct security_descriptor *desc);
-
- /**
- * Retrieve the security descriptor on a registry key.
- *
- * This should return WERR_NOT_SUPPORTED if the underlying
- * format does not have a mechanism for storing
- * security descriptors.
- */
- WERROR (*get_sec_desc) (TALLOC_CTX *ctx,
- const struct hive_key *key,
- struct security_descriptor **desc);
-
- /**
- * Retrieve general information about a key.
- */
- WERROR (*get_key_info) (TALLOC_CTX *mem_ctx,
- const struct hive_key *key,
- const char **classname,
- uint32_t *num_subkeys,
- uint32_t *num_values,
- NTTIME *last_change_time,
- uint32_t *max_subkeynamelen,
- uint32_t *max_valnamelen,
- uint32_t *max_valbufsize);
-};
-
-struct cli_credentials;
-struct auth_session_info;
-
-WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
- struct auth_session_info *session_info,
- struct cli_credentials *credentials,
- struct loadparm_context *lp_ctx,
- struct hive_key **root);
-WERROR hive_key_get_info(TALLOC_CTX *mem_ctx, const struct hive_key *key,
- const char **classname, uint32_t *num_subkeys,
- uint32_t *num_values, NTTIME *last_change_time,
- uint32_t *max_subkeynamelen,
- uint32_t *max_valnamelen, uint32_t *max_valbufsize);
-WERROR hive_key_add_name(TALLOC_CTX *ctx, const struct hive_key *parent_key,
- const char *name, const char *classname,
- struct security_descriptor *desc,
- struct hive_key **key);
-WERROR hive_key_del(const struct hive_key *key, const char *name);
-WERROR hive_get_key_by_name(TALLOC_CTX *mem_ctx,
- const struct hive_key *key, const char *name,
- struct hive_key **subkey);
-WERROR hive_enum_key(TALLOC_CTX *mem_ctx,
- const struct hive_key *key, uint32_t idx,
- const char **name,
- const char **classname,
- NTTIME *last_mod_time);
-
-WERROR hive_key_set_value(struct hive_key *key, const char *name,
- uint32_t type, const DATA_BLOB data);
-
-WERROR hive_get_value(TALLOC_CTX *mem_ctx,
- struct hive_key *key, const char *name,
- uint32_t *type, DATA_BLOB *data);
-WERROR hive_get_value_by_index(TALLOC_CTX *mem_ctx,
- struct hive_key *key, uint32_t idx,
- const char **name,
- uint32_t *type, DATA_BLOB *data);
-
-WERROR hive_key_del_value(struct hive_key *key, const char *name);
-
-WERROR hive_key_flush(struct hive_key *key);
-
-
-/* Individual backends */
-WERROR reg_open_directory(TALLOC_CTX *parent_ctx,
- const char *location, struct hive_key **key);
-WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx,
- const char *location, struct smb_iconv_convenience *iconv_convenience,
- struct hive_key **key);
-WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
- struct auth_session_info *session_info,
- struct cli_credentials *credentials,
- struct loadparm_context *lp_ctx,
- struct hive_key **k);
-
-
-WERROR reg_create_directory(TALLOC_CTX *parent_ctx,
- const char *location, struct hive_key **key);
-WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx,
- struct smb_iconv_convenience *iconv_convenience,
- const char *location,
- int major_version,
- struct hive_key **key);
-
-
-#endif /* __REGISTRY_HIVE_H__ */
diff --git a/source4/lib/registry/local.c b/source4/lib/registry/local.c
index b2cdec9cdf..af235e7b04 100644
--- a/source4/lib/registry/local.c
+++ b/source4/lib/registry/local.c
@@ -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,
diff --git a/source4/lib/registry/patchfile.c b/source4/lib/registry/patchfile.c
index 687fd4b91b..15e3a158f2 100644
--- a/source4/lib/registry/patchfile.c
+++ b/source4/lib/registry/patchfile.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "lib/registry/patchfile.h"
#include "lib/registry/registry.h"
#include "system/filesys.h"
#include "param/param.h"
diff --git a/source4/lib/registry/patchfile.h b/source4/lib/registry/patchfile.h
deleted file mode 100644
index 9289390685..0000000000
--- a/source4/lib/registry/patchfile.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- Patchfile interface
- Copyright (C) Jelmer Vernooij 2006
- Copyright (C) Wilco Baan Hofman 2006
-
- 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
- (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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef _PATCHFILE_H
-#define _PATCHFILE_H
-
-#include "lib/registry/registry.h"
-
-struct reg_diff_callbacks {
- WERROR (*add_key) (void *callback_data, const char *key_name);
- WERROR (*set_value) (void *callback_data, const char *key_name,
- const char *value_name, uint32_t value_type,
- DATA_BLOB value);
- WERROR (*del_value) (void *callback_data, const char *key_name,
- const char *value_name);
- WERROR (*del_key) (void *callback_data, const char *key_name);
- WERROR (*del_all_values) (void *callback_data, const char *key_name);
- WERROR (*done) (void *callback_data);
-};
-
-WERROR reg_diff_apply(struct registry_context *ctx, const char *filename);
-
-WERROR reg_generate_diff(struct registry_context *ctx1,
- struct registry_context *ctx2,
- const struct reg_diff_callbacks *callbacks,
- void *callback_data);
-WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
- struct smb_iconv_convenience *iconv_convenience,
- struct reg_diff_callbacks **callbacks,
- void **callback_data);
-WERROR reg_generate_diff_key(struct registry_key *oldkey,
- struct registry_key *newkey,
- const char *path,
- const struct reg_diff_callbacks *callbacks,
- void *callback_data);
-
-#endif /* _PATCHFILE_H */
diff --git a/source4/lib/registry/patchfile_dotreg.c b/source4/lib/registry/patchfile_dotreg.c
index 6de642ecb8..59f4044713 100644
--- a/source4/lib/registry/patchfile_dotreg.c
+++ b/source4/lib/registry/patchfile_dotreg.c
@@ -7,7 +7,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,
@@ -23,7 +23,6 @@
/* FIXME Newer .REG files, created by Windows XP and above use unicode UTF-16 */
#include "includes.h"
-#include "lib/registry/patchfile.h"
#include "lib/registry/registry.h"
#include "system/filesys.h"
#include "param/param.h"
diff --git a/source4/lib/registry/patchfile_preg.c b/source4/lib/registry/patchfile_preg.c
index 0d39e67450..0fa367bfcb 100644
--- a/source4/lib/registry/patchfile_preg.c
+++ b/source4/lib/registry/patchfile_preg.c
@@ -6,7 +6,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,
@@ -21,7 +21,6 @@
#include "includes.h"
#include "lib/registry/registry.h"
-#include "lib/registry/patchfile.h"
#include "system/filesys.h"
#include "param/param.h"
diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c
index a192f3be4d..46ccca922b 100644
--- a/source4/lib/registry/regf.c
+++ b/source4/lib/registry/regf.c
@@ -18,13 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "includes.h"
-#include "lib/registry/hive.h"
#include "system/filesys.h"
#include "system/time.h"
#include "lib/registry/tdr_regf.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/winreg.h"
#include "param/param.h"
+#include "lib/registry/registry.h"
static struct hive_operations reg_backend_regf;
diff --git a/source4/lib/registry/registry.h b/source4/lib/registry/registry.h
index 5e0b971a1d..a86294bf46 100644
--- a/source4/lib/registry/registry.h
+++ b/source4/lib/registry/registry.h
@@ -22,11 +22,196 @@
#define _REGISTRY_H
struct registry_context;
+struct loadparm_context;
+struct smb_iconv_convenience;
#include <talloc.h>
+#include "libcli/util/werror.h"
#include "librpc/gen_ndr/security.h"
-#include "lib/registry/hive.h"
#include "libcli/util/ntstatus.h"
+#include "util/time.h"
+#include "util/data_blob.h"
+
+/**
+ * The hive API. This API is generally used for
+ * reading a specific file that contains just one hive.
+ *
+ * Good examples are .DAT (NTUSER.DAT) files.
+ *
+ * This API does not have any notification support (that
+ * should be provided by the registry implementation), nor
+ * does it understand what predefined keys are.
+ */
+
+struct hive_key {
+ const struct hive_operations *ops;
+};
+
+struct hive_operations {
+ const char *name;
+
+ /**
+ * Open a specific subkey
+ */
+ WERROR (*enum_key) (TALLOC_CTX *mem_ctx,
+ const struct hive_key *key, uint32_t idx,
+ const char **name,
+ const char **classname,
+ NTTIME *last_mod_time);
+
+ /**
+ * Open a subkey by name
+ */
+ WERROR (*get_key_by_name) (TALLOC_CTX *mem_ctx,
+ const struct hive_key *key, const char *name,
+ struct hive_key **subkey);
+
+ /**
+ * Add a new key.
+ */
+ WERROR (*add_key) (TALLOC_CTX *ctx,
+ const struct hive_key *parent_key, const char *name,
+ const char *classname,
+ struct security_descriptor *desc,
+ struct hive_key **key);
+ /**
+ * Remove an existing key.
+ */
+ WERROR (*del_key) (const struct hive_key *key, const char *name);
+
+ /**
+ * Force write of a key to disk.
+ */
+ WERROR (*flush_key) (struct hive_key *key);
+
+ /**
+ * Retrieve a registry value with a specific index.
+ */
+ WERROR (*enum_value) (TALLOC_CTX *mem_ctx,
+ struct hive_key *key, int idx,
+ const char **name, uint32_t *type,
+ DATA_BLOB *data);
+
+ /**
+ * Retrieve a registry value with the specified name
+ */
+ WERROR (*get_value_by_name) (TALLOC_CTX *mem_ctx,
+ struct hive_key *key, const char *name,
+ uint32_t *type, DATA_BLOB *data);
+
+ /**
+ * Set a value on the specified registry key.
+ */
+ WERROR (*set_value) (struct hive_key *key, const char *name,
+ uint32_t type, const DATA_BLOB data);
+
+ /**
+ * Remove a value.
+ */
+ WERROR (*delete_value) (struct hive_key *key, const char *name);
+
+ /* Security Descriptors */
+
+ /**
+ * Change the security descriptor on a registry key.
+ *
+ * This should return WERR_NOT_SUPPORTED if the underlying
+ * format does not have a mechanism for storing
+ * security descriptors.
+ */
+ WERROR (*set_sec_desc) (struct hive_key *key,
+ const struct security_descriptor *desc);
+
+ /**
+ * Retrieve the security descriptor on a registry key.
+ *
+ * This should return WERR_NOT_SUPPORTED if the underlying
+ * format does not have a mechanism for storing
+ * security descriptors.
+ */
+ WERROR (*get_sec_desc) (TALLOC_CTX *ctx,
+ const struct hive_key *key,
+ struct security_descriptor **desc);
+
+ /**
+ * Retrieve general information about a key.
+ */
+ WERROR (*get_key_info) (TALLOC_CTX *mem_ctx,
+ const struct hive_key *key,
+ const char **classname,
+ uint32_t *num_subkeys,
+ uint32_t *num_values,
+ NTTIME *last_change_time,
+ uint32_t *max_subkeynamelen,
+ uint32_t *max_valnamelen,
+ uint32_t *max_valbufsize);
+};
+
+struct cli_credentials;
+struct auth_session_info;
+
+WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
+ struct auth_session_info *session_info,
+ struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
+ struct hive_key **root);
+WERROR hive_key_get_info(TALLOC_CTX *mem_ctx, const struct hive_key *key,
+ const char **classname, uint32_t *num_subkeys,
+ uint32_t *num_values, NTTIME *last_change_time,
+ uint32_t *max_subkeynamelen,
+ uint32_t *max_valnamelen, uint32_t *max_valbufsize);
+WERROR hive_key_add_name(TALLOC_CTX *ctx, const struct hive_key *parent_key,
+ const char *name, const char *classname,
+ struct security_descriptor *desc,
+ struct hive_key **key);
+WERROR hive_key_del(const struct hive_key *key, const char *name);
+WERROR hive_get_key_by_name(TALLOC_CTX *mem_ctx,
+ const struct hive_key *key, const char *name,
+ struct hive_key **subkey);
+WERROR hive_enum_key(TALLOC_CTX *mem_ctx,
+ const struct hive_key *key, uint32_t idx,
+ const char **name,
+ const char **classname,
+ NTTIME *last_mod_time);
+
+WERROR hive_key_set_value(struct hive_key *key, const char *name,
+ uint32_t type, const DATA_BLOB data);
+
+WERROR hive_get_value(TALLOC_CTX *mem_ctx,
+ struct hive_key *key, const char *name,
+ uint32_t *type, DATA_BLOB *data);
+WERROR hive_get_value_by_index(TALLOC_CTX *mem_ctx,
+ struct hive_key *key, uint32_t idx,
+ const char **name,
+ uint32_t *type, DATA_BLOB *data);
+
+WERROR hive_key_del_value(struct hive_key *key, const char *name);
+
+WERROR hive_key_flush(struct hive_key *key);
+
+
+/* Individual backends */
+WERROR reg_open_directory(TALLOC_CTX *parent_ctx,
+ const char *location, struct hive_key **key);
+WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx,
+ const char *location, struct smb_iconv_convenience *iconv_convenience,
+ struct hive_key **key);
+WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
+ struct auth_session_info *session_info,
+ struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
+ struct hive_key **k);
+
+
+WERROR reg_create_directory(TALLOC_CTX *parent_ctx,
+ const char *location, struct hive_key **key);
+WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx,
+ struct smb_iconv_convenience *iconv_convenience,
+ const char *location,
+ int major_version,
+ struct hive_key **key);
+
+
/* Handles for the predefined keys */
#define HKEY_CLASSES_ROOT 0x80000000
@@ -66,8 +251,6 @@ struct registry_key
struct registry_context *context;
};
-#include "lib/registry/patchfile.h"
-
struct registry_value
{
const char *name;
@@ -285,5 +468,34 @@ WERROR reg_get_security(TALLOC_CTX *mem_ctx,
WERROR reg_set_security(struct registry_key *key,
struct security_descriptor *security);
+struct reg_diff_callbacks {
+ WERROR (*add_key) (void *callback_data, const char *key_name);
+ WERROR (*set_value) (void *callback_data, const char *key_name,
+ const char *value_name, uint32_t value_type,
+ DATA_BLOB value);
+ WERROR (*del_value) (void *callback_data, const char *key_name,
+ const char *value_name);
+ WERROR (*del_key) (void *callback_data, const char *key_name);
+ WERROR (*del_all_values) (void *callback_data, const char *key_name);
+ WERROR (*done) (void *callback_data);
+};
+
+WERROR reg_diff_apply(struct registry_context *ctx, const char *filename);
+
+WERROR reg_generate_diff(struct registry_context *ctx1,
+ struct registry_context *ctx2,
+ const struct reg_diff_callbacks *callbacks,
+ void *callback_data);
+WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
+ struct smb_iconv_convenience *iconv_convenience,
+ struct reg_diff_callbacks **callbacks,
+ void **callback_data);
+WERROR reg_generate_diff_key(struct registry_key *oldkey,
+ struct registry_key *newkey,
+ const char *path,
+ const struct reg_diff_callbacks *callbacks,
+ void *callback_data);
+
+
#endif /* _REGISTRY_H */
diff --git a/source4/lib/registry/registry.i b/source4/lib/registry/registry.i
index 20ae671c75..8ab402d57d 100644
--- a/source4/lib/registry/registry.i
+++ b/source4/lib/registry/registry.i
@@ -26,7 +26,6 @@
#include "includes.h"
#include "registry.h"
#include "param/param.h"
-#include "hive.h"
typedef struct registry_context reg;
typedef struct hive_key hive_key;
diff --git a/source4/lib/registry/registry.pc.in b/source4/lib/registry/registry.pc.in
index 98943a0736..d981a45b2c 100644
--- a/source4/lib/registry/registry.pc.in
+++ b/source4/lib/registry/registry.pc.in
@@ -5,8 +5,8 @@ includedir=@includedir@
Name: registry
Description: Windows-style registry library
-Requires: ldb
-Requires.private:
+Requires: talloc
+Requires.private: ldb
Version: 0.0.1
Libs: -L${libdir} -lregistry
Cflags: -I${includedir} -DHAVE_IMMEDIATE_STRUCTURES=1
diff --git a/source4/lib/registry/registry_wrap.c b/source4/lib/registry/registry_wrap.c
index 51c255e9f7..da09ecbe08 100644
--- a/source4/lib/registry/registry_wrap.c
+++ b/source4/lib/registry/registry_wrap.c
@@ -2529,7 +2529,6 @@ static swig_module_info swig_module = {swig_types, 25, 0, 0, 0, 0};
#include "includes.h"
#include "registry.h"
#include "param/param.h"
-#include "hive.h"
typedef struct registry_context reg;
typedef struct hive_key hive_key;
diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c
index 145e599504..6eae26bc46 100644
--- a/source4/lib/registry/tests/generic.c
+++ b/source4/lib/registry/tests/generic.c
@@ -112,7 +112,7 @@ static bool test_reg_val_description_nullname(struct torture_context *ctx)
return true;
}
-_PUBLIC_ struct torture_suite *torture_registry(TALLOC_CTX *mem_ctx)
+struct torture_suite *torture_registry(TALLOC_CTX *mem_ctx)
{
struct torture_suite *suite = torture_suite_create(mem_ctx, "REGISTRY");
torture_suite_add_simple_test(suite, "str_regtype",
diff --git a/source4/lib/registry/tests/hive.c b/source4/lib/registry/tests/hive.c
index 1e56f125c5..70b0241b04 100644
--- a/source4/lib/registry/tests/hive.c
+++ b/source4/lib/registry/tests/hive.c
@@ -7,7 +7,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,
diff --git a/source4/lib/registry/tests/registry.c b/source4/lib/registry/tests/registry.c
index 7d14b3a412..e5e34c11e0 100644
--- a/source4/lib/registry/tests/registry.c
+++ b/source4/lib/registry/tests/registry.c
@@ -7,7 +7,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,
diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c
index 71837d1807..98443e6456 100644
--- a/source4/lib/registry/tools/regpatch.c
+++ b/source4/lib/registry/tools/regpatch.c
@@ -23,7 +23,6 @@
#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
#include "lib/registry/tools/common.h"
-#include "lib/registry/patchfile.h"
#include "param/param.h"
int main(int argc, char **argv)