rhash / RHash

Great utility for computing hash sums
http://rhash.sf.net
BSD Zero Clause License
585 stars 116 forks source link

"No such file" error when checking hash on path with length of exactly 32 characters #264

Closed so718 closed 2 months ago

so718 commented 4 months ago

rhash --check will report a No such file or directory error when run on hashes whose file path has exactly 32 characters including slashes (/).

The error does not happen on paths of 31 characters or 33 characters in length

The examples are run using RHash v1.4.1

Example 1:

$ rhash --md5 abcdefghijklmnopqrstuvwxyzabcdef | tee ex1.md5 d41d8cd98f00b204e9800998ecf8427e abcdefghijklmnopqrstuvwxyzabcdef

$ rhash --check ex1.md5

--( Verifying ex1.md5 )--------------------------------------------------------- d41d8cd98f00b204e9800998ecf8427e No such file or directory -------------------------------------------------------------------------------- Errors Occurred: Errors:0 Miss:1 Success:0 Total:1

Example 2:

$ rhash --md5 --recursive abcdefghijklmno | tee ex2.md5 d41d8cd98f00b204e9800998ecf8427e abcdefghijklmno/abcdefghijklmno d41d8cd98f00b204e9800998ecf8427e abcdefghijklmno/abcdefghijklmnop d41d8cd98f00b204e9800998ecf8427e abcdefghijklmno/abcdefghijklmnopq

$ rhash --check ex2.md5

--( Verifying ex2.md5 )--------------------------------------------------------- abcdefghijklmno/abcdefghijklmno OK d41d8cd98f00b204e9800998ecf8427e No such file or directory abcdefghijklmno/abcdefghijklmnopq OK -------------------------------------------------------------------------------- Errors Occurred: Errors:0 Miss:1 Success:2 Total:3

Example 3:

$ rhash --md5 --recursive abcdefghijklmnopqrstuvwxyzabc | tee ex3.md5 d41d8cd98f00b204e9800998ecf8427e abcdefghijklmnopqrstuvwxyzabc/a d41d8cd98f00b204e9800998ecf8427e abcdefghijklmnopqrstuvwxyzabc/ab d41d8cd98f00b204e9800998ecf8427e abcdefghijklmnopqrstuvwxyzabc/abc

$ rhash --check ex3.md5

--( Verifying ex3.md5 )--------------------------------------------------------- abcdefghijklmnopqrstuvwxyzabc/a OK d41d8cd98f00b204e9800998ecf8427e No such file or directory abcdefghijklmnopqrstuvwxyzabc/abc OK -------------------------------------------------------------------------------- Errors Occurred: Errors:0 Miss:1 Success:2 Total:3

Example 4:

$ rhash --md5 --recursive abcdefghij | tee ex4.md5 d41d8cd98f00b204e9800998ecf8427e abcdefghij/abcdefghij/abcdefghi d41d8cd98f00b204e9800998ecf8427e abcdefghij/abcdefghij/abcdefghij d41d8cd98f00b204e9800998ecf8427e abcdefghij/abcdefghij/abcdefghijk

$ rhash --check ex4.md5

--( Verifying ex4.md5 )--------------------------------------------------------- abcdefghij/abcdefghij/abcdefghi OK d41d8cd98f00b204e9800998ecf8427e No such file or directory abcdefghij/abcdefghij/abcdefghijk OK -------------------------------------------------------------------------------- Errors Occurred: Errors:0 Miss:1 Success:2 Total:3

rhash_bug.tar.gz

so718 commented 2 months ago

This bug has been fixed in version 1.4.3