Skip to main content

SecDesc

Struct SecDesc 

Source
pub struct SecDesc { /* private fields */ }
Expand description

A validated, portable representation of a self-relative Windows security descriptor.

A descriptor tracks which components were loaded through its mask, so partial security queries can be carried without pretending that omitted components were absent on the target. Use SecDescUpdate with with to make a checked update.

Implementations§

Source§

impl SecDesc

Source

pub fn new( mask: SecInfo, rm_control: u8, control: SecDescControl, owner: Option<Sid>, group: Option<Sid>, dacl: Option<AclBuf>, sacl: Option<AclBuf>, ) -> Result<Self, SecDescError>

Creates a security descriptor from its structural components.

Source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, SecDescError>

Parses a self-relative Windows security descriptor packet.

Source

pub fn from_bytes_with_mask( bytes: &[u8], mask: SecInfo, ) -> Result<Self, SecDescError>

Parses the selected components of a self-relative Windows security descriptor packet.

Source

pub fn to_bytes(&self) -> Vec<u8>

Converts this descriptor to a canonical self-relative Windows packet.

Source

pub const fn mask(&self) -> SecInfo

Returns the native SECURITY_INFORMATION mask associated with the descriptor.

Source

pub const fn revision(&self) -> SecDescRevision

Returns the security descriptor revision.

Source

pub const fn control(&self) -> SecDescControl

Returns the security descriptor control mask.

Source

pub const fn rm_control(&self) -> Option<u8>

Returns the resource-manager control byte when it is valid.

Source

pub const fn rm_control_valid(&self) -> bool

Returns whether the resource-manager control byte is valid.

Source

pub const fn owner_loaded(&self) -> bool

Returns whether the owner component was loaded.

Source

pub const fn owner(&self) -> Option<&Sid>

Returns the owner SID, if present.

Source

pub const fn owner_defaulted(&self) -> bool

Returns whether the owner SID was supplied by a default mechanism.

Source

pub const fn group_loaded(&self) -> bool

Returns whether the group component was loaded.

Source

pub const fn group(&self) -> Option<&Sid>

Returns the primary group SID, if present.

Source

pub const fn group_defaulted(&self) -> bool

Returns whether the group SID was supplied by a default mechanism.

Source

pub const fn dacl_loaded(&self) -> bool

Returns whether the DACL component was loaded.

Source

pub fn dacl(&self) -> Option<&Acl>

Returns the DACL, if it is non-null.

Source

pub const fn dacl_present(&self) -> bool

Returns whether the descriptor marks the DACL as present.

Source

pub const fn dacl_defaulted(&self) -> bool

Returns whether the DACL was supplied by a default mechanism.

Source

pub const fn dacl_auto_inherit_required(&self) -> bool

Returns whether DACL inheritance computation was requested.

Source

pub const fn dacl_auto_inherited(&self) -> bool

Returns whether the DACL was produced through inheritance.

Source

pub const fn dacl_protected(&self) -> bool

Returns whether the DACL is protected from inheritance.

Source

pub const fn sacl_loaded(&self) -> bool

Returns whether the SACL component was loaded.

Source

pub fn sacl(&self) -> Option<&Acl>

Returns the SACL, if it is non-null.

Source

pub const fn sacl_present(&self) -> bool

Returns whether the descriptor marks the SACL as present.

Source

pub const fn sacl_defaulted(&self) -> bool

Returns whether the SACL was supplied by a default mechanism.

Source

pub const fn sacl_auto_inherit_required(&self) -> bool

Returns whether SACL inheritance computation was requested.

Source

pub const fn sacl_auto_inherited(&self) -> bool

Returns whether the SACL was produced through inheritance.

Source

pub const fn sacl_protected(&self) -> bool

Returns whether the SACL is protected from inheritance.

Source

pub fn with(&self, update: SecDescUpdate) -> Result<Self, SecDescError>

Returns a new descriptor with the supplied component and control updates.

Trait Implementations§

Source§

impl Clone for SecDesc

Source§

fn clone(&self) -> SecDesc

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SecDesc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SecDesc

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for SecDesc

Source§

impl PartialEq for SecDesc

Source§

fn eq(&self, other: &SecDesc) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SecDesc

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SecDesc

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.