Moved chmod
module to mode
; Added some types to mode
This commit is contained in:
parent
c6e162ebc8
commit
68a4c08fe9
@ -1 +0,0 @@
|
|||||||
//! Functions for parsing and managing permissions
|
|
@ -1,10 +1,10 @@
|
|||||||
#![warn(clippy::all, clippy::pedantic)]
|
#![warn(clippy::all, clippy::pedantic)]
|
||||||
use std::{env, path::PathBuf, process, string::ToString};
|
use std::{env, path::PathBuf, process, string::ToString};
|
||||||
|
|
||||||
pub mod chmod;
|
|
||||||
mod cmd;
|
mod cmd;
|
||||||
pub use cmd::Cmd;
|
pub use cmd::Cmd;
|
||||||
pub mod math;
|
pub mod math;
|
||||||
|
pub mod mode;
|
||||||
pub mod pw;
|
pub mod pw;
|
||||||
|
|
||||||
/// Defines the location relative to the binary where a command will be installed
|
/// Defines the location relative to the binary where a command will be installed
|
||||||
|
38
src/mode/mod.rs
Normal file
38
src/mode/mod.rs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
//! Functions for parsing and managing permissions
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq)]
|
||||||
|
pub enum Bits {
|
||||||
|
Suid = 0o4000,
|
||||||
|
Sgid = 0o2000,
|
||||||
|
Sticky = 0o1000,
|
||||||
|
URead = 0o400,
|
||||||
|
UWrite = 0o200,
|
||||||
|
UExec = 0o100,
|
||||||
|
GRead = 0o40,
|
||||||
|
GWrite = 0o20,
|
||||||
|
GExec = 0o10,
|
||||||
|
ORead = 0o4,
|
||||||
|
OWrite = 0o2,
|
||||||
|
OExec = 0o1,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq)]
|
||||||
|
pub enum Op {
|
||||||
|
Add,
|
||||||
|
Remove,
|
||||||
|
Equals,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq)]
|
||||||
|
pub enum Who {
|
||||||
|
User,
|
||||||
|
Group,
|
||||||
|
Other,
|
||||||
|
All,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Parser {
|
||||||
|
mode: u32,
|
||||||
|
op: Op,
|
||||||
|
who: Who,
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user