MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / add_rule

Method add_rule

vmm/src/landlock.rs:90–105  ·  view source on GitHub ↗
(
        &mut self,
        path: &Path,
        access: BitFlags<AccessFs>,
    )

Source from the content-addressed store, hash-verified

88 }
89
90 pub(crate) fn add_rule(
91 &mut self,
92 path: &Path,
93 access: BitFlags<AccessFs>,
94 ) -> Result<(), LandlockError> {
95 // path_beneath_rules in landlock crate handles file and directory access rules.
96 // Incoming path/s are passed to path_beneath_rules, so that we don't
97 // have to worry about the type of the path.
98 let paths = vec![&path];
99 let path_beneath_rules = path_beneath_rules(paths, access);
100 self.ruleset
101 .as_mut()
102 .add_rules(path_beneath_rules)
103 .map_err(LandlockError::ManageRuleset)?;
104 Ok(())
105 }
106
107 pub(crate) fn add_rule_with_access(
108 &mut self,

Callers 1

add_rule_with_accessMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected