Stop the scanner decompressing and decrypting what it reads - #2167
Merged
Conversation
`projectile-replace--scan-file' reads candidates with `insert-file-contents', which dispatches through `file-name-handler-alist'. So a project search ran gzip over every archive in the candidate set and handed every `.gpg' to EPA - and then threw the result away, because the very next line classifies it as binary. On a genuinely encrypted file that is a passphrase prompt in the middle of a search; the file that turned this up was a `.gpg' test fixture in an unrelated repository. Only `jka-compr-handler' and `epa-file-handler' are inhibited, so a remote project still reads through TRAMP. Matches inside compressed files are no longer reported. That is a behaviour change, and the right way round: the ripgrep path never looked inside archives, so the two engines now agree.
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.
projectile-replace--scan-filereads candidates withinsert-file-contents, which dispatches throughfile-name-handler-alist. So a project search ran gzip over every archive in the candidate set and handed every.gpgto EPA - then discarded the result, since the next line classifies it as binary. On a genuinely encrypted file that means a passphrase prompt in the middle of a search.I hit this benchmarking a search across 122 projects: it decrypted a
.gpgtest fixture in an unrelated repo.Only
jka-compr-handlerandepa-file-handlerare inhibited, so a remote project still reads through TRAMP.One behaviour change worth flagging: matches inside compressed files are no longer reported by this scanner. That's the right way round - the ripgrep path never looked inside archives, so the two engines now agree.