pxar: move acl helper functions to src/tools/acl.rs
They are not only needed by the pxar::sequential_decoder but also for the fuse xattr impl, so it makes more sense to have them there. Signed-off-by: Christian Ebner <c.ebner@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
committed by
Wolfgang Bumiller
parent
6f763ae673
commit
bcf0d452c9
@ -270,3 +270,18 @@ impl<'a> Iterator for &'a mut ACLEntriesIterator {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Helper to transform `PxarEntry`s user mode to acl permissions.
|
||||
pub fn mode_user_to_acl_permissions(mode: u64) -> u64 {
|
||||
(mode >> 6) & 7
|
||||
}
|
||||
|
||||
/// Helper to transform `PxarEntry`s group mode to acl permissions.
|
||||
pub fn mode_group_to_acl_permissions(mode: u64) -> u64 {
|
||||
(mode >> 3) & 7
|
||||
}
|
||||
|
||||
/// Helper to transform `PxarEntry`s other mode to acl permissions.
|
||||
pub fn mode_other_to_acl_permissions(mode: u64) -> u64 {
|
||||
mode & 7
|
||||
}
|
||||
|
Reference in New Issue
Block a user