-
Notifications
You must be signed in to change notification settings - Fork 777
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
Filenames with newlines aren't handled properly #695
Comments
Hi @systwi-again, thanks for the report. I've confirmed your issue. So far, I put terminal agnostic version of your investigation for contributors and future version of our test.
|
See Cyan4973#695 for details.
I've made experimental branch for this issue - https://github.com/t-mat/xxHash/tree/issue-695 You can check it by the following commands
But I have 2 questions (1) Should we really support I'm really sorry. And this is 100% my personal taste. But since we've been stating and trying to mimic (2) Should we introduce md5sum style convention to BSD style line? Since I'm no-brainer, I put same rule to |
Good question, Hence I presume it's better to support them, though this is weak preference.
Same idea, it depends on |
Sure!
|
Agreed |
I've added test script to my branch.
The test script
|
For details, see issue Cyan4973#695. If filename contains special character (\n, 0x0a, LF), - Put '\' (0x5c) at the beginning of the line. - Escape special character by '\'.
See also issue Cyan4973#695.
Hi @systwi-again, since we've merged the fix of this issue, could you check fresh |
When I use
md5sum
(version 9.0 from GNU coreutils), I can properly calculate and verify hashes of files containing0x0A
in their filenames:Unfortunately, this intended behaviour cannot be replicated with
xxhsum
(version 0.8.1):Filenames containing carriage returns (
0x0D
) act bizarrely when quoted (finished with tab complete):as well as when unquoted:
Notice the 'bar' overlapped part of the hash in my terminal and makes it look like a file named 'bar' has a matching hash. GNU coreutils'
md5sum
uses\r
instead of the raw character (excluding its-z
flag).It seems that the offending character(s) are not backslash-escaped and therefore causes confusion with
xxhsum
when parsing the list back.Including/omitting
--tag
results in the same behaviour.Tested using Arch GNU/Linux.
The text was updated successfully, but these errors were encountered: