[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Mon Feb 21 23:10:02 MST 2011


The branch, master has been updated
       via  5590ac2 selftest the raw.mux test is flaky:
       via  e3821f2 s4-auth Move libcli/security/session.c to the top level
       via  d7fa349 s3:auth: change num_groups to from size_t to uint32_t
       via  2e69e89 s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
       via  985c7da selftest: Improve gdb_backtrace to run in batch mode
       via  6c1ce36 selftest pass in srcdir into Samba3 target module
       via  b73cfab smbtorture Remove random file name before we start RW2
       via  a82d9e4 s3-selftest convert tests.sh to python
       via  0b066b8 selftest split $PERL into multiple arguments for Test::More check
       via  a056792 selftest move selftesthelpers to a top level helper script
       via  56c28d1 s3-tests use $PREFIX to ensure tests don't work outside the test area
       via  1650da8 Add tests for various s3 auth modes
      from  c43eb39 build: added WHYNEEDED=TARGET:DEPENDENCY

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


- Log -----------------------------------------------------------------
commit 5590ac257f8656858946c38f7adefcd877182379
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Feb 22 13:37:06 2011 +1100

    selftest the raw.mux test is flaky:
    
    TESTING MULTIPLEXED LOCK/LOCK/UNLOCK
    establishing a lock
    the second lock will conflict with the first
    this will too, but we'll unlock while waiting
    unlock the first range
    recv the async reply
    async lock took 265.40 msec
    failed to trigger early lock retry
    UNEXPECTED(error): samba3.posix_s3.raw.mux.mux
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Tue Feb 22 07:09:07 CET 2011 on sn-devel-104

commit e3821f2c40691cc747d887bac14d4e3d37f0763b
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Feb 10 20:21:11 2011 +1100

    s4-auth Move libcli/security/session.c to the top level
    
    This code is now useful in common, as the elements of the
    auth_session_info structure have now been defined in common IDL.
    
    Andrew Bartlett

commit d7fa34905223ebbf02dadcea0720062a30c3bbab
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 21 10:30:28 2011 +0100

    s3:auth: change num_groups to from size_t to uint32_t
    
    This will help with the change from UNIX_USER_TOKEN to security_unix_token
    
    metze

commit 2e69e894566d32001120d76d7ba58cdacb56d279
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Feb 21 10:25:52 2011 +0100

    s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
    
    These variables, of type struct auth_serversupplied_info were poorly
    named when added into 2001, and in good consistant practice, this has
    extended all over the codebase in the years since.
    
    The structure is also not ideal for it's current purpose.  Originally
    intended to convey the results of the authentication modules, it
    really describes all the essential attributes of a session.  This
    rename will reduce the volume of a future patch to replaced these with
    a struct auth_session_info, with auth_serversupplied_info confined to
    the lower levels of the auth subsystem, and then eliminated.
    
    (The new structure will be the output of create_local_token(), and the
    change in struct definition will ensure that this is always run, populating
    local groups and privileges).
    
    Andrew Bartlett
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 985c7da604ac30e67ee4b5a829935074900d6f26
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Feb 22 12:28:33 2011 +1100

    selftest: Improve gdb_backtrace to run in batch mode
    
    Following Tridge's advice, we need to have no input (/dev/null) and
    -batch for reliable opeation on big backtraces.
    
    We should also use --pid, and let gdb find the binary
    
    Andrew Bartlett

commit 6c1ce36ec97525774aaba294f48fbd6fab15a80e
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Feb 22 11:56:18 2011 +1100

    selftest pass in srcdir into Samba3 target module

commit b73cfabdf5cc28a91a72df8b64cf57021e08f0b0
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Feb 22 11:21:53 2011 +1100

    smbtorture Remove random file name before we start RW2

commit a82d9e4e72d624916b1e12393a73a4d79ae080d2
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Feb 21 16:01:44 2011 +1100

    s3-selftest convert tests.sh to python
    
    This should allow us a much better chance of invoking the subunit
    wrappers in the right way, at the right level.
    
    Andrew Bartlett

commit 0b066b88dfbcc612089cdb5d971b7bb1bb7542ed
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Feb 22 09:17:05 2011 +1100

    selftest split $PERL into multiple arguments for Test::More check

commit a05679229438abb454660550b6d107ef4b6b6339
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Feb 21 11:16:03 2011 +1100

    selftest move selftesthelpers to a top level helper script

commit 56c28d1cfb06688f77a87fb2af0609c72db829bc
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Feb 21 09:10:33 2011 +1100

    s3-tests use $PREFIX to ensure tests don't work outside the test area
    
    Andrew Bartlett

commit 1650da8a9964ba2ca3d389bdb39f65f7fa579ffc
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Feb 18 18:52:00 2011 +1100

    Add tests for various s3 auth modes

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

Summary of changes:
 lib/util/util.h                                    |    4 +-
 lib/util/util_id.c                                 |    4 +-
 libcli/security/security.h                         |    1 +
 {source4/libcli => libcli}/security/session.c      |    3 +-
 {source4/libcli => libcli}/security/session.h      |   21 +-
 libcli/security/wscript_build                      |    2 +-
 selftest/gdb_backtrace                             |    5 +-
 selftest/selftest.pl                               |    3 +-
 selftest/selftesthelpers.py                        |  157 +++++++++
 selftest/target/Samba3.pm                          |   63 +++-
 source3/auth/auth_ntlmssp.c                        |   10 +-
 source3/auth/auth_util.c                           |   32 +-
 source3/auth/server_info.c                         |    2 +-
 source3/auth/token_util.c                          |    8 +-
 source3/include/ntdomain.h                         |    2 +-
 source3/include/passdb.h                           |    2 +-
 source3/include/proto.h                            |   30 +-
 source3/include/smb.h                              |    8 +-
 source3/lib/afs.c                                  |   10 +-
 source3/lib/substitute.c                           |    4 +-
 source3/lib/system_smbd.c                          |    4 +-
 source3/librpc/rpc/dcerpc_ep.c                     |    2 +-
 source3/modules/onefs_open.c                       |    6 +-
 source3/modules/vfs_acl_common.c                   |    4 +-
 source3/modules/vfs_expand_msdfs.c                 |    8 +-
 source3/modules/vfs_fake_perms.c                   |    8 +-
 source3/modules/vfs_full_audit.c                   |    8 +-
 source3/modules/vfs_readonly.c                     |    2 +-
 source3/modules/vfs_recycle.c                      |    8 +-
 source3/modules/vfs_smb_traffic_analyzer.c         |   10 +-
 source3/passdb/pdb_interface.c                     |   10 +-
 source3/passdb/pdb_ldap.c                          |    8 +-
 source3/printing/nt_printing.c                     |   48 ++--
 source3/printing/nt_printing_ads.c                 |   32 +-
 source3/printing/nt_printing_migrate.c             |    8 +-
 source3/printing/printspoolss.c                    |    6 +-
 source3/rpc_client/cli_winreg_int.c                |    4 +-
 source3/rpc_client/cli_winreg_int.h                |    4 +-
 source3/rpc_server/dcesrv_gssapi.h                 |    2 +-
 source3/rpc_server/dcesrv_ntlmssp.c                |    4 +-
 source3/rpc_server/dcesrv_ntlmssp.h                |    2 +-
 source3/rpc_server/dfs/srv_dfs_nt.c                |    4 +-
 source3/rpc_server/epmapper/srv_epmapper.c         |    4 +-
 source3/rpc_server/eventlog/srv_eventlog_nt.c      |    6 +-
 source3/rpc_server/eventlog/srv_eventlog_reg.c     |    2 +-
 source3/rpc_server/lsa/srv_lsa_nt.c                |   46 ++--
 source3/rpc_server/netlogon/srv_netlog_nt.c        |   24 +-
 source3/rpc_server/ntsvcs/srv_ntsvcs_nt.c          |    2 +-
 source3/rpc_server/rpc_handles.c                   |    2 +-
 source3/rpc_server/rpc_ncacn_np.c                  |   60 ++--
 source3/rpc_server/rpc_ncacn_np.h                  |    8 +-
 source3/rpc_server/rpc_server.c                    |   14 +-
 source3/rpc_server/samr/srv_samr_nt.c              |   78 ++--
 source3/rpc_server/spoolss/srv_spoolss_nt.c        |  368 ++++++++++----------
 source3/rpc_server/spoolss/srv_spoolss_util.c      |  118 ++++----
 source3/rpc_server/spoolss/srv_spoolss_util.h      |   86 +++---
 source3/rpc_server/srv_pipe.c                      |   32 +-
 source3/rpc_server/srv_pipe_hnd.c                  |    6 +-
 source3/rpc_server/srvsvc/srv_srvsvc_nt.c          |   46 ++--
 source3/rpc_server/svcctl/srv_svcctl_nt.c          |   32 +-
 source3/rpc_server/svcctl/srv_svcctl_reg.c         |    2 +-
 source3/rpc_server/winreg/srv_winreg_nt.c          |    8 +-
 source3/rpc_server/wkssvc/srv_wkssvc_nt.c          |   20 +-
 source3/script/tests/test_net_misc.sh              |   11 +
 source3/script/tests/test_net_registry.sh          |   12 +-
 .../script/tests/test_net_registry_roundtrip.sh    |   11 +
 source3/script/tests/test_ntlm_auth_s3.sh          |   24 +-
 source3/script/tests/test_posix_s3.sh              |   95 -----
 source3/script/tests/test_smbclient_auth.sh        |   36 ++
 source3/script/tests/test_smbclient_s3.sh          |   37 +-
 source3/script/tests/test_smbtorture_s3.sh         |   39 +--
 source3/script/tests/test_testparm_s3.sh           |    9 +
 source3/script/tests/test_wbinfo_s3.sh             |   45 +---
 source3/script/tests/tests_smbclient_s3.sh         |    1 -
 source3/selftest/knownfail                         |    1 +
 source3/selftest/s3-selftest.sh                    |   10 +-
 source3/selftest/tests.py                          |  196 +++++++++++
 source3/selftest/tests.sh                          |  202 -----------
 source3/selftest/wscript                           |    2 +-
 source3/services/svc_winreg_glue.c                 |   20 +-
 source3/services/svc_winreg_glue.h                 |   10 +-
 source3/smbd/close.c                               |    2 +-
 source3/smbd/connection.c                          |    4 +-
 source3/smbd/fake_file.c                           |    2 +-
 source3/smbd/globals.h                             |    2 +-
 source3/smbd/lanman.c                              |   74 ++--
 source3/smbd/msdfs.c                               |   10 +-
 source3/smbd/nttrans.c                             |    8 +-
 source3/smbd/open.c                                |    2 +-
 source3/smbd/password.c                            |   52 ++--
 source3/smbd/pipes.c                               |    2 +-
 source3/smbd/process.c                             |    6 +-
 source3/smbd/reply.c                               |    6 +-
 source3/smbd/server_reload.c                       |   16 +-
 source3/smbd/service.c                             |   80 +++---
 source3/smbd/session.c                             |    8 +-
 source3/smbd/sesssetup.c                           |   14 +-
 source3/smbd/smb2_sesssetup.c                      |   68 ++--
 source3/smbd/smb2_tcon.c                           |    2 +-
 source3/smbd/trans2.c                              |   40 +-
 source3/smbd/uid.c                                 |  120 ++++----
 source3/torture/torture.c                          |    4 +
 source3/winbindd/winbindd_samr.c                   |   16 +-
 source4/auth/auth.h                                |    1 +
 source4/auth/session.h                             |    9 +-
 source4/dsdb/repl/drepl_out_helpers.c              |    1 +
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c    |    1 -
 source4/dsdb/samdb/ldb_modules/rootdse.c           |    1 -
 source4/dsdb/samdb/ldb_modules/util.c              |    1 -
 source4/dsdb/samdb/ldb_modules/wscript_build       |    6 +-
 source4/libcli/security/wscript_build              |    9 -
 source4/libcli/wscript_build                       |    1 -
 source4/rpc_server/wscript_build                   |    6 +-
 source4/selftest/tests.py                          |  152 +--------
 114 files changed, 1513 insertions(+), 1501 deletions(-)
 rename {source4/libcli => libcli}/security/session.c (96%)
 rename {source4/libcli => libcli}/security/session.h (65%)
 create mode 100644 selftest/selftesthelpers.py
 delete mode 100755 source3/script/tests/test_posix_s3.sh
 create mode 100755 source3/script/tests/test_smbclient_auth.sh
 delete mode 100644 source3/script/tests/tests_smbclient_s3.sh
 create mode 100755 source3/selftest/tests.py
 delete mode 100755 source3/selftest/tests.sh
 delete mode 100644 source4/libcli/security/wscript_build


Changeset truncated at 500 lines:

diff --git a/lib/util/util.h b/lib/util/util.h
index b0ed4e1..537045c 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -842,9 +842,9 @@ void print_asc_cb(const uint8_t *buf, int len,
  */
 
 bool add_uid_to_array_unique(TALLOC_CTX *mem_ctx, uid_t uid,
-			     uid_t **uids, size_t *num_uids);
+			     uid_t **uids, uint32_t *num_uids);
 bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid,
-			     gid_t **gids, size_t *num_gids);
+			     gid_t **gids, uint32_t *num_gids);
 
 /**
  * Allocate anonymous shared memory of the given size
diff --git a/lib/util/util_id.c b/lib/util/util_id.c
index 8744ce4..d5a8c66 100644
--- a/lib/util/util_id.c
+++ b/lib/util/util_id.c
@@ -26,7 +26,7 @@
 ****************************************************************************/
 
 bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid,
-			     gid_t **gids, size_t *num_gids)
+			     gid_t **gids, uint32_t *num_gids)
 {
 	int i;
 
@@ -59,7 +59,7 @@ bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid,
 ****************************************************************************/
 
 bool add_uid_to_array_unique(TALLOC_CTX *mem_ctx, uid_t uid,
-			     uid_t **uids, size_t *num_uids)
+			     uid_t **uids, uint32_t *num_uids)
 {
 	int i;
 
diff --git a/libcli/security/security.h b/libcli/security/security.h
index 39ae3ec..bb7bc72 100644
--- a/libcli/security/security.h
+++ b/libcli/security/security.h
@@ -105,5 +105,6 @@ struct object_tree {
 #include "libcli/security/sddl.h"
 #include "libcli/security/privileges.h"
 #include "libcli/security/access_check.h"
+#include "libcli/security/session.h"
 
 #endif
diff --git a/source4/libcli/security/session.c b/libcli/security/session.c
similarity index 96%
rename from source4/libcli/security/session.c
rename to libcli/security/session.c
index 401e11c..0c32556 100644
--- a/source4/libcli/security/session.c
+++ b/libcli/security/session.c
@@ -20,9 +20,8 @@
 */
 
 #include "includes.h"
-#include "auth/session.h"
-#include "libcli/security/session.h"
 #include "libcli/security/security.h"
+#include "librpc/gen_ndr/auth.h"
 
 enum security_user_level security_session_user_level(struct auth_session_info *session_info,
 						     const struct dom_sid *domain_sid)
diff --git a/source4/libcli/security/session.h b/libcli/security/session.h
similarity index 65%
rename from source4/libcli/security/session.h
rename to libcli/security/session.h
index cf69665..36da09b 100644
--- a/source4/libcli/security/session.h
+++ b/libcli/security/session.h
@@ -19,6 +19,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifndef _LIBCLI_SECURITY_SESSION_H_
+#define _LIBCLI_SECURITY_SESSION_H_
+
 enum security_user_level {
 	SECURITY_ANONYMOUS            = 0,
 	SECURITY_USER                 = 10,
@@ -28,6 +31,20 @@ enum security_user_level {
 	SECURITY_SYSTEM               = 50
 };
 
-#include "libcli/security/session_proto.h"
+struct cli_credentials;
+struct security_token;
+struct auth_user_info;
+struct auth_user_info_torture;
+
+struct auth_session_info {
+	struct security_token *security_token;
+	struct auth_user_info *info;
+	struct auth_user_info_torture *torture;
+	DATA_BLOB session_key;
+	struct cli_credentials *credentials;
+};
+
+enum security_user_level security_session_user_level(struct auth_session_info *session_info,
+						     const struct dom_sid *domain_sid);
 
-struct auth_session_info;
+#endif
diff --git a/libcli/security/wscript_build b/libcli/security/wscript_build
index 3526e66..3f2e06a 100644
--- a/libcli/security/wscript_build
+++ b/libcli/security/wscript_build
@@ -2,7 +2,7 @@
 
 
 bld.SAMBA_LIBRARY('security',
-                  source='dom_sid.c display_sec.c secace.c secacl.c security_descriptor.c sddl.c privileges.c security_token.c access_check.c object_tree.c create_descriptor.c util_sid.c',
+                  source='dom_sid.c display_sec.c secace.c secacl.c security_descriptor.c sddl.c privileges.c security_token.c access_check.c object_tree.c create_descriptor.c util_sid.c session.c',
                   private_library=True,
                   deps='talloc ndr NDR_SECURITY'
                   )
diff --git a/selftest/gdb_backtrace b/selftest/gdb_backtrace
index 91637ec..5531814 100755
--- a/selftest/gdb_backtrace
+++ b/selftest/gdb_backtrace
@@ -102,12 +102,13 @@ EOF
 	;;
 	gdb)
 cat << EOF  > ${BATCHFILE_MAIN}
-set height 1000
+set height 0
 bt full
+thread apply all bt full
 info locals
 quit
 EOF
-	${DB_BIN} -x "${BATCHFILE_MAIN}" "${BINARY}" "${PID}"
+	${DB_BIN} -batch -x "${BATCHFILE_MAIN}" --pid "${PID}" < /dev/null
 	;;
 dbx)
 	${DB_BIN} "where;dump;kill;quit" "${BINARY}" "${PID}"
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 4f1f1d4..9db3f21 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -421,6 +421,7 @@ $ENV{SRCDIR} = $srcdir;
 $ENV{SRCDIR_ABS} = $srcdir_abs;
 $ENV{BUILDDIR} = $builddir;
 $ENV{BUILDDIR_ABS} = $builddir_abs;
+$ENV{BINDIR} = $bindir_abs;
 $ENV{EXEEXT} = $exeext;
 
 my $tls_enabled = not $opt_quick;
@@ -471,7 +472,7 @@ if ($opt_target eq "samba4") {
 	}
 	$testenv_default = "member";
 	require target::Samba3;
-	$target = new Samba3($bindir);
+	$target = new Samba3($bindir, $srcdir_abs);
 } elsif ($opt_target eq "win") {
 	die("Windows tests will not run with socket wrapper enabled.") 
 		if ($opt_socket_wrapper);
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
new file mode 100644
index 0000000..781c8cc
--- /dev/null
+++ b/selftest/selftesthelpers.py
@@ -0,0 +1,157 @@
+#!/usr/bin/python
+# This script generates a list of testsuites that should be run as part of
+# the Samba 4 test suite.
+
+# The output of this script is parsed by selftest.pl, which then decides
+# which of the tests to actually run. It will, for example, skip all tests
+# listed in selftest/skip or only run a subset during "make quicktest".
+
+# The idea is that this script outputs all of the tests of Samba 4, not
+# just those that are known to pass, and list those that should be skipped
+# or are known to fail in selftest/skip or selftest/knownfail. This makes it
+# very easy to see what functionality is still missing in Samba 4 and makes
+# it possible to run the testsuite against other servers, such as Samba 3 or
+# Windows that have a different set of features.
+
+# The syntax for a testsuite is "-- TEST --" on a single line, followed
+# by the name of the test, the environment it needs and the command to run, all
+# three separated by newlines. All other lines in the output are considered
+# comments.
+
+import os
+import subprocess
+
+def srcdir():
+    return os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
+
+def source4dir():
+    return os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../source4"))
+
+def bindir():
+    return os.path.normpath(os.path.join(os.getenv("BUILDDIR", "."), "bin"))
+
+def binpath(name):
+    return os.path.join(bindir(), "%s%s" % (name, os.getenv("EXEEXT", "")))
+
+perl = os.getenv("PERL", "perl")
+perl = perl.split()
+
+if subprocess.call(perl + ["-e", "eval require Test::More;"]) == 0:
+    has_perl_test_more = True
+else:
+    has_perl_test_more = False
+
+try:
+    from subunit.run import TestProgram
+except ImportError:
+    has_system_subunit_run = False
+else:
+    has_system_subunit_run = True
+
+python = os.getenv("PYTHON", "python")
+
+#Set a default value, overridden if we find a working one on the system
+tap2subunit = "PYTHONPATH=%s/lib/subunit/python:%s/lib/testtools %s %s/lib/subunit/filters/tap2subunit" % (srcdir(), srcdir(), python, srcdir())
+
+sub = subprocess.Popen("tap2subunit 2> /dev/null", stdout=subprocess.PIPE, stdin=subprocess.PIPE, shell=True)
+sub.communicate("")
+
+if sub.returncode == 0:
+    cmd = "echo -ne \"1..1\nok 1 # skip doesn't seem to work yet\n\" | tap2subunit 2> /dev/null | grep skip"
+    sub = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
+    if sub.returncode == 0:
+        tap2subunit = "tap2subunit"
+
+def valgrindify(cmdline):
+    """Run a command under valgrind, if $VALGRIND was set."""
+    valgrind = os.getenv("VALGRIND")
+    if valgrind is None:
+        return cmdline
+    return valgrind + " " + cmdline
+
+
+def plantestsuite(name, env, cmdline, allow_empty_output=False):
+    """Plan a test suite.
+
+    :param name: Testsuite name
+    :param env: Environment to run the testsuite in
+    :param cmdline: Command line to run
+    """
+    print "-- TEST --"
+    print name
+    print env
+    if isinstance(cmdline, list):
+        cmdline = " ".join(cmdline)
+    filter_subunit_args = []
+    if not allow_empty_output:
+        filter_subunit_args.append("--fail-on-empty")
+    if "$LISTOPT" in cmdline:
+        filter_subunit_args.append("$LISTOPT")
+    print "%s 2>&1 | %s/selftest/filter-subunit %s --prefix=\"%s.\"" % (cmdline,
+                                                                        srcdir(),
+                                                                        " ".join(filter_subunit_args),
+                                                                        name)
+    if allow_empty_output:
+        print "WARNING: allowing empty subunit output from %s" % name
+
+
+def add_prefix(prefix, support_list=False):
+    if support_list:
+        listopt = "$LISTOPT "
+    else:
+        listopt = ""
+    return "%s/selftest/filter-subunit %s--fail-on-empty --prefix=\"%s.\"" % (srcdir(), listopt, prefix)
+
+
+def plantestsuite_loadlist(name, env, cmdline):
+    print "-- TEST-LOADLIST --"
+    if env == "none":
+        fullname = name
+    else:
+        fullname = "%s(%s)" % (name, env)
+    print fullname
+    print env
+    if isinstance(cmdline, list):
+        cmdline = " ".join(cmdline)
+    support_list = ("$LISTOPT" in cmdline)
+    print "%s $LOADLIST 2>&1 | %s" % (cmdline, add_prefix(name, support_list))
+
+
+def plantestsuite_idlist(name, env, cmdline):
+    print "-- TEST-IDLIST --"
+    print name
+    print env
+    if isinstance(cmdline, list):
+        cmdline = " ".join(cmdline)
+    print cmdline
+
+
+def skiptestsuite(name, reason):
+    """Indicate that a testsuite was skipped.
+
+    :param name: Test suite name
+    :param reason: Reason the test suite was skipped
+    """
+    # FIXME: Report this using subunit, but re-adjust the testsuite count somehow
+    print "skipping %s (%s)" % (name, reason)
+
+
+def planperltestsuite(name, path):
+    """Run a perl test suite.
+
+    :param name: Name of the test suite
+    :param path: Path to the test runner
+    """
+    if has_perl_test_more:
+        plantestsuite(name, "none", "%s %s | %s" % (" ".join(perl), path, tap2subunit))
+    else:
+        skiptestsuite(name, "Test::More not available")
+
+
+def planpythontestsuite(env, module):
+    if has_system_subunit_run:
+        plantestsuite_idlist(module, env, [python, "-m", "subunit.run", "$LISTOPT", module])
+    else:
+        plantestsuite_idlist(module, env, "PYTHONPATH=$PYTHONPATH:%s/lib/subunit/python:%s/lib/testtools %s -m subunit.run $LISTOPT %s" % (srcdir(), srcdir(), python, module))
+
+
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index a0a13f9..b46a2df 100644
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -24,8 +24,10 @@ sub binpath($$)
 }
 
 sub new($$) {
-	my ($classname, $bindir) = @_;
-	my $self = { bindir => $bindir };
+	my ($classname, $bindir, $srcdir) = @_;
+	my $self = { bindir => $bindir,
+		     srcdir => $srcdir
+	};
 	bless $self;
 	return $self;
 }
@@ -98,6 +100,8 @@ sub setup_env($$$)
 	
 	if ($envname eq "dc") {
 		return $self->setup_dc("$path/dc");
+	} elsif ($envname eq "secshare") {
+		return $self->setup_secshare("$path/secshare");
 	} elsif ($envname eq "member") {
 		if (not defined($self->{vars}->{dc})) {
 			$self->setup_dc("$path/dc");
@@ -132,6 +136,12 @@ sub setup_dc($$)
 
 	$self->wait_for_start($vars);
 
+	$vars->{DC_SERVER} = $vars->{SERVER};
+	$vars->{DC_SERVER_IP} = $vars->{SERVER_IP};
+	$vars->{DC_NETBIOSNAME} = $vars->{NETBIOSNAME};
+	$vars->{DC_USERNAME} = $vars->{USERNAME};
+	$vars->{DC_PASSWORD} = $vars->{PASSWORD};
+
 	$self->{vars}->{dc} = $vars;
 
 	return $vars;
@@ -178,6 +188,34 @@ sub setup_member($$$)
 	return $ret;
 }
 
+sub setup_secshare($$)
+{
+	my ($self, $path) = @_;
+
+	print "PROVISIONING server with security=share...";
+
+	my $secshare_options = "
+	security = share
+	lanman auth = yes
+";
+
+	my $vars = $self->provision($path,
+				    "LOCALSHARE4",
+				    4,
+				    "local4pass",
+				    $secshare_options);
+
+	$self->check_or_start($vars,
+			      ($ENV{SMBD_MAXTIME} or 2700),
+			       "yes", "no", "yes");
+
+	$self->wait_for_start($vars);
+
+	$self->{vars}->{secshare} = $vars;
+
+	return $vars;
+}
+
 sub stop_sig_term($$) {
 	my ($self, $pid) = @_;
 	kill("USR1", $pid) or kill("ALRM", $pid) or warn("Unable to kill $pid: $!");
@@ -439,11 +477,11 @@ sub provision($$$$$$)
 
 	my $conffile="$libdir/server.conf";
 
-	my $nss_wrapper_pl = "$ENV{PERL} $RealBin/../lib/nss_wrapper/nss_wrapper.pl";
+	my $nss_wrapper_pl = "$ENV{PERL} $self->{srcdir}/lib/nss_wrapper/nss_wrapper.pl";
 	my $nss_wrapper_passwd = "$privatedir/passwd";
 	my $nss_wrapper_group = "$privatedir/group";
 
-	my $mod_printer_pl = "$ENV{PERL} $RealBin/../source3/script/tests/printing/modprinter.pl";
+	my $mod_printer_pl = "$ENV{PERL} $self->{srcdir}/source3/script/tests/printing/modprinter.pl";
 
 	my @eventlog_list = ("dns server", "application");
 
@@ -485,7 +523,7 @@ sub provision($$$$$$)
 	netbios name = $server
 	interfaces = $server_ip/8
 	bind interfaces only = yes
-	panic action = $RealBin/gdb_backtrace %d %\$(MAKE_TEST_BINARY)
+	panic action = $self->{srcdir}/selftest/gdb_backtrace %d %\$(MAKE_TEST_BINARY)
 
 	workgroup = $domain
 
@@ -572,6 +610,21 @@ sub provision($$$$$$)
 	print CONF "
 [tmp]
 	path = $shrdir
+[tmpguest]
+	path = $shrdir
+        guest ok = yes
+[guestonly]
+	path = $shrdir
+        guest only = yes
+        guest ok = yes
+[forceuser]
+	path = $shrdir
+        force user = $unix_name
+        guest ok = yes
+[forcegroup]
+	path = $shrdir
+        force group = nogroup
+        guest ok = yes
 [ro-tmp]
 	path = $ro_shrdir
 	guest ok = yes
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c
index 4262d15..ad45d81 100644
--- a/source3/auth/auth_ntlmssp.c
+++ b/source3/auth/auth_ntlmssp.c
@@ -25,9 +25,9 @@
 #include "ntlmssp_wrap.h"
 #include "../librpc/gen_ndr/netlogon.h"
 
-NTSTATUS auth_ntlmssp_steal_server_info(TALLOC_CTX *mem_ctx,
+NTSTATUS auth_ntlmssp_steal_session_info(TALLOC_CTX *mem_ctx,
 					struct auth_ntlmssp_state *auth_ntlmssp_state,
-					struct auth_serversupplied_info **server_info)
+					struct auth_serversupplied_info **session_info)
 {
 	/* Free the current server_info user_session_key and reset it from the
 	 * current ntlmssp_state session_key */
@@ -40,11 +40,11 @@ NTSTATUS auth_ntlmssp_steal_server_info(TALLOC_CTX *mem_ctx,
 			auth_ntlmssp_state->ntlmssp_state->session_key.length);
 	if (auth_ntlmssp_state->ntlmssp_state->session_key.length &&
 	    !auth_ntlmssp_state->server_info->user_session_key.data) {
-		*server_info = NULL;
+		*session_info = NULL;
 		return NT_STATUS_NO_MEMORY;
 	}
-	/* Steal server_info away from auth_ntlmssp_state */
-	*server_info = talloc_move(mem_ctx, &auth_ntlmssp_state->server_info);
+	/* Steal session_info away from auth_ntlmssp_state */
+	*session_info = talloc_move(mem_ctx, &auth_ntlmssp_state->server_info);
 	return NT_STATUS_OK;
 }
 
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 3143710..5940628 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -745,12 +745,12 @@ done:
 }
 
 /***************************************************************************
- Make (and fill) a user_info struct for a system user login.
+ Make (and fill) a auth_session_info struct for a system user login.
  This *must* succeed for smbd to start.
 ***************************************************************************/
 
-static NTSTATUS make_new_server_info_system(TALLOC_CTX *mem_ctx,
-					    struct auth_serversupplied_info **server_info)
+static NTSTATUS make_new_session_info_system(TALLOC_CTX *mem_ctx,
+					    struct auth_serversupplied_info **session_info)
 {
 	struct passwd *pwd;
 	NTSTATUS status;
@@ -763,20 +763,20 @@ static NTSTATUS make_new_server_info_system(TALLOC_CTX *mem_ctx,
 	status = make_serverinfo_from_username(mem_ctx,
 					     pwd->pw_name,
 					     false,
-					     server_info);
+					     session_info);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list