#[non_exhaustive]pub enum Error {
NotSupported {
source: Error,
},
Unsupported {
feature: Feature,
kernel_abi: u32,
required_abi: u32,
},
InvalidPath {
path: PathBuf,
reason: PathError,
},
Open {
path: PathBuf,
source: Error,
},
InapplicableAccess {
access: Access,
path: Option<PathBuf>,
},
InvalidFileDescriptor {
source: Error,
},
LayerLimitReached,
Syscall {
operation: Operation,
source: Error,
},
}Expand description
Everything that can prevent a policy from being enforced.
Ruleset::restrict_self returns the first error encountered while the
policy was built. When it returns an error, no restriction has been applied
(with one caveat: a failure while enforcing the second or third ruleset
layer can leave the process partially restricted, see Error::Syscall).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotSupported
Landlock is not available: the kernel does not implement it (ENOSYS),
it is disabled at boot time (EOPNOTSUPP, lsm= kernel command line),
or the system calls are blocked (for example by a seccomp filter).
Unsupported
In strict mode, the running kernel cannot enforce a requested feature.
Fields
InvalidPath
The path is not usable for a rule.
Open
The path could not be opened.
Fields
InapplicableAccess
The requested access has no meaning for the object (for example
Access::ReadDir on a regular file).
Fields
InvalidFileDescriptor
The file descriptor does not identify a file hierarchy that Landlock can
restrict: it refers to a pipe, a socket, an anonymous inode, a ruleset,
or an internal filesystem such as /proc/<pid>/ns/*.
LayerLimitReached
The kernel’s limit of 16 stacked rulesets is reached for this thread.
A single Ruleset applies at most three layers (filesystem, network
and scope). This error means the thread already inherited or applied
many rulesets; build a single policy per thread where possible.
Syscall
An unexpected error from a Landlock system call.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()