Skip to content

Commit

Permalink
Add fast-windows feature
Browse files Browse the repository at this point in the history
  • Loading branch information
vvuk committed Feb 9, 2021
1 parent 841ad99 commit 7526910
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ serial_test = "0.5"

[features]
sudo = []
no-windows-permissions = []
26 changes: 26 additions & 0 deletions src/meta/windows_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,32 @@ use super::{Owner, Permissions};

const BUF_SIZE: u32 = 256;

#[cfg(feature = "no-windows-permissions")]
pub fn get_file_data(path: &Path) -> Result<(Owner, Permissions), io::Error> {
let owner = Owner::new("?".to_string(), "?".to_string());

let permissions = Permissions {
user_read: true,
user_write: true,
user_execute: true,

group_read: true,
group_write: true,
group_execute: true,

other_read: true,
other_write: true,
other_execute: true,

sticky: false,
setuid: false,
setgid: false,
};

Ok((owner, permissions))
}

#[cfg(not(feature = "no-windows-permissions"))]
pub fn get_file_data(path: &Path) -> Result<(Owner, Permissions), io::Error> {
// Overall design:
// This function allocates some data with GetNamedSecurityInfoW,
Expand Down

0 comments on commit 7526910

Please sign in to comment.