WindowsSecure

Trait WindowsSecure 

Source
pub trait WindowsSecure {
    // Required methods
    fn security_descriptor(
        &self,
        sec_info: SecurityInformation,
    ) -> Result<LocalBox<SecurityDescriptor>>;
    fn set_owner(&mut self, owner: &Sid) -> Result<()>;
    fn set_group(&mut self, group: &Sid) -> Result<()>;
    fn set_dacl(&mut self, dacl: &Acl) -> Result<()>;
    fn set_sacl(&mut self, sacl: &Acl) -> Result<()>;

    // Provided methods
    fn set_multiple(
        &mut self,
        owner: Option<&Sid>,
        group: Option<&Sid>,
        dacl: Option<&Acl>,
        sacl: Option<&Acl>,
    ) -> Result<()> { ... }
    fn set_security_descriptor(&mut self, sd: &SecurityDescriptor) -> Result<()> { ... }
}
Expand description

A trait indicating that an object is subject to Windows security.

Required Methods§

Source

fn security_descriptor( &self, sec_info: SecurityInformation, ) -> Result<LocalBox<SecurityDescriptor>>

Get a security descriptor for the object

Source

fn set_owner(&mut self, owner: &Sid) -> Result<()>

Set the object’s owner

Source

fn set_group(&mut self, group: &Sid) -> Result<()>

Set the object’s group

Source

fn set_dacl(&mut self, dacl: &Acl) -> Result<()>

Set the object’s DACL

Source

fn set_sacl(&mut self, sacl: &Acl) -> Result<()>

Set the object’s SACL

Provided Methods§

Source

fn set_multiple( &mut self, owner: Option<&Sid>, group: Option<&Sid>, dacl: Option<&Acl>, sacl: Option<&Acl>, ) -> Result<()>

Set multiple security options at once

Some securable objects may be able to set multiple security options at the same time with less overhead. The default implementation just calls each of the other functions one at a time.

This does not guarantee an atomic update. It is possible that only some of the options will be updated.

Source

fn set_security_descriptor(&mut self, sd: &SecurityDescriptor) -> Result<()>

Set the object’s security descriptor.

Implementations on Foreign Types§

Source§

impl WindowsSecure for OsStr

Source§

fn security_descriptor( &self, sec_info: SecurityInformation, ) -> Result<LocalBox<SecurityDescriptor>>

Source§

fn set_owner(&mut self, owner: &Sid) -> Result<()>

Source§

fn set_group(&mut self, group: &Sid) -> Result<()>

Source§

fn set_dacl(&mut self, dacl: &Acl) -> Result<()>

Source§

fn set_sacl(&mut self, sacl: &Acl) -> Result<()>

Source§

fn set_multiple( &mut self, owner: Option<&Sid>, group: Option<&Sid>, dacl: Option<&Acl>, sacl: Option<&Acl>, ) -> Result<()>

Implementors§

Source§

impl<T> WindowsSecure for T
where T: AsRawHandle,