222 lines
13 KiB
Diff
222 lines
13 KiB
Diff
|
|
From 9cb6b4e9131afac71a39a2f6a3c142723cb6ca19 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Joe Guo <joeg@catalyst.net.nz>
|
||
|
|
Date: Mon, 30 Jul 2018 18:19:21 +1200
|
||
|
|
Subject: [PATCH 13/17] CVE-2018-16857 PEP8: fix E251: unexpected spaces around
|
||
|
|
keyword / parameter equals
|
||
|
|
|
||
|
|
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
|
||
|
|
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
||
|
|
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
|
||
|
|
|
||
|
|
Partial backport of commit 1ccc36b4010cd63 (only password_lockout_base.py
|
||
|
|
change) as a dependency for:
|
||
|
|
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13683
|
||
|
|
---
|
||
|
|
.../tests/python/password_lockout_base.py | 60 +++++++------------
|
||
|
|
1 file changed, 20 insertions(+), 40 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/source4/dsdb/tests/python/password_lockout_base.py b/source4/dsdb/tests/python/password_lockout_base.py
|
||
|
|
index 1b408c75166..48a74018624 100644
|
||
|
|
--- a/source4/dsdb/tests/python/password_lockout_base.py
|
||
|
|
+++ b/source4/dsdb/tests/python/password_lockout_base.py
|
||
|
|
@@ -93,8 +93,7 @@ class BasePasswordTestCase(PasswordTestCase):
|
||
|
|
logonCount=0,
|
||
|
|
lastLogon=0,
|
||
|
|
lastLogonTimestamp=("absent", None),
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
|
||
|
|
def _check_account(self, dn,
|
||
|
|
@@ -389,8 +388,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
logonCount=(logoncount_relation, 0),
|
||
|
|
lastLogon=("greater", 0),
|
||
|
|
lastLogonTimestamp=("greater", 0),
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||
|
|
logonCount = int(res[0]["logonCount"][0])
|
||
|
|
@@ -420,8 +418,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
logonCount=logonCount,
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0,
|
||
|
|
msg='lastlogontimestamp with wrong password')
|
||
|
|
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||
|
|
@@ -439,8 +436,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
logonCount=(logoncount_relation, logonCount),
|
||
|
|
lastLogon=('greater', lastLogon),
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0,
|
||
|
|
msg='LLTimestamp is updated to lastlogon')
|
||
|
|
|
||
|
|
@@ -460,8 +456,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
logonCount=logonCount,
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||
|
|
|
||
|
|
@@ -482,8 +477,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
logonCount=logonCount,
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||
|
|
|
||
|
|
@@ -507,8 +501,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
lockoutTime=("greater", badPasswordTime),
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||
|
|
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||
|
|
lockoutTime = int(res[0]["lockoutTime"][0])
|
||
|
|
@@ -529,8 +522,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
lockoutTime=lockoutTime,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||
|
|
|
||
|
|
# The wrong password
|
||
|
|
@@ -549,8 +541,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
lockoutTime=lockoutTime,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||
|
|
|
||
|
|
# The correct password, but we are locked out
|
||
|
|
@@ -569,8 +560,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
lockoutTime=lockoutTime,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||
|
|
|
||
|
|
# wait for the lockout to end
|
||
|
|
@@ -584,8 +574,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lockoutTime=lockoutTime,
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
|
||
|
|
# The correct password after letting the timeout expire
|
||
|
|
@@ -604,8 +593,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lastLogon=(lastlogon_relation, lastLogon),
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
lockoutTime=0,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0,
|
||
|
|
msg="lastLogon is way off")
|
||
|
|
|
||
|
|
@@ -628,8 +616,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lockoutTime=0,
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||
|
|
|
||
|
|
@@ -649,8 +636,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lockoutTime=0,
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||
|
|
|
||
|
|
@@ -663,8 +649,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lockoutTime=0,
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
|
||
|
|
# The wrong password
|
||
|
|
@@ -683,8 +668,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lockoutTime=0,
|
||
|
|
lastLogon=lastLogon,
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||
|
|
|
||
|
|
@@ -699,8 +683,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
lockoutTime=0,
|
||
|
|
lastLogon=("greater", lastLogon),
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
|
||
|
|
def _test_multiple_logon(self, creds):
|
||
|
|
@@ -733,8 +716,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
logonCount=(logoncount_relation, 0),
|
||
|
|
lastLogon=("greater", 0),
|
||
|
|
lastLogonTimestamp=("greater", 0),
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||
|
|
logonCount = int(res[0]["logonCount"][0])
|
||
|
|
@@ -754,8 +736,7 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
logonCount=(logoncount_relation, logonCount),
|
||
|
|
lastLogon=(lastlogon_relation, lastLogon),
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0,
|
||
|
|
msg=("second logon, firstlogon was %s" %
|
||
|
|
firstLogon))
|
||
|
|
@@ -773,6 +754,5 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||
|
|
logonCount=(logoncount_relation, logonCount),
|
||
|
|
lastLogon=(lastlogon_relation, lastLogon),
|
||
|
|
lastLogonTimestamp=lastLogonTimestamp,
|
||
|
|
- userAccountControl=
|
||
|
|
- dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
+ userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||
|
|
msDSUserAccountControlComputed=0)
|
||
|
|
--
|
||
|
|
2.17.1
|