List Info

Thread: why doesn't NetBSD ship with md5sum or sha1sum?




why doesn't NetBSD ship with md5sum or sha1sum?
user name
2006-05-07 02:29:46
Hubert Feyrer --> netbsd-help (2006-04-25 01:07:21
+0200):
[...]
> You're welcome! FWIW, I've hacked it a bit more so
that the checksum file 
> is now optional, and stdin is used when no file is
given. Also, for input 
> formats where the hash algorithm can be determined
from, it's used 
> according to that. 
> 
> For cksum(1) -o[12] and sum(1) those tools/options
still need to be 
> specified, just like when -n ("normal"?!)
is used. I think those should be 
> nuked from orbit / merged in consistently.

Thanks again!

BTW, it seems that Linux's (md5|sha1)sum puts _two_ spaces
between the
ckecksum and the filename, but cksum doesn't parse this
correctly and
prints `FAILED'. The attached patch should fix this.


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~
Index: usr.bin/cksum/cksum.c
============================================================
=======
RCS file: /cvsroot/src/usr.bin/cksum/cksum.c,v
retrieving revision 1.36
diff -u -p -r1.36 cksum.c
--- usr.bin/cksum/cksum.c	5 May 2006 22:07:22 -0000	1.36
+++ usr.bin/cksum/cksum.c	7 May 2006 02:26:22 -0000
 -366,6
+366,7  main(int argc, char **argv)
 
 			} else {
 				if (hash) {
+					int nspaces = 1;
 					/*
 					 * 'normal' output, no (ck)sum
 					 */
 -380,9
+381,10  main(int argc, char **argv)
 						rval = 1;
 						continue;
 					}
-					p_filename++;
+					while (*++p_filename == ' ')
+						++nspaces;
 					l_filename = strlen(p_filename);
-					l_cksum = p_filename - buf - 1;
+					l_cksum = p_filename - buf - nspaces;
 				} else {
 					/*
 					 * sum/cksum output format
why doesn't NetBSD ship with md5sum or sha1sum?
user name
2006-05-07 12:23:18
On Sun, 7 May 2006, Jukka Salmi wrote:
> BTW, it seems that Linux's (md5|sha1)sum puts _two_
spaces between the
> ckecksum and the filename, but cksum doesn't parse
this correctly and
> prints `FAILED'. The attached patch should fix this.

I have committed a fix based on your patch. thanks!


  - Hubert
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )