Browse Source

Plan 9 from Bell Labs 2011-01-07

David du Colombier 13 years ago
parent
commit
6647671ae6
4 changed files with 37 additions and 21 deletions
  1. 33 16
      sys/man/1/sum
  2. 1 0
      sys/src/9/pc/ether82598.c
  3. 1 1
      sys/src/cmd/cc/acid.c
  4. 2 4
      sys/src/cmd/ndb/dn.c

+ 33 - 16
sys/man/1/sum

@@ -17,6 +17,9 @@ sum, md5sum, sha1sum \- sum and count blocks in a file
 .PP
 .B sha1sum
 [
+.B -2
+.I bits
+] [
 .I file ...
 ]
 .SH DESCRIPTION
@@ -28,11 +31,15 @@ and the name of
 each
 .IR file .
 The checksum is also a function of the input length.
-If no files are given,
+If no
+.IR file s
+are given,
 the standard input is
 summed.
 Other summing algorithms are available.
 The options are
+.TF -r
+.PD
 .TP
 .B -r
 Sum with the algorithm of System V's
@@ -49,23 +56,32 @@ to validate a file communicated over
 some transmission line or
 as a quick way to determine if two files on different machines might be the same.
 .PP
-.B Md5sum
+.I Md5sum
 computes the 32 hex digit RSA Data Security, Inc. MD5 Message-Digest Algorithm
 described in RFC1321.
-If no
-.I files
-are given,
-the standard input is
-summed.
 .PP
-.B Sha1sum
-computes the 40 hex digit National Institute of Standards and Technology SHA1 secure hash algorithm
-described in FIPS PUB 180-1.
-If no
-.I files
-are given,
-the standard input is
-summed.
+.I Sha1sum
+computes the 40 hex digit National Institute of Standards and Technology
+(NIST)
+SHA1 secure hash algorithm
+described in FIPS PUB 180-1,
+by default.
+Given the
+.L 2
+option,
+it instead computes the
+.IR bits -bit
+NIST SHA2 secure hash algorithm
+described in FIPS PUB 180-2
+and prints the hash in hex.
+Currently supported values of
+.I bits
+are
+224,
+256,
+384,
+and
+512.
 .SH SOURCE
 .B /sys/src/cmd/sum.c
 .br
@@ -74,4 +90,5 @@ summed.
 .B /sys/src/cmd/sha1sum.c
 .SH "SEE ALSO"
 .IR cmp (1),
-.IR wc (1)
+.IR wc (1),
+.IR sechash (2)

+ 1 - 0
sys/src/9/pc/ether82598.c

@@ -900,6 +900,7 @@ scan(void)
 		case 0x10c7:		/* 82598 af single port */
 		case 0x10b6:		/* 82598 backplane */
 		case 0x10dd:		/* 82598 at cx4 */
+		case 0x10ec:		/* 82598 at cx4 dual port */
 			break;
 		default:
 			continue;

+ 1 - 1
sys/src/cmd/cc/acid.c

@@ -2,7 +2,7 @@
 
 static char *kwd[] =
 {
-	"$adt", "$aggr", "$append", "$complex", "$defn",
+	"$adt", "$aggr", "$append", "$builtin", "$complex", "$defn",
 	"$delete", "$do", "$else", "$eval", "$head", "$if",
 	"$local", "$loop", "$return", "$tail", "$then",
 	"$union", "$whatis", "$while",

+ 2 - 4
sys/src/cmd/ndb/dn.c

@@ -742,14 +742,12 @@ rrattach1(RR *new, int auth)
 
 //	dnslog("rrattach1: %s", new->owner->name);
 	if(!new->db) {
-		new->expire = new->ttl;		/* ? */
 		/*
 		 * try not to let responses expire before we
 		 * can use them to complete this query, by extending
-		 * past expiration time.
+		 * past (or nearly past) expiration time.
 		 */
-		if(new->expire <= now - 60)
-			new->expire = now + 10*Min;
+		new->expire = new->ttl > now + Min? new->ttl: now + 10*Min;
 	} else
 		new->expire = now + Year;
 	dp = new->owner;