1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

traffic: simplify tests for badpassword_frequency

x <= 0 will fail one or both of the other test clauses.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2018-10-19 17:19:09 +13:00 committed by Douglas Bagnall
parent 65c02fd68c
commit 41b0cfce2c

View File

@ -480,8 +480,8 @@ class ReplayContext(object):
than that requested, but not significantly.
"""
if not failed_last_time:
if (self.badpassword_frequency and self.badpassword_frequency > 0
and random.random() < self.badpassword_frequency):
if (self.badpassword_frequency and
random.random() < self.badpassword_frequency):
try:
f(bad)
except:
@ -762,7 +762,8 @@ class ReplayContext(object):
def get_authenticator(self):
auth = self.machine_creds.new_client_authenticator()
current = netr_Authenticator()
current.cred.data = [x if isinstance(x, int) else ord(x) for x in auth["credential"]]
current.cred.data = [x if isinstance(x, int) else ord(x)
for x in auth["credential"]]
current.timestamp = auth["timestamp"]
subsequent = netr_Authenticator()