invoked as /bin/md5sum, yields sha1sum

Denis Vlasenko vda.linux at googlemail.com
Tue Jul 3 17:45:33 UTC 2007


On Tuesday 03 July 2007 14:59, 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?

I think yes.

        hash_algo_t hash_algo = ENABLE_MD5SUM
                ? (ENABLE_SHA1SUM ? (**argv=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5)
                : HASH_SHA1;

It should check applet_name[0] instead.

Fixing in svn, thanks for the report.
--
vda



More information about the busybox mailing list