Skip to content

Commit

Permalink
Fix: OpenVASD: add path on hashsum failure
Browse files Browse the repository at this point in the history
Adds the path to the erreor as a key when hash sum verification for
sha256sums fails.
  • Loading branch information
nichtsfrei committed Apr 26, 2024
1 parent 0917d57 commit 8da5f15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rust/openvasd/src/controller/feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ async fn changed_hash(signature_check: bool, feeds: &[FeedHash]) -> Result<Vec<F
}

let path = h.path.clone();
let hash = tokio::task::spawn_blocking(move || match FeedIdentifier::sumfile_hash(path) {
let hash = tokio::task::spawn_blocking(move || match FeedIdentifier::sumfile_hash(&path) {
Ok(h) => h,
Err(e) => {
Err(mut e) => {
e.key = path.to_str().unwrap_or_default().to_string();

tracing::warn!(%e, "Failed to compute sumfile hash");
"".to_string()
}
Expand Down

0 comments on commit 8da5f15

Please sign in to comment.