[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Wed Dec 18 08:46:04 MST 2013


The branch, master has been updated
       via  ec790f8 libgpo: remove unused process_group_policy2 callback from CSE module API.
       via  65a3ed5 libgpo: remove some unnecessary usage of ADS_STATUS.
       via  172d6cd libgpo: remove unrequired references to ads_struct.
       via  e3be1d1 libgpo: clean up CSE api, remove unrequired references to ads_struct.
       via  8fef712 libgpo: clean up CSE module api, remove unrequired references to ads_struct.
       via  103e672 libgpo: support probing for parameters in gp_inifile_get functions.
       via  785c3c1 libgpo: check for talloc failures in ini file parsing routines.
      from  078c868 vfs_glusterfs: Enable per client log file

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


- Log -----------------------------------------------------------------
commit ec790f84bea30f361a296104b59502a9ac11d29c
Author: Günther Deschner <gd at samba.org>
Date:   Mon Dec 16 14:59:00 2013 +0100

    libgpo: remove unused process_group_policy2 callback from CSE module API.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Wed Dec 18 16:45:20 CET 2013 on sn-devel-104

commit 65a3ed51347168d994e1c1fe35b85ec7c110d948
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 13 15:02:13 2013 +0100

    libgpo: remove some unnecessary usage of ADS_STATUS.
    
    Use NTSTATUS instead.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 172d6cd0d033a63d1b057fcadafca3b9bc7c53db
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 13 15:54:42 2013 +0100

    libgpo: remove unrequired references to ads_struct.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit e3be1d118831670b89acb3799c9e3b3f7789fb0f
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 13 15:54:10 2013 +0100

    libgpo: clean up CSE api, remove unrequired references to ads_struct.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 8fef712eff881fdd48cfd656856826c9f014406c
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 13 15:52:31 2013 +0100

    libgpo: clean up CSE module api, remove unrequired references to ads_struct.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 103e672ef533ad0f4010daa5d3e9183e0894c754
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 12 18:24:47 2013 +0100

    libgpo: support probing for parameters in gp_inifile_get functions.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 785c3c12a9fc6bebdce518bbd1de4f5fcb5c1670
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 12 18:23:47 2013 +0100

    libgpo: check for talloc failures in ini file parsing routines.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

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

Summary of changes:
 libgpo/gpext/gpext.c            |    8 ++---
 libgpo/gpext/gpext.h            |   15 ++------
 libgpo/gpo.h                    |   24 ++++++-------
 libgpo/gpo_ini.c                |   34 ++++++++++++++++--
 libgpo/gpo_util.c               |   73 ++++++++++++++++++--------------------
 source3/libgpo/gpext/registry.c |    3 +-
 source3/libgpo/gpext/scripts.c  |    3 +-
 source3/libgpo/gpext/security.c |    3 +-
 source3/utils/net_ads_gpo.c     |    4 +-
 9 files changed, 87 insertions(+), 80 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libgpo/gpext/gpext.c b/libgpo/gpext/gpext.c
index df84475..a48d3f5 100644
--- a/libgpo/gpext/gpext.c
+++ b/libgpo/gpext/gpext.c
@@ -678,7 +678,7 @@ void debug_gpext_header(int lvl,
 	TALLOC_FREE(flags_str);
 }
 
-NTSTATUS process_gpo_list_with_extension(ADS_STRUCT *ads,
+NTSTATUS process_gpo_list_with_extension(
 			   TALLOC_CTX *mem_ctx,
 			   uint32_t flags,
 			   const struct security_token *token,
@@ -692,8 +692,7 @@ NTSTATUS process_gpo_list_with_extension(ADS_STRUCT *ads,
 /****************************************************************
 ****************************************************************/
 
-NTSTATUS gpext_process_extension(ADS_STRUCT *ads,
-				 TALLOC_CTX *mem_ctx,
+NTSTATUS gpext_process_extension(TALLOC_CTX *mem_ctx,
 				 uint32_t flags,
 				 const struct security_token *token,
 				 struct registry_key *root_key,
@@ -733,8 +732,7 @@ NTSTATUS gpext_process_extension(ADS_STRUCT *ads,
 	status = ext->methods->initialize(mem_ctx);
 	NT_STATUS_NOT_OK_RETURN(status);
 
-	status = ext->methods->process_group_policy(ads,
-						    mem_ctx,
+	status = ext->methods->process_group_policy(mem_ctx,
 						    flags,
 						    root_key,
 						    token,
diff --git a/libgpo/gpext/gpext.h b/libgpo/gpext/gpext.h
index ce999a1..ef0b1a2 100644
--- a/libgpo/gpext/gpext.h
+++ b/libgpo/gpext/gpext.h
@@ -61,8 +61,7 @@ struct gp_extension_methods {
 
 	NTSTATUS (*initialize)(TALLOC_CTX *mem_ctx);
 
-	NTSTATUS (*process_group_policy)(ADS_STRUCT *ads,
-					 TALLOC_CTX *mem_ctx,
+	NTSTATUS (*process_group_policy)(TALLOC_CTX *mem_ctx,
 					 uint32_t flags,
 					 struct registry_key *root_key,
 					 const struct security_token *token,
@@ -70,13 +69,6 @@ struct gp_extension_methods {
 					 const char *extension_guid,
 					 const char *snapin_guid);
 
-	NTSTATUS (*process_group_policy2)(ADS_STRUCT *ads,
-					 TALLOC_CTX *mem_ctx,
-					 uint32_t flags,
-					 const struct security_token *token,
-					 struct GROUP_POLICY_OBJECT *gpo_list,
-					 const char *extension_guid);
-
 	NTSTATUS (*get_reg_config)(TALLOC_CTX *mem_ctx,
 				   struct gp_extension_reg_info **info);
 
@@ -106,15 +98,14 @@ void debug_gpext_header(int lvl,
 			struct GROUP_POLICY_OBJECT *gpo,
 			const char *extension_guid,
 			const char *snapin_guid);
-NTSTATUS process_gpo_list_with_extension(ADS_STRUCT *ads,
+NTSTATUS process_gpo_list_with_extension(
 			   TALLOC_CTX *mem_ctx,
 			   uint32_t flags,
 			   const struct security_token *token,
 			   struct GROUP_POLICY_OBJECT *gpo_list,
 			   const char *extension_guid,
 			   const char *snapin_guid);
-NTSTATUS gpext_process_extension(ADS_STRUCT *ads,
-				 TALLOC_CTX *mem_ctx,
+NTSTATUS gpext_process_extension(TALLOC_CTX *mem_ctx,
 				 uint32_t flags,
 				 const struct security_token *token,
 				 struct registry_key *root_key,
diff --git a/libgpo/gpo.h b/libgpo/gpo.h
index 6e677c9..40ecd34 100644
--- a/libgpo/gpo.h
+++ b/libgpo/gpo.h
@@ -237,19 +237,17 @@ void dump_gpo_list(ADS_STRUCT *ads,
 		   struct GROUP_POLICY_OBJECT *gpo_list,
 		   int debuglevel);
 void dump_gplink(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, struct GP_LINK *gp_link);
-ADS_STATUS gpo_process_a_gpo(ADS_STRUCT *ads,
-			     TALLOC_CTX *mem_ctx,
-			     const struct security_token *token,
-			     struct registry_key *root_key,
-			     struct GROUP_POLICY_OBJECT *gpo,
-			     const char *extension_guid_filter,
-			     uint32_t flags);
-ADS_STATUS gpo_process_gpo_list(ADS_STRUCT *ads,
-				TALLOC_CTX *mem_ctx,
-				const struct security_token *token,
-				struct GROUP_POLICY_OBJECT *gpo_list,
-				const char *extensions_guid_filter,
-				uint32_t flags);
+NTSTATUS gpo_process_a_gpo(TALLOC_CTX *mem_ctx,
+			   const struct security_token *token,
+			   struct registry_key *root_key,
+			   struct GROUP_POLICY_OBJECT *gpo,
+			   const char *extension_guid_filter,
+			   uint32_t flags);
+NTSTATUS gpo_process_gpo_list(TALLOC_CTX *mem_ctx,
+			      const struct security_token *token,
+			      struct GROUP_POLICY_OBJECT *gpo_list,
+			      const char *extensions_guid_filter,
+			      uint32_t flags);
 NTSTATUS check_refresh_gpo(ADS_STRUCT *ads,
 			   TALLOC_CTX *mem_ctx,
                            const char *cache_dir,
diff --git a/libgpo/gpo_ini.c b/libgpo/gpo_ini.c
index 1f69eec..a91bb92 100644
--- a/libgpo/gpo_ini.c
+++ b/libgpo/gpo_ini.c
@@ -32,6 +32,9 @@ static bool change_section(const char *section, void *ctx_ptr)
 		talloc_free(ctx->current_section);
 	}
 	ctx->current_section = talloc_strdup(ctx, section);
+	if (!ctx->current_section) {
+		return false;
+	}
 	return true;
 }
 
@@ -41,10 +44,25 @@ static bool change_section(const char *section, void *ctx_ptr)
 static bool store_keyval_pair(const char *key, const char *value, void *ctx_ptr)
 {
 	struct gp_inifile_context *ctx = (struct gp_inifile_context *) ctx_ptr;
+
 	ctx->data = talloc_realloc(ctx, ctx->data, struct keyval_pair *, ctx->keyval_count+1);
+	if (!ctx->data) {
+		return false;
+	}
+
 	ctx->data[ctx->keyval_count] = talloc_zero(ctx, struct keyval_pair);
+	if (!ctx->data[ctx->keyval_count]) {
+		return false;
+	}
+
 	ctx->data[ctx->keyval_count]->key = talloc_asprintf(ctx, "%s:%s", ctx->current_section, key);
 	ctx->data[ctx->keyval_count]->val = talloc_strdup(ctx, value);
+
+	if (!ctx->data[ctx->keyval_count]->key ||
+	    !ctx->data[ctx->keyval_count]->val) {
+		return false;
+	}
+
 	ctx->keyval_count++;
 	return true;
 }
@@ -138,7 +156,9 @@ NTSTATUS gp_inifile_getstring(struct gp_inifile_context *ctx, const char *key, c
 
 	for (i = 0; i < ctx->keyval_count; i++) {
 		if (strcmp(ctx->data[i]->key, key) == 0) {
-			*ret = ctx->data[i]->val;
+			if (ret) {
+				*ret = ctx->data[i]->val;
+			}
 			return NT_STATUS_OK;
 		}
 	}
@@ -158,7 +178,9 @@ NTSTATUS gp_inifile_getint(struct gp_inifile_context *ctx, const char *key, int
 		return result;
 	}
 
-	*ret = (int)strtol(value, NULL, 10);
+	if (ret) {
+		*ret = (int)strtol(value, NULL, 10);
+	}
 	return NT_STATUS_OK;
 }
 
@@ -176,10 +198,14 @@ NTSTATUS gp_inifile_getbool(struct gp_inifile_context *ctx, const char *key, boo
 	}
 
 	if (strequal(value, "Yes")) {
-		*ret = true;
+		if (ret) {
+			*ret = true;
+		}
 		return NT_STATUS_OK;
 	} else if (strequal(value, "No")) {
-		*ret = false;
+		if (ret) {
+			*ret = false;
+		}
 		return NT_STATUS_OK;
 	}
 
diff --git a/libgpo/gpo_util.c b/libgpo/gpo_util.c
index b38a40c..7378cfc 100644
--- a/libgpo/gpo_util.c
+++ b/libgpo/gpo_util.c
@@ -443,13 +443,12 @@ static bool gpo_get_gp_ext_from_gpo(TALLOC_CTX *mem_ctx,
 /****************************************************************
 ****************************************************************/
 
-ADS_STATUS gpo_process_a_gpo(ADS_STRUCT *ads,
-			     TALLOC_CTX *mem_ctx,
-			     const struct security_token *token,
-			     struct registry_key *root_key,
-			     struct GROUP_POLICY_OBJECT *gpo,
-			     const char *extension_guid_filter,
-			     uint32_t flags)
+NTSTATUS gpo_process_a_gpo(TALLOC_CTX *mem_ctx,
+			   const struct security_token *token,
+			   struct registry_key *root_key,
+			   struct GROUP_POLICY_OBJECT *gpo,
+			   const char *extension_guid_filter,
+			   uint32_t flags)
 {
 	struct GP_EXT *gp_ext = NULL;
 	int i;
@@ -463,7 +462,7 @@ ADS_STATUS gpo_process_a_gpo(ADS_STRUCT *ads,
 	}
 
 	if (!gpo_get_gp_ext_from_gpo(mem_ctx, flags, gpo, &gp_ext)) {
-		return ADS_ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+		return NT_STATUS_INVALID_PARAMETER;
 	}
 
 	if (!gp_ext || !gp_ext->num_exts) {
@@ -472,7 +471,7 @@ ADS_STATUS gpo_process_a_gpo(ADS_STRUCT *ads,
 				"no policies in %s (%s) for this extension\n",
 				gpo->name, gpo->display_name));
 		}
-		return ADS_SUCCESS;
+		return NT_STATUS_OK;
 	}
 
 	for (i=0; i<gp_ext->num_exts; i++) {
@@ -485,30 +484,29 @@ ADS_STATUS gpo_process_a_gpo(ADS_STRUCT *ads,
 			continue;
 		}
 
-		ntstatus = gpext_process_extension(ads, mem_ctx,
+		ntstatus = gpext_process_extension(mem_ctx,
 						   flags, token, root_key, gpo,
 						   gp_ext->extensions_guid[i],
 						   gp_ext->snapins_guid[i]);
 		if (!NT_STATUS_IS_OK(ntstatus)) {
-			ADS_ERROR_NT(ntstatus);
+			return ntstatus;
 		}
 	}
 
-	return ADS_SUCCESS;
+	return NT_STATUS_OK;
 }
 
 /****************************************************************
 ****************************************************************/
 
-static ADS_STATUS gpo_process_gpo_list_by_ext(ADS_STRUCT *ads,
-					      TALLOC_CTX *mem_ctx,
-					      const struct security_token *token,
-					      struct registry_key *root_key,
-					      struct GROUP_POLICY_OBJECT *gpo_list,
-					      const char *extensions_guid,
-					      uint32_t flags)
+static NTSTATUS gpo_process_gpo_list_by_ext(TALLOC_CTX *mem_ctx,
+					    const struct security_token *token,
+					    struct registry_key *root_key,
+					    struct GROUP_POLICY_OBJECT *gpo_list,
+					    const char *extensions_guid,
+					    uint32_t flags)
 {
-	ADS_STATUS status;
+	NTSTATUS status;
 	struct GROUP_POLICY_OBJECT *gpo;
 
 	for (gpo = gpo_list; gpo; gpo = gpo->next) {
@@ -522,44 +520,43 @@ static ADS_STATUS gpo_process_gpo_list_by_ext(ADS_STRUCT *ads,
 		 * extension, otherwise we cannot store the e.g. the *list* of
 		 * logon-scripts correctly (for more then one GPO) */
 
-		status = gpo_process_a_gpo(ads, mem_ctx, token, root_key,
+		status = gpo_process_a_gpo(mem_ctx, token, root_key,
 					   gpo, extensions_guid, flags);
 
-		if (!ADS_ERR_OK(status)) {
+		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(0,("failed to process gpo by ext: %s\n",
-				ads_errstr(status)));
+				nt_errstr(status)));
 			return status;
 		}
 	}
 
-	return ADS_SUCCESS;
+	return NT_STATUS_OK;
 }
 
 /****************************************************************
 ****************************************************************/
 
-ADS_STATUS gpo_process_gpo_list(ADS_STRUCT *ads,
-				TALLOC_CTX *mem_ctx,
-				const struct security_token *token,
-				struct GROUP_POLICY_OBJECT *gpo_list,
-				const char *extensions_guid_filter,
-				uint32_t flags)
+NTSTATUS gpo_process_gpo_list(TALLOC_CTX *mem_ctx,
+			      const struct security_token *token,
+			      struct GROUP_POLICY_OBJECT *gpo_list,
+			      const char *extensions_guid_filter,
+			      uint32_t flags)
 {
-	ADS_STATUS status = ADS_SUCCESS;
+	NTSTATUS status = NT_STATUS_OK;
 	struct gp_extension *gp_ext_list = NULL;
 	struct gp_extension *gp_ext = NULL;
 	struct registry_key *root_key = NULL;
 	struct gp_registry_context *reg_ctx = NULL;
 	WERROR werr;
 
-	status = ADS_ERROR_NT(init_gp_extensions(mem_ctx));
-	if (!ADS_ERR_OK(status)) {
+	status = init_gp_extensions(mem_ctx);
+	if (!NT_STATUS_IS_OK(status)) {
 		return status;
 	}
 
 	gp_ext_list = get_gp_extension_list();
 	if (!gp_ext_list) {
-		return ADS_ERROR_NT(NT_STATUS_DLL_INIT_FAILED);
+		return NT_STATUS_DLL_INIT_FAILED;
 	}
 
 	/* get the key here */
@@ -574,7 +571,7 @@ ADS_STATUS gpo_process_gpo_list(ADS_STRUCT *ads,
 	}
 	if (!W_ERROR_IS_OK(werr)) {
 		talloc_free(reg_ctx);
-		return ADS_ERROR_NT(werror_to_ntstatus(werr));
+		return werror_to_ntstatus(werr);
 	}
 
 	root_key = reg_ctx->curr_key;
@@ -585,7 +582,7 @@ ADS_STATUS gpo_process_gpo_list(ADS_STRUCT *ads,
 
 		guid_str = GUID_string(mem_ctx, gp_ext->guid);
 		if (!guid_str) {
-			status = ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
+			status = NT_STATUS_NO_MEMORY;
 			goto done;
 		}
 
@@ -599,10 +596,10 @@ ADS_STATUS gpo_process_gpo_list(ADS_STRUCT *ads,
 			gp_ext->name, guid_str));
 
 
-		status = gpo_process_gpo_list_by_ext(ads, mem_ctx, token,
+		status = gpo_process_gpo_list_by_ext(mem_ctx, token,
 						     root_key, gpo_list,
 						     guid_str, flags);
-		if (!ADS_ERR_OK(status)) {
+		if (!NT_STATUS_IS_OK(status)) {
 			goto done;
 		}
 	}
diff --git a/source3/libgpo/gpext/registry.c b/source3/libgpo/gpext/registry.c
index b0ec7b8..3b4c52d 100644
--- a/source3/libgpo/gpext/registry.c
+++ b/source3/libgpo/gpext/registry.c
@@ -269,8 +269,7 @@ done:
 /****************************************************************
 ****************************************************************/
 
-static NTSTATUS registry_process_group_policy(ADS_STRUCT *ads,
-					      TALLOC_CTX *mem_ctx,
+static NTSTATUS registry_process_group_policy(TALLOC_CTX *mem_ctx,
 					      uint32_t flags,
 					      struct registry_key *root_key,
 					      const struct security_token *token,
diff --git a/source3/libgpo/gpext/scripts.c b/source3/libgpo/gpext/scripts.c
index 0b67485..3850216 100644
--- a/source3/libgpo/gpext/scripts.c
+++ b/source3/libgpo/gpext/scripts.c
@@ -335,8 +335,7 @@ static WERROR scripts_apply(TALLOC_CTX *mem_ctx,
 /****************************************************************
 ****************************************************************/
 
-static NTSTATUS scripts_process_group_policy(ADS_STRUCT *ads,
-					     TALLOC_CTX *mem_ctx,
+static NTSTATUS scripts_process_group_policy(TALLOC_CTX *mem_ctx,
 					     uint32_t flags,
 					     struct registry_key *root_key,
 					     const struct security_token *token,
diff --git a/source3/libgpo/gpext/security.c b/source3/libgpo/gpext/security.c
index 2322bce..37d8e4f 100644
--- a/source3/libgpo/gpext/security.c
+++ b/source3/libgpo/gpext/security.c
@@ -140,8 +140,7 @@ static NTSTATUS gpttmpl_process(struct gp_inifile_context *ini_ctx,
 /****************************************************************
 ****************************************************************/
 
-static NTSTATUS security_process_group_policy(ADS_STRUCT *ads,
-					      TALLOC_CTX *mem_ctx,
+static NTSTATUS security_process_group_policy(TALLOC_CTX *mem_ctx,
 					      uint32_t flags,
 					      struct registry_key *root_key,
 					      const struct security_token *token,
diff --git a/source3/utils/net_ads_gpo.c b/source3/utils/net_ads_gpo.c
index 7c397e6..0a698da 100644
--- a/source3/utils/net_ads_gpo.c
+++ b/source3/utils/net_ads_gpo.c
@@ -433,8 +433,8 @@ static int net_ads_gpo_apply(struct net_context *c, int argc, const char **argv)
 		goto out;
 	}
 
-	status = gpo_process_gpo_list(ads, mem_ctx, token, gpo_list,
-				      filter, flags);
+	status = ADS_ERROR_NT(gpo_process_gpo_list(mem_ctx, token, gpo_list,
+						   filter, flags));
 	if (!ADS_ERR_OK(status)) {
 		d_printf("failed to process gpo list: %s\n",
 			ads_errstr(status));


-- 
Samba Shared Repository


More information about the samba-cvs mailing list