Skip to content

Commit 469ad75

Browse files
authored
Merge pull request #34 from kizzx2/master
specify DACL_SECURITY_INFROMATION for modifying DACLs
2 parents 00d8e3b + 67dfc9b commit 469ad75

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Diff for: msldap/client.py

+18-2
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,15 @@ async def add_priv_addmember(self, user_dn:str, group_dn:str):
11801180
changes = {
11811181
'nTSecurityDescriptor' : [('replace', new_sd.to_bytes())]
11821182
}
1183-
_, err = await self.modify(group_dn, changes)
1183+
req_flags = SDFlagsRequestValue({
1184+
'Flags': SDFlagsRequest.DACL_SECURITY_INFORMATION
1185+
})
1186+
controls = [{
1187+
'controlType': b'1.2.840.113556.1.4.801',
1188+
'controlValue': req_flags.dump(),
1189+
'criticality': False
1190+
}]
1191+
_, err = await self.modify(group_dn, changes, controls)
11841192
if err is not None:
11851193
raise err
11861194

@@ -1229,7 +1237,15 @@ async def add_priv_dcsync(self, user_dn:str, forest_dn:str = None):
12291237
changes = {
12301238
'nTSecurityDescriptor' : [('replace', new_sd.to_bytes())]
12311239
}
1232-
_, err = await self.modify(forest_dn, changes)
1240+
req_flags = SDFlagsRequestValue({
1241+
'Flags': SDFlagsRequest.DACL_SECURITY_INFORMATION
1242+
})
1243+
controls = [{
1244+
'controlType': b'1.2.840.113556.1.4.801',
1245+
'controlValue': req_flags.dump(),
1246+
'criticality': False
1247+
}]
1248+
_, err = await self.modify(forest_dn, changes, controls)
12331249
if err is not None:
12341250
raise err
12351251

0 commit comments

Comments
 (0)