invoked as /bin/md5sum, yields sha1sum

Tito farmatito at tiscali.it
Tue Jul 3 20:09:24 UTC 2007


On Tuesday 03 July 2007 14:59:46 Jim Freeman wrote:
> 
> Busybox 1.6.0, on powerpc:
> 
> When md5sum is invoked as /bin/md5sum, it yields the 40-character sha1sum
> instead of the 32-character md5sum:
> 
> 	# md5sum /etc/passwd
> 	fe611ba27d0d7d92bbef243109fed95d  /etc/passwd
> 
> 	# /bin/md5sum /etc/passwd
> 	8a20e2821a34d10a48d278d1095be4856c1bcdf0  /etc/passwd
> 
> 	# sha1sum /etc/passwd
> 	8a20e2821a34d10a48d278d1095be4856c1bcdf0  /etc/passwd
> 
> Does this happen with any other platforms?
> 
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
> 

Please,  try attached patch.

--- coreutils/md5_sha1_sum.c.orig       2007-05-26 23:23:50.000000000 +0200
+++ coreutils/md5_sha1_sum.c    2007-07-03 22:06:56.000000000 +0200
@@ -84,7 +84,7 @@
        uint8_t *hash_value;
        unsigned flags;
        hash_algo_t hash_algo = ENABLE_MD5SUM
-               ? (ENABLE_SHA1SUM ? (**argv=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5)
+               ? (ENABLE_SHA1SUM ? (applet_name[0]=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5)
                : HASH_SHA1;

        if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK)
-----------------------------------------------------------------------------------------------------------------------------------

Ciao,
Tito

-------------- next part --------------
A non-text attachment was scrubbed...
Name: md5sum.patch
Type: text/x-diff
Size: 445 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070703/a41401f4/attachment-0002.bin 


More information about the busybox mailing list