[−][src]Struct capctl::caps::FileCaps
Represents the capabilities attached to a file.
Fields (Non-exhaustive)
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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<FileCaps> for FileCaps
[src]
impl StructuralEq for FileCaps
[src]
impl StructuralPartialEq for FileCaps
[src]
Auto Trait Implementations
impl RefUnwindSafe for FileCaps
impl Send for FileCaps
impl Sync for FileCaps
impl Unpin for FileCaps
impl UnwindSafe for FileCaps
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,