'Verify checksum' fails if file is renamed

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
vudu
Junior Member
Junior Member
Posts: 27
Joined: 2011-12-04, 19:52 UTC

'Verify checksum' fails if file is renamed

Post by *vudu »

Scenario:
1. Several large files
2. One md5 file with hashes, placed in the same directory

Problem:
1. If file has the extension .md5 or no extension at all, the command Files -> Verify Checksums passes OK.
2. If I change the extension to .txt, it says
Wrong CRC: md5sum.txt

Errors: 1
OK: 0, not found: 0, read error: 0, wrong checksum: 1
This doesn't represent a big problem if the hash file is on a hard drive (because I can rename it to .md5), but it can be pain in the ear if it's located on a read-only drive (e.g. md5 hash file on Linux ISOs). In that case, I have to copy the hash file on a hard drive, rename it to .md5 (or remove the extension) and then search/replace relative paths with full paths to point to DVD drive, so the verify procedure can locate actual files.

Please make this command work according to file content and not according to file extension.

Here is an example md5 file:
https://dl.dropboxusercontent.com/u/22166389/md5sum.md5
(Unix-style endline format)
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

I have a way of reproducing this weird error:
  1. Select at least two files and create their MD5.
  2. Rename the checksum to *.txt.
  3. Try to use the .txt file to verify checksums. You should see the unexpected error mentioned above every time you try.
  4. Now, if you rename the txt file back to *.md5, the verification will work as it should.
  5. But there is even more interesting thing if you don't rename it, but only press Ctrl+C on it instead. The next time you try to use the .txt file to verify a checksum, it will show the proper "Please select only SFV, MD5 or SHA files!" error dialog.
2vudu
TC checks filename and extension of a checksum file to make sure it's really a proper file. It accepts *.md5, *.sfv, *.sha and a few exceptions. More info here: http://www.ghisler.ch/board/viewtopic.php?t=27323
And by the way, TC recognizes "md5sum.txt" as a proper checksum file.

edit: shorter instructions
Last edited by umbra on 2013-05-18, 15:42 UTC, edited 1 time in total.
Windows 7 Pro x64, Windows 10 Pro x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

For what reason do you change the extension of a checksum file ?
There is no technical need at all and it hides the file function.
vudu
Junior Member
Junior Member
Posts: 27
Joined: 2011-12-04, 19:52 UTC

Post by *vudu »

Many linux distros ship md5 sums in a .txt file inside the ISO (e.g. Ubuntu, Debian etc), see the paragraph after the quote. This is not a Total Commander-specific thing, it's simply an output of standard unix/linux md5sum, sha256sum etc. utilities.

Since md5, sha1 and sha256 sums have fixed format (e.g. md5 sums always have 32-character hash), the verify utility should recognize the content of files with "unknown" extensions according to that format.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

vudu wrote:Many linux distros ship md5 sums in a .txt file inside the ISO (e.g. Ubuntu, Debian etc), see the paragraph after the quote. This is not a Total Commander-specific thing, it's simply an output of standard unix/linux md5sum, sha256sum etc. utilities.
Ubuntu and Debian have files named "md5sum.txt" on their ISOs which can be checked by TC without any change (as was mentioned by umbra).

System Rescue CD has a file named sysrcd.md5 which TC can check as well.

Knoppix might be a problem as it has a file named "sha1sums"; funnily enough the path to the file KNOPPIX is wrong in "sha1sums" on the Knoppix 7.0.3 CD so TC really can't check that file ;).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
vudu
Junior Member
Junior Member
Posts: 27
Joined: 2011-12-04, 19:52 UTC

Post by *vudu »

So if Total Commander handles one md5sum.txt file and can't handle another md5sum.txt file, but handles it if it's renamed to .md5, it's obviosly a consistency problem which should be fixed.
Personal licence #263866
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

2vudu
Yes, you are right, that's the point of my post. TC, for some reason, cannot properly detect if the provided file is a proper checksum file or not. The same file is sometimes recognized and sometimes not (see step 5 in my post).
Windows 7 Pro x64, Windows 10 Pro x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, extension .txt is currently not supported for checksums.
Author of Total Commander
https://www.ghisler.com
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

2ghisler(Author)
Please, read these posts again. There are two issues here:

1. A feature request. vudu asked for supporting .txt checksum files.

2. A bug report. Sometimes, when user tries to use a .txt file (with valid content) for verification, TC shows an incorrect error. It should display "Please select only SFV, MD5 or SHA files!". But instead, it pretends that the verification failed. However this is not easily reproducible. On Saturday, it happened to me every time I renamed an .md5 file to .txt and tried to use it. Today, I'm not able to reproduce it anymore.
Windows 7 Pro x64, Windows 10 Pro x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

umbra wrote:2ghisler(Author)
Please, read these posts again. There are two issues here:
...
2. A bug report. Sometimes, when user tries to use a .txt file (with valid content) for verification, TC shows an incorrect error. It should display "Please select only SFV, MD5 or SHA files!". But instead, it pretends that the verification failed. However this is not easily reproducible. On Saturday, it happened to me every time I renamed an .md5 file to .txt and tried to use it. Today, I'm not able to reproduce it anymore.
I can't reproduce your problem with TC 8.01
It always gives the correct error message
"Please select only SFV‚ MD5 or SHA files!"
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

2Horst.Epp
And just now, it happened again. I created test.md5 for one file. I edited it and duplicated the first line, so the file contained two checksums of the same file. I saved it, closed the editor and renamed test.md5 to test.txt. And when I tried the verification I got the error.
As I said, it does not happed always. But I'm just confirming the error that vudu reported in the opening post, so it definitely exists.
Windows 7 Pro x64, Windows 10 Pro x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

umbra wrote:2Horst.Epp
And just now, it happened again. I created test.md5 for one file. I edited it and duplicated the first line, so the file contained two checksums of the same file. I saved it, closed the editor and renamed test.md5 to test.txt. And when I tried the verification I got the error.
As I said, it does not happed always. But I'm just confirming the error that vudu reported in the opening post, so it definitely exists.
Finally I was able to reproduce the bug, following your steps.
But I had to rename the filename itself to trigger the wrong message.
vudu
Junior Member
Junior Member
Posts: 27
Joined: 2011-12-04, 19:52 UTC

Post by *vudu »

Another interesting thing:

1. md5sum.txt verifies OK.
2. I rename it to md5sum2.txt. Verify command throws "Please select only SFV, MD5 or SHA files!"
3. I rename it back to md5sum.txt, verifies OK again.
Personal licence #263866
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

2vudu
Please read previous posts. While in general TC does not accept *.txt files for verification, "md5sum.txt" is a commonly used checksum file, so the author added an exception for it.
Windows 7 Pro x64, Windows 10 Pro x64
Post Reply