Skip to content

Stop the scanner decompressing and decrypting what it reads - #2167

Merged
bbatsov merged 2 commits into
masterfrom
fix/scan-file-handlers
Aug 20, 2026
Merged

Stop the scanner decompressing and decrypting what it reads#2167
bbatsov merged 2 commits into
masterfrom
fix/scan-file-handlers

Conversation

@bbatsov

@bbatsov bbatsov commented Aug 20, 2026

Copy link
Copy Markdown
Owner

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 - 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 .gpg test fixture in an unrelated repo.

Only jka-compr-handler and epa-file-handler are 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.

`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.
@bbatsov
bbatsov merged commit 00aa209 into master Aug 20, 2026
5 checks passed
@bbatsov
bbatsov deleted the fix/scan-file-handlers branch August 20, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant