Struct fs_mistrust::MistrustBuilder
source · pub struct MistrustBuilder { /* private fields */ }
Expand description
Builder for Mistrust
.
Implementations§
source§impl MistrustBuilder
impl MistrustBuilder
sourcepub fn ignore_prefix<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
pub fn ignore_prefix<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
If the user called MistrustBuilder::ignore_prefix
, what did they give us?
(This is stored in canonical form.)
source§impl MistrustBuilder
impl MistrustBuilder
sourcepub fn dangerously_trust_everyone(&mut self) -> &mut Self
pub fn dangerously_trust_everyone(&mut self) -> &mut Self
Configure this Mistrust
to trust every user and every group.
With this option set, every file and directory is treated as having valid permissions: even world-writeable files are allowed. File-type checks are still performed.
This option is mainly useful to handle cases where you want to make
these checks optional, and still use CheckedDir
without having to
implement separate code paths for the “checking on” and “checking off”
cases.
Setting this flag will supersede any value set in the environment.
sourcepub fn remove_ignored_prefix(&mut self) -> &mut Self
pub fn remove_ignored_prefix(&mut self) -> &mut Self
Remove any ignored prefix, restoring this MistrustBuilder
to a state
as if MistrustBuilder::ignore_prefix
had not been called.
sourcepub fn controlled_by_env_var(&mut self, var: &str) -> &mut Self
pub fn controlled_by_env_var(&mut self, var: &str) -> &mut Self
Configure this MistrustBuilder
to become disabled based on the
environment variable var
.
(If the variable is “false”, “no”, or “0”, it will be treated as false; other values are treated as true.)
If var
is not set, then we’ll look at
$FS_MISTRUST_DISABLE_PERMISSIONS_CHECKS
.
sourcepub fn controlled_by_env_var_if_not_set(&mut self, var: &str) -> &mut Self
pub fn controlled_by_env_var_if_not_set(&mut self, var: &str) -> &mut Self
Like controlled_by_env_var
, but do not override any previously set
environment settings.
(The arti-client
wants this, so that it can inform a caller-supplied
MistrustBuilder
about its Arti-specific env var, but only if the
caller has not already provided a variable of its own. Other code
embedding fs-mistrust
may want it too.)
sourcepub fn controlled_by_default_env_var(&mut self) -> &mut Self
pub fn controlled_by_default_env_var(&mut self) -> &mut Self
Configure this MistrustBuilder
to become disabled based on the
environment variable $FS_MISTRUST_DISABLE_PERMISSIONS_CHECKS
only,
(If the variable is “false”, “no”, “0”, or “”, it will be treated as false; other values are treated as true.)
This is the default.
sourcepub fn ignore_environment(&mut self) -> &mut Self
pub fn ignore_environment(&mut self) -> &mut Self
Configure this MistrustBuilder
to never consult the environment to
see whether it should be disabled.
Trait Implementations§
source§impl Clone for MistrustBuilder
impl Clone for MistrustBuilder
source§fn clone(&self) -> MistrustBuilder
fn clone(&self) -> MistrustBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more