-
Notifications
You must be signed in to change notification settings - Fork 883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perform download safety check even when user is prompted for save location. #16969
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
chromium_src/chrome/browser/download/download_target_determiner.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
// Prompting the user for download location shouldn't be a factor in determining | ||
// the download's danger level. | ||
#define BRAVE_DOWNLOAD_TARGET_DETERMINER_GET_DANGER_LEVEL \ | ||
true) {} \ | ||
if ( | ||
|
||
#include "src/chrome/browser/download/download_target_determiner.cc" | ||
#undef BRAVE_DOWNLOAD_TARGET_DETERMINER_GET_DANGER_LEVEL |
12 changes: 12 additions & 0 deletions
12
patches/chrome-browser-download-download_target_determiner.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc | ||
index 6e2ece915f5b00068b804607d24a0eb39bce8ffd..19a3ed5111d24613941f5c5505694cedabe42884 100644 | ||
--- a/chrome/browser/download/download_target_determiner.cc | ||
+++ b/chrome/browser/download/download_target_determiner.cc | ||
@@ -1253,6 +1253,7 @@ DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel( | ||
// contains malware. | ||
if (HasPromptedForPath() || | ||
confirmation_reason_ != DownloadConfirmationReason::NONE || | ||
+ BRAVE_DOWNLOAD_TARGET_DETERMINER_GET_DANGER_LEVEL | ||
!download_->GetForcedFilePath().empty()) | ||
return DownloadFileType::NOT_DANGEROUS; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused because this looks like an upstream issue if there is an issue here, but the location does affect the danger level which is why macOS prompts for permission to access different file system locations for each app