summaryrefslogtreecommitdiff
path: root/source4/include
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-12-10 20:07:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:29 -0500
commit444a86792471c0bef33dde15c7a4a33e16a951b4 (patch)
tree075b0cdd27acb80470a4e90e99598cbcea3b082c /source4/include
parent60c69445f6fa86b27bd697cc8af52b582f620725 (diff)
downloadsamba-444a86792471c0bef33dde15c7a4a33e16a951b4.tar.gz
samba-444a86792471c0bef33dde15c7a4a33e16a951b4.tar.bz2
samba-444a86792471c0bef33dde15c7a4a33e16a951b4.zip
r4132: - Bunch of rather large fixes in the registry
- Added some README files Not everything works yet, e.g. the EnumValue test appears to be broken. (This used to be commit c169e86c1f52763b83e77e509f89cb91f9b69071)
Diffstat (limited to 'source4/include')
-rw-r--r--source4/include/credentials.h36
-rw-r--r--source4/include/registry.h49
2 files changed, 62 insertions, 23 deletions
diff --git a/source4/include/credentials.h b/source4/include/credentials.h
new file mode 100644
index 0000000000..99173ab421
--- /dev/null
+++ b/source4/include/credentials.h
@@ -0,0 +1,36 @@
+/*
+ samba -- Unix SMB/CIFS implementation.
+
+ Client credentials structure
+
+ Copyright (C) 2004 Jelmer Vernooij <jelmer@samba.org>
+
+ 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.
+*/
+
+struct cli_credentials {
+ /* Preferred methods, NULL means default */
+ const char **preferred_methods;
+
+ const char *username;
+ const char *password;
+ const char *domain;
+ const char *realm;
+
+ const char *(*username_cb) (void);
+ const char *(*password_cb) (void);
+ const char *(*domain_cb) (void);
+ const char *(*realm_cb) (void);
+};
diff --git a/source4/include/registry.h b/source4/include/registry.h
index a099ae1e0f..4ce9569376 100644
--- a/source4/include/registry.h
+++ b/source4/include/registry.h
@@ -22,26 +22,36 @@
#ifndef _REGISTRY_H /* _REGISTRY_H */
#define _REGISTRY_H
-#define HKEY_CLASSES_ROOT 0x80000000
-#define HKEY_CURRENT_USER 0x80000001
-#define HKEY_LOCAL_MACHINE 0x80000002
-#define HKEY_USERS 0x80000003
+
+enum hkeys {
+ HKEY_CLASSES_ROOT = 0x80000000,
+ HKEY_CURRENT_USER = 0x80000001,
+ HKEY_LOCAL_MACHINE = 0x80000002,
+ HKEY_USERS = 0x80000003,
+ HKEY_PERFORMANCE_DATA = 0x80000004,
+ HKEY_CURRENT_CONFIG = 0x80000005,
+ HKEY_DYN_DATA = 0x80000006,
+ HKEY_PT = 0x80000007, /* Don't know if this is correct! */
+ HKEY_PN = 0x80000008 /* Don't know if this is correct! */
+};
/* Registry data types */
-#define REG_DELETE -1
+#define REG_DELETE -1
#define REG_NONE 0
#define REG_SZ 1
#define REG_EXPAND_SZ 2
#define REG_BINARY 3
-#define REG_DWORD 4
-#define REG_DWORD_LE 4 /* DWORD, little endian*/
-#define REG_DWORD_BE 5 /* DWORD, big endian */
+#define REG_DWORD_LE 4
+#define REG_DWORD REG_DWORD_LE
+#define REG_DWORD_BE 5
#define REG_LINK 6
#define REG_MULTI_SZ 7
#define REG_RESOURCE_LIST 8
#define REG_FULL_RESOURCE_DESCRIPTOR 9
#define REG_RESOURCE_REQUIREMENTS_LIST 10
+#define REG_QWORD_LE 11
+#define REG_QWORD REQ_QWORD_LE
#if 0
/* FIXME */
@@ -62,7 +72,7 @@ typedef struct ace_struct_s {
/* structure to store the registry handles */
struct registry_key {
char *name; /* Name of the key */
- char *path; /* Full path to the key */
+ const char *path; /* Full path to the key */
char *class_name; /* Name of key class */
NTTIME last_mod; /* Time last modified */
SEC_DESC *security;
@@ -92,18 +102,15 @@ typedef void (*value_notification_function) (void);
*
* Backends can provide :
* - just one hive (example: nt4, w95)
- * - several hives (example: rpc)
+ * - several hives (example: rpc).
*
*/
-struct registry_operations {
+struct hive_operations {
const char *name;
- /* If one file, connection, etc may have more then one hive */
- WERROR (*list_available_hives) (TALLOC_CTX *, const char *location, const char *credentials, char ***hives);
-
/* Implement this one */
- WERROR (*open_hive) (TALLOC_CTX *, struct registry_hive *, struct registry_key **);
+ WERROR (*open_hive) (struct registry_hive *, struct registry_key **);
WERROR (*close_hive) (struct registry_hive *);
/* Or this one */
@@ -140,11 +147,8 @@ struct registry_operations {
};
struct registry_hive {
- const struct registry_operations *functions;
- char *name; /* usually something like HKEY_CURRENT_USER, etc */
+ const struct hive_operations *functions;
char *location;
- char *credentials;
- char *backend_hivename;
void *backend_data;
struct registry_key *root;
struct registry_context *reg_ctx;
@@ -153,14 +157,13 @@ struct registry_hive {
/* Handle to a full registry
* contains zero or more hives */
struct registry_context {
- TALLOC_CTX *mem_ctx;
- int num_hives;
- struct registry_hive **hives;
+ void *backend_data;
+ WERROR (*get_hive) (struct registry_context *, uint32 hkey, struct registry_key **);
};
struct reg_init_function_entry {
/* Function to create a member of the pdb_methods list */
- const struct registry_operations *functions;
+ const struct hive_operations *hive_functions;
struct reg_init_function_entry *prev, *next;
};