-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
cksum/hashsum: Support for non-UTF-8 input in checksum files #6793
Conversation
GNU testsuite comparison:
|
febab10
to
71bc35b
Compare
71bc35b
to
7fa39e4
Compare
GNU testsuite comparison:
|
050ad32
to
91c1cd8
Compare
I closed the PR by mistake, wanted to mark it as ready :/ |
91c1cd8
to
57ac761
Compare
GNU testsuite comparison:
|
3285e74
to
953fa37
Compare
@cakebaker @BenWiederhake |
GNU testsuite comparison:
|
@RenjiSann sorry, there are some conflicts :| |
953fa37
to
838d433
Compare
Fixed ! 😁 |
GNU testsuite comparison:
|
838d433
to
61ca177
Compare
GNU testsuite comparison:
|
61ca177
to
7e45735
Compare
23d0c71
to
ebe53e0
Compare
GNU testsuite comparison:
|
178cc03
to
50bfa3d
Compare
GNU testsuite comparison:
|
GNU testsuite comparison:
|
The full line will be matched against the selected regex anyway
463c959
to
6030ad9
Compare
GNU testsuite comparison:
|
Ready for what should be a final review :) |
Thanks :) |
Second part of splitting #6603.
This PR adds support for non-UTF-8 checksum file content for
cksum
andhashsum
validation tools.In practice, given a CHECKSUM file with the following content, non-UTF-8 characters can appear in 2 places:
All the other places are either algorithm name, which should be ASCII, or hexa/base64 digest, which should be ASCII as well.
The most important step is to get rid of the call to
BufRead::lines()
to iterate on the lines of the CHECKSUM file, otherwise, it panics on non-UTF-8 characters.This change makes heavy use of
String
/OsString
/Vec<u8>
conversion, which happen to not be equally treated on all platforms.