comprock
07-09-2004, 05:19 PM
My ThePlanet box, Linux *.*.com 2.4.21-15.ELsmp #1 SMP Thu Apr 22 00:18:24 EDT 2004 i686 i686 i386 GNU/Linux, with cPanel RELEASE has once again lost md5. I can do a find with the following.
root@*:~ # find / -name "md5"
/dev/md5
/usr/local/cpanel/whostmgr/kb/md5
/home/virtfs/*/dev/md5
/home/cpzendinstall/ZendOptimizer-2.5.1-Linux_glibc21-i386/md5
I've ran /scripts/cleanmd5 a couple of times and restarted services to try and reinstall md5.
I'm still getting,
root@*:~ # which md5
root@*:~ #
Since md5 is AWOL, my md5 hashes in PHP are coming back wrong.
Any thoughts to resolving this?
Thank you,
Michael
mainarea
07-09-2004, 05:50 PM
You should have /usr/bin/md5sum, my server doesn't have a file named "md5" in any place that you don't already have it though.
- Matt
comprock
07-09-2004, 05:55 PM
Can I link md5 to md5sum then?
My Mac has a compiled md5 in the path so I'm not sure what to press further with.
Thanks,
Michael
Jay Cornwall
07-09-2004, 06:04 PM
'md5' is a command from BSD-based systems, of which Mac OS X is one. On GNU/Linux systems you'll find that GNU's 'md5sum' from coreutils performs a very similar function, albeit with slightly different options and output.
Or if you really want the BSD 'md5' command, you could grab the source from one of the BSDs and build it yourself.
Steven
07-09-2004, 08:13 PM
Just a suggestion update your kernel :)
comprock
07-09-2004, 09:44 PM
Is 2.4.21-15.ELsmp really that old? What's a good resource to learn the difference between mine and newer?
How'd I get the md5 hash via md5sum then?
before: md5 -s 'hashme'
now: md5sum 'hashme'
I reviewed man md5sum without success in my experiments.
Cheers and thanks,
Michael
Steven
07-09-2004, 10:55 PM
2.4.21-15.0.3.ELsmp is the newest :)
Jay Cornwall
07-10-2004, 07:26 AM
I'm not sure exactly how the -s flag works since these two commands report different results:
[jay@python jay]$ md5 -s 'hashme'
MD5 ("hashme") = 533f6357e0210e67d91f651bc49e1278
[jay@python jay]$ echo 'hashme' > file ; md5 file
MD5 (file) = 12adcdee8dd3155fd1108a4ed1892d6d
The latter is correct as shown by:
[jay@python jay]$ echo 'hashme' | md5
12adcdee8dd3155fd1108a4ed1892d6d
And the equivalent with 'md5sum' is:
adder:~ jay$ echo 'hashme' | md5sum
12adcdee8dd3155fd1108a4ed1892d6d -
You can strip that trailing - with:
adder:~ jay$ echo 'hashme' | md5sum | awk '{print $1}'
12adcdee8dd3155fd1108a4ed1892d6d
codywatkins
07-10-2004, 01:09 PM
Thread moved to more specific forum.
comprock
07-10-2004, 06:04 PM
Thanks for helping with the md5 explanations.
wKkaY
07-11-2004, 03:51 AM
Jay Cornwall: that's because echo by default will output a trailing \n. try echo -n instead :)
$ echo -n 'hashme' | md5
533f6357e0210e67d91f651bc49e1278
$ md5 -s 'hashme'
MD5 ("hashme") = 533f6357e0210e67d91f651bc49e1278
cheers :)
comprock
07-11-2004, 12:41 PM
Thanks for help here. Actually, it seems that the processor gateways had bungled up something that made me be thinking that my md5 was broken. Now though, all's well with a little bit more knowledge of md5sum usage. In previous problems md5 was returning the wrong hash and in those I usually just told cpanel to rebuild md5 and it worked.
Michael