-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
cksum: even more fixes #6929
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: even more fixes #6929
Conversation
6bbbb87
to
31de97a
Compare
GNU testsuite comparison:
|
a few jobs are failing |
42997a2
to
f36fe46
Compare
GNU testsuite comparison:
|
f36fe46
to
219a91d
Compare
GNU testsuite comparison:
|
219a91d
to
00d1730
Compare
GNU testsuite comparison:
|
eda6659
to
f836b08
Compare
I've fixed what I could. |
GNU testsuite comparison:
|
5f22dad
to
5e92491
Compare
GNU testsuite comparison:
|
5e92491
to
6873fe2
Compare
GNU testsuite comparison:
|
let (filename_to_check_unescaped, prefix) = unescape_filename(filename); | ||
let real_filename_to_check = os_str_from_bytes(&filename_to_check_unescaped)?; |
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 suggest to rename filename_to_check_unescaped
to unescaped_filename_to_check
to match the naming of real_filename_to_check
. And I think the _to_check
suffices can be dropped in both cases.
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.
Overall good job with this refactoring!
c410c28
to
e7fa8dd
Compare
…of the expected digest
…ore and introduce LineFormat struct
e7fa8dd
to
958222a
Compare
Thanks :) |
@RenjiSann btw, you will see that the fuzzer finds some issues: to run it locally: |
Indeed. Many tests fail because the cksum installed in the CI is older than ours (probably GNU coreutils 9.1 which is Ubuntu's default), which does not support --base64 and --raw. Another issue is that --length validity should be checked before the --check argument. |
Fixes #6653
This PR changes the way the regex to parse a checksum line is chosen. Now, every line gets to choose the regex it matches with, instead of trying to match with the regex that matched the first line (except for non-algo based line which should follow the flavor of the first one).
While doing this, I've decided to get rid of the
regex::Capture
which was being carried around everywhere, and create aLineInfo
struct that holds all the parsed data.It adds
lazy_static
as a direct dependency touu_core
(it was an indirect dependency until now). I allows to not recompile the regexes again and again.EDIT: I have added some code to rework the way the expected checksum is decoded, this PR now fixes #6576 and #6614 as well.