[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Tue Dec 13 17:17:03 MST 2011


The branch, master has been updated
       via  079d157 s4-resolv: fix dns_ex so as to fail correctly when a name does not exist
       via  8a4b5cd s4-selftest: Add test of RPC to a netbios alias
       via  abed965 s4-selftest Give local.resolve a real name to look up
      from  b87e887 s3: Fix examples/VFS build

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


- Log -----------------------------------------------------------------
commit 079d1572c2e9c3a349ad63514034673d07b1a557
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Dec 13 17:22:34 2011 +1100

    s4-resolv: fix dns_ex so as to fail correctly when a name does not exist
    
    Without this, netbios name lookups do not work, as we never fall back to them.
    
    This caused segfaults from e38d97e0424f7e5b21c8b7ac0b1f1bac33f19d69 to
    251209bd6f6e66ca9bcf28cd652d85d1cd729fdc and then name lookup failure
    or timeouts until this patch.
    
    Andrew Bartlett
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Wed Dec 14 01:16:37 CET 2011 on sn-devel-104

commit 8a4b5cdfea7b2370b9d700e7dbdaa8143cfc972c
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Dec 13 15:43:35 2011 +1100

    s4-selftest: Add test of RPC to a netbios alias
    
    This tries to ensure our netbios lookup code is still run.
    
    Andrew Bartlett

commit abed96535e0e47692be483cb35fc8b6224a0899d
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Dec 14 06:55:53 2011 +1100

    s4-selftest Give local.resolve a real name to look up

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

Summary of changes:
 selftest/target/Samba4.pm       |    5 ++---
 source4/libcli/resolve/dns_ex.c |    9 +++++++++
 source4/selftest/tests.py       |    4 +++-
 3 files changed, 14 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 9419921..fa7988f 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -1119,15 +1119,14 @@ sub provision_dc($$)
 				   "2008",
 				   21,
 				   "locDCpass1",
-				   undef, "netbios aliases = DC1");
+				   undef, "netbios aliases = localDC1-a");
 
 	return undef unless(defined $ret);
 	unless($self->add_wins_config("$prefix/private")) {
 		warn("Unable to add wins configuration");
 		return undef;
 	}
-
-	$ret->{NETBIOSALIAS} = "DC1";
+	$ret->{NETBIOSALIAS} = "localdc1-a";
 	$ret->{DC_SERVER} = $ret->{SERVER};
 	$ret->{DC_SERVER_IP} = $ret->{SERVER_IP};
 	$ret->{DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c
index 9467521..4f46235 100644
--- a/source4/libcli/resolve/dns_ex.c
+++ b/source4/libcli/resolve/dns_ex.c
@@ -393,6 +393,12 @@ static void run_child_dns_lookup(struct dns_ex_state *state, int fd)
 		c = get_a_aaaa_records(state, state->name.name, state->port);
 	}
 
+	/* This line in critical - if we return without writing to the
+	 * pipe, this is the signal that the name did not exist */
+	if (c.count == 0) {
+		goto done;
+	}
+
 	addrs = talloc_strdup(state, "");
 	if (!addrs) {
 		goto done;
@@ -521,6 +527,9 @@ static void pipe_handler(struct tevent_context *ev, struct tevent_fd *fde,
 	}
 
 	if (ret <= 0) {
+		/* The check for ret == 0 here is important, if the
+		 * name does not exist, then no bytes are written to
+		 * the pipe */
 		DEBUG(3,("dns child failed to find name '%s' of type %s\n",
 			 state->name.name, (state->flags & RESOLVE_NAME_FLAG_DNS_SRV)?"SRV":"A"));
 		composite_error(c, NT_STATUS_OBJECT_NAME_NOT_FOUND);
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 9bb622b..82f0ae9 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -276,7 +276,8 @@ plansmbtorturetestsuite('echo.udp', 'dc:local', '//$SERVER/whatever')
 
 # Local tests
 for t in smb4torture_testsuites("local."):
-    plansmbtorturetestsuite(t, "none", "ncalrpc:")
+    #The local.resolve test needs a name to look up using real system (not emulated) name routines
+    plansmbtorturetestsuite(t, "none", "ncalrpc:localhost")
 
 # Confirm these tests with the system iconv too
 for t in ["local.convert_string_handle", "local.convert_string", "local.ndr"]:
@@ -323,6 +324,7 @@ plantestsuite("samba4.blackbox.gentest(dc)", "dc", [os.path.join(samba4srcdir, "
 plantestsuite("samba4.blackbox.wbinfo(dc:local)", "dc:local", [os.path.join(samba4srcdir, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$USERNAME', '$PASSWORD', "dc"])
 plantestsuite("samba4.blackbox.wbinfo(s4member:local)", "s4member:local", [os.path.join(samba4srcdir, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', "s4member"])
 plantestsuite("samba4.blackbox.chgdcpass(dc)", "dc", [os.path.join(bbdir, "test_chgdcpass.sh"), '$SERVER', "LOCALDC\$", '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", '$SELFTEST_PREFIX/dc'])
+plantestsuite_loadlist("samba4.rpc.echo against NetBIOS alias", "dc", [valgrindify(smb4torture), "$LISTOPT", 'ncacn_np:$NETBIOSALIAS', '-U$DOMAIN/$USERNAME%$PASSWORD', 'rpc.echo'])
 
 # Tests using the "Simple" NTVFS backend
 for t in ["base.rw1"]:


-- 
Samba Shared Repository


More information about the samba-cvs mailing list