Rev 11177: Add hive operations. in file:///home/jelmer/bzr.samba/4.0-regwrite/

Jelmer Vernooij jelmer at samba.org
Mon Apr 23 14:05:59 GMT 2007


At file:///home/jelmer/bzr.samba/4.0-regwrite/

------------------------------------------------------------
revno: 11177
revision-id: jelmer at samba.org-20070423140539-m81ruspga5mhbmdm
parent: jelmer at samba.org-20070418170502-zvjkpzrur94nevvb
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 4.0-regwrite
timestamp: Mon 2007-04-23 16:05:39 +0200
message:
  Add hive operations.
added:
  source/lib/registry/hive.h     hive.h-20070423140448-w1nvzs8d2qxvyswz-1
modified:
  source/lib/registry/config.mk  svn-v2:851 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2fconfig.mk
  source/lib/registry/registry.h svn-v2:10026 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2fregistry.h
=== added file 'source/lib/registry/hive.h'
--- a/source/lib/registry/hive.h	1970-01-01 00:00:00 +0000
+++ b/source/lib/registry/hive.h	2007-04-23 14:05:39 +0000
@@ -0,0 +1,59 @@
+/* 
+   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__
+
+struct hive_context {
+	const struct hive_operations *ops;
+};
+
+struct hive_key {
+	struct hive_context *context;
+
+};
+
+struct hive_operations {
+	const char *name;	
+
+	WERROR (*open_root) (struct hive_context *hive, struct hive_key **key);
+	
+	WERROR (*enum_key) (struct hive_key *key, int idx, struct hive_key **key);
+	WERROR (*get_key_by_name) (struct hive_key *key, const char *name, struct hive_key **key);
+	
+	WERROR (*add_key) (struct hive_key *key, const char *name, uint32_t access_mask, 
+					   struct security_descriptor *desc, struct hive_key **key);
+	WERROR (*del_key) (struct hive_key *key, const char *name);
+	WERROR (*flush_key) (struct hive_key *key);
+
+	/* Value */
+	WERROR (*enum_value) (struct hive_key *key, int idx, uint32_t *type, DATA_BLOB *data);
+	WERROR (*get_value_by_name) (struct hive_key *key, const char *name, uint32_t *type, 
+								 DATA_BLOB *data);
+	WERROR (*set_value) (struct hive_key *key, const char *name, uint32_t type, DATA_BLOB data);
+
+	/* Security Descriptors */
+	WERROR (*set_sec_desc) (struct hive_key *key, struct security_descriptor *desc);
+	WERROR (*set_get_desc) (struct hive_key *key, struct security_descriptor **desc);
+};
+
+struct hive_context *hive_load(TALLOC_CTX *ctx, const char *filename);
+
+#endif /* __REGISTRY_HIVE_H__ */

=== modified file 'source/lib/registry/config.mk'
--- a/source/lib/registry/config.mk	2007-04-18 17:05:02 +0000
+++ b/source/lib/registry/config.mk	2007-04-23 14:05:39 +0000
@@ -33,13 +33,8 @@
 		dir.o \
 		rpc.o
 PUBLIC_DEPENDENCIES = \
-<<<<<<< TREE
 		LIBSAMBA-UTIL CHARSET TDR_REGF ldb \
 		RPC_NDR_WINREG
-PRIVATE_PROTO_HEADER = registry_proto.h
-=======
-		LIBSAMBA-UTIL CHARSET
->>>>>>> MERGE-SOURCE
 PUBLIC_HEADERS = registry.h
 # End MODULE registry_ldb
 ################################################

=== modified file 'source/lib/registry/registry.h'
--- a/source/lib/registry/registry.h	2007-04-18 17:05:02 +0000
+++ b/source/lib/registry/registry.h	2007-04-23 14:05:39 +0000
@@ -57,6 +57,10 @@
 
 #define REGISTRY_INTERFACE_VERSION 1
 
+struct reg_key_path {
+	const char **elements;
+};
+
 struct reg_key_operations;
 
 /* structure to store the registry handles */
@@ -82,55 +86,6 @@
 typedef void (*reg_key_notification_function) (void);
 typedef void (*reg_value_notification_function) (void);
 
-/* 
- * Container for function pointers to enumeration routines
- * for virtual registry view 
- *
- * Backends provide just one hive (example: regf, creg)
- * 
- * Backends should always do case-insensitive compares 
- * (everything is case-insensitive but case-preserving, 
- * just like the FS)
- *
- * There is no save function as all operations are expected to 
- * be atomic.
- */ 
-
-struct reg_key_operations {
-	const char *name;
-
-	/* Or this function or get_subkey_by_name() */
-	WERROR (*open_key) (TALLOC_CTX *, const struct registry_key *, const char *name, struct registry_key **);
-
-	WERROR (*num_subkeys) (const struct registry_key *, uint32_t *count);
-	WERROR (*num_values) (const struct registry_key *, uint32_t *count);
-	WERROR (*get_subkey_by_index) (TALLOC_CTX *, const struct registry_key *, int idx, struct registry_key **);
-
-	/* Can not contain more than one level */
-	WERROR (*get_subkey_by_name) (TALLOC_CTX *, const struct registry_key *, const char *name, struct registry_key **);
-	WERROR (*get_value_by_index) (TALLOC_CTX *, const struct registry_key *, int idx, struct registry_value **);
-
-	/* Can not contain more than one level */
-	WERROR (*get_value_by_name) (TALLOC_CTX *, const struct registry_key *, const char *name, struct registry_value **);
-
-	/* Security control */
-	WERROR (*key_get_sec_desc) (TALLOC_CTX *, const struct registry_key *, struct security_descriptor **);
-	WERROR (*key_set_sec_desc) (const struct registry_key *, const struct security_descriptor *);
-
-	/* Notification */
-	WERROR (*request_key_change_notify) (const struct registry_key *, reg_key_notification_function);
-	WERROR (*request_value_change_notify) (const struct registry_value *, reg_value_notification_function);
-
-	/* Key management */
-	WERROR (*add_key)(TALLOC_CTX *, const struct registry_key *, const char *name, uint32_t access_mask, struct security_descriptor *, struct registry_key **);
-	WERROR (*del_key)(const struct registry_key *, const char *name);
-	WERROR (*flush_key) (const struct registry_key *);
-
-	/* Value management */
-	WERROR (*set_value)(const struct registry_key *, const char *name, uint32_t type, const DATA_BLOB data); 
-	WERROR (*del_value)(const struct registry_key *, const char *valname);
-};
-
 struct cli_credentials;
 
 /* Handle to a full registry
@@ -227,6 +182,13 @@
 WERROR reg_key_del_abs(struct registry_context *ctx, const char *path);
 WERROR reg_key_add_abs(TALLOC_CTX *mem_ctx, struct registry_context *ctx, const char *path, uint32_t access_mask, struct security_descriptor *sec_desc, struct registry_key **result);
 
+struct reg_key_path {
+	uint32_t predefined_key;
+	const char **elements;
+};
+
+WERROR reg_mount_hive(struct registry_context *ctx, struct reg_key_path *path, struct hive_context *hive);
+WERROR reg_unmount_hive(struct registry_context *ctx, struct hive_context *hive);
 
 /* Patch files */
 



More information about the samba-cvs mailing list