keep_transaction = False
self.samdb.transaction_start()
try:
- nc_root = self.samdb.get_nc_root(obj.dn);
+ nc_root = self.samdb.get_nc_root(obj.dn)
lost_and_found = self.samdb.get_wellknown_dn(nc_root, dsdb.DS_GUID_LOSTANDFOUND_CONTAINER)
new_dn = ldb.Dn(self.samdb, str(obj.dn))
new_dn.remove_base_components(len(new_dn) - 1)
nc.dn = naming_context
req1 = drsuapi.DsReplicaSyncRequest1()
- req1.naming_context = nc;
+ req1.naming_context = nc
req1.options = req_option
req1.source_dsa_guid = misc.GUID(source_dsa_guid)
nc.dn = str(part)
req1 = drsuapi.DsReplicaSyncRequest1()
- req1.naming_context = nc;
+ req1.naming_context = nc
req1.options = drsuapi.DRSUAPI_DRS_WRIT_REP
req1.source_dsa_guid = misc.GUID(ntds_guid)
w = "__unknown__%08X__" % v32
r = "0x%x (%s)" % (v, w)
- return r;
+ return r
def generic_bitmap_to_string(self, b_dict, v, names_only=False):
if names_only:
return w
r = "0x%x (%s)" % (v, w)
- return r;
+ return r
def trustType_string(self, v):
types = {
local_tdo_forest.count = 0
local_tdo_forest.entries = []
- self.outf.write("TrustedDomain:\n\n");
+ self.outf.write("TrustedDomain:\n\n")
self.outf.write("NetbiosName: %s\n" % local_tdo_info.netbios_name.string)
if local_tdo_info.netbios_name.string != local_tdo_info.domain_name.string:
self.outf.write("DnsName: %s\n" % local_tdo_info.domain_name.string)
self.samdb_url = H
self.dirsync_filter = dirsync_filter
self.dirsync_attrs = dirsync_attrs
- self.dirsync_controls = ["dirsync:1:0:0", "extended_dn:1:0"];
+ self.dirsync_controls = ["dirsync:1:0:0", "extended_dn:1:0"]
self.password_attrs = password_attrs
self.decrypt_samba_gpg = decrypt_samba_gpg
self.sync_command = sync_command
paths = provision_paths_from_lp(lp, names.dnsdomain)
paths.bind_gid = bind_gid
- paths.root_uid = root_uid;
+ paths.root_uid = root_uid
paths.root_gid = root_gid
hostip = determine_host_ip(logger, lp, hostip)
def __init__(self, next_cycle_hours=0):
super(AgingEnabledTimeProperty, self).__init__()
self.wDataLength = 1
- self.version = 1;
+ self.version = 1
self.id = dnsp.DSPROPERTY_ZONE_AGING_ENABLED_TIME
self.data = next_cycle_hours
self.add_user()
if not self.lp.get("password hash gpg key ids"):
self.skipTest("No password hash gpg key ids, " +
- "Primary:SambaGPG will not be generated");
+ "Primary:SambaGPG will not be generated")
sc = self.get_supplemental_creds()
self.add_user(clear_text=True)
if not self.lp.get("password hash gpg key ids"):
self.skipTest("No password hash gpg key ids, " +
- "Primary:SambaGPG will not be generated");
+ "Primary:SambaGPG will not be generated")
sc = self.get_supplemental_creds()
#
# Get the authenticator from the machine creds.
def get_authenticator(self, c):
- auth = self.machine_creds.new_client_authenticator();
- current = netr_Authenticator()
+ auth = self.machine_creds.new_client_authenticator()
+ current = netr_Authenticator()
current.cred.data = [ord(x) for x in auth["credential"]]
current.timestamp = auth["timestamp"]
def __init__(self, basedn, dn, lp):
self.db = Ldb(lp=lp, session_info=system_session())
- self.db.set_opaque("skip_allocate_sids", "true");
+ self.db.set_opaque("skip_allocate_sids", "true")
self.basedn = basedn
self.basedn_casefold = ldb.Dn(self.db, basedn).get_casefold()
self.substvars = {"BASEDN": self.basedn}
def setUp(self):
super(Samba3SamTestCase, self).setUp()
ldb = Ldb(self.ldburl, lp=self.lp, session_info=system_session())
- ldb.set_opaque("skip_allocate_sids", "true");
+ ldb.set_opaque("skip_allocate_sids", "true")
self.samba3.setup_data("samba3.ldif")
ldif = read_datafile("provision_samba3sam.ldif")
ldb.add_ldif(self.samba4.subst(ldif))
self.setup_modules(ldb, self.samba3, self.samba4)
del ldb
self.ldb = Ldb(self.ldburl, lp=self.lp, session_info=system_session())
- self.ldb.set_opaque("skip_allocate_sids", "true");
+ self.ldb.set_opaque("skip_allocate_sids", "true")
def test_search_non_mapped(self):
"""Looking up by non-mapped attribute"""
def setUp(self):
super(MapTestCase, self).setUp()
ldb = Ldb(self.ldburl, lp=self.lp, session_info=system_session())
- ldb.set_opaque("skip_allocate_sids", "true");
+ ldb.set_opaque("skip_allocate_sids", "true")
ldif = read_datafile("provision_samba3sam.ldif")
ldb.add_ldif(self.samba4.subst(ldif))
self.setup_modules(ldb, self.samba3, self.samba4)
del ldb
self.ldb = Ldb(self.ldburl, lp=self.lp, session_info=system_session())
- self.ldb.set_opaque("skip_allocate_sids", "true");
+ self.ldb.set_opaque("skip_allocate_sids", "true")
def test_map_search(self):
"""Running search tests on mapped data."""
"""
The smb.unlink API should delete file
"""
- self.conn.savefile(test_file, binary_contents);
+ self.conn.savefile(test_file, binary_contents)
self.conn.unlink(test_file)
self.assertFalse(self.conn.chkpath(test_file))
# with python2 this will save/load str type
# with python3 this will save/load bytes type
def test_save_binary_contents(self):
- self.conn.savefile(test_file, binary_contents);
+ self.conn.savefile(test_file, binary_contents)
contents = self.conn.loadfile(test_file)
self.assertEquals(contents, binary_contents,
admin_user = username
try:
- group_memberships = s3db.enum_group_memberships(user);
+ group_memberships = s3db.enum_group_memberships(user)
for group in group_memberships:
if str(group) in groupmembers:
if user.user_sid not in groupmembers[str(group)]:
groupmembers[str(group)].append(user.user_sid)
else:
- groupmembers[str(group)] = [user.user_sid];
+ groupmembers[str(group)] = [user.user_sid]
except passdb.error as e:
logger.warn("Ignoring group memberships of '%s' %s: %s",
username, user.user_sid, e)
file_out.write("\t\t.flags\t\t= %s,\n" % flags)
file_out.write("\t},\n")
- file_out.write("\n\t{NULL, P_BOOL, P_NONE, 0, NULL, NULL, 0}\n");
+ file_out.write("\n\t{NULL, P_BOOL, P_NONE, 0, NULL, NULL, 0}\n")
file_out.write("};\n")
file_out.write("\n#endif /* %s */\n\n" % header)
finally:
if default_dos_charset is False or default_unix_charset is False:
# we found iconv, but it failed to convert anything (e.g. on AIX)
- conf.undefine('HAVE_NATIVE_ICONV');
+ conf.undefine('HAVE_NATIVE_ICONV')
default_dos_charset = "ASCII"
default_unix_charset = "UTF-8"
msDSUserAccountControlComputed=dsdb.UF_LOCKOUT)
# Now reset the lockout, by removing ACB_AUTOLOCK (which removes the lock, despite being a generated attribute)
- self._reset_samr(res);
+ self._reset_samr(res)
res = self._check_account(userdn,
badPwdCount=0,
str(res[0]['schemaInfo']))
else:
pfm_schi = drsblobs.schemaInfoBlob()
- pfm_schi.marker = 0xFF;
+ pfm_schi.marker = 0xFF
return pfm_schi
# The dlz_bind9 tests needs to look at the DNS database
plansmbtorture4testsuite(t, "chgdcpass:local", ["ncalrpc:$SERVER", '-U$USERNAME%$PASSWORD'])
-planpythontestsuite("nt4_dc", "samba.tests.libsmb_samba_internal", py3_compatible=True);
+planpythontestsuite("nt4_dc", "samba.tests.libsmb_samba_internal", py3_compatible=True)
# Blackbox Tests:
# tests that interact directly with the command-line tools rather than using
for o in drs_ctr.first_object.meta_data_ctr.meta_data:
i = 0
drs_attid = drs_ctr.first_object.object.attribute_ctr.attributes[att_idx]
- e = expected[i];
+ e = expected[i]
(attid, orig_dsa, version) = e
# Skip the RDN from the expected set, it is not sent over DRS
or (user_dn.get_rdn_name().upper() == "OU"
and attid == DRSUAPI_ATTID_ou):
i = i + 1
- e = expected[i];
+ e = expected[i]
(attid, orig_dsa, version) = e
self.assertEquals(attid, drs_attid.attid,
child = t.pexpect_spawn('bin/net ads password root -Uadministrator%${WIN_PASS}')
child.expect("Enter new password for root")
child.sendline("${PASSWORD2}")
- child.expect("Password change for ");
+ child.expect("Password change for ")
child.expect(" completed")
child = t.pexpect_spawn('bin/net rpc shell -S ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator%${WIN_PASS}')
child.expect("net rpc>")
self.write_file('/etc/resolv.conf.wintest', contents, mode='a')
self.write_file('/etc/resolv.conf.wintest-bak', contents)
self.run_cmd("mv -f /etc/resolv.conf.wintest /etc/resolv.conf")
- self.resolv_conf_backup = '/etc/resolv.conf.wintest-bak';
+ self.resolv_conf_backup = '/etc/resolv.conf.wintest-bak'
def configure_bind(self, kerberos_support=False, include=None):
self.chdir('${PREFIX}')
if set_dns:
set_dns = False
if self.set_dns(child):
- continue;
+ continue
if set_route:
child.sendline('route add 0.0.0.0 mask 0.0.0.0 ${WIN_DEFAULT_GATEWAY}')
child.expect("C:")