[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Wed Jun 5 16:56:09 UTC 2019


The branch, master has been updated
       via  a66af4c96ac s3:auth: explicitly add BUILTIN\Guests to the guest token
       via  0e88f98855e tests: add a test for guest authentication
       via  ac2167eb234 selftest: allow guest login in the ad_member_idmap_rid env
       via  f4e340a48b6 s3:smbd: call reinit_guest_session_info() in the conf updated handler
       via  8096cc7eb2b s3:auth: add reinit_guest_session_info()
       via  96843452548 tests auth log winbind: Fix flapping test
       via  aabdcc91513 third_party: Update waf to version 2.0.17
      from  952437b1bdb ctdb-utils: Fix CID 1125558 (Unchecked return value from library)

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


- Log -----------------------------------------------------------------
commit a66af4c96accba4ee64eeb1958458b69f3ccec1d
Author: Ralph Boehme <slow at samba.org>
Date:   Mon May 13 20:16:47 2019 +0200

    s3:auth: explicitly add BUILTIN\Guests to the guest token
    
    This changes ensures that smbd always adds BUILTIN\Guests to the guest token
    which is required for guest authentication.
    
    Currently the guest token depends on the on-disk configured group mappings. If
    there's an existing group mapping for BUILTIN\Guests, but LOCALSAM\Guest is not
    a member, the final guest token won't contain BUILTIN\Guests.
    
    For SMB2 the flag SMB2_SESSION_FLAG_IS_GUEST will not be set in the final SMB2
    SESSION_SETUP response, because smbd sets it based on the token containing the
    BUILTIN\Guests SID S-1-5-32-546.
    
    At the same time, the packet is not signed which causes Windows clients and
    smbclient to reject the unsigned SMB2 SESSION_SETUP response.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13944
    
    Pair-programmed-with: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Wed Jun  5 16:55:26 UTC 2019 on sn-devel-184

commit 0e88f98855e24cfddb55bef65c5910b8e662c630
Author: Ralph Boehme <slow at samba.org>
Date:   Thu May 16 12:47:34 2019 +0200

    tests: add a test for guest authentication
    
    This verifies that smbd always adds BUILTIN\Guests to the guest token which is
    required for guest authentication.
    
    Currently the guest token depends on the on-disk configured group mappings. If
    there's an existing group mapping for BUILTIN\Guests, but LOCALSAM\Guest is not
    a member, the final guest token won't contain BUILTIN\Guests.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13944
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit ac2167eb2349dc1c453e14a65692f16c8ba6532e
Author: Ralph Boehme <slow at samba.org>
Date:   Thu May 16 12:43:40 2019 +0200

    selftest: allow guest login in the ad_member_idmap_rid env
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13944
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit f4e340a48b6f059a1daa66deb9c26da9e8fcd5e7
Author: Ralph Boehme <slow at samba.org>
Date:   Thu May 16 12:42:54 2019 +0200

    s3:smbd: call reinit_guest_session_info() in the conf updated handler
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13944
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 8096cc7eb2b36b074ff17a52dc3540be4ecff6bb
Author: Ralph Boehme <slow at samba.org>
Date:   Thu May 16 12:42:29 2019 +0200

    s3:auth: add reinit_guest_session_info()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13944
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 968434525480020999a30881ca20b9b13c99ad65
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Wed Jun 5 14:52:03 2019 +1200

    tests auth log winbind: Fix flapping test
    
    Fix flapping auth_log_winbind tests, were seeing failures like
    
    UNEXPECTED(failure):
    samba.tests.auth_log_winbind.samba.tests.auth_log_winbind.AuthLogTestsWinbind.
    test_wbinfo(ad_member:local)
    REASON: Exception: Exception: Traceback (most recent call last):
      File "bin/python/samba/tests/auth_log_winbind.py", line 328, in
      test_wbinfo
          self.assertEquals(logon_id, msg["Authentication"]["logonId"])
          AssertionError: '812b7158bff1660e' != '2cfc1fed76ff8865'
          - 812b7158bff1660e
          + 2cfc1fed76ff8865
    
    Test had a race condition with other SamLogon events on the domain
    server. The tests can now handle multiple SamLogon messages and filter
    out the SamLogon messages for other logons.
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit aabdcc91513e242c4f191e1bbbb70c890416d213
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 3 10:40:55 2019 +0200

    third_party: Update waf to version 2.0.17
    
    This fixes building Samba, libtalloc, libtevent, libtdb and libldb with
    Python 3.8.
    
         wget https://waf.io/waf-2.0.17.tar.bz2
         tar -xf waf-2.0.17.tar.bz2
         git rm third_party/waf/waflib/ -r
         mkdir third_party/waf -p
         rsync -a waf-2.0.17/waflib/ third_party/waf/waflib/
         git add third_party/waf/waflib/
    
    (Then update version number in buildtools/bin/waf and
    buildtools/wafsamba/wafsamba.py)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13960
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 buildtools/bin/waf                                 |   2 +-
 buildtools/wafsamba/wafsamba.py                    |   2 +-
 python/samba/tests/auth_log_winbind.py             |  89 +++++----
 selftest/target/Samba3.pm                          |   1 +
 source3/auth/auth_util.c                           |  26 +++
 source3/auth/proto.h                               |   1 +
 source3/script/tests/test_guest_auth.sh            | 103 ++++++++++
 source3/selftest/tests.py                          |   5 +
 source3/smbd/server.c                              |   6 +
 third_party/waf/waflib/Build.py                    |  62 ++++--
 third_party/waf/waflib/ConfigSet.py                |   4 +-
 third_party/waf/waflib/Configure.py                |   5 +-
 third_party/waf/waflib/Context.py                  |  16 +-
 third_party/waf/waflib/Logs.py                     |   9 +-
 third_party/waf/waflib/Node.py                     |   3 +-
 third_party/waf/waflib/Runner.py                   |  60 ++++--
 third_party/waf/waflib/Scripting.py                |  15 +-
 third_party/waf/waflib/Task.py                     | 215 ++++++++++++++++-----
 third_party/waf/waflib/TaskGen.py                  |   6 +-
 third_party/waf/waflib/Tools/c_config.py           |  11 +-
 third_party/waf/waflib/Tools/c_preproc.py          |   8 +-
 third_party/waf/waflib/Tools/ccroot.py             |  22 ++-
 third_party/waf/waflib/Tools/d_scan.py             |   8 +-
 third_party/waf/waflib/Tools/fc.py                 |  24 ++-
 third_party/waf/waflib/Tools/fc_config.py          |   6 +-
 third_party/waf/waflib/Tools/fc_scan.py            |  12 +-
 third_party/waf/waflib/Tools/ifort.py              |   2 +-
 third_party/waf/waflib/Tools/javaw.py              | 157 +++++++++++++--
 third_party/waf/waflib/Tools/md5_tstamp.py         |   6 +-
 third_party/waf/waflib/Tools/msvc.py               |  18 +-
 third_party/waf/waflib/Tools/python.py             |  18 +-
 third_party/waf/waflib/Tools/qt5.py                |  14 +-
 third_party/waf/waflib/Tools/waf_unit_test.py      |   4 +-
 third_party/waf/waflib/Tools/winres.py             |   4 +-
 third_party/waf/waflib/Utils.py                    |  26 ++-
 third_party/waf/waflib/ansiterm.py                 |   2 +-
 third_party/waf/waflib/extras/buildcopy.py         |   7 +-
 third_party/waf/waflib/extras/clang_cross.py       |  92 +++++++++
 .../waf/waflib/extras/clang_cross_common.py        | 113 +++++++++++
 third_party/waf/waflib/extras/clangxx_cross.py     | 106 ++++++++++
 third_party/waf/waflib/extras/color_msvc.py        |  59 ++++++
 third_party/waf/waflib/extras/cppcheck.py          |  12 +-
 third_party/waf/waflib/extras/cpplint.py           |  77 +++-----
 third_party/waf/waflib/extras/cython.py            |  15 +-
 third_party/waf/waflib/extras/distnet.py           |   2 +-
 third_party/waf/waflib/extras/doxygen.py           |  13 +-
 third_party/waf/waflib/extras/erlang.py            |   2 +-
 third_party/waf/waflib/extras/fast_partial.py      |   3 +-
 third_party/waf/waflib/extras/fc_cray.py           |   2 +-
 third_party/waf/waflib/extras/fc_nec.py            |   2 +-
 third_party/waf/waflib/extras/fc_nfort.py          |  52 +++++
 third_party/waf/waflib/extras/gccdeps.py           |   6 +-
 third_party/waf/waflib/extras/kde4.py              |   2 +-
 third_party/waf/waflib/extras/msvcdeps.py          |  73 ++++---
 third_party/waf/waflib/extras/ocaml.py             |   2 +-
 third_party/waf/waflib/extras/parallel_debug.py    |   9 +-
 third_party/waf/waflib/extras/pgicc.py             |   2 +-
 third_party/waf/waflib/extras/protoc.py            |  93 ++++-----
 third_party/waf/waflib/extras/pyqt5.py             |  21 +-
 third_party/waf/waflib/extras/qt4.py               |   6 +-
 third_party/waf/waflib/extras/remote.py            |   2 +-
 third_party/waf/waflib/extras/run_do_script.py     |   2 +-
 third_party/waf/waflib/extras/sphinx.py            |  81 ++++++++
 third_party/waf/waflib/extras/swig.py              |   4 +-
 third_party/waf/waflib/extras/syms.py              |   2 +-
 third_party/waf/waflib/extras/use_config.py        |   2 +-
 third_party/waf/waflib/extras/xcode6.py            |   8 +-
 third_party/waf/waflib/processor.py                |   4 +
 68 files changed, 1454 insertions(+), 394 deletions(-)
 create mode 100755 source3/script/tests/test_guest_auth.sh
 create mode 100644 third_party/waf/waflib/extras/clang_cross.py
 create mode 100644 third_party/waf/waflib/extras/clang_cross_common.py
 create mode 100644 third_party/waf/waflib/extras/clangxx_cross.py
 create mode 100644 third_party/waf/waflib/extras/color_msvc.py
 create mode 100644 third_party/waf/waflib/extras/fc_nfort.py
 create mode 100644 third_party/waf/waflib/extras/sphinx.py


Changeset truncated at 500 lines:

diff --git a/buildtools/bin/waf b/buildtools/bin/waf
index 3ee4d5bc4df..8413f2332b7 100755
--- a/buildtools/bin/waf
+++ b/buildtools/bin/waf
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 import os, sys, inspect
 
-VERSION="2.0.8"
+VERSION="2.0.17"
 REVISION="x"
 GIT="x"
 INSTALL="x"
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index cd3e9d3e7a8..76d65ebfcb6 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -38,7 +38,7 @@ LIB_PATH="shared"
 
 os.environ['PYTHONUNBUFFERED'] = '1'
 
-if Context.HEXVERSION not in (0x2000800,):
+if Context.HEXVERSION not in (0x2001100,):
     Logs.error('''
 Please use the version of waf that comes with Samba, not
 a system installed version. See http://wiki.samba.org/index.php/Waf
diff --git a/python/samba/tests/auth_log_winbind.py b/python/samba/tests/auth_log_winbind.py
index 219b5b8cfc8..a390197fe7f 100644
--- a/python/samba/tests/auth_log_winbind.py
+++ b/python/samba/tests/auth_log_winbind.py
@@ -21,8 +21,6 @@
 
 import json
 import os
-from random import SystemRandom
-import string
 import time
 
 from samba.auth import system_session
@@ -67,8 +65,7 @@ class AuthLogTestsWinbind(AuthLogTestBase, BlackboxTestCase):
             msg = json.loads(m)
             return (
                 msg["type"] == "Authentication" and
-                msg["Authentication"]["serviceDescription"] == "SamLogon" and
-                msg["Authentication"]["authDescription"] == "interactive")
+                msg["Authentication"]["serviceDescription"] == "SamLogon")
 
         #
         # Handler function for received authentication messages.
@@ -76,7 +73,7 @@ class AuthLogTestsWinbind(AuthLogTestBase, BlackboxTestCase):
             # Print the message to help debugging the tests.
             # as it's a JSON message it does not look like a sub-unit message.
             print(message)
-            self.dc_msg = message
+            self.dc_msgs.append(message)
 
         # Set up a messaging context to listen for authentication events on
         # the domain controller.
@@ -86,17 +83,22 @@ class AuthLogTestsWinbind(AuthLogTestBase, BlackboxTestCase):
         msg_ctx.register(msg_handler_and_context, msg_type=MSG_AUTH_LOG)
 
         # Wait for the SamLogon message.
-        # As the SamLogon is the only message we're interested ignore any other
-        # messages.
-        self.dc_msg = None
+        # As there could be other SamLogon's in progress we need to collect
+        # all the SamLogons and let the caller match them to the session.
+        self.dc_msgs = []
         start_time = time.time()
-        while not is_sam_logon(self.dc_msg) and (time.time() - start_time < 1):
+        while (time.time() - start_time < 1):
             msg_ctx.loop_once(0.1)
 
-        if self.dc_msg is None:
-            os.write(w1, get_bytes("None"))
+        # Only interested in SamLogon messages, filter out the rest
+        msgs = list(filter(is_sam_logon, self.dc_msgs))
+        if msgs:
+            for m in msgs:
+                m += "\n"
+                os.write(w1, get_bytes(m))
         else:
-            os.write(w1, get_bytes(self.dc_msg))
+            os.write(w1, get_bytes("None\n"))
+        os.close(w1)
 
         msg_ctx.deregister(msg_handler_and_context, msg_type=MSG_AUTH_LOG)
         msg_ctx.irpc_remove_name(AUTH_EVENT_NAME)
@@ -163,6 +165,39 @@ class AuthLogTestsWinbind(AuthLogTestBase, BlackboxTestCase):
         self.user_creds.set_username(self.user_name)
         self.user_creds.set_workstation(self.server)
 
+    #
+    # Check that the domain server received a SamLogon request for the
+    # current logon.
+    #
+    def check_domain_server_authentication(self, pipe, logon_id, description):
+
+        messages = os.read(pipe, 8192)
+        messages = get_string(messages)
+        if len(messages) == 0 or messages == "None":
+            self.fail("No Domain server authentication message")
+
+        #
+        # Look for the SamLogon request matching logon_id
+        msg = None
+        for message in messages.split("\n"):
+            msg = json.loads(get_string(message))
+            if logon_id == msg["Authentication"]["logonId"]:
+                break
+            msg = None
+
+        if msg is None:
+            self.fail("No Domain server authentication message")
+
+        #
+        # Validate that message contains the expected data
+        #
+        self.assertEquals("Authentication", msg["type"])
+        self.assertEquals(logon_id, msg["Authentication"]["logonId"])
+        self.assertEquals("SamLogon",
+                          msg["Authentication"]["serviceDescription"])
+        self.assertEquals(description,
+                          msg["Authentication"]["authDescription"])
+
     def test_ntlm_auth(self):
 
         def isLastExpectedMessage(msg):
@@ -213,14 +248,10 @@ class AuthLogTestsWinbind(AuthLogTestBase, BlackboxTestCase):
 
         logon_id = msg["Authentication"]["logonId"]
 
-        message = os.read(pipe, 4096)
-        msg = json.loads(get_string(message))
-        self.assertEquals("Authentication", msg["type"])
-        self.assertEquals(logon_id, msg["Authentication"]["logonId"])
-        self.assertEquals("SamLogon",
-                          msg["Authentication"]["serviceDescription"])
-        self.assertEquals("interactive",
-                          msg["Authentication"]["authDescription"])
+        #
+        # Now check the Domain server authentication message
+        #
+        self.check_domain_server_authentication(pipe, logon_id, "interactive")
 
     def test_wbinfo(self):
         def isLastExpectedMessage(msg):
@@ -322,14 +353,7 @@ class AuthLogTestsWinbind(AuthLogTestBase, BlackboxTestCase):
         #
         # Now check the Domain server authentication message
         #
-        message = os.read(pipe, 4096)
-        msg = json.loads(get_string(message))
-        self.assertEquals("Authentication", msg["type"])
-        self.assertEquals(logon_id, msg["Authentication"]["logonId"])
-        self.assertEquals("SamLogon",
-                          msg["Authentication"]["serviceDescription"])
-        self.assertEquals("network",
-                          msg["Authentication"]["authDescription"])
+        self.check_domain_server_authentication(pipe, logon_id, "network")
 
     def test_wbinfo_ntlmv1(self):
         def isLastExpectedMessage(msg):
@@ -432,11 +456,4 @@ class AuthLogTestsWinbind(AuthLogTestBase, BlackboxTestCase):
         #
         # Now check the Domain server authentication message
         #
-        message = os.read(pipe, 4096)
-        msg = json.loads(get_string(message))
-        self.assertEquals("Authentication", msg["type"])
-        self.assertEquals(logon_id, msg["Authentication"]["logonId"])
-        self.assertEquals("SamLogon",
-                          msg["Authentication"]["serviceDescription"])
-        self.assertEquals("network",
-                          msg["Authentication"]["authDescription"])
+        self.check_domain_server_authentication(pipe, logon_id, "network")
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 98863954263..34a9864cd48 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -614,6 +614,7 @@ sub setup_ad_member_idmap_rid
 	# Prevent overridding the provisioned lib/krb5.conf which sets certain
 	# values required for tests to succeed
 	create krb5 conf = no
+        map to guest = bad user
 ";
 
 	my $ret = $self->provision($prefix, $dcvars->{DOMAIN},
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 7f80055fda8..d0be7e6c576 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -1386,6 +1386,21 @@ static NTSTATUS make_new_session_info_guest(TALLOC_CTX *mem_ctx,
 		goto done;
 	}
 
+	/*
+	 * It's ugly, but for now it's
+	 * needed to force Builtin_Guests
+	 * here, because memberships of
+	 * Builtin_Guests might be incomplete.
+	 */
+	status = add_sid_to_array_unique(session_info->security_token,
+					 &global_sid_Builtin_Guests,
+					 &session_info->security_token->sids,
+					 &session_info->security_token->num_sids);
+	if (!NT_STATUS_IS_OK(status)) {
+		DBG_ERR("Failed to force Builtin_Guests to nt token\n");
+		goto done;
+	}
+
 	/* annoying, but the Guest really does have a session key, and it is
 	   all zeros! */
 	session_info->session_key = data_blob_talloc_zero(session_info, 16);
@@ -1721,6 +1736,17 @@ bool init_guest_session_info(TALLOC_CTX *mem_ctx)
 	return true;
 }
 
+bool reinit_guest_session_info(TALLOC_CTX *mem_ctx)
+{
+	TALLOC_FREE(guest_info);
+	TALLOC_FREE(guest_server_info);
+	TALLOC_FREE(anonymous_info);
+
+	DBG_DEBUG("Reinitialing guest info\n");
+
+	return init_guest_session_info(mem_ctx);
+}
+
 NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx,
 				struct auth_serversupplied_info **server_info)
 {
diff --git a/source3/auth/proto.h b/source3/auth/proto.h
index a96ff6e2582..575a3a147cb 100644
--- a/source3/auth/proto.h
+++ b/source3/auth/proto.h
@@ -271,6 +271,7 @@ NTSTATUS make_session_info_from_username(TALLOC_CTX *mem_ctx,
 					 bool is_guest,
 					 struct auth_session_info **session_info);
 bool init_guest_session_info(TALLOC_CTX *mem_ctx);
+bool reinit_guest_session_info(TALLOC_CTX *mem_ctx);
 NTSTATUS init_system_session_info(TALLOC_CTX *mem_ctx);
 bool session_info_set_session_key(struct auth_session_info *info,
 				 DATA_BLOB session_key);
diff --git a/source3/script/tests/test_guest_auth.sh b/source3/script/tests/test_guest_auth.sh
new file mode 100755
index 00000000000..4ad4a5cbd63
--- /dev/null
+++ b/source3/script/tests/test_guest_auth.sh
@@ -0,0 +1,103 @@
+#!/bin/sh
+#
+# Test guest authentication
+#
+# Copyright (C) 2019 Ralph Boehme
+#
+
+if [ $# -lt 5 ]; then
+cat <<EOF
+Usage: $0 SERVER SMBCLIENT SMBCONTROL NET CONFIGURATION
+EOF
+exit 1;
+fi
+
+SERVER=$1
+SMBCLIENT=$2
+SMBCONTROL=$3
+NET=$4
+CONFIGURATION=$5
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+
+failed=0
+SIDS=""
+
+prepare_empty_builtin_guests() {
+    TMP=$($NET $CONFIGURATION groupmap listmem S-1-5-32-546 2>&1)
+    bg_exists=$?
+    if [ $bg_exists != 0 ] ; then
+	printf "Group map for BUILTIN\\Guests must exist for test\n"
+	return 1
+    fi
+
+    SIDS=$($NET $CONFIGURATION groupmap listmem S-1-5-32-546)
+    if [ $? != 0 ] ; then
+	printf "$NET $CONFIGURATION groupmap listmem S-1-5-32-546 failed. Returned:\n"
+	printf "$SIDS\n"
+	return 1
+    fi
+    printf "Got S-1-5-32-546 members:\n$SIDS\n"
+
+    if [ "$SIDS" != "" ] ; then
+	for SID in $SIDS ; do
+	    printf "Deleting member $SID from S-1-5-32-546\n"
+	    $NET $CONFIGURATION groupmap delmem S-1-5-32-546 $SID || return 1
+	done
+    fi
+
+    return 0
+}
+
+add_local_guest_to_builtin_guests() {
+    if [ "$SIDS" != "" ] ; then
+	for SID in $SIDS ; do
+	    printf "Adding $SID as member to S-1-5-32-546\n"
+	    $NET $CONFIGURATION groupmap addmem S-1-5-32-546 $SID || return 1
+	done
+    fi
+}
+
+test_smbclient() {
+    $SMBCLIENT -U foo%bar //$SERVER/tmpguest -c exit
+    if [ $? != 0 ] ; then
+	printf "smbclient failed\n"
+	return 1
+    fi
+    return 0
+}
+
+testit "smbclient_guest_at_startup" \
+    test_smbclient  ||
+    failed=$(expr $failed + 1)
+
+printf "Prepare BUILTIN\\Guests group mapping without members\n"
+
+prepare_empty_builtin_guests || {
+    printf "Setting up BUILTIN\\Guests without members failed\n"
+    exit 1
+}
+
+$SMBCONTROL $CONFIGURATION smbd reload-config || {
+    printf "Reloading parent smbd guest info failed\n"
+    exit 1
+}
+
+testit "smbclient_guest_auth_without_members" \
+    test_smbclient &&
+    failed=$(expr $failed + 1)
+
+# restore config
+add_local_guest_to_builtin_guests
+
+$SMBCONTROL $CONFIGURATION smbd reload-config || {
+    printf "Reloading parent smbd guest info failed\n"
+    exit 1
+}
+
+testit "smbclient_works_after_restored_setup" \
+    test_smbclient  ||
+    failed=$(expr $failed + 1)
+
+testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index e9124f22a54..512a0b2c421 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -819,3 +819,8 @@ for e in endianness_options:
 
 plansmbtorture4testsuite('rpc.epmapper', 'nt4_dc:local', 'ncalrpc: -U$USERNAME%$PASSWORD', 'over ncalrpc')
 plansmbtorture4testsuite('rpc.fsrvp', 'nt4_dc:local', 'ncacn_np:$SERVER_IP[/pipe/FssagentRpc] -U$USERNAME%$PASSWORD', 'over ncacn_np')
+
+for env in ["ad_member_idmap_rid:local", "maptoguest:local"]:
+    plantestsuite("samba3.blackbox.guest (%s)" % env , env,
+                  [os.path.join(samba3srcdir, "script/tests/test_guest_auth.sh"),
+                   '$SERVER', smbclient3, smbcontrol, net, configuration])
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 3ac9be90f7d..ef79aba5bcf 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -108,12 +108,18 @@ static void smbd_parent_conf_updated(struct messaging_context *msg,
 {
 	struct tevent_context *ev_ctx =
 		talloc_get_type_abort(private_data, struct tevent_context);
+	bool ok;
 
 	DEBUG(10,("smbd_parent_conf_updated: Got message saying smb.conf was "
 		  "updated. Reloading.\n"));
 	change_to_root_user();
 	reload_services(NULL, NULL, false);
 	printing_subsystem_update(ev_ctx, msg, false);
+
+	ok = reinit_guest_session_info(NULL);
+	if (!ok) {
+		DBG_ERR("Failed to reinit guest info\n");
+	}
 }
 
 /*******************************************************************
diff --git a/third_party/waf/waflib/Build.py b/third_party/waf/waflib/Build.py
index 8347a287a81..39f0991918b 100644
--- a/third_party/waf/waflib/Build.py
+++ b/third_party/waf/waflib/Build.py
@@ -104,7 +104,7 @@ class BuildContext(Context.Context):
 		"""Amount of jobs to run in parallel"""
 
 		self.targets = Options.options.targets
-		"""List of targets to build (default: \*)"""
+		"""List of targets to build (default: \\*)"""
 
 		self.keep = Options.options.keep
 		"""Whether the build should continue past errors"""
@@ -758,14 +758,31 @@ class BuildContext(Context.Context):
 			elif not ln.is_child_of(self.srcnode):
 				Logs.warn('CWD %s is not under %s, forcing --targets=* (run distclean?)', ln.abspath(), self.srcnode.abspath())
 				ln = self.srcnode
-			for tg in self.groups[self.current_group]:
+
+			def is_post(tg, ln):
 				try:
 					p = tg.path
 				except AttributeError:
 					pass
 				else:
 					if p.is_child_of(ln):
-						tgpost(tg)
+						return True
+
+			def is_post_group():
+				for i, g in enumerate(self.groups):
+					if i > self.current_group:
+						for tg in g:
+							if is_post(tg, ln):
+								return True
+
+			if self.post_mode == POST_LAZY and ln != self.srcnode:
+				# partial folder builds require all targets from a previous build group
+				if is_post_group():
+					ln = self.srcnode
+
+			for tg in self.groups[self.current_group]:
+				if is_post(tg, ln):
+					tgpost(tg)
 
 	def get_tasks_group(self, idx):
 		"""
@@ -884,7 +901,7 @@ class BuildContext(Context.Context):
 
 		:param dest: absolute path of the symlink
 		:type dest: :py:class:`waflib.Node.Node` or string (absolute path)
-		:param src: link contents, which is a relative or abolute path which may exist or not
+		:param src: link contents, which is a relative or absolute path which may exist or not
 		:type src: string
 		:param env: configuration set for performing substitutions in dest
 		:type env: :py:class:`waflib.ConfigSet.ConfigSet`
@@ -1038,12 +1055,16 @@ class inst(Task.Task):
 		"""
 		Returns the destination path where files will be installed, pre-pending `destdir`.
 
+		Relative paths will be interpreted relative to `PREFIX` if no `destdir` is given.
+
 		:rtype: string
 		"""
 		if isinstance(self.install_to, Node.Node):
 			dest = self.install_to.abspath()
 		else:
-			dest = Utils.subst_vars(self.install_to, self.env)
+			dest = os.path.normpath(Utils.subst_vars(self.install_to, self.env))
+		if not os.path.isabs(dest):
+		    dest = os.path.join(self.env.PREFIX, dest)
 		if destdir and Options.options.destdir:
 			dest = os.path.join(Options.options.destdir, os.path.splitdrive(dest)[1].lstrip(os.sep))
 		return dest
@@ -1139,11 +1160,19 @@ class inst(Task.Task):
 				# same size and identical timestamps -> make no copy
 				if st1.st_mtime + 2 >= st2.st_mtime and st1.st_size == st2.st_size:
 					if not self.generator.bld.progress_bar:
-						Logs.info('- install %s (from %s)', tgt, lbl)
+
+						c1 = Logs.colors.NORMAL
+						c2 = Logs.colors.BLUE
+
+						Logs.info('%s- install %s%s%s (from %s)', c1, c2, tgt, c1, lbl)
 					return False
 
 		if not self.generator.bld.progress_bar:
-			Logs.info('+ install %s (from %s)', tgt, lbl)
+
+			c1 = Logs.colors.NORMAL
+			c2 = Logs.colors.BLUE
+
+			Logs.info('%s+ install %s%s%s (from %s)', c1, c2, tgt, c1, lbl)
 
 		# Give best attempt at making destination overwritable,
 		# like the 'install' utility used by 'make install' does.
@@ -1200,14 +1229,18 @@ class inst(Task.Task):
 		"""
 		if os.path.islink(tgt) and os.readlink(tgt) == src:
 			if not self.generator.bld.progress_bar:
-				Logs.info('- symlink %s (to %s)', tgt, src)
+				c1 = Logs.colors.NORMAL
+				c2 = Logs.colors.BLUE
+				Logs.info('%s- symlink %s%s%s (to %s)', c1, c2, tgt, c1, src)
 		else:
 			try:
 				os.remove(tgt)
 			except OSError:
 				pass
 			if not self.generator.bld.progress_bar:
-				Logs.info('+ symlink %s (to %s)', tgt, src)


-- 
Samba Shared Repository



More information about the samba-cvs mailing list