#44374 [NEW]: MD5_file HASH problem

From: Date: Sat, 08 Mar 2008 14:20:54 +0000
Subject: #44374 [NEW]: MD5_file HASH problem
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123063@lists.php.net to get a copy of this message
From: palo654 at hotmail dot com Operating system: Linux Fedora PHP version: 4.4.8 PHP Bug Type: *Encryption and hash functions Bug description: MD5_file HASH problem Description: ------------ I've noticed a really confusing fact. MD5_file and shell md5sum gives different checksums in some cases. I've written a complete file integrity check in php. O was using md5sum from shell to calcullate md5 checksums. After switching to md5_file i've got allerts in some files. So I made some test, and found, that in some cases md5sum and md5_file gives different output !!! on my /usr/lib directory I've got 6 differences. Reproduce code: --------------- shell_exec("/usr/bin/md5sum $currentfile"); md5_file($currentfile); -- Edit bug report at http://bugs.php.net/?id=44374&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44374&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44374&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44374&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44374&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44374&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44374&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44374&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44374&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44374&r=support Expected behavior: http://bugs.php.net/fix.php?id=44374&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44374&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44374&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44374&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44374&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44374&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44374&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44374&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44374&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44374&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44374&r=mysqlcfg

« previous php.bugs (#123063) next »