[PATCH] build group policy client extensions for --enable-developer at least

Günther Deschner gd at samba.org
Fri May 5 15:59:47 UTC 2017


Hi,

please review and push.

Thanks,
Guentherg
-- 
Günther Deschner                    GPG-ID: 8EE11688
Red Hat                         gdeschner at redhat.com
Samba Team                              gd at samba.org
-------------- next part --------------
From 8b012b2a4b43e347a9860de4418064825439ac01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Thu, 4 May 2017 15:06:39 +0200
Subject: [PATCH 1/2] s3-gpo: Fix build of scripts CSE

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
---
 source3/libgpo/gpext/scripts.c | 39 ++++++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 17 deletions(-)

diff --git a/source3/libgpo/gpext/scripts.c b/source3/libgpo/gpext/scripts.c
index 3f2c514..ccd1712 100644
--- a/source3/libgpo/gpext/scripts.c
+++ b/source3/libgpo/gpext/scripts.c
@@ -83,7 +83,7 @@ static NTSTATUS generate_gp_registry_entry(TALLOC_CTX *mem_ctx,
 					   const char *key,
 					   const char *value,
 					   uint32_t data_type,
-					   const void *data_p,
+					   DATA_BLOB *blob,
 					   enum gp_reg_action action,
 					   struct gp_registry_entry **entry_out)
 {
@@ -97,19 +97,7 @@ static NTSTATUS generate_gp_registry_entry(TALLOC_CTX *mem_ctx,
 	NT_STATUS_HAVE_NO_MEMORY(data);
 
 	data->type = data_type;
-	switch (data->type) {
-		case REG_QWORD:
-			data->data = data_blob_talloc(mem_ctx, NULL, 8);
-			SBVAL(data->data.data, 0, *(uint64_t *)data_p);
-			break;
-		case REG_SZ:
-			if (!push_reg_sz(mem_ctx, &data->data, (const char *)data_p)) {
-				return NT_STATUS_NO_MEMORY;
-			}
-			break;
-		default:
-			return NT_STATUS_NOT_SUPPORTED;
-	}
+	data->data = *blob;
 
 	entry->key = key;
 	entry->data = data;
@@ -141,6 +129,8 @@ static NTSTATUS scripts_parse_ini_section(struct gp_inifile_context *ini_ctx,
 		const char *script = NULL;
 		const char *count = NULL;
 		const char *parameters = NULL;
+		DATA_BLOB blob;
+		bool ok;
 
 		count = talloc_asprintf(ini_ctx->mem_ctx, "%d", i);
 		NT_STATUS_HAVE_NO_MEMORY(count);
@@ -167,11 +157,17 @@ static NTSTATUS scripts_parse_ini_section(struct gp_inifile_context *ini_ctx,
 
 		{
 			struct gp_registry_entry *entry = NULL;
+
+			ok = push_reg_sz(ini_ctx->mem_ctx, &blob, script);
+			if (!ok) {
+				return NT_STATUS_NO_MEMORY;
+			}
+
 			status = generate_gp_registry_entry(ini_ctx->mem_ctx,
 							    count,
 							    GP_SCRIPTS_REG_VAL_SCRIPT,
 							    REG_SZ,
-							    script,
+							    &blob,
 							    GP_REG_ACTION_ADD_VALUE,
 							    &entry);
 			NT_STATUS_NOT_OK_RETURN(status);
@@ -184,11 +180,17 @@ static NTSTATUS scripts_parse_ini_section(struct gp_inifile_context *ini_ctx,
 		}
 		{
 			struct gp_registry_entry *entry = NULL;
+
+			ok = push_reg_sz(ini_ctx->mem_ctx, &blob, parameters);
+			if (!ok) {
+				return NT_STATUS_NO_MEMORY;
+			}
+
 			status = generate_gp_registry_entry(ini_ctx->mem_ctx,
 							    count,
 							    GP_SCRIPTS_REG_VAL_PARAMETERS,
 							    REG_SZ,
-							    parameters,
+							    &blob,
 							    GP_REG_ACTION_ADD_VALUE,
 							    &entry);
 			NT_STATUS_NOT_OK_RETURN(status);
@@ -201,11 +203,14 @@ static NTSTATUS scripts_parse_ini_section(struct gp_inifile_context *ini_ctx,
 		}
 		{
 			struct gp_registry_entry *entry = NULL;
+
+			blob = data_blob_talloc_zero(ini_ctx->mem_ctx, 8);
+
 			status = generate_gp_registry_entry(ini_ctx->mem_ctx,
 							    count,
 							    GP_SCRIPTS_REG_VAL_EXECTIME,
 							    REG_QWORD,
-							    0,
+							    &blob,
 							    GP_REG_ACTION_ADD_VALUE,
 							    &entry);
 			NT_STATUS_NOT_OK_RETURN(status);
-- 
2.9.3


From 4c1e211be7185669cb6a7ae9b91365fc72358025 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Thu, 4 May 2017 15:07:14 +0200
Subject: [PATCH 2/2] s3-gpo: Build scripts, security and registry CSE with
 --enable-developer

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
---
 source3/wscript | 1 +
 1 file changed, 1 insertion(+)

diff --git a/source3/wscript b/source3/wscript
index e9705b9..5a3749c 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1699,6 +1699,7 @@ main() {
         default_shared_modules.extend(TO_LIST('vfs_skel_opaque vfs_skel_transparent vfs_shadow_copy_test'))
         default_shared_modules.extend(TO_LIST('auth_skel pdb_test'))
         default_shared_modules.extend(TO_LIST('vfs_fake_dfq'))
+        default_shared_modules.extend(TO_LIST('gpext_security gpext_registry gpext_scripts'))
 
     if Options.options.enable_selftest or Options.options.developer:
         default_shared_modules.extend(TO_LIST('vfs_fake_acls vfs_nfs4acl_xattr'))
-- 
2.9.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 201 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170505/0810aaa6/signature.sig>


More information about the samba-technical mailing list