[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Tue May 9 03:19:02 UTC 2017


The branch, master has been updated
       via  8c87d4e s3-gpo: Build scripts, security and registry CSE with --enable-developer
       via  b6d2017 s3-gpo: Fix build of scripts CSE
      from  24d43f8 WHATSNEW: Add new 'net tdb locking' command

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


- Log -----------------------------------------------------------------
commit 8c87d4eedc123ba000a536666b961f589581f8c4
Author: G√ľnther Deschner <gd at samba.org>
Date:   Thu May 4 15:07:14 2017 +0200

    s3-gpo: Build scripts, security and registry CSE with --enable-developer
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Tue May  9 05:18:52 CEST 2017 on sn-devel-144

commit b6d2017467b59a5929a21b53fff52542d3dee9de
Author: G√ľnther Deschner <gd at samba.org>
Date:   Thu May 4 15:06:39 2017 +0200

    s3-gpo: Fix build of scripts CSE
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

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

Summary of changes:
 source3/libgpo/gpext/registry.c |  2 ++
 source3/libgpo/gpext/scripts.c  | 41 ++++++++++++++++++++++++-----------------
 source3/libgpo/gpext/security.c |  2 ++
 source3/wscript                 |  1 +
 4 files changed, 29 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libgpo/gpext/registry.c b/source3/libgpo/gpext/registry.c
index 088701a..4a0d0cf 100644
--- a/source3/libgpo/gpext/registry.c
+++ b/source3/libgpo/gpext/registry.c
@@ -37,6 +37,8 @@
 
 static TALLOC_CTX *ctx = NULL;
 
+NTSTATUS gpext_registry_init(TALLOC_CTX *mem_ctx);
+
 /****************************************************************
 ****************************************************************/
 
diff --git a/source3/libgpo/gpext/scripts.c b/source3/libgpo/gpext/scripts.c
index 3f2c514..de66413 100644
--- a/source3/libgpo/gpext/scripts.c
+++ b/source3/libgpo/gpext/scripts.c
@@ -44,6 +44,8 @@
 #define GP_SCRIPTS_REG_VAL_PARAMETERS "Parameters"
 #define GP_SCRIPTS_REG_VAL_EXECTIME "ExecTime"
 
+NTSTATUS gpext_scripts_init(TALLOC_CTX *mem_ctx);
+
 static TALLOC_CTX *ctx = NULL;
 
 /****************************************************************
@@ -83,7 +85,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 +99,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 +131,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 +159,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 +182,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 +205,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);
diff --git a/source3/libgpo/gpext/security.c b/source3/libgpo/gpext/security.c
index 3650f4c..29e7bb7 100644
--- a/source3/libgpo/gpext/security.c
+++ b/source3/libgpo/gpext/security.c
@@ -42,6 +42,8 @@
 #define GPTTMPL_SECTION_FILE_SECURITY		"File Security"
 #define GPTTMPL_SECTION_SERVICE_GENERAL_SETTING "Service General Setting"
 
+NTSTATUS gpext_security_init(TALLOC_CTX *mem_ctx);
+
 static TALLOC_CTX *ctx = NULL;
 
 struct gpttmpl_table {
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'))


-- 
Samba Shared Repository



More information about the samba-cvs mailing list