Skip to main content

alpm_db/db/
utils.rs

1//! Utility functions for alpm-db handling.
2
3/// The file mode of directories on disk.
4pub(crate) const DIR_MODE: u32 = 0o040755;
5
6/// Checks whether a given Unix-style `mode` is considered world-writable.
7///
8/// This ensures, that the last octal of `mode` is not `2`, `3`, `6` or `7`.
9pub(crate) fn permissions_world_writable(mode: u32) -> bool {
10    mode & 0o002 != 0
11}