[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Tue Sep 25 21:49:02 MDT 2012


The branch, master has been updated
       via  3c4d0ce samba_dnsupdate: Safely update/create names for Samba3 targets as well
       via  6d7c651 samba_dnsupdate: Move to using tmpfile/rename to keep the dns_hosts_file consistent
       via  b320e7f selftest: Remove invalid security=share and rename secshare to simpleserver
      from  83f6067 Fix bug #9213 - Bad ASN.1 NegTokenInit packet can cause invalid free.

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


- Log -----------------------------------------------------------------
commit 3c4d0ce46995f82921f538757783fa7a678a7fc1
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Sep 26 10:02:43 2012 +1000

    samba_dnsupdate: Safely update/create names for Samba3 targets as well
    
    This avoids unlocked writes to the dns_hosts_file, and may fix some of our
    issues on the build farm where large numbers of tests fail due to failed name resolution.
    
    Andrew Bartlett
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Wed Sep 26 05:48:25 CEST 2012 on sn-devel-104

commit 6d7c651f2f61b481c1e1ade1e2e0e756ccef2210
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Sep 26 09:48:48 2012 +1000

    samba_dnsupdate: Move to using tmpfile/rename to keep the dns_hosts_file consistent
    
    This may be the cause of some of the large failure modes on the build farm.
    
    Andrew Bartlett

commit b320e7f93b5905558efa879992c125af66f0043c
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Sep 26 10:40:17 2012 +1000

    selftest: Remove invalid security=share and rename secshare to simpleserver
    
    This avoids the loadparm code failing due to the invalid smb.conf entry, and removes
    the very last hint of security=share!
    
    Andrew Bartlett

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

Summary of changes:
 selftest/target/Samba3.pm             |   24 +++++++++++++-----------
 source3/Makefile.in                   |    2 +-
 source3/selftest/tests.py             |    6 +++---
 source4/scripting/bin/samba_dnsupdate |   29 +++++++++++++++++++++++------
 4 files changed, 40 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index c1f8fbd..df8b55c 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -153,8 +153,8 @@ sub setup_env($$$)
 
 	if ($envname eq "s3dc") {
 		return $self->setup_s3dc("$path/s3dc");
-	} elsif ($envname eq "secshare") {
-		return $self->setup_secshare("$path/secshare");
+	} elsif ($envname eq "simpleserver") {
+		return $self->setup_simpleserver("$path/simpleserver");
 	} elsif ($envname eq "maptoguest") {
 		return $self->setup_maptoguest("$path/maptoguest");
 	} elsif ($envname eq "ktest") {
@@ -337,7 +337,7 @@ sub setup_admember($$$$)
 	return $ret;
 }
 
-sub setup_secshare($$)
+sub setup_simpleserver($$)
 {
 	my ($self, $path) = @_;
 	my $vfs_modulesdir_abs = $ENV{VFSLIBDIR};
@@ -346,8 +346,7 @@ sub setup_secshare($$)
 
 	my $prefix_abs = abs_path($path);
 
-	my $secshare_options = "
-	security = share
+	my $simpleserver_options = "
 	lanman auth = yes
 	vfs objects = $vfs_modulesdir_abs/xattr_tdb.so $vfs_modulesdir_abs/streams_depot.so
 
@@ -361,7 +360,7 @@ sub setup_secshare($$)
 	my $vars = $self->provision($path,
 				    "LOCALSHARE4",
 				    "local4pass",
-				    $secshare_options);
+				    $simpleserver_options);
 
 	$vars or return undef;
 
@@ -371,7 +370,7 @@ sub setup_secshare($$)
 	       return undef;
 	}
 
-	$self->{vars}->{secshare} = $vars;
+	$self->{vars}->{simpleserver} = $vars;
 
 	return $vars;
 }
@@ -1068,10 +1067,13 @@ domusers:X:$gid_domusers:
         }
 	print "DONE\n";
 
-	open(HOSTS, ">>$ENV{SELFTEST_PREFIX}/dns_host_file") or die("Unable to open $ENV{SELFTEST_PREFIX}/dns_host_file");
-	print HOSTS "A $server. $server_ip
-";
-	close(HOSTS);
+	open(DNS_UPDATE_LIST, ">$prefix/dns_update_list") or die("Unable to open $$prefix/dns_update_list");
+	print DNS_UPDATE_LIST "A $server. $server_ip";
+	close(DNS_UPDATE_LIST);
+
+        if (system("$ENV{SRCDIR_ABS}/source4/scripting/bin/samba_dnsupdate --all-interfaces --use-file=$dns_host_file -s $conffile --update-list=$prefix/dns_update_list --no-substiutions --no-credentials") != 0) {
+                die "Unable to update hostname into $dns_host_file";
+        }
 
 	$ret{SERVER_IP} = $server_ip;
 	$ret{NMBD_TEST_LOG} = "$prefix/nmbd_test.log";
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 2ad8ecc..0e72fea 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -3328,7 +3328,7 @@ test:: all torture timelimit
 		VFSLIBDIR="$(builddir)/bin" \
 		RUN_FROM_BUILD_FARM="$(RUN_FROM_BUILD_FARM)" \
 		SUBUNIT_FORMATTER="$(SUBUNIT_FORMATTER)" \
-		PERL="$(PERL)" PYTHON="$(PYTHON)" \
+		PERL="$(PERL)" PYTHON="$(PYTHON)" PYTHONPATH="$(srcdir)/../bin/python" \
 		$(srcdir)/selftest/s3-selftest.sh
 
 test-%:
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index f4a0d54..b07b690 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -104,7 +104,7 @@ for t in tests:
 
 tests = ["RW1", "RW2", "RW3"]
 for t in tests:
-    plantestsuite("samba3.smbtorture_s3.vfs_aio_fork(secshare).%s" % t, "secshare", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/vfs_aio_fork', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
+    plantestsuite("samba3.smbtorture_s3.vfs_aio_fork(simpleserver).%s" % t, "simpleserver", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/vfs_aio_fork', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
 
 posix_tests=[ "POSIX", "POSIX-APPEND"]
 
@@ -200,7 +200,7 @@ plantestsuite("samba3.ntlm_auth.krb5(ktest:local) old ccache", "ktest:local", [o
 plantestsuite("samba3.ntlm_auth.krb5(ktest:local)", "ktest:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_krb5.sh"), valgrindify(python), samba3srcdir, ntlm_auth, '$PREFIX/ktest/krb5_ccache-3', '$SERVER', configuration])
 
 
-for env in ["maptoguest", "secshare"]:
+for env in ["maptoguest", "simpleserver"]:
     plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) local creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient, configuration + " --option=clientntlmv2auth=no --option=clientlanmanauth=yes"])
 
 env = "maptoguest"
@@ -343,7 +343,7 @@ for t in tests:
         plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
     elif t == "raw.samba3hide" or t == "raw.samba3checkfsp" or t ==  "raw.samba3closeerr":
         plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
-        plansmbtorturetestsuite(t, "secshare", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
+        plansmbtorturetestsuite(t, "simpleserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
         plansmbtorturetestsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
     elif t == "raw.session" or t == "smb2.session":
         plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'plain')
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index d21496c..2f2c7b5 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -65,6 +65,7 @@ parser.add_option("--use-file", type="string", help="Use a file, rather than rea
 parser.add_option("--update-list", type="string", help="Add DNS names from the given file")
 parser.add_option("--fail-immediately", action='store_true', help="Exit on first failure")
 parser.add_option("--no-credentials", dest='nocreds', action='store_true', help="don't try and get credentials")
+parser.add_option("--no-substiutions", dest='nosubs', action='store_true', help="don't try and expands variables in file specified by --update-list")
 
 creds = None
 ccachename = None
@@ -278,10 +279,23 @@ def call_nsupdate(d):
         print "Calling nsupdate for %s" % d
 
     if opts.use_file is not None:
-        wfile = open(opts.use_file, 'a')
-        fcntl.lockf(wfile, fcntl.LOCK_EX)
+        try:
+            rfile = open(opts.use_file, 'r+')
+        except IOError:
+            # Perhaps create it
+            rfile = open(opts.use_file, 'w+')
+            # Open it for reading again, in case someone else got to it first
+            rfile = open(opts.use_file, 'r+')
+        fcntl.lockf(rfile, fcntl.LOCK_EX)
+        (file_dir, file_name) = os.path.split(opts.use_file)
+        (tmp_fd, tmpfile) = tempfile.mkstemp(dir=file_dir, prefix=file_name, suffix="XXXXXX")
+        wfile = os.fdopen(tmp_fd, 'a')
+        rfile.seek(0)
+        for line in rfile:
+            wfile.write(line)
         wfile.write(str(d)+"\n")
-        fcntl.lockf(wfile, fcntl.LOCK_UN)
+        os.rename(tmpfile, opts.use_file)
+        fcntl.lockf(rfile, fcntl.LOCK_UN)
         return
 
     normalised_name = d.name.rstrip('.') + '.'
@@ -425,10 +439,13 @@ os.environ['KRB5_CONFIG'] = krb5conf
 
 file = open(dns_update_list, "r")
 
-samdb = SamDB(url=lp.samdb_url(), session_info=system_session(), lp=lp)
+if opts.nosubs:
+    sub_vars = {}
+else:
+    samdb = SamDB(url=lp.samdb_url(), session_info=system_session(), lp=lp)
 
-# get the substitution dictionary
-sub_vars = get_subst_vars(samdb)
+    # get the substitution dictionary
+    sub_vars = get_subst_vars(samdb)
 
 # build up a list of update commands to pass to nsupdate
 update_list = []


-- 
Samba Shared Repository


More information about the samba-cvs mailing list