[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1178-g7010365

Günther Deschner gd at samba.org
Mon Apr 20 21:17:01 GMT 2009


The branch, master has been updated
       via  7010365e9ac5f9a285b5ad7b660a3c49ff0e8c17 (commit)
       via  171a361375e1cd76a80253d67e4e34a139bb5570 (commit)
       via  933482e64869f5aee2ca0356abb721facfd65943 (commit)
       via  374b47fb45d0a4b0cb24ff4afea9d6e341c2f8b5 (commit)
       via  4626ffb27e1cfc4f6366b2555412b48359b8952e (commit)
       via  75f830781fe1f175013eb9530c3cdeb17721677d (commit)
       via  3e010e3eb8f463cb49e5dbace4abc34a067d08f4 (commit)
       via  b939638dc79daa065c58755abf9f58d1df571401 (commit)
       via  161d2603d2d7b1163b124ba3c529780e8aeec409 (commit)
       via  68ff179b2960c80c56978869e2dd97806b10a214 (commit)
       via  ff33d50fabd6d5262d1917678d83c7c01351f04d (commit)
       via  248554370af30f485a4088d0d5de675e77b2aa7b (commit)
       via  c441b7dda8507b22a94146be0df77e54e623645a (commit)
       via  7761850b1f6062b61fbb05124e23703c191229d1 (commit)
       via  d2bd5895cf9b8a3572b17bca850e9c56a4cca901 (commit)
       via  cecd142f2bb77787985a1a55b1f55cef7ff9af75 (commit)
      from  9930e5b3db6b47fa4a1611ed0719ed73340bf8c0 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7010365e9ac5f9a285b5ad7b660a3c49ff0e8c17
Author: Günther Deschner <gd at samba.org>
Date:   Mon Apr 20 19:15:32 2009 +0200

    libgpo: Fix some minor issues.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 171a361375e1cd76a80253d67e4e34a139bb5570
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Mon Apr 20 16:51:33 2009 +0200

    Fix ini parsing in the s3 gpext modules. Fix ini parser API. Make the build work
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 933482e64869f5aee2ca0356abb721facfd65943
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Mon Apr 20 14:57:33 2009 +0200

    Move gpo_ini stuff to the main libgpo. Make gpo_ini use a common parser.
    
    It now makes use of lib/util/param.c to parse ini files.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 374b47fb45d0a4b0cb24ff4afea9d6e341c2f8b5
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Mon Apr 20 10:11:00 2009 +0200

    Fix Samba 4 Makefile to also clean ../libgpo
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 4626ffb27e1cfc4f6366b2555412b48359b8952e
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Mon Apr 20 09:57:00 2009 +0200

    Move some headers around to avoid confusion.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 75f830781fe1f175013eb9530c3cdeb17721677d
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Mon Apr 20 09:56:08 2009 +0200

    Move some headers around to avoid confusion.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 3e010e3eb8f463cb49e5dbace4abc34a067d08f4
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Sun Mar 15 20:34:59 2009 +0100

    Adjust samba 3 to the new gpo API. Still untested code.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit b939638dc79daa065c58755abf9f58d1df571401
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Sun Mar 15 04:40:12 2009 +0100

    Make the gpo files build for samba 4.
    
    Only gpt.ini remaining. Not suitable for merge yet, samba 3 is currently broken due to some changed public API.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 161d2603d2d7b1163b124ba3c529780e8aeec409
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Sun Mar 1 19:49:42 2009 +0100

    Mark the places where work needs to be done.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 68ff179b2960c80c56978869e2dd97806b10a214
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Sun Mar 1 18:44:58 2009 +0100

    Add nt_token_check_sid convenience function. Map NT_USER_TOKEN to struct security_token. Fix build errors.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit ff33d50fabd6d5262d1917678d83c7c01351f04d
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Sun Mar 1 16:53:07 2009 +0100

    Add ../libgpo to samba4 srcdir list in rules.mk.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 248554370af30f485a4088d0d5de675e77b2aa7b
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Sun Mar 1 16:25:57 2009 +0100

    Make gpo_ldap.c compatible with samba 4. Add ads_get_ldap_server_name() function to samba 3. Move prototypes to root libgpo where appropriate.
    
    gpo_ldap.c now compiles for both samba 3 and 4.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit c441b7dda8507b22a94146be0df77e54e623645a
Author: Wilco Baan Hofman <wilco at baanhofman.nl>
Date:   Sun Mar 1 14:06:36 2009 +0100

    Add ads convenience functions to samba 4. Move gpo_ldap.c to root libgpo.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit 7761850b1f6062b61fbb05124e23703c191229d1
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Mar 1 02:53:42 2009 +0100

    Move gpo_fetch to top-level.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit d2bd5895cf9b8a3572b17bca850e9c56a4cca901
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Mar 1 02:44:51 2009 +0100

    Move gpo_sec to top-level.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

commit cecd142f2bb77787985a1a55b1f55cef7ff9af75
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Mar 1 02:13:21 2009 +0100

    Move some libgpo files to root.
    
    Signed-off-by: Günther Deschner <gd at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 libgpo/config.mk                 |    7 +
 libgpo/gpext/gpext.c             |  749 ++++++++++++++++++++++++++++++++
 libgpo/gpext/gpext.h             |  126 ++++++
 libgpo/gpo.h                     |  289 +++++++++++++
 libgpo/gpo_fetch.c               |  274 ++++++++++++
 libgpo/gpo_ini.c                 |  281 ++++++++++++
 libgpo/gpo_ini.h                 |   42 ++
 libgpo/gpo_ldap.c                |  871 ++++++++++++++++++++++++++++++++++++++
 libgpo/gpo_sec.c                 |  207 +++++++++
 libgpo/gpo_util.c                |  869 +++++++++++++++++++++++++++++++++++++
 source3/Makefile.in              |    6 +-
 source3/include/ads.h            |    2 -
 source3/include/gpo.h            |  158 -------
 source3/include/includes.h       |    2 +-
 source3/include/proto.h          |  146 +-------
 source3/libads/ads_utils.c       |    5 +
 source3/libgpo/gpext/gpext.c     |  746 --------------------------------
 source3/libgpo/gpext/gpext.h     |   79 ----
 source3/libgpo/gpext/scripts.c   |   10 +-
 source3/libgpo/gpext/security.c  |   25 +-
 source3/libgpo/gpo_fetch.c       |  187 --------
 source3/libgpo/gpo_ini.c         |  245 -----------
 source3/libgpo/gpo_ini.h         |   33 --
 source3/libgpo/gpo_ldap.c        |  866 -------------------------------------
 source3/libgpo/gpo_sec.c         |  186 --------
 source3/libgpo/gpo_util.c        |  870 -------------------------------------
 source3/utils/net_ads_gpo.c      |    6 +-
 source4/Makefile                 |    3 +-
 source4/build/make/rules.mk      |    2 +-
 source4/libgpo/ads_convenience.c |  284 +++++++++++++
 source4/libgpo/ads_convenience.h |  103 +++++
 source4/libgpo/gpo_filesync.c    |  241 +++++++++++
 source4/libgpo/gpo_s4.h          |   40 ++
 source4/main.mk                  |    2 +-
 34 files changed, 4422 insertions(+), 3540 deletions(-)
 create mode 100644 libgpo/config.mk
 create mode 100644 libgpo/gpext/gpext.c
 create mode 100644 libgpo/gpext/gpext.h
 create mode 100644 libgpo/gpo.h
 create mode 100644 libgpo/gpo_fetch.c
 create mode 100644 libgpo/gpo_ini.c
 create mode 100644 libgpo/gpo_ini.h
 create mode 100644 libgpo/gpo_ldap.c
 create mode 100644 libgpo/gpo_sec.c
 create mode 100644 libgpo/gpo_util.c
 delete mode 100644 source3/include/gpo.h
 delete mode 100644 source3/libgpo/gpext/gpext.c
 delete mode 100644 source3/libgpo/gpext/gpext.h
 delete mode 100644 source3/libgpo/gpo_fetch.c
 delete mode 100644 source3/libgpo/gpo_ini.c
 delete mode 100644 source3/libgpo/gpo_ini.h
 delete mode 100644 source3/libgpo/gpo_ldap.c
 delete mode 100644 source3/libgpo/gpo_sec.c
 delete mode 100644 source3/libgpo/gpo_util.c
 create mode 100644 source4/libgpo/ads_convenience.c
 create mode 100644 source4/libgpo/ads_convenience.h
 create mode 100644 source4/libgpo/gpo_filesync.c
 create mode 100644 source4/libgpo/gpo_s4.h


Changeset truncated at 500 lines:

diff --git a/libgpo/config.mk b/libgpo/config.mk
new file mode 100644
index 0000000..6472d16
--- /dev/null
+++ b/libgpo/config.mk
@@ -0,0 +1,7 @@
+[SUBSYSTEM::LIBGPO]
+PRIVATE_DEPENDENCIES = LIBLDB LIBSAMBA-NET
+
+LIBGPO_OBJ_FILES = ../libgpo/gpo_util.o ../libgpo/gpo_sec.o \
+				   ../libgpo/gpext/gpext.o \
+				   ../libgpo/gpo_fetch.o ../libgpo/gpo_ini.o \
+			$(libgpodir)/ads_convenience.o $(libgpodir)/gpo_filesync.o
diff --git a/libgpo/gpext/gpext.c b/libgpo/gpext/gpext.c
new file mode 100644
index 0000000..b6cc410
--- /dev/null
+++ b/libgpo/gpext/gpext.c
@@ -0,0 +1,749 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  Group Policy Support
+ *  Copyright (C) Guenther Deschner 2007-2008
+ *
+ *  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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "includes.h"
+#include "../libgpo/gpext/gpext.h"
+#include "librpc/gen_ndr/ndr_misc.h"
+#include "lib/util/dlinklist.h"
+
+static struct gp_extension *extensions = NULL;
+
+/****************************************************************
+****************************************************************/
+
+struct gp_extension *get_gp_extension_list(void)
+{
+	return extensions;
+}
+
+/****************************************************************
+****************************************************************/
+
+/* see http://support.microsoft.com/kb/216358/en-us/ for more info */
+
+struct gp_extension_reg_table gpext_reg_vals[] = {
+	{ "DllName", REG_EXPAND_SZ },
+	{ "ProcessGroupPolicy", REG_SZ },
+	{ "NoMachinePolicy", REG_DWORD },
+	{ "NoUserPolicy", REG_DWORD },
+	{ "NoSlowLink", REG_DWORD },
+	{ "NoBackgroundPolicy", REG_DWORD },
+	{ "NoGPOListChanges", REG_DWORD },
+	{ "PerUserLocalSettings", REG_DWORD },
+	{ "RequiresSuccessfulRegistry", REG_DWORD },
+	{ "EnableAsynchronousProcessing", REG_DWORD },
+	{ "ExtensionDebugLevel", REG_DWORD },
+	/* new */
+	{ "GenerateGroupPolicy", REG_SZ }, /* not supported on w2k */
+	{ "NotifyLinkTransition", REG_DWORD },
+	{ "ProcessGroupPolicyEx", REG_SZ }, /* not supported on w2k */
+	{ "ExtensionEventSource", REG_MULTI_SZ }, /* not supported on w2k */
+	{ "GenerateGroupPolicy", REG_SZ },
+	{ "MaxNoGPOListChangesInterval", REG_DWORD },
+	{ NULL, REG_NONE }
+};
+
+/****************************************************************
+****************************************************************/
+
+static struct gp_extension *get_extension_by_name(struct gp_extension *be,
+						  const char *name)
+{
+	struct gp_extension *b;
+
+	for (b = be; b; b = b->next) {
+		if (strequal(b->name, name)) {
+			return b;
+		}
+	}
+
+	return NULL;
+}
+
+/****************************************************************
+****************************************************************/
+
+static struct gp_extension_methods *get_methods_by_name(struct gp_extension *be,
+							const char *name)
+{
+	struct gp_extension *b;
+
+	for (b = be; b; b = b->next) {
+		if (strequal(b->name, name)) {
+			return b->methods;
+		}
+	}
+
+	return NULL;
+}
+
+/****************************************************************
+****************************************************************/
+
+NTSTATUS unregister_gp_extension(const char *name)
+{
+	struct gp_extension *ext;
+
+	ext = get_extension_by_name(extensions, name);
+	if (!ext) {
+		return NT_STATUS_OK;
+	}
+
+	DLIST_REMOVE(extensions, ext);
+	talloc_free(ext);
+
+	DEBUG(2,("Successfully removed GP extension '%s'\n", name));
+
+	return NT_STATUS_OK;
+}
+
+/****************************************************************
+****************************************************************/
+
+NTSTATUS register_gp_extension(TALLOC_CTX *gpext_ctx,
+			       int version,
+			       const char *name,
+			       const char *guid,
+			       struct gp_extension_methods *methods)
+{
+	struct gp_extension_methods *test;
+	struct gp_extension *entry;
+	NTSTATUS status;
+
+	if (!gpext_ctx) {
+		return NT_STATUS_INTERNAL_DB_ERROR;
+	}
+
+	if ((version != SMB_GPEXT_INTERFACE_VERSION)) {
+		DEBUG(0,("Failed to register gp extension.\n"
+		         "The module was compiled against "
+			 "SMB_GPEXT_INTERFACE_VERSION %d,\n"
+		         "current SMB_GPEXT_INTERFACE_VERSION is %d.\n"
+		         "Please recompile against the current "
+			 "version of samba!\n",
+			 version, SMB_GPEXT_INTERFACE_VERSION));
+		return NT_STATUS_OBJECT_TYPE_MISMATCH;
+	}
+
+	if (!guid || !name || !name[0] || !methods) {
+		DEBUG(0,("Called with NULL pointer or empty name!\n"));
+		return NT_STATUS_INVALID_PARAMETER;
+	}
+
+	test = get_methods_by_name(extensions, name);
+	if (test) {
+		DEBUG(0,("GP extension module %s already registered!\n",
+			name));
+		return NT_STATUS_OBJECT_NAME_COLLISION;
+	}
+
+	entry = talloc_zero(gpext_ctx, struct gp_extension);
+	NT_STATUS_HAVE_NO_MEMORY(entry);
+
+	entry->name = talloc_strdup(gpext_ctx, name);
+	NT_STATUS_HAVE_NO_MEMORY(entry->name);
+
+	entry->guid = talloc_zero(gpext_ctx, struct GUID);
+	NT_STATUS_HAVE_NO_MEMORY(entry->guid);
+	status = GUID_from_string(guid, entry->guid);
+	NT_STATUS_NOT_OK_RETURN(status);
+
+	entry->methods = methods;
+	DLIST_ADD(extensions, entry);
+
+	DEBUG(2,("Successfully added GP extension '%s' %s\n",
+		name, GUID_string2(gpext_ctx, entry->guid)));
+
+	return NT_STATUS_OK;
+}
+
+/****************************************************************
+****************************************************************/
+
+static NTSTATUS gp_extension_init_module(TALLOC_CTX *mem_ctx,
+					 const char *name,
+					 struct gp_extension **gpext)
+{
+	NTSTATUS status;
+	struct gp_extension *ext = NULL;
+
+	ext = talloc_zero(mem_ctx, struct gp_extension);
+	NT_STATUS_HAVE_NO_MEMORY(gpext);
+
+	ext->methods = get_methods_by_name(extensions, name);
+	if (!ext->methods) {
+
+		status = smb_probe_module(SAMBA_SUBSYSTEM_GPEXT,
+					  name);
+		if (!NT_STATUS_IS_OK(status)) {
+			return status;
+		}
+
+		ext->methods = get_methods_by_name(extensions, name);
+		if (!ext->methods) {
+			return NT_STATUS_DLL_INIT_FAILED;
+		}
+	}
+
+	*gpext = ext;
+
+	return NT_STATUS_OK;
+}
+
+/****************************************************************
+****************************************************************/
+
+static bool add_gp_extension_reg_entry_to_array(TALLOC_CTX *mem_ctx,
+						struct gp_extension_reg_entry *entry,
+						struct gp_extension_reg_entry **entries,
+						size_t *num)
+{
+	*entries = talloc_realloc(mem_ctx, *entries,
+					struct gp_extension_reg_entry,
+					(*num)+1);
+	if (*entries == NULL) {
+		*num = 0;
+		return false;
+	}
+
+	(*entries)[*num].value = entry->value;
+	(*entries)[*num].data = entry->data;
+
+	*num += 1;
+	return true;
+}
+
+/****************************************************************
+****************************************************************/
+
+static bool add_gp_extension_reg_info_entry_to_array(TALLOC_CTX *mem_ctx,
+						     struct gp_extension_reg_info_entry *entry,
+						     struct gp_extension_reg_info_entry **entries,
+						     size_t *num)
+{
+	*entries = talloc_realloc(mem_ctx, *entries,
+					struct gp_extension_reg_info_entry,
+					(*num)+1);
+	if (*entries == NULL) {
+		*num = 0;
+		return false;
+	}
+
+	(*entries)[*num].guid = entry->guid;
+	(*entries)[*num].num_entries = entry->num_entries;
+	(*entries)[*num].entries = entry->entries;
+
+	*num += 1;
+	return true;
+}
+
+/****************************************************************
+****************************************************************/
+
+static NTSTATUS gp_ext_info_add_reg(TALLOC_CTX *mem_ctx,
+				    struct gp_extension_reg_info_entry *entry,
+				    const char *value,
+				    enum winreg_Type type,
+				    const char *data_s)
+{
+	struct gp_extension_reg_entry *reg_entry = NULL;
+	struct registry_value *data = NULL;
+
+	reg_entry = talloc_zero(mem_ctx, struct gp_extension_reg_entry);
+	NT_STATUS_HAVE_NO_MEMORY(reg_entry);
+
+	data = talloc_zero(mem_ctx, struct registry_value);
+	NT_STATUS_HAVE_NO_MEMORY(data);
+
+	data->type = type;
+
+	switch (type) {
+		case REG_SZ:
+		case REG_EXPAND_SZ:
+			data->v.sz.str = talloc_strdup(mem_ctx, data_s);
+			NT_STATUS_HAVE_NO_MEMORY(data->v.sz.str);
+			data->v.sz.len = strlen(data_s);
+			break;
+		case REG_DWORD:
+			data->v.dword = atoi(data_s);
+			break;
+		default:
+			return NT_STATUS_NOT_SUPPORTED;
+	}
+
+	reg_entry->value = value;
+	reg_entry->data = data;
+
+	if (!add_gp_extension_reg_entry_to_array(mem_ctx, reg_entry,
+						 &entry->entries,
+						 &entry->num_entries)) {
+		return NT_STATUS_NO_MEMORY;
+	}
+
+	return NT_STATUS_OK;
+}
+
+/****************************************************************
+****************************************************************/
+
+static NTSTATUS gp_ext_info_add_reg_table(TALLOC_CTX *mem_ctx,
+					  const char *module,
+					  struct gp_extension_reg_info_entry *entry,
+					  struct gp_extension_reg_table *table)
+{
+	NTSTATUS status;
+	const char *module_name = NULL;
+	int i;
+
+	module_name = talloc_asprintf(mem_ctx, "%s.%s", module, shlib_ext());
+	NT_STATUS_HAVE_NO_MEMORY(module_name);
+
+	status = gp_ext_info_add_reg(mem_ctx, entry,
+				     "DllName", REG_EXPAND_SZ, module_name);
+	NT_STATUS_NOT_OK_RETURN(status);
+
+	for (i=0; table[i].val; i++) {
+		status = gp_ext_info_add_reg(mem_ctx, entry,
+					     table[i].val,
+					     table[i].type,
+					     table[i].data);
+		NT_STATUS_NOT_OK_RETURN(status);
+	}
+
+	return status;
+}
+
+/****************************************************************
+****************************************************************/
+
+NTSTATUS gp_ext_info_add_entry(TALLOC_CTX *mem_ctx,
+			       const char *module,
+			       const char *ext_guid,
+			       struct gp_extension_reg_table *table,
+			       struct gp_extension_reg_info *info)
+{
+	NTSTATUS status;
+	struct gp_extension_reg_info_entry *entry = NULL;
+
+	entry = TALLOC_ZERO_P(mem_ctx, struct gp_extension_reg_info_entry);
+	NT_STATUS_HAVE_NO_MEMORY(entry);
+
+	status = GUID_from_string(ext_guid, &entry->guid);
+	NT_STATUS_NOT_OK_RETURN(status);
+
+	status = gp_ext_info_add_reg_table(mem_ctx, module, entry, table);
+	NT_STATUS_NOT_OK_RETURN(status);
+
+	if (!add_gp_extension_reg_info_entry_to_array(mem_ctx, entry,
+						      &info->entries,
+						      &info->num_entries)) {
+		return NT_STATUS_NO_MEMORY;
+	}
+
+	return NT_STATUS_OK;
+}
+
+/****************************************************************
+****************************************************************/
+
+static bool gp_extension_reg_info_verify_entry(struct gp_extension_reg_entry *entry)
+{
+	int i;
+
+	for (i=0; gpext_reg_vals[i].val; i++) {
+
+		if ((strequal(entry->value, gpext_reg_vals[i].val)) &&
+		    (entry->data->type == gpext_reg_vals[i].type)) {
+			return true;
+		}
+	}
+
+	return false;
+}
+
+/****************************************************************
+****************************************************************/
+
+static bool gp_extension_reg_info_verify(struct gp_extension_reg_info_entry *entry)
+{
+	int i;
+
+	for (i=0; i < entry->num_entries; i++) {
+		if (!gp_extension_reg_info_verify_entry(&entry->entries[i])) {
+			return false;
+		}
+	}
+
+	return true;
+}
+
+/****************************************************************
+****************************************************************/
+
+static WERROR gp_extension_store_reg_vals(TALLOC_CTX *mem_ctx,
+					  struct registry_key *key,
+					  struct gp_extension_reg_info_entry *entry)
+{
+	WERROR werr = WERR_OK;
+	size_t i;
+
+	for (i=0; i < entry->num_entries; i++) {
+
+		werr = reg_setvalue(key,
+				    entry->entries[i].value,
+				    entry->entries[i].data);
+		W_ERROR_NOT_OK_RETURN(werr);
+	}
+
+	return werr;
+}
+
+/****************************************************************
+****************************************************************/
+
+static WERROR gp_extension_store_reg_entry(TALLOC_CTX *mem_ctx,
+					   struct gp_registry_context *reg_ctx,
+					   struct gp_extension_reg_info_entry *entry)
+{
+	WERROR werr;
+	struct registry_key *key = NULL;
+	const char *subkeyname = NULL;
+
+	if (!gp_extension_reg_info_verify(entry)) {
+		return WERR_INVALID_PARAM;
+	}
+
+	subkeyname = GUID_string2(mem_ctx, &entry->guid);
+	W_ERROR_HAVE_NO_MEMORY(subkeyname);
+
+	strupper_m(CONST_DISCARD(char *,subkeyname));
+
+	werr = gp_store_reg_subkey(mem_ctx,
+				   subkeyname,
+				   reg_ctx->curr_key,
+				   &key);
+	W_ERROR_NOT_OK_RETURN(werr);
+
+	werr = gp_extension_store_reg_vals(mem_ctx,
+					   key,
+					   entry);
+	W_ERROR_NOT_OK_RETURN(werr);
+
+	return werr;
+}
+
+/****************************************************************
+****************************************************************/
+
+static WERROR gp_extension_store_reg(TALLOC_CTX *mem_ctx,
+				     struct gp_registry_context *reg_ctx,
+				     struct gp_extension_reg_info *info)
+{
+	WERROR werr = WERR_OK;
+	int i;
+
+	if (!info) {
+		return WERR_OK;
+	}
+
+	for (i=0; i < info->num_entries; i++) {
+		werr = gp_extension_store_reg_entry(mem_ctx,
+						    reg_ctx,
+						    &info->entries[i]);
+		W_ERROR_NOT_OK_RETURN(werr);
+	}
+
+	return werr;
+}
+
+/****************************************************************
+****************************************************************/
+
+static NTSTATUS gp_glob_ext_list(TALLOC_CTX *mem_ctx,
+				 const char ***ext_list,
+				 size_t *ext_list_len)
+{


-- 
Samba Shared Repository


More information about the samba-cvs mailing list