[][src]Struct capctl::prctl::Secbits

pub struct Secbits { /* fields omitted */ }

Implementations

impl Secbits[src]

pub const NOROOT: Secbits[src]

If this flag is set, the kernel does not grant capabilities when a SUID-root program is executed, or when a process with an effective/real UID of 0 calls exec().

pub const NOROOT_LOCKED: Secbits[src]

Locks the NOROOT flag so it cannot be changed.

pub const NO_SETUID_FIXUP: Secbits[src]

If this flag is set, the kernel will not adjust the current thread's permitted/effective/inheritable capability sets when its effective and filesystem UIDs are changed between zero and nonzero values.

pub const NO_SETUID_FIXUP_LOCKED: Secbits[src]

Locks the NO_SETUID_FIXUP flag so it cannot be changed.

pub const KEEP_CAPS: Secbits[src]

If this flag is set, the kernel will not empty the current thread's permitted capability set when all of its UIDs are switched to nonzero values. (However, the effective capability set will still be cleared.)

This flag is cleared across execve() calls.

Note: get_keepcaps() and set_keepcaps() provide the same functionality as this flag (setting the flag via one method will change its value as perceived by the other, and vice versa). However, set_keepcaps() does not require CAP_SETPCAP; changing the securebits does. As a result, if you only need to manipulate the KEEP_CAPS flag, you may wish to instead use get_keepcaps() and set_keepcaps().

pub const KEEP_CAPS_LOCKED: Secbits[src]

Locks the KEEP_CAPS flag so it cannot be changed.

Note: The KEEP_CAPS flag is always cleared across execve(), even if it is "locked" using this flag. As a result, this flag is mainly useful for locking the KEEP_CAPS in the "off" setting.

pub const NO_CAP_AMBIENT_RAISE: Secbits[src]

Disallows raising ambient capabilities.

pub const NO_CAP_AMBIENT_RAISE_LOCKED: Secbits[src]

Locks the NO_CAP_AMBIENT_RAISE_LOCKED flag so it cannot be changed.

pub const fn empty() -> Secbits[src]

Returns an empty set of flags

pub const fn all() -> Secbits[src]

Returns the set containing all flags.

pub const fn bits(&self) -> c_ulong[src]

Returns the raw value of the flags currently stored.

pub fn from_bits(bits: c_ulong) -> Option<Secbits>[src]

Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.

pub const fn from_bits_truncate(bits: c_ulong) -> Secbits[src]

Convert from underlying bit representation, dropping any bits that do not correspond to flags.

pub const unsafe fn from_bits_unchecked(bits: c_ulong) -> Secbits[src]

Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).

pub const fn is_empty(&self) -> bool[src]

Returns true if no flags are currently stored.

pub const fn is_all(&self) -> bool[src]

Returns true if all flags are currently set.

pub const fn intersects(&self, other: Secbits) -> bool[src]

Returns true if there are flags common to both self and other.

pub const fn contains(&self, other: Secbits) -> bool[src]

Returns true all of the flags in other are contained within self.

pub fn insert(&mut self, other: Secbits)[src]

Inserts the specified flags in-place.

pub fn remove(&mut self, other: Secbits)[src]

Removes the specified flags in-place.

pub fn toggle(&mut self, other: Secbits)[src]

Toggles the specified flags in-place.

pub fn set(&mut self, other: Secbits, value: bool)[src]

Inserts or removes the specified flags depending on the passed value.

Trait Implementations

impl Binary for Secbits[src]

impl BitAnd<Secbits> for Secbits[src]

type Output = Secbits

The resulting type after applying the & operator.

fn bitand(self, other: Secbits) -> Secbits[src]

Returns the intersection between the two sets of flags.

impl BitAndAssign<Secbits> for Secbits[src]

fn bitand_assign(&mut self, other: Secbits)[src]

Disables all flags disabled in the set.

impl BitOr<Secbits> for Secbits[src]

type Output = Secbits

The resulting type after applying the | operator.

fn bitor(self, other: Secbits) -> Secbits[src]

Returns the union of the two sets of flags.

impl BitOrAssign<Secbits> for Secbits[src]

fn bitor_assign(&mut self, other: Secbits)[src]

Adds the set of flags.

impl BitXor<Secbits> for Secbits[src]

type Output = Secbits

The resulting type after applying the ^ operator.

fn bitxor(self, other: Secbits) -> Secbits[src]

Returns the left flags, but with all the right flags toggled.

impl BitXorAssign<Secbits> for Secbits[src]

fn bitxor_assign(&mut self, other: Secbits)[src]

Toggles the set of flags.

impl Clone for Secbits[src]

impl Copy for Secbits[src]

impl Debug for Secbits[src]

impl Eq for Secbits[src]

impl Extend<Secbits> for Secbits[src]

impl FromIterator<Secbits> for Secbits[src]

impl Hash for Secbits[src]

impl LowerHex for Secbits[src]

impl Not for Secbits[src]

type Output = Secbits

The resulting type after applying the ! operator.

fn not(self) -> Secbits[src]

Returns the complement of this set of flags.

impl Octal for Secbits[src]

impl Ord for Secbits[src]

impl PartialEq<Secbits> for Secbits[src]

impl PartialOrd<Secbits> for Secbits[src]

impl StructuralEq for Secbits[src]

impl StructuralPartialEq for Secbits[src]

impl Sub<Secbits> for Secbits[src]

type Output = Secbits

The resulting type after applying the - operator.

fn sub(self, other: Secbits) -> Secbits[src]

Returns the set difference of the two sets of flags.

impl SubAssign<Secbits> for Secbits[src]

fn sub_assign(&mut self, other: Secbits)[src]

Disables all flags enabled in the set.

impl UpperHex for Secbits[src]

Auto Trait Implementations

impl RefUnwindSafe for Secbits

impl Send for Secbits

impl Sync for Secbits

impl Unpin for Secbits

impl UnwindSafe for Secbits

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.