Struct landlock::RulesetCreated
source · pub struct RulesetCreated { /* private fields */ }
Expand description
Ruleset created with Ruleset::create()
.
Implementations§
source§impl RulesetCreated
impl RulesetCreated
sourcepub fn restrict_self(self) -> Result<RestrictionStatus, RulesetError>
pub fn restrict_self(self) -> Result<RestrictionStatus, RulesetError>
Attempts to restrict the calling thread with the ruleset
according to the best-effort configuration
(see RulesetCreated::set_best_effort()
).
Call prctl(2)
with the PR_SET_NO_NEW_PRIVS
according to the ruleset configuration.
On error, returns a wrapped RestrictSelfError
.
Trait Implementations§
source§impl AsMut<RulesetCreated> for RulesetCreated
impl AsMut<RulesetCreated> for RulesetCreated
source§fn as_mut(&mut self) -> &mut RulesetCreated
fn as_mut(&mut self) -> &mut RulesetCreated
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl Compatible for RulesetCreated
impl Compatible for RulesetCreated
source§fn set_best_effort(self, best_effort: bool) -> Self
fn set_best_effort(self, best_effort: bool) -> Self
To enable a best-effort security approach,
Landlock features that are not supported by the running system
are silently ignored by default,
which is a sane choice for most use cases.
However, on some rare circumstances,
developers may want to have some guarantees that their applications
will not run if a certain level of sandboxing is not possible.
If you really want to error out when not all your requested requirements are met,
then you can configure it with
set_best_effort(false)
. Read moresource§impl Drop for RulesetCreated
impl Drop for RulesetCreated
source§impl RulesetCreatedAttr for &mut RulesetCreated
impl RulesetCreatedAttr for &mut RulesetCreated
source§fn add_rule<T, U>(self, rule: T) -> Result<Self, RulesetError>where
T: Rule<U>,
U: Access,
fn add_rule<T, U>(self, rule: T) -> Result<Self, RulesetError>where T: Rule<U>, U: Access,
Attempts to add a new rule to the ruleset. Read more
source§fn add_rules<I, T, U, E>(self, rules: I) -> Result<Self, E>where
I: IntoIterator<Item = Result<T, E>>,
T: Rule<U>,
U: Access,
E: From<RulesetError>,
fn add_rules<I, T, U, E>(self, rules: I) -> Result<Self, E>where I: IntoIterator<Item = Result<T, E>>, T: Rule<U>, U: Access, E: From<RulesetError>,
Attempts to add a set of new rules to the ruleset. Read more
source§fn set_no_new_privs(self, no_new_privs: bool) -> Self
fn set_no_new_privs(self, no_new_privs: bool) -> Self
source§impl RulesetCreatedAttr for RulesetCreated
impl RulesetCreatedAttr for RulesetCreated
source§fn add_rule<T, U>(self, rule: T) -> Result<Self, RulesetError>where
T: Rule<U>,
U: Access,
fn add_rule<T, U>(self, rule: T) -> Result<Self, RulesetError>where T: Rule<U>, U: Access,
Attempts to add a new rule to the ruleset. Read more
source§fn add_rules<I, T, U, E>(self, rules: I) -> Result<Self, E>where
I: IntoIterator<Item = Result<T, E>>,
T: Rule<U>,
U: Access,
E: From<RulesetError>,
fn add_rules<I, T, U, E>(self, rules: I) -> Result<Self, E>where I: IntoIterator<Item = Result<T, E>>, T: Rule<U>, U: Access, E: From<RulesetError>,
Attempts to add a set of new rules to the ruleset. Read more
source§fn set_no_new_privs(self, no_new_privs: bool) -> Self
fn set_no_new_privs(self, no_new_privs: bool) -> Self
Auto Trait Implementations§
impl RefUnwindSafe for RulesetCreated
impl Send for RulesetCreated
impl Sync for RulesetCreated
impl Unpin for RulesetCreated
impl UnwindSafe for RulesetCreated
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more