#[non_exhaustive]pub enum ABI {
Unsupported,
V1,
V2,
}
Expand description
Version of the Landlock ABI.
ABI
enables to get the features supported by a specific Landlock ABI.
For example, AccessFs::from_all(ABI::V1)
gets all the file system access rights defined by the first version.
Without ABI
, it would be hazardous to rely on the the full set of access flags
(e.g., BitFlags::<AccessFs>::all()
or BitFlags::ALL
),
a moving target that would change the semantics of your Landlock rule
when migrating to a newer version of this crate
(i.e. non-breaking change with new supported features).
This usage should then be considered indeterministic because requested features
(e.g., access rights)
could not be tied to the application source code.
Such ABI
is also convenient to get the features supported by a specific Linux kernel
without relying on the kernel version (which may not be accessible or patched).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unsupported
Kernel not supporting Landlock, either because it is not built with Landlock or Landlock is not enabled at boot.
V1
First Landlock ABI, introduced with Linux 5.13.
V2
Second Landlock ABI, introduced with Linux 5.19.