[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Fri Apr 12 05:42:04 UTC 2019


The branch, master has been updated
       via  bfd762b53ab selftest: rename schemaupgrade_dc (+pair) to schema_dc
       via  c9e6331afc1 ndrdump: change behaviour of flags to operate as flags
       via  10dd15010bd ndrdump: Remove local variables for pipes
       via  075a078d365 ldb: Avoid calling talloc_get_type() in ldb_kv_parse_data_unpack()
      from  fccd9c8c94e utils: Move conn_tdb.c to utils/

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


- Log -----------------------------------------------------------------
commit bfd762b53ab681909a8a0b413cce4243271db749
Author: Garming Sam <garming at samba.org>
Date:   Fri Apr 12 03:31:29 2019 +0200

    selftest: rename schemaupgrade_dc (+pair) to schema_dc
    
    This is needed because the name of the autobuild job and
    the name of the selftest env end up in the socket path
    for ncalrpc sockets.
    
    The challenge is that (for example)
    /memdisk/autobuild/fl/b2424063/samba-schemaupgrade/bin/ab/schemaupgrade_pair_dc/ncalrpc/np/protected_storage
    does not fit in a struct sockaddr_un.
    
    Signed-off-by: Garming Sam <garming at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Fri Apr 12 05:41:36 UTC 2019 on sn-devel-144

commit c9e6331afc1ee0e85a9582c6682ff95885135792
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 12 15:10:35 2019 +1200

    ndrdump: change behaviour of flags to operate as flags
    
    These are called flags because that is what they become to the ndr_pull function,
    but to avoid total confusion treat them as flags generally even if the values are
    always exclusive (at the moment).
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit 10dd15010bddb929128b3585f1280ae1eb7b6b99
Author: Michael Hanselmann <public at hansmi.ch>
Date:   Thu Apr 4 00:04:23 2019 +0200

    ndrdump: Remove local variables for pipes
    
    There's no need for the local variables as the NDR call structure
    pointer is kept around anyway.
    
    Signed-off-by: Michael Hanselmann <public at hansmi.ch>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 075a078d3655e4101021f47842b56d2dc755d092
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 12 11:26:01 2019 +1200

    ldb: Avoid calling talloc_get_type() in ldb_kv_parse_data_unpack()
    
    We have the ldb_kv in the caller, just fill it into the context and
    so avoid the cost of the talloc_get_type().
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>

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

Summary of changes:
 lib/ldb/ldb_key_value/ldb_kv_search.c |  7 ++++---
 librpc/tools/ndrdump.c                | 20 ++++++++------------
 script/autobuild.py                   |  8 ++++----
 selftest/target/README                |  4 ++--
 selftest/target/Samba4.pm             | 12 ++++++------
 source4/selftest/tests.py             | 10 +++++-----
 6 files changed, 29 insertions(+), 32 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/ldb_key_value/ldb_kv_search.c b/lib/ldb/ldb_key_value/ldb_kv_search.c
index a2946d6506b..a7e532e41ac 100644
--- a/lib/ldb/ldb_key_value/ldb_kv_search.c
+++ b/lib/ldb/ldb_key_value/ldb_kv_search.c
@@ -177,6 +177,7 @@ int ldb_kv_search_base(struct ldb_module *module,
 struct ldb_kv_parse_data_unpack_ctx {
 	struct ldb_message *msg;
 	struct ldb_module *module;
+	struct ldb_kv_private *ldb_kv;
 	unsigned int unpack_flags;
 };
 
@@ -190,8 +191,7 @@ static int ldb_kv_parse_data_unpack(struct ldb_val key,
 	struct ldb_context *ldb = ldb_module_get_ctx(ctx->module);
 	struct ldb_val data_parse = data;
 
-	struct ldb_kv_private *ldb_kv =
-	    talloc_get_type(ldb_module_get_private(ctx->module), struct ldb_kv_private);
+	struct ldb_kv_private *ldb_kv = ctx->ldb_kv;
 
 	if ((ctx->unpack_flags & LDB_UNPACK_DATA_FLAG_NO_DATA_ALLOC)) {
 		if ((ldb_kv->kv_ops->options & LDB_KV_OPTION_STABLE_READ_LOCK) &&
@@ -266,7 +266,8 @@ int ldb_kv_search_key(struct ldb_module *module,
 	struct ldb_kv_parse_data_unpack_ctx ctx = {
 		.msg = msg,
 		.module = module,
-		.unpack_flags = unpack_flags
+		.unpack_flags = unpack_flags,
+		.ldb_kv = ldb_kv
 	};
 
 	memset(msg, 0, sizeof(*msg));
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index e26d3719429..ef7f9c66139 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -201,7 +201,7 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
 	struct ndr_pull *ndr_pull;
 	struct ndr_print *ndr_print;
 	TALLOC_CTX *mem_ctx;
-	int flags;
+	int flags = 0;
 	poptContext pc;
 	NTSTATUS status;
 	enum ndr_err_code ndr_err;
@@ -229,8 +229,6 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
 		POPT_COMMON_VERSION
 		{ NULL }
 	};
-	const struct ndr_interface_call_pipes *in_pipes = NULL;
-	const struct ndr_interface_call_pipes *out_pipes = NULL;
 	uint32_t highest_ofs;
 	struct dcerpc_sec_verification_trailer *sec_vt = NULL;
 	
@@ -318,12 +316,10 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
 
 	if (strcmp(inout, "in") == 0 ||
 	    strcmp(inout, "request") == 0) {
-		flags = NDR_IN;
-		in_pipes = &f->in_pipes;
+		flags |= NDR_IN;
 	} else if (strcmp(inout, "out") == 0 ||
 		   strcmp(inout, "response") == 0) {
-		flags = NDR_OUT;
-		out_pipes = &f->out_pipes;
+		flags |= NDR_OUT;
 	} else {
 		printf("Bad inout value '%s'\n", inout);
 		exit(1);
@@ -344,7 +340,7 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
 	}
 
 	if (ctx_filename) {
-		if (flags == NDR_IN) {
+		if (flags & NDR_IN) {
 			printf("Context file can only be used for \"out\" packages\n");
 			exit(1);
 		}
@@ -445,8 +441,8 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
 	}
 	TALLOC_FREE(sec_vt);
 
-	if (out_pipes) {
-		status = ndrdump_pull_and_print_pipes(function, ndr_pull, ndr_print, out_pipes);
+	if (flags & NDR_OUT) {
+		status = ndrdump_pull_and_print_pipes(function, ndr_pull, ndr_print, &f->out_pipes);
 		if (!NT_STATUS_IS_OK(status)) {
 			printf("dump FAILED\n");
 			exit(1);
@@ -483,8 +479,8 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
 		exit(1);
 	}
 
-	if (in_pipes) {
-		status = ndrdump_pull_and_print_pipes(function, ndr_pull, ndr_print, in_pipes);
+	if (flags & NDR_IN) {
+		status = ndrdump_pull_and_print_pipes(function, ndr_pull, ndr_print, &f->in_pipes);
 		if (!NT_STATUS_IS_OK(status)) {
 			printf("dump FAILED\n");
 			exit(1);
diff --git a/script/autobuild.py b/script/autobuild.py
index 13ea568237e..e1aea054e1f 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -132,8 +132,8 @@ tasks = {
                  "--exclude-env=rodc "
                  "--exclude-env=ad_dc_default "
                  "--exclude-env=ad_dc_slowtests "
-                 "--exclude-env=schemaupgrade_pair_dc "
-                 "--exclude-env=schemaupgrade_dc "
+                 "--exclude-env=schema_pair_dc "
+                 "--exclude-env=schema_dc "
                  "'",
                  "text/plain"),
                 ("install", "make install", "text/plain"),
@@ -245,8 +245,8 @@ tasks = {
                         ("make", "make -j", "text/plain"),
                         ("test", "make test FAIL_IMMEDIATELY=1 "
                          "TESTS='"
-                         "--include-env=schemaupgrade_dc "
-                         "--include-env=schemaupgrade_pair_dc "
+                         "--include-env=schema_dc "
+                         "--include-env=schema_pair_dc "
                          "'", "text/plain"),
                         ("check-clean-tree", "script/clean-source-tree.sh", "text/plain")],
 
diff --git a/selftest/target/README b/selftest/target/README
index acdbb421d27..81d744759e6 100644
--- a/selftest/target/README
+++ b/selftest/target/README
@@ -129,9 +129,9 @@ allowed processes artificially low, to test that new connections are refused
 correctly.  Due to the limited number of connections accepted, it's not
 recommended to use this testenv for anything else.
 
-schemaupgrade_dc
+schema_dc
 ----------------
-This is a 2-DC testenv setup (schemaupgrade_dc and schemaupgrade_pair_dc).
+This is a 2-DC testenv setup (schema_dc and schema_pair_dc).
 We provision the first DC, and join the second, using an older version of the
 schema (2008R2), then start-up Samba. Then, we run a schema upgrade (i.e.
 'samba-tool domain schemaupgrade') on the PDC.
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 7c1671d4007..6f4a31d357a 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -2267,14 +2267,14 @@ sub check_env($$)
 	ad_dc_slowtests      => ["ad_dc_ntvfs"],
 	ad_dc_backup         => ["ad_dc"],
 
-	schemaupgrade_dc      => ["dns_hub"],
-	schemaupgrade_pair_dc => ["schemaupgrade_dc"],
+	schema_dc      => ["dns_hub"],
+	schema_pair_dc => ["schema_dc"],
 
 	none                 => [],
 );
 
 %Samba4::ENV_DEPS_POST = (
-	schemaupgrade_dc => ["schemaupgrade_pair_dc"],
+	schema_dc => ["schema_pair_dc"],
 );
 
 sub return_alias_env
@@ -2791,7 +2791,7 @@ sub setup_proclimitdc
 }
 
 # Used to test a live upgrade of the schema on a 2 DC network.
-sub setup_schemaupgrade_dc
+sub setup_schema_dc
 {
 	my ($self, $path) = @_;
 
@@ -2819,9 +2819,9 @@ sub setup_schemaupgrade_dc
 }
 
 # the second DC in the live schema upgrade pair
-sub setup_schemaupgrade_pair_dc
+sub setup_schema_pair_dc
 {
-	# note: dcvars contains the env info for the dependent testenv ('schemaupgrade_dc')
+	# note: dcvars contains the env info for the dependent testenv ('schema_dc')
 	my ($self, $prefix, $dcvars) = @_;
 	print "Preparing SCHEMA UPGRADE PAIR DC...\n";
 
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 6fc5471924b..12e8538315e 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -675,7 +675,7 @@ planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.ou")
 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.computer")
 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.forest")
 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.schema")
-planpythontestsuite("schemaupgrade_dc:local", "samba.tests.samba_tool.schema")
+planpythontestsuite("schema_dc:local", "samba.tests.samba_tool.schema")
 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.ntacl")
 planpythontestsuite("none", "samba.tests.samba_tool.provision_password_check")
 planpythontestsuite("none", "samba.tests.samba_tool.help")
@@ -839,7 +839,7 @@ plantestsuite("samba4.sam.python(fl2008r2dc)", "fl2008r2dc", [python, os.path.jo
 plantestsuite("samba4.sam.python(ad_dc_default)", "ad_dc_default", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sam.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
 plantestsuite("samba4.user_account_control.python(ad_dc_default)", "ad_dc_default", [python, os.path.join(samba4srcdir, "dsdb/tests/python/user_account_control.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'])
 
-for env in ['ad_dc_default:local', 'schemaupgrade_dc:local']:
+for env in ['ad_dc_default:local', 'schema_dc:local']:
     planoldpythontestsuite(env, "dsdb_schema_info",
                            extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')],
                            name="samba4.schemaInfo.python(%s)" % (env),
@@ -909,7 +909,7 @@ planoldpythontestsuite("ad_dc_default", "password_settings",
                        name="samba4.ldap.passwordsettings.python",
                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
 
-for env in all_fl_envs + ["schemaupgrade_dc"]:
+for env in all_fl_envs + ["schema_dc"]:
     plantestsuite_loadlist("samba4.ldap_schema.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/ldap_schema.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
     plantestsuite("samba4.ldap.possibleInferiors.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/samdb/ldb_modules/tests/possibleinferiors.py"), "ldap://$SERVER", '-U"$USERNAME%$PASSWORD"', "-W$DOMAIN"])
     plantestsuite_loadlist("samba4.ldap.secdesc.python(%s)" % env, env, [python, os.path.join(samba4srcdir, "dsdb/tests/python/sec_descriptor.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
@@ -1010,7 +1010,7 @@ planoldpythontestsuite(env, "ridalloc_exop",
                        environ={'DC1': "$DC_SERVER", 'DC2': '$SERVER'},
                        extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
 
-env = 'schemaupgrade_pair_dc'
+env = 'schema_pair_dc'
 planoldpythontestsuite("%s:local" % env, "samba_tool_drs",
                        extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
                        name="samba4.drs.samba_tool_drs.python(%s)" % env,
@@ -1171,7 +1171,7 @@ for env in [
 planpythontestsuite("ad_dc_default:local", "samba.tests.kcc.kcc_utils")
 
 for env in ["simpleserver", "fileserver", "nt4_dc", "ad_dc", "ad_dc_ntvfs",
-            "ad_member", "offlinebackupdc", "restoredc", "renamedc", "labdc", 'schemaupgrade_pair_dc']:
+            "ad_member", "offlinebackupdc", "restoredc", "renamedc", "labdc", 'schema_pair_dc']:
     planoldpythontestsuite(env, "netlogonsvc",
                            extra_path=[os.path.join(srcdir(), 'python/samba/tests')],
                            name="samba.tests.netlogonsvc.python(%s)" % env)


-- 
Samba Shared Repository



More information about the samba-cvs mailing list