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
Get rid of warn_binary #16367
Get rid of warn_binary #16367
Conversation
Current implementation of warn_binary introduces a regression when the content is passed in /dev/stdin as an explicit file name and reads the file to be processed twice otherwise. I suggest to reimplement this functionality after 3.0 if necessary. Fixes openssl#16359
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 do not agree with entirely removing the warn_binary
function.
Yet sure stdin
should not be read twice.
Instead, the function can simply check for the input file
being /dev/stdin
and return immediately in this case.
I think no files should be read twice - and check for stdin is not the right way to fix the issue. If we have a really large file, why are we to read it twice? The right way looks to me like set some flag about possible binary content during reading the file and report afterwards. But this also looks like a post-3.0 solution |
Good point that reading a (large) file twice is not a good solution.
Yes.
I agree. Please open an issue, pointing to this discussion, such that this point is not forgotten, |
This doesn't exist on some platforms. Reading via a memory BIO and checking the first bytes for binary might be an option. Otherwise @beldmit's suggestion of a flag that is set when something is encountered (filter BIO perhaps?). Finally, the command does know if it has been told to read stdin and could skip the check in this case -- not ideal but possibly okay enough. |
24 hours has passed since 'approval: done' was set, but this PR has failing CI tests. Once the tests pass it will get moved to 'approval: ready to merge' automatically, alternatively please review and set the label manually. |
Current implementation of warn_binary introduces a regression when the content is passed in /dev/stdin as an explicit file name and reads the file to be processed twice otherwise. I suggest to reimplement this functionality after 3.0 if necessary. Fixes #16359 Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from #16367)
Merged. Thanks! |
Current implementation of warn_binary introduces a regression
when the content is passed in /dev/stdin as an explicit file name
and reads the file to be processed twice otherwise.
I suggest to reimplement this functionality after 3.0 if necessary.
Fixes #16359
Checklist