ObjectSecurity.SetSecurityDescriptorBinaryForm 方法

定义

根据指定的二进制数据设置此 ObjectSecurity 对象的安全描述符。Sets the security descriptor for this ObjectSecurity object from the specified binary data.

重载

SetSecurityDescriptorBinaryForm(Byte[])

根据指定的字节值数组设置此 ObjectSecurity 对象的安全描述符。Sets the security descriptor for this ObjectSecurity object from the specified array of byte values.

SetSecurityDescriptorBinaryForm(Byte[], AccessControlSections)

根据指定的字节值数组设置此 ObjectSecurity 对象的安全描述符的指定部分。Sets the specified sections of the security descriptor for this ObjectSecurity object from the specified array of byte values.

注解

如果二进制数据所表示的安全描述符包含其自由访问控制列表(DACL)的 null,则将向 DACL 添加允许每个人完全访问权限(AEFA)的单个访问控制项(ACE)。If the security descriptor represented by the binary data contains null for its discretionary access control list (DACL), a single access control entry (ACE) that allows everyone full access (AEFA) is added to the DACL. 如果某个应用程序修改了 AEFA ACE 已添加到的安全描述符的 DACL,则在保留该 DACL 时,AEFA ACE 将与 DACL 一起保存。If an application modifies the DACL of a security descriptor to which an AEFA ACE has been added, the AEFA ACE is persisted with the DACL when that DACL is persisted.

这可能导致应用程序意外允许访问主体。This can result in an application unintentionally allowing access to principals. 因此,在修改任何安全描述符之前,应用程序应检查是否存在 AEFA ACE 并将其删除。Because of this, an application should check for the existence of an AEFA ACE and remove it before modifying any security descriptor.

SetSecurityDescriptorBinaryForm(Byte[])

根据指定的字节值数组设置此 ObjectSecurity 对象的安全描述符。Sets the security descriptor for this ObjectSecurity object from the specified array of byte values.

public:
 void SetSecurityDescriptorBinaryForm(cli::array <System::Byte> ^ binaryForm);
public void SetSecurityDescriptorBinaryForm (byte[] binaryForm);
member this.SetSecurityDescriptorBinaryForm : byte[] -> unit
Public Sub SetSecurityDescriptorBinaryForm (binaryForm As Byte())

参数

binaryForm
Byte[]

要根据其设置安全描述符的字节数组。The array of bytes from which to set the security descriptor.

注解

如果二进制数据所表示的安全描述符包含其自由访问控制列表(DACL)的 null,则将向 DACL 添加允许每个人完全访问权限(AEFA)的单个访问控制项(ACE)。If the security descriptor represented by the binary data contains null for its discretionary access control list (DACL), a single access control entry (ACE) that allows everyone full access (AEFA) is added to the DACL. 如果某个应用程序修改了 AEFA ACE 已添加到的安全描述符的 DACL,则在保留该 DACL 时,AEFA ACE 将与 DACL 一起保存。If an application modifies the DACL of a security descriptor to which an AEFA ACE has been added, the AEFA ACE is persisted with the DACL when that DACL is persisted.

这可能导致应用程序意外允许访问主体。This can result in an application unintentionally allowing access to principals. 因此,在修改任何安全描述符之前,应用程序应检查是否存在 AEFA ACE 并将其删除。Because of this, an application should check for the existence of an AEFA ACE and remove it before modifying any security descriptor.

SetSecurityDescriptorBinaryForm(Byte[], AccessControlSections)

根据指定的字节值数组设置此 ObjectSecurity 对象的安全描述符的指定部分。Sets the specified sections of the security descriptor for this ObjectSecurity object from the specified array of byte values.

public:
 void SetSecurityDescriptorBinaryForm(cli::array <System::Byte> ^ binaryForm, System::Security::AccessControl::AccessControlSections includeSections);
public void SetSecurityDescriptorBinaryForm (byte[] binaryForm, System.Security.AccessControl.AccessControlSections includeSections);
member this.SetSecurityDescriptorBinaryForm : byte[] * System.Security.AccessControl.AccessControlSections -> unit
Public Sub SetSecurityDescriptorBinaryForm (binaryForm As Byte(), includeSections As AccessControlSections)

参数

binaryForm
Byte[]

要根据其设置安全描述符的字节数组。The array of bytes from which to set the security descriptor.

includeSections
AccessControlSections

要设置的安全描述符的部分(访问规则、审核规则、所有者、主要组)。The sections (access rules, audit rules, owner, primary group) of the security descriptor to set.

注解

如果二进制数据所表示的安全描述符包含其自由访问控制列表(DACL)的 null,则将向 DACL 添加允许每个人完全访问权限(AEFA)的单个访问控制项(ACE)。If the security descriptor represented by the binary data contains null for its discretionary access control list (DACL), a single access control entry (ACE) that allows everyone full access (AEFA) is added to the DACL. 如果某个应用程序修改了 AEFA ACE 已添加到的安全描述符的 DACL,则在保留该 DACL 时,AEFA ACE 将与 DACL 一起保存。If an application modifies the DACL of a security descriptor to which an AEFA ACE has been added, the AEFA ACE is persisted with the DACL when that DACL is persisted.

这可能导致应用程序意外允许访问主体。This can result in an application unintentionally allowing access to principals. 因此,在修改任何安全描述符之前,应用程序应检查是否存在 AEFA ACE 并将其删除。Because of this, an application should check for the existence of an AEFA ACE and remove it before modifying any security descriptor.

适用于