def get_default_backend_store():
return "tdb"
+
class SamDB(samba.Ldb):
"""The SAM database."""
"objectClass": "user"}
if smartcard_required:
- ldbmessage["userAccountControl"] = str(dsdb.UF_NORMAL_ACCOUNT|dsdb.UF_SMARTCARD_REQUIRED)
+ ldbmessage["userAccountControl"] = str(dsdb.UF_NORMAL_ACCOUNT |
+ dsdb.UF_SMARTCARD_REQUIRED)
setpassword = False
if surname is not None:
o.originating_usn = seq
o.local_usn = seq
- if not found and addifnotexist and len(ctr.array) >0:
+ if not found and addifnotexist and len(ctr.array) > 0:
o2 = drsblobs.replPropertyMetaData1()
o2.attid = 589914
att_oid = self.get_oid_from_attid(o2.attid)
ctr.count = ctr.count + 1
ctr.array = tab
- if found :
+ if found:
replBlob = ndr_pack(repl)
msg = ldb.Message()
msg.dn = res[0].dn
res = self.search(self.domain_dn(), scope=ldb.SCOPE_BASE, attrs=["minPwdAge"])
if len(res) == 0:
return None
- elif not "minPwdAge" in res[0]:
+ elif "minPwdAge" not in res[0]:
return None
else:
return int(res[0]["minPwdAge"][0])
m["maxPwdAge"] = ldb.MessageElement(value, ldb.FLAG_MOD_REPLACE, "maxPwdAge")
self.modify(m)
-
def get_maxPwdAge(self):
res = self.search(self.domain_dn(), scope=ldb.SCOPE_BASE, attrs=["maxPwdAge"])
if len(res) == 0:
return None
- elif not "maxPwdAge" in res[0]:
+ elif "maxPwdAge" not in res[0]:
return None
else:
return int(res[0]["maxPwdAge"][0])
-
-
def set_minPwdLength(self, value):
value = str(value).encode('utf8')
m = ldb.Message()
res = self.search(self.domain_dn(), scope=ldb.SCOPE_BASE, attrs=["minPwdLength"])
if len(res) == 0:
return None
- elif not "minPwdLength" in res[0]:
+ elif "minPwdLength" not in res[0]:
return None
else:
return int(res[0]["minPwdLength"][0])
res = self.search(self.domain_dn(), scope=ldb.SCOPE_BASE, attrs=["pwdProperties"])
if len(res) == 0:
return None
- elif not "pwdProperties" in res[0]:
+ elif "pwdProperties" not in res[0]:
return None
else:
return int(res[0]["pwdProperties"][0])
'''garbage_collect_tombstones(lp, samdb, [dn], current_time, tombstone_lifetime)
-> (num_objects_expunged, num_links_expunged)'''
-
if tombstone_lifetime is None:
return dsdb._dsdb_garbage_collect_tombstones(self, dn,
current_time)