1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-15 16:59:09 +03:00

s4-python: Fix formatting.

This commit is contained in:
Jelmer Vernooij
2010-06-10 23:12:53 +02:00
parent a53ca94416
commit c446fbc3bf
7 changed files with 176 additions and 133 deletions

View File

@ -57,28 +57,27 @@ class IDmapDB(samba.Ldb):
:return xid can that be used for SID/unixid mapping
"""
res=self.search(expression="dn=CN=CONFIG",base="", scope=ldb.SCOPE_SUBTREE)
id=res[0].get("xidNumber")
flag=ldb.FLAG_MOD_REPLACE
if id == None:
id=res[0].get("lowerBound")
res = self.search(expression="dn=CN=CONFIG", base="",
scope=ldb.SCOPE_SUBTREE)
id = res[0].get("xidNumber")
flag = ldb.FLAG_MOD_REPLACE
if id is None:
id = res[0].get("lowerBound")
flag = ldb.FLAG_MOD_ADD
newid = int(str(id)) + 1
msg = ldb.Message()
msg.dn = ldb.Dn(self,"CN=CONFIG")
msg["xidNumber"] = ldb.MessageElement(str(newid),flag,"xidNumber")
msg.dn = ldb.Dn(self, "CN=CONFIG")
msg["xidNumber"] = ldb.MessageElement(str(newid), flag, "xidNumber")
self.modify(msg)
return id
def setup_name_mapping(self, sid, type, unixid=None):
"""Setup a mapping between a sam name and a unix name.
:param sid: SID of the NT-side of the mapping.
:param unixname: Unix id to map to, if none supplied the next one will be selected
"""
if unixid == None:
if unixid is None:
unixid = self.increment_xid()
type_string = ""
if type == self.TYPE_UID: