pub struct RestrictionsBuilder { /* private fields */ }Expand description
Narrowing-only ratchet builder. There is deliberately no “unfiltered” escape here — a ratchet only ever subtracts.
Implementations§
Source§impl RestrictionsBuilder
impl RestrictionsBuilder
Sourcepub fn syscalls(self, deny: &'static [&'static str]) -> Self
pub fn syscalls(self, deny: &'static [&'static str]) -> Self
Block additional syscalls beyond those the applied profile already denies, installed as an additional stacked seccomp filter. The kernel takes the most restrictive verdict across every installed filter, so a stacked denylist can only ever narrow the surface further.
Repeated calls union the denials, deduplicating in first-seen order.
Sourcepub fn revoke_path(self, path: impl AsRef<Path>) -> Self
pub fn revoke_path(self, path: impl AsRef<Path>) -> Self
Enforce an additional restriction that removes access to a path the applied profile previously permitted. It can never add access.
Not implemented: tighten rejects path revocation on
Linux with Error::RequiredPrimitiveUnavailable.
Sourcepub fn build(self) -> Restrictions
pub fn build(self) -> Restrictions
Finalize the ratchet.
Trait Implementations§
Source§impl Clone for RestrictionsBuilder
impl Clone for RestrictionsBuilder
Source§fn clone(&self) -> RestrictionsBuilder
fn clone(&self) -> RestrictionsBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RestrictionsBuilder
impl RefUnwindSafe for RestrictionsBuilder
impl Send for RestrictionsBuilder
impl Sync for RestrictionsBuilder
impl Unpin for RestrictionsBuilder
impl UnsafeUnpin for RestrictionsBuilder
impl UnwindSafe for RestrictionsBuilder
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