[][src]Struct capctl::caps::FileCaps

#[non_exhaustive]pub struct FileCaps {
    pub effective: bool,
    pub permitted: CapSet,
    pub inheritable: CapSet,
    pub rootid: Option<uid_t>,
}

Represents the capabilities attached to a file.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
effective: bool

The "effective" bit. If this is set on a file, then during an execve() the kernel will raise all the capabilities from the file's permitted set in the process's new effective capability set.

permitted: CapSet

The permitted capability set. These capabilities are automatically added to the process's new permitted capability set.

inheritable: CapSet

The inheritable capability set. These capabilities are automatically added to the process's new inheritable capability set.

rootid: Option<uid_t>

The root user ID of the user namespace in which file capabilities were added to this file. See capabilities(7) for more details. This is only set to a non-None value for version 3 file capabilities.

Implementations

impl FileCaps[src]

pub fn empty() -> Self[src]

Construct an empty FileCaps object.

pub fn get_for_file<P: AsRef<OsStr>>(path: P) -> Result<Option<Self>>[src]

Get the file capabilities attached to the file identified by path.

If an error occurs while retrieving information on the capabilities from the given file, this method returns Err(<error>). Otherwise, if the given file has no file capabilities attached, this method returns Ok(None). Otherwise, this method returns Ok(Some(<capabilities>)).

pub fn get_for_fd(fd: RawFd) -> Result<Option<Self>>[src]

Get the file capabilities attached to the open file identified by the file descriptor fd.

See get_for_file() for more information.

pub fn unpack_attrs(attrs: &[u8]) -> Result<Self>[src]

From the raw data from the security.capability extended attribute of a file, construct a new FileCaps object representing the same data.

Most users should call get_for_file() or get_for_fd(); those methods call this method internally.

Trait Implementations

impl Clone for FileCaps[src]

impl Copy for FileCaps[src]

impl Debug for FileCaps[src]

impl Eq for FileCaps[src]

impl Hash for FileCaps[src]

impl PartialEq<FileCaps> for FileCaps[src]

impl StructuralEq for FileCaps[src]

impl StructuralPartialEq for FileCaps[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.