drive: send acknowledgeAbuse=true on every download when --drive-acknowledge-abuse - #9914
Open
Masterxilo wants to merge 1 commit into
Open
drive: send acknowledgeAbuse=true on every download when --drive-acknowledge-abuse#9914Masterxilo wants to merge 1 commit into
Masterxilo wants to merge 1 commit into
Conversation
…owledge-abuse is set Google holds every download of an executable for about 27 seconds before the first byte, whatever the file size, to malware-scan it on each request. Nautilus asks GIO for the content type of every file, and GIO opens any file whose extension is ambiguous to sniff its bytes. Four system mime types claim .exe, so it is always ambiguous. Three .exe files in the root of a Google Drive, each sniffed twice for type and icon, gave a 3-minute "Loading" hang in Nautilus on an rclone mount. Adding acknowledgeAbuse=true to the download request skips the scan entirely: 0.4 seconds instead of 27. rclone only sent that parameter after a cannotDownloadAbusiveFile error, so --drive-acknowledge-abuse never helped with downloads that succeed slowly. Send it up front when the option is set. Measured with this patch: 3 seconds versus 30 seconds for the same 4 KiB read of an .exe, and the Nautilus listing of that folder dropped from 175 s to 3 s. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The retry can duplicate the parameter, and focused tests plus generated-documentation cleanup are still needed.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates Google Drive downloads to send acknowledgeAbuse=true proactively when enabled, avoiding malware-scan delays.
Changes:
- Adds proactive acknowledgment to download requests.
- Documents the updated behavior.
File summaries
| File | Summary | Findings |
|---|---|---|
docs/content/drive.md |
Documents the updated option behavior. | Nit (1 vote): Remove this generated hunk; keep documentation in backend/drive/drive.go. |
backend/drive/drive.go |
Adds acknowledgment to download URLs. | Moderate (2 votes): Add focused HTTP tests. Moderate (1 vote): Prevent the retry from duplicating the query parameter. |
Review details
Suppressed comments (2)
backend/drive/drive.go:4415
- The initial request already passes through
withAcknowledgeAbuse, so this retry appends the parameter a second time and sendsacknowledgeAbuse=true&acknowledgeAbuse=true. Keep the existing URL for the retry (or make the helper idempotent) so the fallback does not emit duplicate query parameters.
url = withAcknowledgeAbuse(url)
docs/content/drive.md:1099
- This file is generated from backend option
Helpfields; repository guidance says not to commitmake backenddocsoutput. Please keep this documentation change inbackend/drive/drive.goand drop this generated hunk, otherwise it will be overwritten on the next doc generation.
With this flag set rclone sends acknowledgeAbuse=true on every download.
Google otherwise holds each download of an executable for ~30s to scan it
for malware on every request, so this also makes those downloads fast.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+4405
to
+4408
| if o.fs.opt.AcknowledgeAbuse { | ||
| // Send it up front: Google otherwise holds every download of an | ||
| // executable for ~30s to scan it for malware on each request. | ||
| url = withAcknowledgeAbuse(url) |
Author
|
fixes are trivial, let copilot do them |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this change do?
Google holds every download of an executable for about 27 seconds before the first byte, whatever the file size, to malware-scan it on each request. Nautilus asks GIO for the content type of every file, and GIO opens any file whose extension is ambiguous to sniff its bytes. Four system mime types claim .exe, so it is always ambiguous. Three .exe files in the root of a Google Drive, each sniffed twice for type and icon, gave a 3-minute "Loading" hang in Nautilus on an rclone mount.
A user-level or system-level mime override to stop GIO from sniffing .exe does not work. GLib merges all mime caches and ignores the delete markers. Both attempts were reverted.
Adding acknowledgeAbuse=true to the download request skips the scan entirely: 0.4 seconds instead of 27. rclone only sent that parameter after a cannotDownloadAbusiveFile error, so --drive-acknowledge-abuse never helped with downloads that succeed slowly. Send it up front when the option is set.
Measured with this patch: 3 seconds versus 30 seconds for the same 4 KiB read of an .exe, and the Nautilus listing of a folder with multiple .exe dropped from 175 s to 3 s.
Checklist
test_allpasses for this backend and if submitting a new backend can provide a test account for the integration tester - see CONTRIBUTING.md.