[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Fri Dec 21 02:40:03 UTC 2018


The branch, master has been updated
       via  390871602d2 s4 messaging tests: Fix race condition in smbcontrol tests
       via  05c981f0b4a tests (audit_auth)_log: PEP8 cleanup.
       via  bd2d6b2bbed WHATSNEW: JSON logging changes
       via  ebc42cb140c dns: treating fully qualified and unqualified zone as identical.
       via  dd6175a273c dns: test for treating fully qualified zones same as unqualified
       via  131ee1b2dbf lib: Remove sid_string_dbg
       via  fc51f82407d samr: Use dom_sid_str_buf
       via  fa6690e90cd lsasrv: Use dom_sid_str_buf
       via  31da287b1c8 spoolss: Use dom_sid_str_buf
       via  58f76ab1376 winbindd: Use dom_sid_str_buf
       via  d425cd5b683 wkssvc: Use dom_sid_str_buf
       via  1ab6c336a3f libnet: Use dom_sid_str_buf
       via  4d4a59ece28 lib: Use dom_sid_str_buf
       via  da3e3c5e057 lib: Avoid sid_string_dbg
       via  6af7d7ffda8 auth3: Use dom_sid_str_buf
       via  59f29acb2cd vfs: Use dom_sid_str_buf
       via  c45c6d09370 lookup_sid: Use dom_sid_str_buf
       via  4cd68f3d16c pdb_ldap: Use dom_sid_str_buf
       via  998d1d1ac4e pdb_smbpasswd: Use dom_sid_str_buf
       via  6438819609d passdb: Use dom_sid_str_buf
       via  09efea3cb63 groupdb: Use dom_sid_str_buf
       via  534620d160f winbind: Use dom_sid_str_buf
       via  1d5c00a34d8 libads: Use dom_sid_str_buf
       via  444fc0bfcc8 smbd: Use dom_sid_str_buf
       via  69a3b899f11 smbcacls: Use dom_sid_str_buf
       via  454d7d00ec7 net: Use dom_sid_str_buf
      from  f9c15350998 lib:util: Use memset_s() in data_blob_clear()

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


- Log -----------------------------------------------------------------
commit 390871602d244510c941f3c978d2f4371bb62bb7
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Thu Dec 20 15:46:21 2018 +1300

    s4 messaging tests: Fix race condition in smbcontrol tests
    
    The test for the smbcontrol sleep command and the inject fault command
    both used the "rpc_server" process as a target.  As the inject fault
    command caused the process to restart there was a race condition between
    the process restarting and the sleep test running.  To prevent this the
    tests now use different target processes.
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Fri Dec 21 03:39:24 CET 2018 on sn-devel-144

commit 05c981f0b4acd7b27e72098def023c82b92b6e59
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Mon Dec 17 10:04:42 2018 +1300

    tests (audit_auth)_log: PEP8 cleanup.
    
    Remove Flake8 warnings from the audit and authentication JSON log
    tests.
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit bd2d6b2bbed1b5b676232c2094c2c65ed86d21e2
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Mon Dec 17 10:03:01 2018 +1300

    WHATSNEW: JSON logging changes
    
    Add details of the Windows Event Id's and Logon Types added to the
    Authorization qnd PasswordChange JSON messages.
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit ebc42cb140ca7477428798678f8552ef76a04dec
Author: Aaron Haslett <aaronhaslett at catalyst.net.nz>
Date:   Fri Aug 17 17:30:20 2018 +1200

    dns: treating fully qualified and unqualified zone as identical.
    
    "zone.com." and "zone.com" should be treated as the same zone.  This patch
    picks the unqualified representation as standard and enforces it, in order to
    match BIND9 behaviour.
    Note: This fixes the failing test added previously, but that test still fails
    on the rodc test target so we modify the expected failure but don't remove it.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13442
    Signed-off-by: Aaron Haslett <aaronhaslett at catalyst.net.nz>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit dd6175a273c7376ec6960f9a8f519fcfcf79ed37
Author: Aaron Haslett <aaronhaslett at catalyst.net.nz>
Date:   Mon Aug 20 16:07:15 2018 +1200

    dns: test for treating fully qualified zones same as unqualified
    
    Failing test that checks if fully qualified zone names are treated the same
    as unqualified zone names by the dns zone creation RPC method. Fix to follow.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13214
    Signed-off-by: Aaron Haslett <aaronhaslett at catalyst.net.nz>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 131ee1b2dbfab5267bb601d935c6af249d7ec6bd
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Dec 15 15:22:25 2018 +0100

    lib: Remove sid_string_dbg
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit fc51f82407d2b9716336db39a508cfba395ff65d
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 14 22:11:56 2018 +0100

    samr: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit fa6690e90cdbbb4af2f0d6abedc4fdb5574a4571
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 14 21:48:48 2018 +0100

    lsasrv: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 31da287b1c8134227ad9371a922881a7b99dba87
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 14 21:44:49 2018 +0100

    spoolss: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 58f76ab13760947ddf2e8298e8191fa084105a7f
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 14 21:09:51 2018 +0100

    winbindd: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit d425cd5b683feeb7fd2d9a532fe7fe9b28c077c8
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Dec 13 22:23:30 2018 +0100

    wkssvc: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 1ab6c336a3f242eebb64b88407be86fa2e00da46
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Dec 13 21:41:43 2018 +0100

    libnet: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 4d4a59ece289065aa31d9342cb9666b0b7bd779c
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Dec 13 21:22:27 2018 +0100

    lib: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit da3e3c5e05770330f69f75a97443477b1d028d78
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Dec 13 21:21:57 2018 +0100

    lib: Avoid sid_string_dbg
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 6af7d7ffda8025a2d270ba1d01b0708efca511a2
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Dec 13 21:01:00 2018 +0100

    auth3: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 59f29acb2cd947d2f594a5af3d73d0cbe8298d92
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 11 17:17:46 2018 +0100

    vfs: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit c45c6d09370a15021e0158a0356af84913b068f4
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 11 17:00:48 2018 +0100

    lookup_sid: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 4cd68f3d16c97760e8b5d13262876a679b80ad0a
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 11 16:52:39 2018 +0100

    pdb_ldap: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 998d1d1ac4e25114a8d93975ec285d58c4d9b81b
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 11 16:39:19 2018 +0100

    pdb_smbpasswd: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 6438819609d1373da54a4efd4346fcd49ab91ff4
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 11 16:09:41 2018 +0100

    passdb: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 09efea3cb6395c99a8818ff75837e556e6fc8fa4
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 11 13:56:03 2018 +0100

    groupdb: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 534620d160f1a481ac2146b479e2d327f7676a09
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 11 11:03:02 2018 +0100

    winbind: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 1d5c00a34d85b530852ae2544de6fd73e9ff9bce
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 11 07:44:13 2018 +0100

    libads: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 444fc0bfcc83a911a7ceeac3d3a24af9254d6bd6
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Dec 10 13:04:11 2018 +0100

    smbd: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 69a3b899f1190a5517be0218068532430c7e7077
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Dec 10 12:51:56 2018 +0100

    smbcacls: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

commit 454d7d00ec7be792ad637c51ef0a9e0e24bb7360
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Dec 10 12:47:36 2018 +0100

    net: Use dom_sid_str_buf
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

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

Summary of changes:
 WHATSNEW.txt                                      |  29 +++++
 python/samba/tests/audit_log_dsdb.py              |   2 +-
 python/samba/tests/audit_log_pass_change.py       |   4 +-
 python/samba/tests/auth_log.py                    |  65 +++++-----
 python/samba/tests/auth_log_base.py               |   1 +
 python/samba/tests/auth_log_ncalrpc.py            |   4 +-
 python/samba/tests/auth_log_netlogon.py           |  19 ++-
 python/samba/tests/auth_log_netlogon_bad_creds.py |  19 ++-
 python/samba/tests/auth_log_samlogon.py           |  30 +++--
 python/samba/tests/blackbox/smbcontrol_process.py |  10 +-
 python/samba/tests/dns.py                         |  61 +++++++++-
 selftest/knownfail.d/dns                          |   1 +
 source3/auth/auth_util.c                          |   6 +-
 source3/auth/server_info.c                        |  26 ++--
 source3/auth/token_util.c                         |  18 +--
 source3/groupdb/mapping.c                         |   3 +-
 source3/groupdb/mapping_tdb.c                     |   3 +-
 source3/include/proto.h                           |   1 -
 source3/lib/privileges.c                          |  15 ++-
 source3/lib/util_sid.c                            |  14 +--
 source3/lib/util_wellknown.c                      |   7 +-
 source3/lib/winbind_util.c                        |   3 +-
 source3/libads/ldap.c                             |   5 +-
 source3/libnet/libnet_dssync_passdb.c             |  55 +++++----
 source3/modules/nfs4_acls.c                       |  14 ++-
 source3/modules/vfs_afsacl.c                      |   6 +-
 source3/modules/vfs_default.c                     |   6 +-
 source3/passdb/lookup_sid.c                       |  59 ++++++---
 source3/passdb/passdb.c                           |  11 +-
 source3/passdb/pdb_compat.c                       |   6 +-
 source3/passdb/pdb_get_set.c                      |   7 +-
 source3/passdb/pdb_interface.c                    |  14 ++-
 source3/passdb/pdb_ldap.c                         |  50 +++++---
 source3/passdb/pdb_secrets.c                      |   3 +-
 source3/passdb/pdb_smbpasswd.c                    |   9 +-
 source3/passdb/pdb_util.c                         |  12 +-
 source3/rpc_server/lsa/srv_lsa_nt.c               |  13 +-
 source3/rpc_server/samr/srv_samr_nt.c             | 139 ++++++++++++++--------
 source3/rpc_server/spoolss/srv_spoolss_nt.c       |  13 +-
 source3/rpc_server/wkssvc/srv_wkssvc_nt.c         |  18 ++-
 source3/smbd/ntquotas.c                           |  13 +-
 source3/smbd/nttrans.c                            |   3 +-
 source3/smbd/posix_acls.c                         |  43 ++++---
 source3/smbd/service.c                            |   3 +-
 source3/utils/net_rpc.c                           |  11 +-
 source3/utils/net_rpc_samsync.c                   |   5 +-
 source3/utils/smbcacls.c                          |   3 +-
 source3/winbindd/idmap_ad.c                       |   5 +-
 source3/winbindd/idmap_autorid.c                  |  22 ++--
 source3/winbindd/idmap_hash/idmap_hash.c          |   3 +-
 source3/winbindd/idmap_ldap.c                     |  16 ++-
 source3/winbindd/idmap_rfc2307.c                  |   7 +-
 source3/winbindd/idmap_rid.c                      |   3 +-
 source3/winbindd/idmap_rw.c                       |   6 +-
 source3/winbindd/wb_lookupsid.c                   |   3 +-
 source3/winbindd/wb_sids2xids.c                   |   3 +-
 source3/winbindd/wb_xids2sids.c                   |   5 +-
 source3/winbindd/winbindd_ads.c                   |  26 ++--
 source3/winbindd/winbindd_cache.c                 |  10 +-
 source3/winbindd/winbindd_dual_srv.c              |   4 +-
 source3/winbindd/winbindd_getgrgid.c              |   4 +-
 source3/winbindd/winbindd_getgrnam.c              |   5 +-
 source3/winbindd/winbindd_getgroups.c             |   4 +-
 source3/winbindd/winbindd_getpwnam.c              |   5 +-
 source3/winbindd/winbindd_getpwsid.c              |   4 +-
 source3/winbindd/winbindd_getpwuid.c              |   4 +-
 source3/winbindd/winbindd_getusersids.c           |   5 +-
 source3/winbindd/winbindd_irpc.c                  |   7 +-
 source3/winbindd/winbindd_lookupname.c            |   5 +-
 source3/winbindd/winbindd_lookuprids.c            |   3 +-
 source3/winbindd/winbindd_lookupsid.c             |   4 +-
 source3/winbindd/winbindd_msrpc.c                 |  13 +-
 source3/winbindd/winbindd_pam.c                   |   9 +-
 source3/winbindd/winbindd_samr.c                  |   8 +-
 source3/winbindd/winbindd_util.c                  |  10 +-
 source4/rpc_server/dnsserver/dcerpc_dnsserver.c   |  19 ++-
 source4/rpc_server/dnsserver/dnsutils.c           |   3 +-
 77 files changed, 728 insertions(+), 359 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index ffbd48b040e..6698b09d8bc 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -105,6 +105,35 @@ Note: Support for python2 (with the exception of a build configured with
       'PYTHON=python2 ./configure --disable-python' and built with
       'PYTHON=python2 make' will be deprecated in the next release.
 
+JSON logging
+------------
+
+Authentication messages now contain the Windows Event Id "eventId" and logon
+type "logonType". The supported event codes and logon types are:
+  Event codes:
+    4624  Successful logon
+    4625  Unsuccessful logon
+
+  Logon Types:
+    2  Interactive
+    3  Network
+    8  NetworkCleartext
+The version number for Authentication messages is now 1.1, changed from 1.0
+
+Password change messages now contain the Windows Event Id "eventId", the
+supported event Id's are:
+  4723 Password changed
+  4724 Password reset
+The version number for PasswordChange messages is now 1.1, changed from 1.0
+
+The leading "JSON <message type>:" and source file  prefix of the JSON formatted
+log entries has been removed to make the parsing of the JSON log messages
+easier. JSON log entries now start with 2 spaces folowed by an opening brace
+i.e. "  {"
+
+
+
+
 REMOVED FEATURES
 ================
 
diff --git a/python/samba/tests/audit_log_dsdb.py b/python/samba/tests/audit_log_dsdb.py
index 883d27e42e7..0471c22f243 100644
--- a/python/samba/tests/audit_log_dsdb.py
+++ b/python/samba/tests/audit_log_dsdb.py
@@ -40,7 +40,7 @@ class AuditLogDsdbTests(AuditLogTestBase):
 
     def setUp(self):
         self.message_type = MSG_DSDB_LOG
-        self.event_type   = DSDB_EVENT_NAME
+        self.event_type = DSDB_EVENT_NAME
         super(AuditLogDsdbTests, self).setUp()
 
         self.remoteAddress = os.environ["CLIENT_IP"]
diff --git a/python/samba/tests/audit_log_pass_change.py b/python/samba/tests/audit_log_pass_change.py
index 8ece235f558..d580698b3ba 100644
--- a/python/samba/tests/audit_log_pass_change.py
+++ b/python/samba/tests/audit_log_pass_change.py
@@ -45,7 +45,7 @@ class AuditLogPassChangeTests(AuditLogTestBase):
 
     def setUp(self):
         self.message_type = MSG_DSDB_PWD_LOG
-        self.event_type   = DSDB_PWD_EVENT_NAME
+        self.event_type = DSDB_PWD_EVENT_NAME
         super(AuditLogPassChangeTests, self).setUp()
 
         self.remoteAddress = os.environ["CLIENT_IP"]
@@ -97,7 +97,7 @@ class AuditLogPassChangeTests(AuditLogTestBase):
     # Discard the messages from the setup code
     #
     def discardSetupMessages(self, dn):
-        messages = self.waitForMessages(1, dn=dn)
+        self.waitForMessages(1, dn=dn)
         self.discardMessages()
 
     def tearDown(self):
diff --git a/python/samba/tests/auth_log.py b/python/samba/tests/auth_log.py
index 14da516f200..c0d0aab94aa 100644
--- a/python/samba/tests/auth_log.py
+++ b/python/samba/tests/auth_log.py
@@ -77,7 +77,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
         # Turn "[foo,bar]" into a list ("foo", "bar") to test
         # lambda x: x removes anything that evaluates to False,
         # including empty strings, so we handle "" as well
-        binding_list = list(filter(lambda x: x, re.compile('[\[,\]]').split(binding)))
+        binding_list = \
+            list(filter(lambda x: x, re.compile('[\[,\]]').split(binding)))
 
         # Handle explicit smb2, smb1 or auto negotiation
         if "smb2" in binding_list:
@@ -103,16 +104,16 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
             EVT_ID_SUCCESSFUL_LOGON, msg["Authentication"]["eventId"])
         self.assertEquals(
             EVT_LOGON_NETWORK, msg["Authentication"]["logonType"])
-        self._assert_ncacn_np_serviceDescription(binding,
-                                                 msg["Authentication"]["serviceDescription"])
+        self._assert_ncacn_np_serviceDescription(
+            binding, msg["Authentication"]["serviceDescription"])
         self.assertEquals(authTypes[1],
                           msg["Authentication"]["authDescription"])
 
         # Check the second message it should be an Authorization
         msg = messages[1]
         self.assertEquals("Authorization", msg["type"])
-        self._assert_ncacn_np_serviceDescription(binding,
-                                                 msg["Authorization"]["serviceDescription"])
+        self._assert_ncacn_np_serviceDescription(
+            binding, msg["Authorization"]["serviceDescription"])
         self.assertEquals(authTypes[2], msg["Authorization"]["authType"])
         self.assertEquals("SMB", msg["Authorization"]["transportProtection"])
         self.assertTrue(self.is_guid(msg["Authorization"]["sessionId"]))
@@ -183,8 +184,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
         # Check the third message it should be an Authorization
         msg = messages[2]
         self.assertEquals("Authorization", msg["type"])
-        self._assert_ncacn_np_serviceDescription(binding,
-                                                 msg["Authorization"]["serviceDescription"])
+        self._assert_ncacn_np_serviceDescription(
+            binding, msg["Authorization"]["serviceDescription"])
         self.assertEquals(authTypes[3], msg["Authorization"]["authType"])
         self.assertEquals("SMB", msg["Authorization"]["transportProtection"])
         self.assertTrue(self.is_guid(msg["Authorization"]["sessionId"]))
@@ -674,7 +675,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
     def test_ldap_anonymous_access(self):
         def isLastExpectedMessage(msg):
             return (msg["type"] == "Authorization" and
-                    msg["Authorization"]["serviceDescription"]  == "LDAP" and
+                    msg["Authorization"]["serviceDescription"] == "LDAP" and
                     msg["Authorization"]["transportProtection"] == "TLS" and
                     msg["Authorization"]["account"] == "ANONYMOUS LOGON" and
                     msg["Authorization"]["authType"] == "no bind")
@@ -808,7 +809,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     msg["Authorization"]["account"] == "ANONYMOUS LOGON" and
                     msg["Authorization"]["transportProtection"] == "SMB")
 
-        server   = os.environ["SERVER"]
+        server = os.environ["SERVER"]
 
         path = "//%s/IPC$" % server
         auth = "-N"
@@ -861,7 +862,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     msg["Authorization"]["account"] == "ANONYMOUS LOGON" and
                     msg["Authorization"]["transportProtection"] == "SMB")
 
-        server   = os.environ["SERVER"]
+        server = os.environ["SERVER"]
 
         path = "//%s/IPC$" % server
         auth = "-N"
@@ -1124,8 +1125,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_INTERACTIVE))
 
-        server   = os.environ["SERVER"]
-        user     = os.environ["USERNAME"]
+        server = os.environ["SERVER"]
+        user = os.environ["USERNAME"]
         password = os.environ["PASSWORD"]
         samlogon = "samlogon %s %s %s %d" % (user, password, workstation, 1)
 
@@ -1157,8 +1158,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_INTERACTIVE))
 
-        server   = os.environ["SERVER"]
-        user     = os.environ["USERNAME"]
+        server = os.environ["SERVER"]
+        user = os.environ["USERNAME"]
         password = "badPassword"
         samlogon = "samlogon %s %s %s %d" % (user, password, workstation, 1)
 
@@ -1190,8 +1191,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_INTERACTIVE))
 
-        server   = os.environ["SERVER"]
-        user     = "badUser"
+        server = os.environ["SERVER"]
+        user = "badUser"
         password = os.environ["PASSWORD"]
         samlogon = "samlogon %s %s %s %d" % (user, password, workstation, 1)
 
@@ -1221,8 +1222,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_NETWORK))
 
-        server   = os.environ["SERVER"]
-        user     = os.environ["USERNAME"]
+        server = os.environ["SERVER"]
+        user = os.environ["USERNAME"]
         password = os.environ["PASSWORD"]
         samlogon = "samlogon %s %s %s %d" % (user, password, workstation, 2)
 
@@ -1253,8 +1254,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_NETWORK))
 
-        server   = os.environ["SERVER"]
-        user     = os.environ["USERNAME"]
+        server = os.environ["SERVER"]
+        user = os.environ["USERNAME"]
         password = "badPassword"
         samlogon = "samlogon %s %s %s %d" % (user, password, workstation, 2)
 
@@ -1285,8 +1286,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_NETWORK))
 
-        server   = os.environ["SERVER"]
-        user     = "badUser"
+        server = os.environ["SERVER"]
+        user = "badUser"
         password = os.environ["PASSWORD"]
         samlogon = "samlogon %s %s %s %d" % (user, password, workstation, 2)
 
@@ -1317,8 +1318,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_NETWORK))
 
-        server   = os.environ["SERVER"]
-        user     = os.environ["USERNAME"]
+        server = os.environ["SERVER"]
+        user = os.environ["USERNAME"]
         password = os.environ["PASSWORD"]
         samlogon = "samlogon %s %s %s %d 0x00010000" % (
             user, password, workstation, 2)
@@ -1351,8 +1352,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_NETWORK))
 
-        server   = os.environ["SERVER"]
-        user     = os.environ["USERNAME"]
+        server = os.environ["SERVER"]
+        user = os.environ["USERNAME"]
         password = "badPassword"
         samlogon = "samlogon %s %s %s %d 0x00010000" % (
             user, password, workstation, 2)
@@ -1385,8 +1386,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_NETWORK))
 
-        server   = os.environ["SERVER"]
-        user     = "badUser"
+        server = os.environ["SERVER"]
+        user = "badUser"
         password = os.environ["PASSWORD"]
         samlogon = "samlogon %s %s %s %d 0x00010000" % (
             user, password, workstation, 2)
@@ -1417,8 +1418,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_NETWORK))
 
-        server   = os.environ["SERVER"]
-        user     = os.environ["USERNAME"]
+        server = os.environ["SERVER"]
+        user = os.environ["USERNAME"]
         password = os.environ["PASSWORD"]
         samlogon = "schannel;samlogon %s %s %s" % (user, password, workstation)
 
@@ -1459,8 +1460,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
                     (msg["Authentication"]["logonType"] ==
                         EVT_LOGON_NETWORK))
 
-        server   = os.environ["SERVER"]
-        user     = os.environ["USERNAME"]
+        server = os.environ["SERVER"]
+        user = os.environ["USERNAME"]
         password = os.environ["PASSWORD"]
         samlogon = "schannelsign;samlogon %s %s %s" % (
             user, password, workstation)
diff --git a/python/samba/tests/auth_log_base.py b/python/samba/tests/auth_log_base.py
index 374ee458639..38f5eb5175d 100644
--- a/python/samba/tests/auth_log_base.py
+++ b/python/samba/tests/auth_log_base.py
@@ -29,6 +29,7 @@ import re
 
 msg_ctxs = []
 
+
 class AuthLogTestBase(samba.tests.TestCase):
 
     def setUp(self):
diff --git a/python/samba/tests/auth_log_ncalrpc.py b/python/samba/tests/auth_log_ncalrpc.py
index d5b8735bcdb..1281d28040e 100644
--- a/python/samba/tests/auth_log_ncalrpc.py
+++ b/python/samba/tests/auth_log_ncalrpc.py
@@ -44,8 +44,8 @@ class AuthLogTestsNcalrpc(samba.tests.auth_log_base.AuthLogTestBase):
         def isLastExpectedMessage(msg):
             return (
                 msg["type"] == "Authorization" and
-                msg["Authorization"]["serviceDescription"]  == "DCE/RPC" and
-                msg["Authorization"]["authType"]            == authTypes[0] and
+                msg["Authorization"]["serviceDescription"] == "DCE/RPC" and
+                msg["Authorization"]["authType"] == authTypes[0] and
                 msg["Authorization"]["transportProtection"] == protection)
 
         if binding:
diff --git a/python/samba/tests/auth_log_netlogon.py b/python/samba/tests/auth_log_netlogon.py
index a52bd28191b..83ffd33c1a6 100644
--- a/python/samba/tests/auth_log_netlogon.py
+++ b/python/samba/tests/auth_log_netlogon.py
@@ -46,8 +46,8 @@ class AuthLogTestsNetLogon(samba.tests.auth_log_base.AuthLogTestBase):
 
     def setUp(self):
         super(AuthLogTestsNetLogon, self).setUp()
-        self.lp      = samba.tests.env_loadparm()
-        self.creds   = Credentials()
+        self.lp = samba.tests.env_loadparm()
+        self.creds = Credentials()
 
         self.session = system_session()
         self.ldb = SamDB(
@@ -55,13 +55,12 @@ class AuthLogTestsNetLogon(samba.tests.auth_log_base.AuthLogTestBase):
             credentials=self.creds,
             lp=self.lp)
 
-        self.domain        = os.environ["DOMAIN"]
-        self.netbios_name  = "NetLogonGood"
-        self.machinepass   = "abcdefghij"
+        self.domain = os.environ["DOMAIN"]
+        self.netbios_name = "NetLogonGood"
+        self.machinepass = "abcdefghij"
         self.remoteAddress = AS_SYSTEM_MAGIC_PATH_TOKEN
-        self.base_dn       = self.ldb.domain_dn()
-        self.dn            = ("cn=%s,cn=users,%s" %
-                              (self.netbios_name, self.base_dn))
+        self.base_dn = self.ldb.domain_dn()
+        self.dn = ("cn=%s,cn=users,%s" % (self.netbios_name, self.base_dn))
 
         utf16pw = text_type('"' + self.machinepass + '"').encode('utf-16-le')
         self.ldb.add({
@@ -81,8 +80,8 @@ class AuthLogTestsNetLogon(samba.tests.auth_log_base.AuthLogTestBase):
         def isLastExpectedMessage(msg):
             return (
                 msg["type"] == "Authorization" and
-                msg["Authorization"]["serviceDescription"]  == "DCE/RPC" and
-                msg["Authorization"]["authType"]            == "schannel" and
+                msg["Authorization"]["serviceDescription"] == "DCE/RPC" and
+                msg["Authorization"]["authType"] == "schannel" and
                 msg["Authorization"]["transportProtection"] == "SEAL")
 
         if binding:
diff --git a/python/samba/tests/auth_log_netlogon_bad_creds.py b/python/samba/tests/auth_log_netlogon_bad_creds.py
index 01cb8cd6af0..3b699bb6505 100644
--- a/python/samba/tests/auth_log_netlogon_bad_creds.py
+++ b/python/samba/tests/auth_log_netlogon_bad_creds.py
@@ -48,8 +48,8 @@ class AuthLogTestsNetLogonBadCreds(samba.tests.auth_log_base.AuthLogTestBase):
 
     def setUp(self):
         super(AuthLogTestsNetLogonBadCreds, self).setUp()
-        self.lp      = samba.tests.env_loadparm()
-        self.creds   = Credentials()
+        self.lp = samba.tests.env_loadparm()
+        self.creds = Credentials()
 
         self.session = system_session()
         self.ldb = SamDB(
@@ -57,13 +57,12 @@ class AuthLogTestsNetLogonBadCreds(samba.tests.auth_log_base.AuthLogTestBase):
             credentials=self.creds,
             lp=self.lp)
 
-        self.domain        = os.environ["DOMAIN"]
-        self.netbios_name  = "NetLogonBad"
-        self.machinepass   = "abcdefghij"
+        self.domain = os.environ["DOMAIN"]
+        self.netbios_name = "NetLogonBad"
+        self.machinepass = "abcdefghij"
         self.remoteAddress = AS_SYSTEM_MAGIC_PATH_TOKEN
-        self.base_dn       = self.ldb.domain_dn()
-        self.dn            = ("cn=%s,cn=users,%s" %
-                              (self.netbios_name, self.base_dn))
+        self.base_dn = self.ldb.domain_dn()
+        self.dn = ("cn=%s,cn=users,%s" % (self.netbios_name, self.base_dn))
 
         utf16pw = get_string('"' + self.machinepass + '"').encode('utf-16-le')
         self.ldb.add({
@@ -147,8 +146,8 @@ class AuthLogTestsNetLogonBadCreds(samba.tests.auth_log_base.AuthLogTestBase):
                 msg["Authentication"]["authDescription"] ==
                 "ServerAuthenticate" and
                 msg["Authentication"]["passwordType"] == "DES" and
-                msg["Authentication"]["eventId"] ==
-                    EVT_ID_UNSUCCESSFUL_LOGON and
+                (msg["Authentication"]["eventId"] ==
+                    EVT_ID_UNSUCCESSFUL_LOGON) and
                 msg["Authentication"]["logonType"] == EVT_LOGON_NETWORK)
 
         c = netlogon.netlogon("ncalrpc:[schannel]", self.get_loadparm())
diff --git a/python/samba/tests/auth_log_samlogon.py b/python/samba/tests/auth_log_samlogon.py
index 35f121e5bf0..eeb64df41eb 100644
--- a/python/samba/tests/auth_log_samlogon.py
+++ b/python/samba/tests/auth_log_samlogon.py
@@ -46,8 +46,8 @@ class AuthLogTestsSamLogon(samba.tests.auth_log_base.AuthLogTestBase):
 
     def setUp(self):
         super(AuthLogTestsSamLogon, self).setUp()
-        self.lp      = samba.tests.env_loadparm()
-        self.creds   = Credentials()
+        self.lp = samba.tests.env_loadparm()
+        self.creds = Credentials()
 
         self.session = system_session()
         self.ldb = SamDB(
@@ -55,13 +55,13 @@ class AuthLogTestsSamLogon(samba.tests.auth_log_base.AuthLogTestBase):
             credentials=self.creds,
             lp=self.lp)
 
-        self.domain        = os.environ["DOMAIN"]
-        self.netbios_name  = "SamLogonTest"
-        self.machinepass   = "abcdefghij"
+        self.domain = os.environ["DOMAIN"]
+        self.netbios_name = "SamLogonTest"
+        self.machinepass = "abcdefghij"
         self.remoteAddress = AS_SYSTEM_MAGIC_PATH_TOKEN
-        self.base_dn       = self.ldb.domain_dn()
-        self.samlogon_dn   = ("cn=%s,cn=users,%s" %
-                              (self.netbios_name, self.base_dn))
+        self.base_dn = self.ldb.domain_dn()
+        self.samlogon_dn = ("cn=%s,cn=users,%s" %
+                           (self.netbios_name, self.base_dn))
 
     def tearDown(self):
         super(AuthLogTestsSamLogon, self).tearDown()
@@ -72,9 +72,9 @@ class AuthLogTestsSamLogon(samba.tests.auth_log_base.AuthLogTestBase):
         def isLastExpectedMessage(msg):
             return (
                 msg["type"] == "Authentication" and
-                msg["Authentication"]["serviceDescription"]  == "SamLogon" and
-                msg["Authentication"]["authDescription"]     == "network" and
-                msg["Authentication"]["passwordType"]        == "NTLMv2" and
+                msg["Authentication"]["serviceDescription"] == "SamLogon" and
+                msg["Authentication"]["authDescription"] == "network" and
+                msg["Authentication"]["passwordType"] == "NTLMv2" and
                 (msg["Authentication"]["eventId"] ==
                     EVT_ID_SUCCESSFUL_LOGON) and
                 (msg["Authentication"]["logonType"] == EVT_LOGON_NETWORK))
@@ -130,10 +130,14 @@ class AuthLogTestsSamLogon(samba.tests.auth_log_base.AuthLogTestBase):
         logon_level = netlogon.NetlogonNetworkTransitiveInformation
         logon = samba.dcerpc.netlogon.netr_NetworkInfo()
 
-        logon.challenge = [x if isinstance(x,int) else ord(x) for x in challenge]
+        logon.challenge = [
+            x if isinstance(x, int) else ord(x) for x in challenge]
         logon.nt = netlogon.netr_ChallengeResponse()
         logon.nt.length = len(response["nt_response"])
-        logon.nt.data = [x if isinstance(x,int) else ord(x) for x in response["nt_response"]]
+        logon.nt.data = [
+            x if isinstance(x, int) else ord(x) for
+            x in response["nt_response"]
+        ]
         logon.identity_info = samba.dcerpc.netlogon.netr_IdentityInfo()
         (username, domain) = creds.get_ntlm_username_domain()
 
diff --git a/python/samba/tests/blackbox/smbcontrol_process.py b/python/samba/tests/blackbox/smbcontrol_process.py
index 4313c6faef3..b4ccc4c455c 100644
--- a/python/samba/tests/blackbox/smbcontrol_process.py
+++ b/python/samba/tests/blackbox/smbcontrol_process.py
@@ -54,6 +54,10 @@ class SmbcontrolProcessBlockboxTests(BlackboxTestCase):
     def test_inject_fault(self):
         INJECT = "inject"
         FAULT = "segv"
+        #
+        # Note that this process name needs to be different to the one used
+        # in the sleep test to avoid a race condition
+        #
         pid = self.get_process("rpc_server")
 
         #
@@ -90,7 +94,11 @@ class SmbcontrolProcessBlockboxTests(BlackboxTestCase):
         DURATION = 5     # duration to sleep server for
         DELTA = 1        # permitted error for the sleep duration
 
-        pid = self.get_process("rpc_server")
+        #
+        # Note that this process name needs to be different to the one used
+        # in the inject fault test to avoid a race condition
+        #
+        pid = self.get_process("ldap_server")
         #
         # Ensure we can ping the process before getting it to sleep
         #
diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py
index 8762abf8f59..275d4fcd692 100644
--- a/python/samba/tests/dns.py
+++ b/python/samba/tests/dns.py
@@ -1080,7 +1080,7 @@ class TestZones(DNSTest):
             if num != werror.WERR_DNS_ERROR_ZONE_DOES_NOT_EXIST:
                 raise
 
-    def create_zone(self, zone, aging_enabled=False):
+    def make_zone_obj(self, zone, aging_enabled=False):
         zone_create = dnsserver.DNS_RPC_ZONE_CREATE_INFO_LONGHORN()
         zone_create.pszZoneName = zone
         zone_create.dwZoneType = dnsp.DNS_ZONE_TYPE_PRIMARY
@@ -1089,6 +1089,10 @@ class TestZones(DNSTest):
         zone_create.fDsIntegrated = 1
         zone_create.fLoadExisting = 1
         zone_create.fAllowUpdate = dnsp.DNS_ZONE_UPDATE_UNSECURE
+        return zone_create
+
+    def create_zone(self, zone, aging_enabled=False):
+        zone_create = self.make_zone_obj(zone, aging_enabled)


-- 
Samba Shared Repository



More information about the samba-cvs mailing list