|
1141 |
for (sid, canonical_name) in AD_well_known_sids.items(): |
1141 |
for (sid, canonical_name) in AD_well_known_sids.items(): |
1142 |
|
1142 |
|
1143 |
msgs = self.samdb.search(base=self.ucr["samba4/ldap/base"], scope=samba.ldb.SCOPE_SUBTREE, |
1143 |
msgs = self.samdb.search(base=self.ucr["samba4/ldap/base"], scope=samba.ldb.SCOPE_SUBTREE, |
1144 |
expression="(objectSid=%s)" % (sid), |
1144 |
expression="(&(objectSid=%s)(sAMAccountName=*))" % (sid), |
1145 |
attrs=["sAMAccountName", "objectClass"]) |
1145 |
attrs=["sAMAccountName", "objectClass"]) |
1146 |
if not msgs: |
1146 |
if not msgs: |
1147 |
log.debug("Well known SID %s not found in Samba" % (sid,)) |
1147 |
log.debug("Name of Well known SID %s not found in Samba" % (sid,)) |
1148 |
continue |
1148 |
continue |
1149 |
|
1149 |
|
1150 |
obj = msgs[0] |
1150 |
obj = msgs[0] |