mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
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>
This commit is contained in:
@ -1455,8 +1455,8 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
|
||||
object. This is used to fix missing replPropertyMetaData elements'''
|
||||
guid_str = str(ndr_unpack(misc.GUID, obj['objectGUID'][0]))
|
||||
dn = ldb.Dn(self.samdb, "<GUID=%s>" % guid_str)
|
||||
res = self.samdb.search(base = dn, scope=ldb.SCOPE_BASE, attrs = [attr],
|
||||
controls = ["search_options:1:2",
|
||||
res = self.samdb.search(base=dn, scope=ldb.SCOPE_BASE, attrs=[attr],
|
||||
controls=["search_options:1:2",
|
||||
"show_recycled:1"])
|
||||
msg = res[0]
|
||||
nmsg = ldb.Message()
|
||||
|
@ -524,7 +524,7 @@ def get_clean_sd(sd):
|
||||
return sd_clean
|
||||
|
||||
|
||||
def get_diff_sds(refsd, cursd, domainsid, checkSacl = True):
|
||||
def get_diff_sds(refsd, cursd, domainsid, checkSacl=True):
|
||||
"""Get the difference between 2 sd
|
||||
|
||||
This function split the textual representation of ACL into smaller
|
||||
|
@ -298,7 +298,7 @@ def __parse_schema_file(filename, objectClass):
|
||||
return "\n\n".join(out)
|
||||
|
||||
|
||||
def read_ms_schema(attr_file, classes_file, dump_attributes = True, dump_classes = True, debug = False):
|
||||
def read_ms_schema(attr_file, classes_file, dump_attributes=True, dump_classes=True, debug=False):
|
||||
"""Read WSPP documentation-derived schema files."""
|
||||
|
||||
attr_ldif = ""
|
||||
|
@ -122,7 +122,7 @@ Example3 adds a new RFC2307 enabled group for NIS domain samdom and GID 12345 (b
|
||||
try:
|
||||
samdb = SamDB(url=H, session_info=system_session(),
|
||||
credentials=creds, lp=lp)
|
||||
samdb.newgroup(groupname, groupou=groupou, grouptype = gtype,
|
||||
samdb.newgroup(groupname, groupou=groupou, grouptype=gtype,
|
||||
description=description, mailaddress=mail_address, notes=notes,
|
||||
gidnumber=gid_number, nisdomain=nis_domain)
|
||||
except Exception as e:
|
||||
|
@ -1251,7 +1251,7 @@ def setup_bind9_dns(samdb, secretsdb, names, paths, lp, logger,
|
||||
|
||||
create_named_txt(paths.namedtxt,
|
||||
realm=names.realm, dnsdomain=names.dnsdomain,
|
||||
dnsname = "%s.%s" % (names.hostname, names.dnsdomain),
|
||||
dnsname="%s.%s" % (names.hostname, names.dnsdomain),
|
||||
binddns_dir=paths.binddns_dir,
|
||||
keytab_name=paths.dns_keytab)
|
||||
logger.info("See %s for an example configuration include file for BIND",
|
||||
|
@ -89,7 +89,7 @@ class AuthAdminSessionTests(samba.tests.TestCase):
|
||||
self.assertTrue(self.admin_session.security_token.has_builtin_administrators())
|
||||
|
||||
def test_session_info_unix_details(self):
|
||||
samba.auth.session_info_fill_unix(session_info = self.admin_session,
|
||||
samba.auth.session_info_fill_unix(session_info=self.admin_session,
|
||||
lp_ctx=self.lp,
|
||||
user_name="Administrator")
|
||||
self.assertEqual(self.admin_session.unix_info.sanitized_username,
|
||||
|
@ -121,7 +121,7 @@ class DnsserverTests(RpcInterfaceTestCase):
|
||||
self.get_credentials())
|
||||
|
||||
self.samdb = SamDB(url="ldap://%s" % os.environ["DC_SERVER_IP"],
|
||||
lp = self.get_loadparm(),
|
||||
lp=self.get_loadparm(),
|
||||
session_info=system_session(),
|
||||
credentials=self.get_credentials())
|
||||
|
||||
|
@ -75,7 +75,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
# And now try a request
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -142,7 +142,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
# And now try a request
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -567,7 +567,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0xffff,
|
||||
stub="")
|
||||
@ -637,7 +637,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=12345,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -889,7 +889,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, zero_syntax)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1a.context_id,
|
||||
opnum=0xffff,
|
||||
stub="")
|
||||
@ -964,7 +964,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx0.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1003,7 +1003,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1042,7 +1042,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[0].syntax, ndr32)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx2.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1093,7 +1093,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[1].syntax, zero_syntax)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx3.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1130,7 +1130,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[1].syntax, zero_syntax)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx4.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1143,7 +1143,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertEquals(rep.u.cancel_count, 0)
|
||||
self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx3.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1180,7 +1180,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[1].syntax, zero_syntax)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx4.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1193,7 +1193,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertEquals(rep.u.cancel_count, 0)
|
||||
self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx3.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1244,7 +1244,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[1].syntax, zero_syntax)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx5mgmt.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1281,7 +1281,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertNDRSyntaxEquals(rep.u.ctx_list[1].syntax, zero_syntax)
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx5mgmt.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1635,7 +1635,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertEquals(len(rep.u.auth_info), 0)
|
||||
|
||||
# And now try a request without auth_info
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -1653,7 +1653,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob="none")
|
||||
|
||||
req = self.generate_request(call_id = 3,
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="",
|
||||
@ -1755,7 +1755,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
chunk_size = rep_both - dcerpc.DCERPC_REQUEST_LENGTH
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
alloc_hint=0xffffffff,
|
||||
@ -1770,7 +1770,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
|
||||
|
||||
chunk_size = 5840 - dcerpc.DCERPC_REQUEST_LENGTH
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
alloc_hint=0xffffffff,
|
||||
@ -1785,7 +1785,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
|
||||
|
||||
chunk_size += 1
|
||||
req = self.generate_request(call_id = 3,
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
alloc_hint=0xffffffff,
|
||||
@ -1882,7 +1882,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertEquals(rep.u.auth_info, '\0' * 0)
|
||||
|
||||
# And now try a request without auth_info
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
alloc_hint=0xffffffff,
|
||||
@ -1896,7 +1896,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertEquals(rep.u.cancel_count, 0)
|
||||
self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
|
||||
|
||||
req = self.generate_request(call_id = 3,
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx.context_id,
|
||||
opnum=1,
|
||||
alloc_hint=0xffffffff,
|
||||
@ -1910,7 +1910,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertEquals(rep.u.cancel_count, 0)
|
||||
self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
|
||||
|
||||
req = self.generate_request(call_id = 4,
|
||||
req = self.generate_request(call_id=4,
|
||||
context_id=ctx.context_id,
|
||||
opnum=1,
|
||||
alloc_hint=1,
|
||||
@ -1975,7 +1975,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
|
||||
# And now try a request without auth_info
|
||||
# netr_ServerReqChallenge()
|
||||
req = self.generate_request(call_id = 0x21234,
|
||||
req = self.generate_request(call_id=0x21234,
|
||||
pfc_flags=pfc_flags,
|
||||
context_id=ctx.context_id,
|
||||
opnum=4,
|
||||
@ -2084,7 +2084,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
(ctx, rep, real_stub) = self._get_netlogon_ctx()
|
||||
|
||||
# netr_ServerReqChallenge with given flags
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
pfc_flags=pfc_flags,
|
||||
context_id=ctx.context_id,
|
||||
opnum=4,
|
||||
@ -2114,7 +2114,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
|
||||
# netr_ServerReqChallenge without DCERPC_PFC_FLAG_LAST
|
||||
# with the same call_id
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
pfc_flags=pfc_flags,
|
||||
context_id=ctx.context_id,
|
||||
opnum=4,
|
||||
@ -2178,7 +2178,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
(ctx, rep, real_stub) = self._get_netlogon_ctx()
|
||||
|
||||
# netr_ServerReqChallenge with given flags
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
dcerpc.DCERPC_PFC_FLAG_PENDING_CANCEL,
|
||||
context_id=ctx.context_id,
|
||||
@ -2209,7 +2209,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
(ctx, rep, real_stub) = self._get_netlogon_ctx()
|
||||
|
||||
# netr_ServerReqChallenge with given flags
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=4,
|
||||
@ -2220,7 +2220,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsConnected()
|
||||
|
||||
# netr_ServerReqChallenge with given flags
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_PENDING_CANCEL,
|
||||
context_id=ctx.context_id,
|
||||
opnum=4,
|
||||
@ -2231,7 +2231,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsConnected()
|
||||
|
||||
# netr_ServerReqChallenge with given flags
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=4,
|
||||
@ -2253,7 +2253,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
(ctx, rep, real_stub) = self._get_netlogon_ctx()
|
||||
|
||||
# netr_ServerReqChallenge with given flags
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=4,
|
||||
@ -2264,7 +2264,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsConnected()
|
||||
|
||||
# netr_ServerReqChallenge with given flags
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_LAST |
|
||||
dcerpc.DCERPC_PFC_FLAG_PENDING_CANCEL,
|
||||
context_id=ctx.context_id,
|
||||
@ -2287,7 +2287,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
(ctx, rep, real_stub) = self._get_netlogon_ctx()
|
||||
|
||||
# netr_ServerReqChallenge with given flags
|
||||
req = self.generate_request(call_id = 50,
|
||||
req = self.generate_request(call_id=50,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=4,
|
||||
@ -2298,7 +2298,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsConnected()
|
||||
|
||||
# netr_ServerReqChallenge with given flags
|
||||
req = self.generate_request(call_id = 51,
|
||||
req = self.generate_request(call_id=51,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=4,
|
||||
@ -2323,14 +2323,14 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
abstract = samba.dcerpc.mgmt.abstract_syntax()
|
||||
ctx = self.prepare_presentation(abstract, ndr32, context_id=0xff)
|
||||
|
||||
req = self.generate_co_cancel(call_id = 3)
|
||||
req = self.generate_co_cancel(call_id=3)
|
||||
self.send_pdu(req)
|
||||
rep = self.recv_pdu(timeout=0.01)
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
# And now try a request
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -2348,7 +2348,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
abstract = samba.dcerpc.mgmt.abstract_syntax()
|
||||
ctx = self.prepare_presentation(abstract, ndr32, context_id=0xff)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
@ -2358,13 +2358,13 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
req = self.generate_co_cancel(call_id = 1)
|
||||
req = self.generate_co_cancel(call_id=1)
|
||||
self.send_pdu(req)
|
||||
rep = self.recv_pdu(timeout=0.01)
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
@ -2379,7 +2379,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
|
||||
|
||||
# And now try a request
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -2397,14 +2397,14 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
abstract = samba.dcerpc.mgmt.abstract_syntax()
|
||||
ctx = self.prepare_presentation(abstract, ndr32)
|
||||
|
||||
req = self.generate_orphaned(call_id = 3)
|
||||
req = self.generate_orphaned(call_id=3)
|
||||
self.send_pdu(req)
|
||||
rep = self.recv_pdu(timeout=0.01)
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
# And now try a request
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -2422,7 +2422,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
abstract = samba.dcerpc.mgmt.abstract_syntax()
|
||||
ctx = self.prepare_presentation(abstract, ndr32)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
@ -2432,13 +2432,13 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
req = self.generate_orphaned(call_id = 1)
|
||||
req = self.generate_orphaned(call_id=1)
|
||||
self.send_pdu(req)
|
||||
rep = self.recv_pdu(timeout=0.1)
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
@ -2453,7 +2453,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
|
||||
|
||||
# And now try a request
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -2475,7 +2475,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
pfc_flags |= samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_CONC_MPX
|
||||
ctx = self.prepare_presentation(abstract, ndr32, pfc_flags=pfc_flags)
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
@ -2485,13 +2485,13 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
req = self.generate_orphaned(call_id = 1)
|
||||
req = self.generate_orphaned(call_id=1)
|
||||
self.send_pdu(req)
|
||||
rep = self.recv_pdu(timeout=0.1)
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
req = self.generate_request(call_id = 1,
|
||||
req = self.generate_request(call_id=1,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
@ -2506,7 +2506,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
|
||||
|
||||
# And now try a request
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -2524,7 +2524,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
abstract = samba.dcerpc.mgmt.abstract_syntax()
|
||||
ctx = self.prepare_presentation(abstract, ndr32)
|
||||
|
||||
req1 = self.generate_request(call_id = 1,
|
||||
req1 = self.generate_request(call_id=1,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
@ -2534,14 +2534,14 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
req = self.generate_orphaned(call_id = 1)
|
||||
req = self.generate_orphaned(call_id=1)
|
||||
self.send_pdu(req)
|
||||
rep = self.recv_pdu(timeout=0.1)
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
# And now try a new request
|
||||
req2 = self.generate_request(call_id = 2,
|
||||
req2 = self.generate_request(call_id=2,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -2572,7 +2572,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
ctx = self.prepare_presentation(abstract, ndr32,
|
||||
pfc_flags=pfc_flags)
|
||||
|
||||
req1 = self.generate_request(call_id = 1,
|
||||
req1 = self.generate_request(call_id=1,
|
||||
pfc_flags=dcerpc.DCERPC_PFC_FLAG_FIRST,
|
||||
context_id=ctx.context_id,
|
||||
opnum=0,
|
||||
@ -2582,14 +2582,14 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
req = self.generate_orphaned(call_id = 1)
|
||||
req = self.generate_orphaned(call_id=1)
|
||||
self.send_pdu(req)
|
||||
rep = self.recv_pdu(timeout=0.1)
|
||||
self.assertIsNone(rep)
|
||||
self.assertIsConnected()
|
||||
|
||||
# And now try a new request
|
||||
req2 = self.generate_request(call_id = 2,
|
||||
req2 = self.generate_request(call_id=2,
|
||||
context_id=ctx.context_id - 1,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -2699,7 +2699,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertTrue(finished)
|
||||
|
||||
# And now try a request without auth_info
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -2717,7 +2717,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_level=auth_level,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob="\x01" +"\x00" *15)
|
||||
req = self.generate_request(call_id = 3,
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="",
|
||||
@ -2736,8 +2736,8 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_info = self.generate_auth(auth_type=auth_type,
|
||||
auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob="\x01" +"\x00" * 15)
|
||||
req = self.generate_request(call_id = 4,
|
||||
auth_blob="\x01" + "\x00" * 15)
|
||||
req = self.generate_request(call_id=4,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="",
|
||||
@ -2852,8 +2852,8 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_info = self.generate_auth(auth_type=auth_type,
|
||||
auth_level=dcerpc.DCERPC_AUTH_LEVEL_CONNECT,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob="\x01" +"\x00" * 15)
|
||||
req = self.generate_request(call_id = 3,
|
||||
auth_blob="\x01" + "\x00" * 15)
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="",
|
||||
@ -2936,8 +2936,8 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_info = self.generate_auth(auth_type=auth_type,
|
||||
auth_level=auth_level,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob="\x01" +"\x00" * 15)
|
||||
req = self.generate_request(call_id = 1,
|
||||
auth_blob="\x01" + "\x00" * 15)
|
||||
req = self.generate_request(call_id=1,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="",
|
||||
@ -3027,7 +3027,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsConnected()
|
||||
|
||||
# And now try a request without auth_info
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -3137,7 +3137,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertTrue(finished)
|
||||
|
||||
# And now try a request without auth_info
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -3154,8 +3154,8 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_info = self.generate_auth(auth_type=auth_type,
|
||||
auth_level=auth_level,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob="\x01" +"\x00" * 15)
|
||||
req = self.generate_request(call_id = 3,
|
||||
auth_blob="\x01" + "\x00" * 15)
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="",
|
||||
@ -3298,7 +3298,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertTrue(finished)
|
||||
|
||||
# And now try a request without auth_info
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -3315,8 +3315,8 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_info = self.generate_auth(auth_type=auth_type,
|
||||
auth_level=auth_level,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob="\x01" +"\x00" * 15)
|
||||
req = self.generate_request(call_id = 3,
|
||||
auth_blob="\x01" + "\x00" * 15)
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="",
|
||||
@ -3996,7 +3996,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertTrue(finished)
|
||||
|
||||
# And now try a request without auth_info
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -4013,8 +4013,8 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_info = self.generate_auth(auth_type=auth_type,
|
||||
auth_level=auth_level,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob="\x01" +"\x00" * 15)
|
||||
req = self.generate_request(call_id = 3,
|
||||
auth_blob="\x01" + "\x00" * 15)
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="",
|
||||
@ -4291,7 +4291,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
self.assertIsConnected()
|
||||
|
||||
# And now try a request without auth_info
|
||||
req = self.generate_request(call_id = 2,
|
||||
req = self.generate_request(call_id=2,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="")
|
||||
@ -4308,8 +4308,8 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_info = self.generate_auth(auth_type=auth_type,
|
||||
auth_level=auth_level,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob="\x01" +"\x00" * 15)
|
||||
req = self.generate_request(call_id = 3,
|
||||
auth_blob="\x01" + "\x00" * 15)
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub="",
|
||||
@ -4494,7 +4494,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_pad_length=auth_pad_length,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob=zero_sig)
|
||||
req = self.generate_request(call_id = 4,
|
||||
req = self.generate_request(call_id=4,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0xffff,
|
||||
stub=stub_bin,
|
||||
@ -4512,7 +4512,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_pad_length=auth_pad_length,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob=sig)
|
||||
req = self.generate_request(call_id = 4,
|
||||
req = self.generate_request(call_id=4,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0xffff,
|
||||
stub=stub_bin,
|
||||
@ -4661,7 +4661,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_pad_length=auth_pad_length,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob=zero_sig)
|
||||
req = self.generate_request(call_id = 3,
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub=stub_bin,
|
||||
@ -4678,7 +4678,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_pad_length=auth_pad_length,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob=sig)
|
||||
req = self.generate_request(call_id = 3,
|
||||
req = self.generate_request(call_id=3,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0,
|
||||
stub=stub_bin,
|
||||
@ -4727,7 +4727,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_pad_length=auth_pad_length,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob=zero_sig)
|
||||
req = self.generate_request(call_id = 4,
|
||||
req = self.generate_request(call_id=4,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0xffff,
|
||||
stub=stub_bin,
|
||||
@ -4744,7 +4744,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_pad_length=auth_pad_length,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob=sig)
|
||||
req = self.generate_request(call_id = 4,
|
||||
req = self.generate_request(call_id=4,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=0xffff,
|
||||
stub=stub_bin,
|
||||
@ -4778,7 +4778,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_pad_length=auth_pad_length,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob=zero_sig)
|
||||
req = self.generate_request(call_id = 5,
|
||||
req = self.generate_request(call_id=5,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=1,
|
||||
stub=stub_bin,
|
||||
@ -4795,7 +4795,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_pad_length=auth_pad_length,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob=sig)
|
||||
req = self.generate_request(call_id = 5,
|
||||
req = self.generate_request(call_id=5,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=1,
|
||||
stub=stub_bin,
|
||||
@ -4843,7 +4843,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_pad_length=auth_pad_length,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob=zero_sig)
|
||||
req = self.generate_request(call_id = 6,
|
||||
req = self.generate_request(call_id=6,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=3,
|
||||
stub=stub_bin,
|
||||
@ -4860,7 +4860,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
auth_pad_length=auth_pad_length,
|
||||
auth_context_id=auth_context_id,
|
||||
auth_blob=sig)
|
||||
req = self.generate_request(call_id = 6,
|
||||
req = self.generate_request(call_id=6,
|
||||
context_id=ctx1.context_id,
|
||||
opnum=3,
|
||||
stub=stub_bin,
|
||||
@ -4966,18 +4966,18 @@ class TestDCERPC_BIND(RawDCERPCTest):
|
||||
context_id=2, return_ack=True)
|
||||
|
||||
inq_if_ids = samba.dcerpc.mgmt.inq_if_ids()
|
||||
self.do_single_request(call_id = 1, ctx=ctx1, io=inq_if_ids)
|
||||
conn2.do_single_request(call_id = 1, ctx=ctx2, io=inq_if_ids)
|
||||
self.do_single_request(call_id=1, ctx=ctx1, io=inq_if_ids)
|
||||
conn2.do_single_request(call_id=1, ctx=ctx2, io=inq_if_ids)
|
||||
|
||||
conn2.do_single_request(call_id = 1, ctx=ctx1, io=inq_if_ids,
|
||||
fault_pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
conn2.do_single_request(call_id=1, ctx=ctx1, io=inq_if_ids,
|
||||
fault_pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_DID_NOT_EXECUTE,
|
||||
fault_status=dcerpc.DCERPC_NCA_S_UNKNOWN_IF,
|
||||
fault_context_id=0)
|
||||
|
||||
self.do_single_request(call_id = 1, ctx=ctx1, io=inq_if_ids)
|
||||
conn2.do_single_request(call_id = 1, ctx=ctx2, io=inq_if_ids)
|
||||
self.do_single_request(call_id=1, ctx=ctx1, io=inq_if_ids)
|
||||
conn2.do_single_request(call_id=1, ctx=ctx2, io=inq_if_ids)
|
||||
return
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -292,7 +292,7 @@ class RawDCERPCTest(TestCase):
|
||||
allow_remaining=False,
|
||||
send_req=True,
|
||||
recv_rep=True,
|
||||
fault_pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
fault_pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
fault_status=None,
|
||||
fault_context_id=None,
|
||||
@ -637,9 +637,9 @@ class RawDCERPCTest(TestCase):
|
||||
def generate_pdu(self, ptype, call_id, payload,
|
||||
rpc_vers=5,
|
||||
rpc_vers_minor=0,
|
||||
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
drep = [samba.dcerpc.dcerpc.DCERPC_DREP_LE, 0, 0, 0],
|
||||
drep=[samba.dcerpc.dcerpc.DCERPC_DREP_LE, 0, 0, 0],
|
||||
ndr_print=None, hexdump=None):
|
||||
|
||||
if getattr(payload, 'auth_info', None):
|
||||
@ -669,9 +669,9 @@ class RawDCERPCTest(TestCase):
|
||||
def verify_pdu(self, p, ptype, call_id,
|
||||
rpc_vers=5,
|
||||
rpc_vers_minor=0,
|
||||
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
drep = [samba.dcerpc.dcerpc.DCERPC_DREP_LE, 0, 0, 0],
|
||||
drep=[samba.dcerpc.dcerpc.DCERPC_DREP_LE, 0, 0, 0],
|
||||
auth_length=None):
|
||||
|
||||
self.assertIsNotNone(p, "No valid pdu")
|
||||
@ -700,7 +700,7 @@ class RawDCERPCTest(TestCase):
|
||||
return
|
||||
|
||||
def generate_bind(self, call_id,
|
||||
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
max_xmit_frag=5840,
|
||||
max_recv_frag=5840,
|
||||
@ -726,7 +726,7 @@ class RawDCERPCTest(TestCase):
|
||||
return p
|
||||
|
||||
def generate_alter(self, call_id,
|
||||
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
max_xmit_frag=5840,
|
||||
max_recv_frag=5840,
|
||||
@ -752,7 +752,7 @@ class RawDCERPCTest(TestCase):
|
||||
return p
|
||||
|
||||
def generate_auth3(self, call_id,
|
||||
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
auth_info="",
|
||||
ndr_print=None, hexdump=None):
|
||||
@ -769,7 +769,7 @@ class RawDCERPCTest(TestCase):
|
||||
return p
|
||||
|
||||
def generate_request(self, call_id,
|
||||
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
alloc_hint=None,
|
||||
context_id=None,
|
||||
@ -802,7 +802,7 @@ class RawDCERPCTest(TestCase):
|
||||
return p
|
||||
|
||||
def generate_co_cancel(self, call_id,
|
||||
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
auth_info="",
|
||||
ndr_print=None, hexdump=None):
|
||||
@ -819,7 +819,7 @@ class RawDCERPCTest(TestCase):
|
||||
return p
|
||||
|
||||
def generate_orphaned(self, call_id,
|
||||
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
auth_info="",
|
||||
ndr_print=None, hexdump=None):
|
||||
@ -836,7 +836,7 @@ class RawDCERPCTest(TestCase):
|
||||
return p
|
||||
|
||||
def generate_shutdown(self, call_id,
|
||||
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
|
||||
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
|
||||
ndr_print=None, hexdump=None):
|
||||
|
||||
|
@ -158,7 +158,7 @@ class SmbDotConfTests(TestCase):
|
||||
|
||||
# registry shares appears to need sudo
|
||||
self._set_arbitrary(['bin/testparm'],
|
||||
exceptions = ['client lanman auth',
|
||||
exceptions=['client lanman auth',
|
||||
'client plaintext auth',
|
||||
'registry shares',
|
||||
'smb ports',
|
||||
@ -170,7 +170,7 @@ class SmbDotConfTests(TestCase):
|
||||
self._test_default(['bin/samba-tool', 'testparm'])
|
||||
self._set_defaults(['bin/samba-tool', 'testparm'])
|
||||
self._set_arbitrary(['bin/samba-tool', 'testparm'],
|
||||
exceptions = ['smb ports',
|
||||
exceptions=['smb ports',
|
||||
'rpc server dynamic port range',
|
||||
'name resolve order'])
|
||||
self._test_empty(['bin/samba-tool', 'testparm'])
|
||||
|
@ -70,7 +70,7 @@ class UserCmdCryptShaTestCase(SambaToolCmdTest):
|
||||
def setUp(self):
|
||||
super(UserCmdCryptShaTestCase, self).setUp()
|
||||
|
||||
def add_user(self, hashes = ""):
|
||||
def add_user(self, hashes=""):
|
||||
self.lp = samba.tests.env_loadparm()
|
||||
|
||||
# set the extra hashes to be calculated
|
||||
@ -92,7 +92,7 @@ class UserCmdCryptShaTestCase(SambaToolCmdTest):
|
||||
super(UserCmdCryptShaTestCase, self).tearDown()
|
||||
self.runsubcmd("user", "delete", USER_NAME)
|
||||
|
||||
def _get_password(self, attributes, decrypt = False):
|
||||
def _get_password(self, attributes, decrypt=False):
|
||||
command = ["user",
|
||||
"getpassword",
|
||||
USER_NAME,
|
||||
|
@ -730,7 +730,7 @@ Please fix this account before attempting to upgrade again
|
||||
result = provision(logger, session_info,
|
||||
targetdir=targetdir, realm=realm, domain=domainname,
|
||||
domainsid=domainsid, next_rid=next_rid,
|
||||
dc_rid=machinerid, adminpass = adminpass,
|
||||
dc_rid=machinerid, adminpass=adminpass,
|
||||
dom_for_fun_level=dsdb.DS_DOMAIN_FUNCTION_2003,
|
||||
hostname=netbiosname.lower(), machinepass=machinepass,
|
||||
serverrole=serverrole, samdb_fill=FILL_FULL,
|
||||
|
@ -635,7 +635,7 @@ def write_pidfile(fname):
|
||||
f.close()
|
||||
|
||||
|
||||
def rebase_tree(rebase_url, rebase_branch = "master"):
|
||||
def rebase_tree(rebase_url, rebase_branch="master"):
|
||||
rebase_remote = "rebaseon"
|
||||
do_print("Rebasing on %s" % rebase_url)
|
||||
run_cmd("git describe HEAD", show=True, dir=test_master)
|
||||
@ -666,7 +666,7 @@ def rebase_tree(rebase_url, rebase_branch = "master"):
|
||||
(rebase_remote, rebase_branch),
|
||||
show=True, dir=test_master)
|
||||
|
||||
def push_to(push_url, push_branch = "master"):
|
||||
def push_to(push_url, push_branch="master"):
|
||||
push_remote = "pushto"
|
||||
do_print("Pushing to %s" % push_url)
|
||||
if options.mark:
|
||||
@ -735,7 +735,7 @@ def send_email(subject, text, log_tar):
|
||||
outer['Subject'] = subject
|
||||
outer['To'] = options.email
|
||||
outer['From'] = options.email_from
|
||||
outer['Date'] = email.utils.formatdate(localtime = True)
|
||||
outer['Date'] = email.utils.formatdate(localtime=True)
|
||||
outer.preamble = 'Autobuild mails are now in MIME because we optionally attach the logs.\n'
|
||||
outer.attach(MIMEText(text, 'plain'))
|
||||
if options.attach_logs:
|
||||
|
@ -38,7 +38,7 @@ parser.add_option("-o", "--output", dest="output",
|
||||
parser.add_option("--mode", type="choice", metavar="<FUNCTIONS|S3PROTO|LIBPROTO|PARAMDEFS|PARAMTABLE>",
|
||||
choices=["FUNCTIONS", "S3PROTO", "LIBPROTO", "PARAMDEFS", "PARAMTABLE"], default="FUNCTIONS")
|
||||
parser.add_option("--scope", metavar="<GLOBAL|LOCAL>",
|
||||
choices = ["GLOBAL", "LOCAL"], default="GLOBAL")
|
||||
choices=["GLOBAL", "LOCAL"], default="GLOBAL")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
|
@ -155,8 +155,7 @@ userAccountControl: %d
|
||||
logonCount=(logoncount_relation, 0),
|
||||
lastLogon=(lastlogon_relation, 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])
|
||||
@ -190,8 +189,7 @@ userPassword: thatsAcomplPASS2
|
||||
logonCount=logonCount,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -211,8 +209,7 @@ userPassword: thatsAcomplPASS2
|
||||
logonCount=logonCount,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
# Wrong old password
|
||||
@ -237,8 +234,7 @@ userPassword: thatsAcomplPASS2
|
||||
logonCount=logonCount,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -267,8 +263,7 @@ userPassword: thatsAcomplPASS2
|
||||
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])
|
||||
@ -296,8 +291,7 @@ userPassword: thatsAcomplPASS2
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=lockoutTime,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||||
|
||||
# Wrong old password
|
||||
@ -323,8 +317,7 @@ userPassword: thatsAcomplPASS2
|
||||
lockoutTime=lockoutTime,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||||
|
||||
try:
|
||||
@ -350,8 +343,7 @@ userPassword: thatsAcomplPASS2x
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=lockoutTime,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||||
|
||||
# Now reset the password, which does NOT change the lockout!
|
||||
@ -369,8 +361,7 @@ userPassword: thatsAcomplPASS2
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=lockoutTime,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||||
|
||||
try:
|
||||
@ -396,8 +387,7 @@ userPassword: thatsAcomplPASS2x
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=lockoutTime,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||||
|
||||
m = Message()
|
||||
@ -416,8 +406,7 @@ userPassword: thatsAcomplPASS2x
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=lockoutTime,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||||
|
||||
# This shows that setting the UF_LOCKOUT flag makes no difference
|
||||
@ -444,8 +433,7 @@ unicodePwd:: """ + base64.b64encode("\"thatsAcomplPASS2x\"".encode('utf-16-le'))
|
||||
lockoutTime=lockoutTime,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||||
|
||||
self._reset_by_method(res, method)
|
||||
@ -458,8 +446,7 @@ unicodePwd:: """ + base64.b64encode("\"thatsAcomplPASS2x\"".encode('utf-16-le'))
|
||||
lockoutTime=0,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
# The correct password after doing the unlock
|
||||
@ -482,8 +469,7 @@ unicodePwd:: """ + base64.b64encode("\"thatsAcomplPASS2x\"".encode('utf-16-le'))
|
||||
lockoutTime=0,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
# Wrong old password
|
||||
@ -509,8 +495,7 @@ userPassword: thatsAcomplPASS2XYZ
|
||||
lockoutTime=0,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -537,8 +522,7 @@ userPassword: thatsAcomplPASS2XYZ
|
||||
lockoutTime=0,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -551,8 +535,7 @@ userPassword: thatsAcomplPASS2XYZ
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=0,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
# The following test lockout behaviour when modifying a user's password
|
||||
@ -650,8 +633,7 @@ userPassword: thatsAcomplPASS2XYZ
|
||||
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])
|
||||
@ -684,8 +666,7 @@ unicodePwd:: """ + base64.b64encode("\"thatsAcomplPASS2\"".encode('utf-16-le')).
|
||||
logonCount=logonCount,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -711,8 +692,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
logonCount=logonCount,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
# Wrong old password
|
||||
@ -737,8 +717,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
logonCount=logonCount,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -753,8 +732,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
logonCount=logonCount,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
print("two failed password change")
|
||||
@ -783,8 +761,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
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])
|
||||
@ -812,8 +789,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=lockoutTime,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||||
|
||||
# Wrong old password
|
||||
@ -839,8 +815,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=lockoutTime,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||||
|
||||
try:
|
||||
@ -866,8 +841,7 @@ unicodePwd:: """ + base64.b64encode(invalid_utf16).decode('utf8') + """
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=lockoutTime,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
|
||||
|
||||
# Now reset the lockout, by removing ACB_AUTOLOCK (which removes the lock, despite being a generated attribute)
|
||||
@ -880,8 +854,7 @@ unicodePwd:: """ + base64.b64encode(invalid_utf16).decode('utf8') + """
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=0,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
# Correct old password
|
||||
@ -907,8 +880,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=0,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
# Wrong old password
|
||||
@ -934,8 +906,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=0,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -962,8 +933,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=0,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -978,8 +948,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=0,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
# Wrong old password
|
||||
@ -1005,8 +974,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
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])
|
||||
@ -1020,8 +988,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=lockoutTime,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
# SAMR doesn't have any impact if dsdb.UF_LOCKOUT isn't present.
|
||||
@ -1036,8 +1003,7 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
lockoutTime=lockoutTime,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
def test_unicodePwd_lockout_with_clear_change_krb5(self):
|
||||
@ -1102,12 +1068,10 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
logonCount=0,
|
||||
lastLogon=0,
|
||||
lastLogonTimestamp=('absent', None),
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT |
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT |
|
||||
dsdb.UF_ACCOUNTDISABLE |
|
||||
dsdb.UF_PASSWD_NOTREQD,
|
||||
msDSUserAccountControlComputed=
|
||||
dsdb.UF_PASSWORD_EXPIRED)
|
||||
msDSUserAccountControlComputed=dsdb.UF_PASSWORD_EXPIRED)
|
||||
|
||||
# SAMR doesn't have any impact if dsdb.UF_LOCKOUT isn't present.
|
||||
# It doesn't create "lockoutTime" = 0.
|
||||
@ -1119,12 +1083,10 @@ unicodePwd:: """ + base64.b64encode(new_utf16).decode('utf8') + """
|
||||
logonCount=0,
|
||||
lastLogon=0,
|
||||
lastLogonTimestamp=('absent', None),
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT |
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT |
|
||||
dsdb.UF_ACCOUNTDISABLE |
|
||||
dsdb.UF_PASSWD_NOTREQD,
|
||||
msDSUserAccountControlComputed=
|
||||
dsdb.UF_PASSWORD_EXPIRED)
|
||||
msDSUserAccountControlComputed=dsdb.UF_PASSWORD_EXPIRED)
|
||||
|
||||
# Tests a password change when we don't have any password yet with a
|
||||
# wrong old password
|
||||
@ -1151,12 +1113,10 @@ userPassword: thatsAcomplPASS2
|
||||
logonCount=0,
|
||||
lastLogon=0,
|
||||
lastLogonTimestamp=('absent', None),
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT |
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT |
|
||||
dsdb.UF_ACCOUNTDISABLE |
|
||||
dsdb.UF_PASSWD_NOTREQD,
|
||||
msDSUserAccountControlComputed=
|
||||
dsdb.UF_PASSWORD_EXPIRED)
|
||||
msDSUserAccountControlComputed=dsdb.UF_PASSWORD_EXPIRED)
|
||||
badPwdCount = int(res[0]["badPwdCount"][0])
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -1178,8 +1138,7 @@ userPassword: """ + userpass + """
|
||||
logonCount=0,
|
||||
lastLogon=0,
|
||||
lastLogonTimestamp=('absent', None),
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT |
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT |
|
||||
dsdb.UF_ACCOUNTDISABLE |
|
||||
dsdb.UF_PASSWD_NOTREQD,
|
||||
msDSUserAccountControlComputed=0)
|
||||
@ -1193,8 +1152,7 @@ userPassword: """ + userpass + """
|
||||
logonCount=0,
|
||||
lastLogon=0,
|
||||
lastLogonTimestamp=('absent', None),
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
if lockOutObservationWindow != 0:
|
||||
time.sleep(lockOutObservationWindow + 1)
|
||||
@ -1209,8 +1167,7 @@ userPassword: """ + userpass + """
|
||||
logonCount=0,
|
||||
lastLogon=0,
|
||||
lastLogonTimestamp=('absent', None),
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
ldb = SamDB(url=self.host_url, credentials=creds, lp=self.lp)
|
||||
@ -1229,8 +1186,7 @@ userPassword: """ + userpass + """
|
||||
logonCount=(logoncount_relation, 0),
|
||||
lastLogon=(lastlogon_relation, 0),
|
||||
lastLogonTimestamp=('greater', badPasswordTime),
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
logonCount = int(res[0]["logonCount"][0])
|
||||
@ -1247,8 +1203,7 @@ userPassword: """ + userpass + """
|
||||
logonCount=logonCount,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
return ldb
|
||||
|
||||
|
@ -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,
|
||||
@ -382,8 +381,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])
|
||||
@ -413,8 +411,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])
|
||||
@ -432,8 +429,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')
|
||||
|
||||
@ -453,8 +449,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])
|
||||
|
||||
@ -475,8 +470,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])
|
||||
|
||||
@ -500,8 +494,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])
|
||||
@ -522,8 +515,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
|
||||
@ -542,8 +534,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
|
||||
@ -562,8 +553,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
|
||||
@ -577,8 +567,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
|
||||
@ -597,8 +586,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")
|
||||
|
||||
@ -621,8 +609,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])
|
||||
|
||||
@ -642,8 +629,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])
|
||||
|
||||
@ -656,8 +642,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
|
||||
@ -676,8 +661,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])
|
||||
|
||||
@ -692,8 +676,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):
|
||||
@ -726,8 +709,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])
|
||||
@ -747,8 +729,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))
|
||||
@ -766,6 +747,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)
|
||||
|
@ -360,8 +360,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
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])
|
||||
@ -386,8 +385,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
logonCount=(logoncount_relation, logonCount),
|
||||
lastLogon=('greater', lastLogon),
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0,
|
||||
msg='badPwdCount not reset on RWDC')
|
||||
|
||||
@ -422,8 +420,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
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])
|
||||
@ -441,8 +438,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
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 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
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 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
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 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
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 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
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 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
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 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
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 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
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 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
lastLogon=(lastlogon_relation, lastLogon),
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
lockoutTime=lockoutTime,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0,
|
||||
msg="lastLogon is way off")
|
||||
|
||||
@ -625,8 +613,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
lockoutTime=lockoutTime,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -646,8 +633,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
lockoutTime=lockoutTime,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -660,8 +646,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
lockoutTime=lockoutTime,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
# The wrong password
|
||||
@ -680,8 +665,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
lockoutTime=lockoutTime,
|
||||
lastLogon=lastLogon,
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
badPasswordTime = int(res[0]["badPasswordTime"][0])
|
||||
|
||||
@ -696,8 +680,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
lockoutTime=lockoutTime,
|
||||
lastLogon=("greater", lastLogon),
|
||||
lastLogonTimestamp=lastLogonTimestamp,
|
||||
userAccountControl=
|
||||
dsdb.UF_NORMAL_ACCOUNT,
|
||||
userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
|
||||
msDSUserAccountControlComputed=0)
|
||||
|
||||
class RodcRwdcTests(password_lockout_base.BasePasswordTestCase):
|
||||
|
Reference in New Issue
Block a user