Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 391195 - sys-apps/coreutils-8.7 md5sum (and sha256sum) binary and text mode shows similiar results for DOS text file
Summary: sys-apps/coreutils-8.7 md5sum (and sha256sum) binary and text mode shows simi...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal minor
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-21 08:49 UTC by Sergey S. Starikoff
Modified: 2011-11-21 09:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.