#NEWLINE# def modify_sd_on_dn( self , object_dn , sd , controls = None ) : #NEWLINE# #INDENT# 'Modify security descriptor using either SDDL string\n            or security.descriptor object\n        ' #NEWLINE# m = Message ( ) #NEWLINE# m . dn = Dn ( self . ldb , object_dn ) #NEWLINE# assert ( isinstance ( sd , str ) or isinstance ( sd , security . descriptor ) ) #NEWLINE# if isinstance ( sd , str ) : #NEWLINE# #INDENT# tmp_desc = security . descriptor . from_sddl ( sd , self . domain_sid ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( sd , security . descriptor ) : #NEWLINE# #INDENT# tmp_desc = sd #NEWLINE# #UNINDENT# #UNINDENT# m [ 'nTSecurityDescriptor' ] = MessageElement ( ndr_pack ( tmp_desc ) , FLAG_MOD_REPLACE , 'nTSecurityDescriptor' ) #NEWLINE# self . ldb . modify ( m , controls )