Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Don't report directory if metadata lookup fails
Browse files Browse the repository at this point in the history
  • Loading branch information
DrChat committed Aug 8, 2023
1 parent 2e44020 commit 062211b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/agent/onefuzz/src/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,12 @@ impl DirectoryMonitor {
}
}
CreateKind::Any | CreateKind::Other => {
if self.report_directories {
return Ok(Some(path));
}

if let Ok(metadata) = fs::metadata(&path).await {
// check if it is a file
if metadata.is_file() {
return Ok(Some(path));
} else if self.report_directories {
return Ok(Some(path));
}
}
}
Expand Down

0 comments on commit 062211b

Please sign in to comment.