Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 391195

Summary: sys-apps/coreutils-8.7 md5sum (and sha256sum) binary and text mode shows similiar results for DOS text file
Product: Gentoo Linux Reporter: Sergey S. Starikoff <Ikonta>
Component: [OLD] Core systemAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: minor    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Sergey S. Starikoff 2011-11-21 08:49:03 UTC
It seems, that, accepting traditional options (-b and -t), for cross-platform compatibility these utils always works in binary mode.

Reproducible: Always

Steps to Reproduce:
1. Get (copy ino temporary test dir) a text file. For example /etc/make.conf.
2. Convert it into DOS text format ($ unix2dos make.conf); 
3. Calculate ckechsums in binary mode:
$ md5sum -b make.conf 
6c0880c485075df4ccf84d80856f424a *make.conf
4. Calculate checksums in text mode:
$ md5sum -t make.conf 
6c0880c485075df4ccf84d80856f424a  make.conf

Actual Results:  
Compare them and find matching (differs only in mode flag in filename).

Expected Results:  
Either the results should not match or utils should not declare different modes (manual page is outdated?).
Comment 1 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-11-21 09:04:27 UTC
From the md5sum info page:

`--binary'
     Treat each input file as binary, by reading it in binary mode and
     outputting a `*' flag.  This is the inverse of `--text'.  On
     systems like GNU that do not distinguish between binary and text
     files, this option merely flags each input file as binary: the MD5
     checksum is unaffected. [...]

The man page does not contradict this.