(
&mut self,
path: &Path,
access: BitFlags<AccessFs>,
)
| 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, |
no outgoing calls
no test coverage detected