PERFORCE change 77513 for review

Christian S.J. Peron csjp at FreeBSD.org
Thu May 26 15:38:31 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=77513

Change 77513 by csjp at csjp_xor on 2005/05/26 15:37:54

	-introduce function pointer which will be dynamically initialized
	 to whatever checksum is stored with the object when -W is used.

Affected files ...

.. //depot/projects/trustedbsd/mac/usr.sbin/getfhash/getfhash.c#7 edit

Differences ...

==== //depot/projects/trustedbsd/mac/usr.sbin/getfhash/getfhash.c#7 (text+ko) ====

@@ -207,6 +207,7 @@
 	int nbytes;
 	const char *algo;
 	u_char digest[64];
+	int (*checksum)(const char *, u_char *);
 
 	error = extattr_get_file(pathname, MAC_CHKEXEC_ATTRN,
 	    MAC_CHKEXEC, (void *)&sum, sizeof(sum));
@@ -217,10 +218,12 @@
 	if (sum.vs_flags == MAC_VCSUM_SHA1) {
 		nbytes = SHA1_HASH_SIZE;
 		algo = "sha1";
+		checksum = calc_sha1;
 	}
 	else if (sum.vs_flags == MAC_VCSUM_MD5) {
 		nbytes = MD5_HASH_SIZE;
 		algo = "md5";
+		checksum = calc_md5;
 	} else {
 		warnx("%s: invalid checksum algorithm",
 		    pathname);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list