Skip to content

Commit

Permalink
broken access control logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mgree committed Jun 23, 2021
1 parent 704efbe commit 9a58dee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/fs.rs
Expand Up @@ -466,7 +466,8 @@ impl Filesystem for FS {
let now = SystemTime::now();
let mut set_time = false;
if let Some(atime) = atime {
if self.check_access(req) && atime != TimeOrNow::Now {
info!("setting atime");
if !self.check_access(req) {
reply.error(libc::EPERM);
return;
}
Expand All @@ -486,7 +487,9 @@ impl Filesystem for FS {
}

if let Some(mtime) = mtime {
if self.check_access(req) && mtime != TimeOrNow::Now {
info!("setting mtime");

if !self.check_access(req) {
reply.error(libc::EPERM);
return;
}
Expand Down

0 comments on commit 9a58dee

Please sign in to comment.