Browse Source

Plan 9 from Bell Labs 2007-11-05

David du Colombier 13 years ago
parent
commit
52870159a5

+ 40 - 40
dist/replica/_plan9.db

@@ -1,8 +1,8 @@
 386 - 20000000775 sys sys 1010957353 0
-386/9load - 775 sys sys 1194145558 337536
-386/9loaddebug - 775 sys sys 1194145568 451295
-386/9loadlite - 775 sys sys 1194145575 160820
-386/9loadlitedebug - 775 sys sys 1194145581 236818
+386/9load - 775 sys sys 1194218336 337604
+386/9loaddebug - 775 sys sys 1194218345 451365
+386/9loadlite - 775 sys sys 1194218348 160884
+386/9loadlitedebug - 775 sys sys 1194218352 236888
 386/9pc - 775 sys sys 1192646200 2054406
 386/9pc.gz - 664 sys sys 1192646200 873537
 386/9pccpu - 775 sys sys 1191889923 1749481
@@ -11,7 +11,7 @@
 386/9pcdisk.gz - 664 sys sys 1192741561 973813
 386/9pcf - 775 sys sys 1191889940 2874011
 386/9pcf.gz - 664 sys sys 1191889940 1230163
-386/9pxeload - 775 sys sys 1194145588 337544
+386/9pxeload - 775 sys sys 1194218358 337612
 386/bin - 20000000775 sys sys 1018897690 0
 386/bin/8a - 775 sys sys 1168402260 116604
 386/bin/8c - 775 sys sys 1190520740 367214
@@ -5311,7 +5311,7 @@ mail/lib/namefiles - 664 upas upas 960222586 63
 mail/lib/names.local - 664 upas upas 960222620 92
 mail/lib/patterns - 664 upas upas 957549063 602
 mail/lib/pipeto.bayes - 664 upas upas 1063950935 129
-mail/lib/pipeto.lib - 664 upas upas 1127394564 3342
+mail/lib/pipeto.lib - 664 upas upas 1194214909 3500
 mail/lib/prof.mbox - 664 upas upas 1063950959 13
 mail/lib/prof.spam - 664 upas upas 1063950959 13
 mail/lib/qmail - 775 upas upas 1102352695 197
@@ -5533,7 +5533,7 @@ rc/bin/leak - 775 sys sys 1172760642 1921
 rc/bin/lookman - 775 sys sys 1186528516 687
 rc/bin/lp - 775 sys sys 1162105982 5201
 rc/bin/mail - 775 sys sys 1045504003 138
-rc/bin/man - 775 sys sys 1174803269 2639
+rc/bin/man - 775 sys sys 1194214975 2639
 rc/bin/map - 775 sys sys 945617207 1576
 rc/bin/mapdemo - 775 sys sys 945617207 4075
 rc/bin/membername - 775 sys sys 945617207 89
@@ -7142,7 +7142,7 @@ sys/lib/tmac/tmac.antimes - 664 sys sys 964454718 7809
 sys/lib/tmac/tmac.bits - 664 sys sys 944956202 1089
 sys/lib/tmac/tmac.cs - 664 sys sys 1112039298 21324
 sys/lib/tmac/tmac.e - 664 sys sys 964454711 11992
-sys/lib/tmac/tmac.html - 664 sys sys 1138396384 1950
+sys/lib/tmac/tmac.html - 664 sys sys 1194215364 2025
 sys/lib/tmac/tmac.jsdisp - 664 sys sys 944956203 828
 sys/lib/tmac/tmac.m - 664 sys sys 944956203 87
 sys/lib/tmac/tmac.mcs - 664 sys sys 955115425 43067
@@ -7697,7 +7697,7 @@ sys/man/3/srv - 664 sys sys 958419690 1470
 sys/man/3/ssl - 664 sys sys 1018386776 3413
 sys/man/3/tls - 664 sys sys 1045501496 7018
 sys/man/3/uart - 664 sys sys 1138191356 2003
-sys/man/3/usb - 664 sys sys 1167774741 7052
+sys/man/3/usb - 664 sys sys 1194215735 7179
 sys/man/3/vga - 664 sys sys 1182367669 4987
 sys/man/4 - 20000000775 sys sys 1128556957 0
 sys/man/4/0intro - 664 sys sys 944959699 472
@@ -7708,7 +7708,7 @@ sys/man/4/archfs - 664 sys sys 960000712 533
 sys/man/4/cdfs - 664 sys sys 1026846913 3638
 sys/man/4/cfs - 664 sys sys 1191355900 2136
 sys/man/4/consolefs - 664 sys sys 1144424854 4245
-sys/man/4/cwfs - 664 sys sys 1189029640 6255
+sys/man/4/cwfs - 664 sys sys 1194214611 6553
 sys/man/4/dossrv - 664 sys sys 1168307403 4334
 sys/man/4/execnet - 664 sys sys 1019866708 1069
 sys/man/4/exportfs - 664 sys sys 1190243304 4655
@@ -7807,7 +7807,7 @@ sys/man/7/playlistfs - 664 sys sys 1103794042 3831
 sys/man/7/scat - 664 sys sys 970069855 8904
 sys/man/8 - 20000000775 sys sys 1162240005 0
 sys/man/8/0intro - 664 sys sys 944959679 247
-sys/man/8/6in4 - 664 sys sys 1186182195 2330
+sys/man/8/6in4 - 664 sys sys 1194215293 2364
 sys/man/8/9load - 664 sys sys 1193364197 9814
 sys/man/8/9pcon - 664 sys sys 1145881850 2234
 sys/man/8/INDEX - 664 sys sys 1183260468 2773
@@ -7832,7 +7832,7 @@ sys/man/8/getflags - 664 sys sys 1159419702 1713
 sys/man/8/gpsfs - 664 sys sys 1165623047 4918
 sys/man/8/httpd - 664 sys sys 1187893163 6866
 sys/man/8/init - 664 sys sys 944959679 1430
-sys/man/8/ipconfig - 664 sys sys 1177100280 7984
+sys/man/8/ipconfig - 664 sys sys 1194215287 8187
 sys/man/8/ipserv - 664 sys sys 1188191285 4411
 sys/man/8/kfscmd - 664 sys sys 1182192559 4514
 sys/man/8/listen - 664 sys sys 1191965641 4032
@@ -8124,7 +8124,7 @@ sys/src/9/pc/kbd.c - 664 sys sys 1191355133 12339
 sys/src/9/pc/l.s - 664 sys sys 1190268443 29347
 sys/src/9/pc/main.c - 664 sys sys 1168306227 15337
 sys/src/9/pc/mem.h - 664 sys sys 1137622431 5203
-sys/src/9/pc/memory.c - 664 sys sys 1153172671 18773
+sys/src/9/pc/memory.c - 664 sys sys 1194216046 18820
 sys/src/9/pc/mkfile - 664 sys sys 1191885521 4025
 sys/src/9/pc/mmu.c - 664 sys sys 1171688128 24591
 sys/src/9/pc/mouse.c - 664 sys sys 1098479254 7057
@@ -9438,7 +9438,7 @@ sys/src/cmd/9nfs/system.c - 664 sys sys 1017337815 437
 sys/src/cmd/9nfs/testit - 775 sys sys 1017337816 251
 sys/src/cmd/9nfs/unixnames.c - 664 sys sys 1065963574 6006
 sys/src/cmd/9nfs/xfile.c - 664 sys sys 1131293680 1894
-sys/src/cmd/aan.c - 664 sys sys 1019856827 9758
+sys/src/cmd/aan.c - 664 sys sys 1194215063 9762
 sys/src/cmd/acid - 20000000775 sys sys 1063859225 0
 sys/src/cmd/acid/acid.h - 664 sys sys 1172764379 4305
 sys/src/cmd/acid/builtin.c - 664 sys sys 1172764379 21752
@@ -10059,7 +10059,7 @@ sys/src/cmd/cpp/mkfile - 664 sys sys 944960879 178
 sys/src/cmd/cpp/nlist.c - 664 sys sys 1188413849 4745
 sys/src/cmd/cpp/test.c - 664 sys sys 944960879 47
 sys/src/cmd/cpp/tokens.c - 664 sys sys 944960879 6755
-sys/src/cmd/cpu.c - 664 sys sys 1179337486 21193
+sys/src/cmd/cpu.c - 664 sys sys 1194215126 20932
 sys/src/cmd/crop.c - 664 sys sys 1134557476 4137
 sys/src/cmd/cwfs - 20000000775 sys sys 1174799196 0
 sys/src/cmd/cwfs/32bit.h - 664 sys sys 1171162581 594
@@ -10120,9 +10120,9 @@ sys/src/cmd/cwfs/io.h - 664 sys sys 1174280312 866
 sys/src/cmd/cwfs/iobuf.c - 664 sys sys 1176500092 4722
 sys/src/cmd/cwfs/juke.c - 664 sys sys 1176500144 28859
 sys/src/cmd/cwfs/lrand.c - 664 sys sys 1171160167 1070
-sys/src/cmd/cwfs/main.c - 664 sys sys 1189033288 10146
+sys/src/cmd/cwfs/main.c - 664 sys sys 1194214683 10347
 sys/src/cmd/cwfs/malloc.c - 664 sys sys 1174281557 2360
-sys/src/cmd/cwfs/mkfile - 664 sys sys 1174941889 201
+sys/src/cmd/cwfs/mkfile - 664 sys sys 1194214687 244
 sys/src/cmd/cwfs/mworm.c - 664 sys sys 1191264337 4542
 sys/src/cmd/cwfs/net.c - 664 sys sys 1174521421 9939
 sys/src/cmd/cwfs/pc.c - 664 sys sys 1174976414 1718
@@ -10380,7 +10380,7 @@ sys/src/cmd/fossil/9auth.c - 664 sys sys 1189552651 3972
 sys/src/cmd/fossil/9dir.c - 664 sys sys 1085333382 2219
 sys/src/cmd/fossil/9excl.c - 664 sys sys 1042005502 1887
 sys/src/cmd/fossil/9fid.c - 664 sys sys 1189110070 5584
-sys/src/cmd/fossil/9fsys.c - 664 sys sys 1189575340 33617
+sys/src/cmd/fossil/9fsys.c - 664 sys sys 1194215521 33624
 sys/src/cmd/fossil/9lstn.c - 664 sys sys 1147355153 3038
 sys/src/cmd/fossil/9p.c - 664 sys sys 1189110070 22957
 sys/src/cmd/fossil/9ping.c - 664 sys sys 1042005503 1563
@@ -10395,10 +10395,10 @@ sys/src/cmd/fossil/archive.c - 664 sys sys 1087005594 10230
 sys/src/cmd/fossil/build - 664 sys sys 1042005505 449
 sys/src/cmd/fossil/buildsh - 775 sys sys 1042005505 561
 sys/src/cmd/fossil/bwatch.c - 664 sys sys 1042005505 6754
-sys/src/cmd/fossil/cache.c - 664 sys sys 1180158132 43913
+sys/src/cmd/fossil/cache.c - 664 sys sys 1194215524 44024
 sys/src/cmd/fossil/check.c - 664 sys sys 1189575296 17505
 sys/src/cmd/fossil/conf.rc - 775 sys sys 1084333190 1416
-sys/src/cmd/fossil/dat.h - 664 sys sys 1189575011 7906
+sys/src/cmd/fossil/dat.h - 664 sys sys 1194214821 7910
 sys/src/cmd/fossil/deadlock - 775 sys sys 1042005506 413
 sys/src/cmd/fossil/disk.c - 664 sys sys 1179296683 6993
 sys/src/cmd/fossil/dump.c - 664 sys sys 1042005506 1340
@@ -12537,7 +12537,7 @@ sys/src/cmd/ip/ppp/dotest - 775 sys sys 944961006 152
 sys/src/cmd/ip/ppp/ipaux.c - 664 sys sys 1125529107 2328
 sys/src/cmd/ip/ppp/mkfile - 664 sys sys 1063897576 352
 sys/src/cmd/ip/ppp/mppc.c - 664 sys sys 1015090267 16624
-sys/src/cmd/ip/ppp/ppp.c - 664 sys sys 1178810697 59924
+sys/src/cmd/ip/ppp/ppp.c - 664 sys sys 1194215466 59955
 sys/src/cmd/ip/ppp/ppp.h - 664 sys sys 1091904423 8284
 sys/src/cmd/ip/ppp/testppp.c - 664 sys sys 1045505281 3011
 sys/src/cmd/ip/ppp/thw.c - 664 sys sys 1015090268 5962
@@ -12760,7 +12760,7 @@ sys/src/cmd/map/route.c - 664 sys sys 964456085 2718
 sys/src/cmd/map/sqrt.c - 664 sys sys 944961024 675
 sys/src/cmd/map/symbol.c - 664 sys sys 964456085 3310
 sys/src/cmd/mc.c - 664 sys sys 1082924484 5520
-sys/src/cmd/md5sum.c - 664 sys sys 1014926238 1009
+sys/src/cmd/md5sum.c - 664 sys sys 1194215423 1090
 sys/src/cmd/mk - 20000000775 sys sys 1056337347 0
 sys/src/cmd/mk/acid - 664 sys sys 1055698806 10395
 sys/src/cmd/mk/arc.c - 664 sys sys 1131129236 826
@@ -12802,22 +12802,22 @@ sys/src/cmd/mtime.c - 664 sys sys 1036172302 450
 sys/src/cmd/mug.c - 664 sys sys 1157143847 24888
 sys/src/cmd/mv.c - 664 sys sys 1163029439 4682
 sys/src/cmd/ndb - 20000000775 sys sys 1080135004 0
-sys/src/cmd/ndb/convDNS2M.c - 664 sys sys 1182554015 7035
-sys/src/cmd/ndb/convM2DNS.c - 664 sys sys 1186081796 11679
+sys/src/cmd/ndb/convDNS2M.c - 664 sys sys 1194216289 7061
+sys/src/cmd/ndb/convM2DNS.c - 664 sys sys 1194216290 11959
 sys/src/cmd/ndb/cs.c - 664 sys sys 1188515063 32892
 sys/src/cmd/ndb/csquery.c - 664 sys sys 1174626119 1073
-sys/src/cmd/ndb/dblookup.c - 664 sys sys 1188581123 25260
-sys/src/cmd/ndb/dn.c - 664 sys sys 1186704098 36512
+sys/src/cmd/ndb/dblookup.c - 664 sys sys 1194216346 25229
+sys/src/cmd/ndb/dn.c - 664 sys sys 1194216512 37395
 sys/src/cmd/ndb/dnarea.c - 664 sys sys 1175664421 2519
 sys/src/cmd/ndb/dnnotify.c - 664 sys sys 1183866408 3217
-sys/src/cmd/ndb/dnresolve.c - 664 sys sys 1184990924 34536
-sys/src/cmd/ndb/dns.c - 664 sys sys 1186704113 16582
-sys/src/cmd/ndb/dns.h - 664 sys sys 1186704085 11726
-sys/src/cmd/ndb/dnsdebug.c - 664 sys sys 1185315248 8805
+sys/src/cmd/ndb/dnresolve.c - 664 sys sys 1194216513 34801
+sys/src/cmd/ndb/dns.c - 664 sys sys 1194216588 16627
+sys/src/cmd/ndb/dns.h - 664 sys sys 1194216527 11889
+sys/src/cmd/ndb/dnsdebug.c - 664 sys sys 1194216583 8790
 sys/src/cmd/ndb/dnserver.c - 664 sys sys 1184990866 4627
 sys/src/cmd/ndb/dnsquery.c - 664 sys sys 1185315254 2507
-sys/src/cmd/ndb/dnstcp.c - 664 sys sys 1183184439 7440
-sys/src/cmd/ndb/dnudpserver.c - 664 sys sys 1183750487 5470
+sys/src/cmd/ndb/dnstcp.c - 664 sys sys 1194216576 7503
+sys/src/cmd/ndb/dnudpserver.c - 664 sys sys 1194216569 5542
 sys/src/cmd/ndb/ipquery.c - 664 sys sys 1124711423 773
 sys/src/cmd/ndb/mkdb.c - 664 sys sys 957402054 2886
 sys/src/cmd/ndb/mkfile - 664 sys sys 1174623575 1984
@@ -13375,7 +13375,7 @@ sys/src/cmd/scuzz/sense.c - 664 sys sys 1177702138 5680
 sys/src/cmd/sed.c - 664 sys sys 1182465504 26844
 sys/src/cmd/seq.c - 664 sys sys 1161442158 1691
 sys/src/cmd/sh.C - 664 sys sys 1055701754 10303
-sys/src/cmd/sha1sum.c - 664 sys sys 1014926229 1017
+sys/src/cmd/sha1sum.c - 664 sys sys 1194215428 1098
 sys/src/cmd/size.c - 664 sys sys 944961619 717
 sys/src/cmd/sleep.c - 664 sys sys 1158061645 544
 sys/src/cmd/snap - 20000000775 sys sys 1039727541 0
@@ -13472,7 +13472,7 @@ sys/src/cmd/ssh/ssh.h - 664 sys sys 1091904420 6086
 sys/src/cmd/ssh/sshnet.c - 664 sys sys 1078840016 17641
 sys/src/cmd/ssh/sshserve.c - 664 sys sys 1135487956 5772
 sys/src/cmd/ssh/util.c - 664 sys sys 1154722953 4522
-sys/src/cmd/stats.c - 664 sys sys 1161483503 28084
+sys/src/cmd/stats.c - 664 sys sys 1194215006 28141
 sys/src/cmd/strings.c - 664 sys sys 1167860903 1474
 sys/src/cmd/strip.c - 664 sys sys 1131293244 2502
 sys/src/cmd/sum.c - 664 sys sys 1014926615 5548
@@ -14644,7 +14644,7 @@ sys/src/libauth/auth_getuserpasswd.c - 664 sys sys 1014929317 1363
 sys/src/libauth/auth_proxy.c - 664 sys sys 1179362110 3673
 sys/src/libauth/auth_respond.c - 664 sys sys 1044828825 1420
 sys/src/libauth/auth_rpc.c - 664 sys sys 1048645351 2064
-sys/src/libauth/auth_userpasswd.c - 664 sys sys 1014929317 1097
+sys/src/libauth/auth_userpasswd.c - 664 sys sys 1194215346 1105
 sys/src/libauth/auth_wep.c - 664 sys sys 1063854011 830
 sys/src/libauth/authlocal.h - 664 sys sys 1014929317 87
 sys/src/libauth/httpauth.c - 664 sys sys 1017166331 1059
@@ -15466,16 +15466,16 @@ sys/src/liboventi/pack.c - 664 sys sys 1188621652 2852
 sys/src/liboventi/packet.c - 664 sys sys 1188621652 13229
 sys/src/liboventi/packet.h - 664 sys sys 1019678692 641
 sys/src/liboventi/parsescore.c - 664 sys sys 1188621652 517
-sys/src/liboventi/plan9-io.c - 664 sys sys 1188621652 1759
+sys/src/liboventi/plan9-io.c - 664 sys sys 1194215819 1912
 sys/src/liboventi/plan9-sha1.c - 664 sys sys 1188621652 1059
 sys/src/liboventi/plan9-thread.acid - 664 sys sys 1138756224 9254
-sys/src/liboventi/plan9-thread.c - 664 sys sys 1188621652 6714
+sys/src/liboventi/plan9-thread.c - 664 sys sys 1194215820 6749
 sys/src/liboventi/readfully.c - 664 sys sys 1188621652 238
-sys/src/liboventi/rpc.c - 664 sys sys 1188621652 7297
+sys/src/liboventi/rpc.c - 664 sys sys 1194215809 7332
 sys/src/liboventi/scorefmt.c - 664 sys sys 1188621652 256
-sys/src/liboventi/server.c - 664 sys sys 1188621652 4508
+sys/src/liboventi/server.c - 664 sys sys 1194215807 4552
 sys/src/liboventi/session.h - 664 sys sys 1063853749 936
-sys/src/liboventi/strdup.c - 664 sys sys 1188621652 204
+sys/src/liboventi/strdup.c - 664 sys sys 1194215805 240
 sys/src/liboventi/venti.txt - 664 sys sys 1045502097 4347
 sys/src/liboventi/zero.c - 664 sys sys 1188621652 1510
 sys/src/libplumb - 20000000775 sys sys 1123099015 0

+ 40 - 40
dist/replica/plan9.db

@@ -1,8 +1,8 @@
 386 - 20000000775 sys sys 1010957353 0
-386/9load - 775 sys sys 1194145558 337536
-386/9loaddebug - 775 sys sys 1194145568 451295
-386/9loadlite - 775 sys sys 1194145575 160820
-386/9loadlitedebug - 775 sys sys 1194145581 236818
+386/9load - 775 sys sys 1194218336 337604
+386/9loaddebug - 775 sys sys 1194218345 451365
+386/9loadlite - 775 sys sys 1194218348 160884
+386/9loadlitedebug - 775 sys sys 1194218352 236888
 386/9pc - 775 sys sys 1192646200 2054406
 386/9pc.gz - 664 sys sys 1192646200 873537
 386/9pccpu - 775 sys sys 1191889923 1749481
@@ -11,7 +11,7 @@
 386/9pcdisk.gz - 664 sys sys 1192741561 973813
 386/9pcf - 775 sys sys 1191889940 2874011
 386/9pcf.gz - 664 sys sys 1191889940 1230163
-386/9pxeload - 775 sys sys 1194145588 337544
+386/9pxeload - 775 sys sys 1194218358 337612
 386/bin - 20000000775 sys sys 1018897690 0
 386/bin/8a - 775 sys sys 1168402260 116604
 386/bin/8c - 775 sys sys 1190520740 367214
@@ -5311,7 +5311,7 @@ mail/lib/namefiles - 664 upas upas 960222586 63
 mail/lib/names.local - 664 upas upas 960222620 92
 mail/lib/patterns - 664 upas upas 957549063 602
 mail/lib/pipeto.bayes - 664 upas upas 1063950935 129
-mail/lib/pipeto.lib - 664 upas upas 1127394564 3342
+mail/lib/pipeto.lib - 664 upas upas 1194214909 3500
 mail/lib/prof.mbox - 664 upas upas 1063950959 13
 mail/lib/prof.spam - 664 upas upas 1063950959 13
 mail/lib/qmail - 775 upas upas 1102352695 197
@@ -5533,7 +5533,7 @@ rc/bin/leak - 775 sys sys 1172760642 1921
 rc/bin/lookman - 775 sys sys 1186528516 687
 rc/bin/lp - 775 sys sys 1162105982 5201
 rc/bin/mail - 775 sys sys 1045504003 138
-rc/bin/man - 775 sys sys 1174803269 2639
+rc/bin/man - 775 sys sys 1194214975 2639
 rc/bin/map - 775 sys sys 945617207 1576
 rc/bin/mapdemo - 775 sys sys 945617207 4075
 rc/bin/membername - 775 sys sys 945617207 89
@@ -7142,7 +7142,7 @@ sys/lib/tmac/tmac.antimes - 664 sys sys 964454718 7809
 sys/lib/tmac/tmac.bits - 664 sys sys 944956202 1089
 sys/lib/tmac/tmac.cs - 664 sys sys 1112039298 21324
 sys/lib/tmac/tmac.e - 664 sys sys 964454711 11992
-sys/lib/tmac/tmac.html - 664 sys sys 1138396384 1950
+sys/lib/tmac/tmac.html - 664 sys sys 1194215364 2025
 sys/lib/tmac/tmac.jsdisp - 664 sys sys 944956203 828
 sys/lib/tmac/tmac.m - 664 sys sys 944956203 87
 sys/lib/tmac/tmac.mcs - 664 sys sys 955115425 43067
@@ -7697,7 +7697,7 @@ sys/man/3/srv - 664 sys sys 958419690 1470
 sys/man/3/ssl - 664 sys sys 1018386776 3413
 sys/man/3/tls - 664 sys sys 1045501496 7018
 sys/man/3/uart - 664 sys sys 1138191356 2003
-sys/man/3/usb - 664 sys sys 1167774741 7052
+sys/man/3/usb - 664 sys sys 1194215735 7179
 sys/man/3/vga - 664 sys sys 1182367669 4987
 sys/man/4 - 20000000775 sys sys 1128556957 0
 sys/man/4/0intro - 664 sys sys 944959699 472
@@ -7708,7 +7708,7 @@ sys/man/4/archfs - 664 sys sys 960000712 533
 sys/man/4/cdfs - 664 sys sys 1026846913 3638
 sys/man/4/cfs - 664 sys sys 1191355900 2136
 sys/man/4/consolefs - 664 sys sys 1144424854 4245
-sys/man/4/cwfs - 664 sys sys 1189029640 6255
+sys/man/4/cwfs - 664 sys sys 1194214611 6553
 sys/man/4/dossrv - 664 sys sys 1168307403 4334
 sys/man/4/execnet - 664 sys sys 1019866708 1069
 sys/man/4/exportfs - 664 sys sys 1190243304 4655
@@ -7807,7 +7807,7 @@ sys/man/7/playlistfs - 664 sys sys 1103794042 3831
 sys/man/7/scat - 664 sys sys 970069855 8904
 sys/man/8 - 20000000775 sys sys 1162240005 0
 sys/man/8/0intro - 664 sys sys 944959679 247
-sys/man/8/6in4 - 664 sys sys 1186182195 2330
+sys/man/8/6in4 - 664 sys sys 1194215293 2364
 sys/man/8/9load - 664 sys sys 1193364197 9814
 sys/man/8/9pcon - 664 sys sys 1145881850 2234
 sys/man/8/INDEX - 664 sys sys 1183260468 2773
@@ -7832,7 +7832,7 @@ sys/man/8/getflags - 664 sys sys 1159419702 1713
 sys/man/8/gpsfs - 664 sys sys 1165623047 4918
 sys/man/8/httpd - 664 sys sys 1187893163 6866
 sys/man/8/init - 664 sys sys 944959679 1430
-sys/man/8/ipconfig - 664 sys sys 1177100280 7984
+sys/man/8/ipconfig - 664 sys sys 1194215287 8187
 sys/man/8/ipserv - 664 sys sys 1188191285 4411
 sys/man/8/kfscmd - 664 sys sys 1182192559 4514
 sys/man/8/listen - 664 sys sys 1191965641 4032
@@ -8124,7 +8124,7 @@ sys/src/9/pc/kbd.c - 664 sys sys 1191355133 12339
 sys/src/9/pc/l.s - 664 sys sys 1190268443 29347
 sys/src/9/pc/main.c - 664 sys sys 1168306227 15337
 sys/src/9/pc/mem.h - 664 sys sys 1137622431 5203
-sys/src/9/pc/memory.c - 664 sys sys 1153172671 18773
+sys/src/9/pc/memory.c - 664 sys sys 1194216046 18820
 sys/src/9/pc/mkfile - 664 sys sys 1191885521 4025
 sys/src/9/pc/mmu.c - 664 sys sys 1171688128 24591
 sys/src/9/pc/mouse.c - 664 sys sys 1098479254 7057
@@ -9438,7 +9438,7 @@ sys/src/cmd/9nfs/system.c - 664 sys sys 1017337815 437
 sys/src/cmd/9nfs/testit - 775 sys sys 1017337816 251
 sys/src/cmd/9nfs/unixnames.c - 664 sys sys 1065963574 6006
 sys/src/cmd/9nfs/xfile.c - 664 sys sys 1131293680 1894
-sys/src/cmd/aan.c - 664 sys sys 1019856827 9758
+sys/src/cmd/aan.c - 664 sys sys 1194215063 9762
 sys/src/cmd/acid - 20000000775 sys sys 1063859225 0
 sys/src/cmd/acid/acid.h - 664 sys sys 1172764379 4305
 sys/src/cmd/acid/builtin.c - 664 sys sys 1172764379 21752
@@ -10059,7 +10059,7 @@ sys/src/cmd/cpp/mkfile - 664 sys sys 944960879 178
 sys/src/cmd/cpp/nlist.c - 664 sys sys 1188413849 4745
 sys/src/cmd/cpp/test.c - 664 sys sys 944960879 47
 sys/src/cmd/cpp/tokens.c - 664 sys sys 944960879 6755
-sys/src/cmd/cpu.c - 664 sys sys 1179337486 21193
+sys/src/cmd/cpu.c - 664 sys sys 1194215126 20932
 sys/src/cmd/crop.c - 664 sys sys 1134557476 4137
 sys/src/cmd/cwfs - 20000000775 sys sys 1174799196 0
 sys/src/cmd/cwfs/32bit.h - 664 sys sys 1171162581 594
@@ -10120,9 +10120,9 @@ sys/src/cmd/cwfs/io.h - 664 sys sys 1174280312 866
 sys/src/cmd/cwfs/iobuf.c - 664 sys sys 1176500092 4722
 sys/src/cmd/cwfs/juke.c - 664 sys sys 1176500144 28859
 sys/src/cmd/cwfs/lrand.c - 664 sys sys 1171160167 1070
-sys/src/cmd/cwfs/main.c - 664 sys sys 1189033288 10146
+sys/src/cmd/cwfs/main.c - 664 sys sys 1194214683 10347
 sys/src/cmd/cwfs/malloc.c - 664 sys sys 1174281557 2360
-sys/src/cmd/cwfs/mkfile - 664 sys sys 1174941889 201
+sys/src/cmd/cwfs/mkfile - 664 sys sys 1194214687 244
 sys/src/cmd/cwfs/mworm.c - 664 sys sys 1191264337 4542
 sys/src/cmd/cwfs/net.c - 664 sys sys 1174521421 9939
 sys/src/cmd/cwfs/pc.c - 664 sys sys 1174976414 1718
@@ -10380,7 +10380,7 @@ sys/src/cmd/fossil/9auth.c - 664 sys sys 1189552651 3972
 sys/src/cmd/fossil/9dir.c - 664 sys sys 1085333382 2219
 sys/src/cmd/fossil/9excl.c - 664 sys sys 1042005502 1887
 sys/src/cmd/fossil/9fid.c - 664 sys sys 1189110070 5584
-sys/src/cmd/fossil/9fsys.c - 664 sys sys 1189575340 33617
+sys/src/cmd/fossil/9fsys.c - 664 sys sys 1194215521 33624
 sys/src/cmd/fossil/9lstn.c - 664 sys sys 1147355153 3038
 sys/src/cmd/fossil/9p.c - 664 sys sys 1189110070 22957
 sys/src/cmd/fossil/9ping.c - 664 sys sys 1042005503 1563
@@ -10395,10 +10395,10 @@ sys/src/cmd/fossil/archive.c - 664 sys sys 1087005594 10230
 sys/src/cmd/fossil/build - 664 sys sys 1042005505 449
 sys/src/cmd/fossil/buildsh - 775 sys sys 1042005505 561
 sys/src/cmd/fossil/bwatch.c - 664 sys sys 1042005505 6754
-sys/src/cmd/fossil/cache.c - 664 sys sys 1180158132 43913
+sys/src/cmd/fossil/cache.c - 664 sys sys 1194215524 44024
 sys/src/cmd/fossil/check.c - 664 sys sys 1189575296 17505
 sys/src/cmd/fossil/conf.rc - 775 sys sys 1084333190 1416
-sys/src/cmd/fossil/dat.h - 664 sys sys 1189575011 7906
+sys/src/cmd/fossil/dat.h - 664 sys sys 1194214821 7910
 sys/src/cmd/fossil/deadlock - 775 sys sys 1042005506 413
 sys/src/cmd/fossil/disk.c - 664 sys sys 1179296683 6993
 sys/src/cmd/fossil/dump.c - 664 sys sys 1042005506 1340
@@ -12537,7 +12537,7 @@ sys/src/cmd/ip/ppp/dotest - 775 sys sys 944961006 152
 sys/src/cmd/ip/ppp/ipaux.c - 664 sys sys 1125529107 2328
 sys/src/cmd/ip/ppp/mkfile - 664 sys sys 1063897576 352
 sys/src/cmd/ip/ppp/mppc.c - 664 sys sys 1015090267 16624
-sys/src/cmd/ip/ppp/ppp.c - 664 sys sys 1178810697 59924
+sys/src/cmd/ip/ppp/ppp.c - 664 sys sys 1194215466 59955
 sys/src/cmd/ip/ppp/ppp.h - 664 sys sys 1091904423 8284
 sys/src/cmd/ip/ppp/testppp.c - 664 sys sys 1045505281 3011
 sys/src/cmd/ip/ppp/thw.c - 664 sys sys 1015090268 5962
@@ -12760,7 +12760,7 @@ sys/src/cmd/map/route.c - 664 sys sys 964456085 2718
 sys/src/cmd/map/sqrt.c - 664 sys sys 944961024 675
 sys/src/cmd/map/symbol.c - 664 sys sys 964456085 3310
 sys/src/cmd/mc.c - 664 sys sys 1082924484 5520
-sys/src/cmd/md5sum.c - 664 sys sys 1014926238 1009
+sys/src/cmd/md5sum.c - 664 sys sys 1194215423 1090
 sys/src/cmd/mk - 20000000775 sys sys 1056337347 0
 sys/src/cmd/mk/acid - 664 sys sys 1055698806 10395
 sys/src/cmd/mk/arc.c - 664 sys sys 1131129236 826
@@ -12802,22 +12802,22 @@ sys/src/cmd/mtime.c - 664 sys sys 1036172302 450
 sys/src/cmd/mug.c - 664 sys sys 1157143847 24888
 sys/src/cmd/mv.c - 664 sys sys 1163029439 4682
 sys/src/cmd/ndb - 20000000775 sys sys 1080135004 0
-sys/src/cmd/ndb/convDNS2M.c - 664 sys sys 1182554015 7035
-sys/src/cmd/ndb/convM2DNS.c - 664 sys sys 1186081796 11679
+sys/src/cmd/ndb/convDNS2M.c - 664 sys sys 1194216289 7061
+sys/src/cmd/ndb/convM2DNS.c - 664 sys sys 1194216290 11959
 sys/src/cmd/ndb/cs.c - 664 sys sys 1188515063 32892
 sys/src/cmd/ndb/csquery.c - 664 sys sys 1174626119 1073
-sys/src/cmd/ndb/dblookup.c - 664 sys sys 1188581123 25260
-sys/src/cmd/ndb/dn.c - 664 sys sys 1186704098 36512
+sys/src/cmd/ndb/dblookup.c - 664 sys sys 1194216346 25229
+sys/src/cmd/ndb/dn.c - 664 sys sys 1194216512 37395
 sys/src/cmd/ndb/dnarea.c - 664 sys sys 1175664421 2519
 sys/src/cmd/ndb/dnnotify.c - 664 sys sys 1183866408 3217
-sys/src/cmd/ndb/dnresolve.c - 664 sys sys 1184990924 34536
-sys/src/cmd/ndb/dns.c - 664 sys sys 1186704113 16582
-sys/src/cmd/ndb/dns.h - 664 sys sys 1186704085 11726
-sys/src/cmd/ndb/dnsdebug.c - 664 sys sys 1185315248 8805
+sys/src/cmd/ndb/dnresolve.c - 664 sys sys 1194216513 34801
+sys/src/cmd/ndb/dns.c - 664 sys sys 1194216588 16627
+sys/src/cmd/ndb/dns.h - 664 sys sys 1194216527 11889
+sys/src/cmd/ndb/dnsdebug.c - 664 sys sys 1194216583 8790
 sys/src/cmd/ndb/dnserver.c - 664 sys sys 1184990866 4627
 sys/src/cmd/ndb/dnsquery.c - 664 sys sys 1185315254 2507
-sys/src/cmd/ndb/dnstcp.c - 664 sys sys 1183184439 7440
-sys/src/cmd/ndb/dnudpserver.c - 664 sys sys 1183750487 5470
+sys/src/cmd/ndb/dnstcp.c - 664 sys sys 1194216576 7503
+sys/src/cmd/ndb/dnudpserver.c - 664 sys sys 1194216569 5542
 sys/src/cmd/ndb/ipquery.c - 664 sys sys 1124711423 773
 sys/src/cmd/ndb/mkdb.c - 664 sys sys 957402054 2886
 sys/src/cmd/ndb/mkfile - 664 sys sys 1174623575 1984
@@ -13375,7 +13375,7 @@ sys/src/cmd/scuzz/sense.c - 664 sys sys 1177702138 5680
 sys/src/cmd/sed.c - 664 sys sys 1182465504 26844
 sys/src/cmd/seq.c - 664 sys sys 1161442158 1691
 sys/src/cmd/sh.C - 664 sys sys 1055701754 10303
-sys/src/cmd/sha1sum.c - 664 sys sys 1014926229 1017
+sys/src/cmd/sha1sum.c - 664 sys sys 1194215428 1098
 sys/src/cmd/size.c - 664 sys sys 944961619 717
 sys/src/cmd/sleep.c - 664 sys sys 1158061645 544
 sys/src/cmd/snap - 20000000775 sys sys 1039727541 0
@@ -13472,7 +13472,7 @@ sys/src/cmd/ssh/ssh.h - 664 sys sys 1091904420 6086
 sys/src/cmd/ssh/sshnet.c - 664 sys sys 1078840016 17641
 sys/src/cmd/ssh/sshserve.c - 664 sys sys 1135487956 5772
 sys/src/cmd/ssh/util.c - 664 sys sys 1154722953 4522
-sys/src/cmd/stats.c - 664 sys sys 1161483503 28084
+sys/src/cmd/stats.c - 664 sys sys 1194215006 28141
 sys/src/cmd/strings.c - 664 sys sys 1167860903 1474
 sys/src/cmd/strip.c - 664 sys sys 1131293244 2502
 sys/src/cmd/sum.c - 664 sys sys 1014926615 5548
@@ -14644,7 +14644,7 @@ sys/src/libauth/auth_getuserpasswd.c - 664 sys sys 1014929317 1363
 sys/src/libauth/auth_proxy.c - 664 sys sys 1179362110 3673
 sys/src/libauth/auth_respond.c - 664 sys sys 1044828825 1420
 sys/src/libauth/auth_rpc.c - 664 sys sys 1048645351 2064
-sys/src/libauth/auth_userpasswd.c - 664 sys sys 1014929317 1097
+sys/src/libauth/auth_userpasswd.c - 664 sys sys 1194215346 1105
 sys/src/libauth/auth_wep.c - 664 sys sys 1063854011 830
 sys/src/libauth/authlocal.h - 664 sys sys 1014929317 87
 sys/src/libauth/httpauth.c - 664 sys sys 1017166331 1059
@@ -15466,16 +15466,16 @@ sys/src/liboventi/pack.c - 664 sys sys 1188621652 2852
 sys/src/liboventi/packet.c - 664 sys sys 1188621652 13229
 sys/src/liboventi/packet.h - 664 sys sys 1019678692 641
 sys/src/liboventi/parsescore.c - 664 sys sys 1188621652 517
-sys/src/liboventi/plan9-io.c - 664 sys sys 1188621652 1759
+sys/src/liboventi/plan9-io.c - 664 sys sys 1194215819 1912
 sys/src/liboventi/plan9-sha1.c - 664 sys sys 1188621652 1059
 sys/src/liboventi/plan9-thread.acid - 664 sys sys 1138756224 9254
-sys/src/liboventi/plan9-thread.c - 664 sys sys 1188621652 6714
+sys/src/liboventi/plan9-thread.c - 664 sys sys 1194215820 6749
 sys/src/liboventi/readfully.c - 664 sys sys 1188621652 238
-sys/src/liboventi/rpc.c - 664 sys sys 1188621652 7297
+sys/src/liboventi/rpc.c - 664 sys sys 1194215809 7332
 sys/src/liboventi/scorefmt.c - 664 sys sys 1188621652 256
-sys/src/liboventi/server.c - 664 sys sys 1188621652 4508
+sys/src/liboventi/server.c - 664 sys sys 1194215807 4552
 sys/src/liboventi/session.h - 664 sys sys 1063853749 936
-sys/src/liboventi/strdup.c - 664 sys sys 1188621652 204
+sys/src/liboventi/strdup.c - 664 sys sys 1194215805 240
 sys/src/liboventi/venti.txt - 664 sys sys 1045502097 4347
 sys/src/liboventi/zero.c - 664 sys sys 1188621652 1510
 sys/src/libplumb - 20000000775 sys sys 1123099015 0

+ 40 - 0
dist/replica/plan9.log

@@ -53285,3 +53285,43 @@
 1194147004 2 c 386/9loadlite - 775 sys sys 1194145575 160820
 1194147004 3 c 386/9loadlitedebug - 775 sys sys 1194145581 236818
 1194147004 4 c 386/9pxeload - 775 sys sys 1194145588 337544
+1194215405 0 c mail/lib/pipeto.lib - 664 upas upas 1194214909 3500
+1194215405 1 c rc/bin/man - 775 sys sys 1194214975 2639
+1194215405 2 c sys/lib/tmac/tmac.html - 664 sys sys 1194215364 2025
+1194215405 3 c sys/man/3/usb - 664 sys sys 1194215735 7179
+1194215405 4 c sys/man/4/cwfs - 664 sys sys 1194214611 6553
+1194215405 5 c sys/man/8/6in4 - 664 sys sys 1194215293 2364
+1194215405 6 c sys/man/8/ipconfig - 664 sys sys 1194215287 8187
+1194215405 7 c sys/src/cmd/cwfs/main.c - 664 sys sys 1194214683 10347
+1194215405 8 c sys/src/cmd/cwfs/mkfile - 664 sys sys 1194214687 244
+1194215405 9 c sys/src/cmd/ip/ppp/ppp.c - 664 sys sys 1194215466 59955
+1194215405 10 c sys/src/cmd/md5sum.c - 664 sys sys 1194215423 1090
+1194215405 11 c sys/src/cmd/sha1sum.c - 664 sys sys 1194215428 1098
+1194215405 12 c sys/src/cmd/aan.c - 664 sys sys 1194215063 9762
+1194215405 13 c sys/src/cmd/cpu.c - 664 sys sys 1194215126 20932
+1194215405 14 c sys/src/cmd/fossil/9fsys.c - 664 sys sys 1194215521 33624
+1194215405 15 c sys/src/cmd/fossil/cache.c - 664 sys sys 1194215524 44024
+1194215405 16 c sys/src/cmd/fossil/dat.h - 664 sys sys 1194214821 7910
+1194215405 17 c sys/src/cmd/stats.c - 664 sys sys 1194215006 28141
+1194215405 18 c sys/src/libauth/auth_userpasswd.c - 664 sys sys 1194215346 1105
+1194215405 19 c sys/src/liboventi/plan9-io.c - 664 sys sys 1194215819 1912
+1194215405 20 c sys/src/liboventi/plan9-thread.c - 664 sys sys 1194215820 6749
+1194215405 21 c sys/src/liboventi/rpc.c - 664 sys sys 1194215809 7332
+1194215405 22 c sys/src/liboventi/server.c - 664 sys sys 1194215807 4552
+1194215405 23 c sys/src/liboventi/strdup.c - 664 sys sys 1194215805 240
+1194217205 0 c sys/src/9/pc/memory.c - 664 sys sys 1194216046 18820
+1194217205 1 c sys/src/cmd/ndb/convDNS2M.c - 664 sys sys 1194216289 7061
+1194217205 2 c sys/src/cmd/ndb/convM2DNS.c - 664 sys sys 1194216290 11959
+1194217205 3 c sys/src/cmd/ndb/dblookup.c - 664 sys sys 1194216346 25229
+1194217205 4 c sys/src/cmd/ndb/dn.c - 664 sys sys 1194216512 37395
+1194217205 5 c sys/src/cmd/ndb/dnresolve.c - 664 sys sys 1194216513 34801
+1194217205 6 c sys/src/cmd/ndb/dns.c - 664 sys sys 1194216588 16627
+1194217205 7 c sys/src/cmd/ndb/dns.h - 664 sys sys 1194216527 11889
+1194217205 8 c sys/src/cmd/ndb/dnsdebug.c - 664 sys sys 1194216583 8790
+1194217205 9 c sys/src/cmd/ndb/dnstcp.c - 664 sys sys 1194216576 7503
+1194217205 10 c sys/src/cmd/ndb/dnudpserver.c - 664 sys sys 1194216569 5542
+1194219005 0 c 386/9load - 775 sys sys 1194218336 337604
+1194219005 1 c 386/9loaddebug - 775 sys sys 1194218345 451365
+1194219005 2 c 386/9loadlite - 775 sys sys 1194218348 160884
+1194219005 3 c 386/9loadlitedebug - 775 sys sys 1194218352 236888
+1194219005 4 c 386/9pxeload - 775 sys sys 1194218358 337612

+ 11 - 0
mail/lib/pipeto.lib

@@ -120,6 +120,17 @@ fn isvirus {
 		status='not this virus'
 }
 
+fn hasgifattachment {
+	gif=no
+	if(grep -s '\.gif' $D/2/mimeheader >[2]/dev/null){
+		gif=yes
+	}
+	if(~ $gif yes)
+		status=''
+	if not
+		status='not this gif'
+}
+
 # bayesian spam filter.  alternative to token.  see /mail/lib/setup.bayes
 fn isspam {
 	for(i in _prof.mbox _prof.spam _bounced){

+ 4 - 4
rc/bin/man

@@ -68,13 +68,13 @@ while(~ $d 0) {
 	}
 	if not
 		switch($1) {
-		case -t ; cmd=t ; shift
+		case -b ; cmd=b ; shift
 		case -n ; cmd=n ; shift
-		case -p ; cmd=p ; shift
 		case -P ; cmd=P ; shift
-		case -w ; cmd=w ; shift
-		case -b ; cmd=b ; shift
+		case -p ; cmd=p ; shift
 		case -S ; search=no ; shift
+		case -t ; cmd=t ; shift
+		case -w ; cmd=w ; shift
 		case * ; d=1
 		}
 }

+ 1 - 0
sys/lib/tmac/tmac.html

@@ -4,6 +4,7 @@
 \!   "http://www.w3.org/TR/html4/loose.dtd"\>
 .html html <html>
 .html head <head>
+.html utf <meta http-equiv=Content-Type content="text/html; charset=utf8">
 .if !'\\$1'' .html title <title>\\$1</title>
 .HEAD
 .html head

+ 7 - 5
sys/man/3/usb

@@ -17,8 +17,9 @@ usb \- USB Host Controller Interface
 \&...
 .fi
 .SH DESCRIPTION
-The Universal Serial Bus is a popular bus for connecting slow and medium speed
-devices, such as mice, keyboards, printers, and scanners to a PC.  It is
+The Universal Serial Bus is a complex yet popular bus
+for connecting devices, such as mice, keyboards, printers, scanners,
+and (eventually with USB 2) disks to a PC.  It is
 a four-wire tree-shaped bus that provides both communication and (limited)
 power to devices.  Branching points in the tree are provided by devices
 called
@@ -34,12 +35,13 @@ Hubs are passive in the sense that they do not poll the devices attached
 to them.  The host polls those devices and the hubs merely route the
 messages.
 .PP
+Devices may be added to or removed from the bus at any time.
 When a device is attached, the host queries it to determine its type
 and its speed.  The querying process is standardized.  The first level
 of querying is the same for all devices, the next is somewhat specialized
 for particular classes of devices (such as mice, keyboards, or audio devices).
 Specialization continues as subclasses and subsubclasses are explored.
-.PP
+.SS Discovery
 For each connected device there is a directory in
 .BI #U/usb n\fR.
 Reading
@@ -63,7 +65,7 @@ proto 2,
 (proto 1 would be the keyboard).
 USB class, subclass and proto codes can be found on
 .BR www.usb.org .
-.PP
+.SS Device Control
 The control interface for each device is
 .I "``endpoint 0''"
 and is named
@@ -154,7 +156,7 @@ If the configuration is successful, a file named
 is created which can be read and/or written depending on
 configuration.  Configuration is not allowed when the data endpoint
 is open.
-.PP
+.SS Isochronous Streams
 Forward
 .I seek
 operations on isochronous endpoints

+ 18 - 1
sys/man/4/cwfs

@@ -4,7 +4,7 @@ cwfs \- cached-worm file server, dump
 .SH SYNOPSIS
 .B cwfs
 [
-.B -f
+.B -cf
 ] [
 .B -a
 .I announce-string
@@ -58,6 +58,23 @@ announce on
 instead of
 .LR tcp!*!9fs .
 .TP
+.B -c
+use a newer, faster, and incompatible cache-device layout.
+To convert an old file system's cache to the new layout,
+dump the file system, note the last superblock number,
+halt
+.IR cwfs ,
+restart
+.I cwfs
+with
+.BR -cf ,
+.I recover
+the file system, and start
+.I cwfs
+with
+.B -c
+thereafter.
+.TP
 .B -f
 enter the file server's configuration mode
 before starting normal operation.

+ 4 - 1
sys/man/8/6in4

@@ -120,7 +120,10 @@ packet interface to IPv6 network
 .IR bridge (3),
 .I ipmux
 in
-.IR ip (3)
+.IR ip (3),
+.I linklocal
+in
+.IR ipconfig (8)
 .br
 .B /lib/rfc/rfc3056
 .br

+ 17 - 0
sys/man/8/ipconfig

@@ -45,6 +45,10 @@ ipconfig, rip, linklocal, ipv6on \- Internet configuration and routing
 .IR netmtpt ]
 .PP
 .B ip/linklocal
+[
+.B -t
+.I ipv4
+]
 .I mac
 \&...
 .PP
@@ -297,6 +301,15 @@ turn on (voluminous) debugging.
 prints the IPv6 link-local address corresponding to the given
 .I mac
 address.
+Given
+.BR -t ,
+.I linklocal
+instead prints the
+.I 6to4
+EUI-64-based IPv6 address corresponding to
+.I ipv4
+and
+.IR mac .
 .PP
 .I Ipv6on
 uses the network database at
@@ -369,5 +382,9 @@ ip/ipconfig ra6 recvra 1
 .IR ip (3),
 .IR loopback (3),
 .IR ndb (6),
+.IR 6in4 (8),
 .IR dhcpd (8),
 .IR ppp (8)
+.br
+.B /lib/rfc/rfc2373
+for IPv6's modified EUI-64

+ 10 - 8
sys/src/9/pc/memory.c

@@ -697,14 +697,16 @@ e820scan(void)
 		return -1;
 	
 	qsort(emap, nemap, sizeof emap[0], emapcmp);
-	
-	for(i=0; i<nemap; i++){
-		e = &emap[i];
-		print("E820: %.8llux %.8llux ", e->base, e->base+e->len);
-		if(e->type < nelem(etypes))
-			print("%s\n", etypes[e->type]);
-		else
-			print("type=%lud\n", e->type);
+
+	if(getconf("*noe820print") == nil){
+		for(i=0; i<nemap; i++){
+			e = &emap[i];
+			print("E820: %.8llux %.8llux ", e->base, e->base+e->len);
+			if(e->type < nelem(etypes))
+				print("%s\n", etypes[e->type]);
+			else
+				print("type=%lud\n", e->type);
+		}
 	}
 
 	last = 0;

+ 1 - 1
sys/src/cmd/aan.c

@@ -79,7 +79,7 @@ static void
 usage(void)
 {
 	fprint(2, "Usage: %s [-c] [-d] [-m maxto] dialstring|handle\n", progname);
-	exits(nil);
+	exits("usage");
 }
 
 static int

+ 27 - 41
sys/src/cmd/cpu.c

@@ -561,6 +561,7 @@ srvnoauth(int fd, char *user)
 {
 	strecpy(user, user+MaxStr, getuser());
 	ealgs = nil;
+	newns(user, nil);
 	return fd;
 }
 
@@ -751,7 +752,7 @@ fsreply(int fd, Fcall *f)
 	int n;
 
 	if(dbg)
-		fprint(2, "<-%F\n", f);
+		fprint(2, "notefs: <-%F\n", f);
 	n = convS2M(f, buf, sizeof buf);
 	if(n > 0){
 		if(write(fd, buf, n) != n){
@@ -899,9 +900,9 @@ void
 notefs(int fd)
 {
 	uchar buf[IOHDRSZ+Maxfdata];
-	int i, j, n, ncpunote;
-	char err[ERRMAX];
+	int i, n, ncpunote;
 	Fcall f;
+	Qid wqid[MAXWELEM];
 	Fid *fid, *nfid;
 	int doreply;
 
@@ -924,7 +925,7 @@ notefs(int fd)
 		if(convM2S(buf, n, &f) <= BIT16SZ)
 			break;
 		if(dbg)
-			fprint(2, "->%F\n", &f);
+			fprint(2, "notefs: ->%F\n", &f);
 		doreply = 1;
 		fid = getfid(f.fid);
 		if(fid == nil){
@@ -948,7 +949,7 @@ nofids:
 			break;
 		case Tauth:
 			f.type = Rerror;
-			f.ename = "cpu: authentication not required";
+			f.ename = "authentication not required";
 			break;
 		case Tattach:
 			f.qid = fstab[Qdir].qid;
@@ -963,65 +964,51 @@ nofids:
 				nfid->file = fid->file;
 				fid = nfid;
 			}
-
-			f.ename = nil;
-			for(i=0; i<f.nwname; i++){
-				if(i > MAXWELEM){
-					f.type = Rerror;
-					f.ename = "too many name elements";
-					break;
-				}
+			for(i=0; i<f.nwname && i<MAXWELEM; i++){
 				if(fid->file != Qdir){
 					f.type = Rerror;
 					f.ename = Enotdir;
 					break;
 				}
-				if(strcmp(f.wname[i], "cpunote") == 0){
-					fid->file = Qcpunote;
-					f.wqid[i] = fstab[Qcpunote].qid;
+				if(strcmp(f.wname[i], "..") == 0){
+					wqid[i] = fstab[Qdir].qid;
 					continue;
 				}
-				f.type = Rerror;
-				f.ename = err;
-				strcpy(err, "cpu: file \"");
-				for(j=0; j<=i; j++){
-					if(strlen(err)+1+strlen(f.wname[j])+32 > sizeof err)
-						break;
-					if(j != 0)
-						strcat(err, "/");
-					strcat(err, f.wname[j]);
+				if(strcmp(f.wname[i], "cpunote") != 0){
+					if(i == 0){
+						f.type = Rerror;
+						f.ename = "file does not exist";
+					}
+					break;
 				}
-				strcat(err, "\" does not exist");
-				break;
+				fid->file = Qcpunote;
+				wqid[i] = fstab[Qcpunote].qid;
 			}
-			if(nfid != nil && (f.ename != nil || i < f.nwname))
+			if(nfid != nil && (f.type == Rerror || i < f.nwname))
 				nfid ->file = -1;
-			if(f.type != Rerror)
+			if(f.type != Rerror){
 				f.nwqid = i;
+				for(i=0; i<f.nwqid; i++)
+					f.wqid[i] = wqid[i];
+			}
 			break;
 		case Topen:
 			if(f.mode != OREAD){
 				f.type = Rerror;
 				f.ename = Eperm;
+				break;
 			}
 			fid->omode = f.mode;
 			if(fid->file == Qcpunote)
 				ncpunote++;
 			f.qid = fstab[fid->file].qid;
-			break;
-		case Tcreate:
-			f.type = Rerror;
-			f.ename = Eperm;
+			f.iounit = 0;
 			break;
 		case Tread:
 			if(fsread(fd, fid, &f) < 0)
 				goto err;
 			doreply = 0;
 			break;
-		case Twrite:
-			f.type = Rerror;
-			f.ename = Eperm;
-			break;
 		case Tclunk:
 			if(fid->omode != -1 && fid->file == Qcpunote){
 				ncpunote--;
@@ -1031,15 +1018,14 @@ nofids:
 			fid->file = -1;
 			fid->omode = -1;
 			break;
-		case Tremove:
-			f.type = Rerror;
-			f.ename = Eperm;
-			break;
 		case Tstat:
 			if(fsstat(fd, fid, &f) < 0)
 				goto err;
 			doreply = 0;
 			break;
+		case Tcreate:
+		case Twrite:
+		case Tremove:
 		case Twstat:
 			f.type = Rerror;
 			f.ename = Eperm;

+ 10 - 4
sys/src/cmd/cwfs/main.c

@@ -3,6 +3,8 @@
 #include "io.h"
 #include "9p1.h"
 
+extern int oldcachefmt;
+
 Map *devmap;
 
 Biobuf bin;
@@ -222,7 +224,8 @@ printsizes(void)
 void
 usage(void)
 {
-	fprint(2, "usage: %s [-f][-a ann-str][-m dev-map] config-dev\n", argv0);
+	fprint(2, "usage: %s [-cf][-a ann-str][-m dev-map] config-dev\n",
+		argv0);
 	exits("usage");
 }
 
@@ -238,7 +241,7 @@ main(int argc, char **argv)
 	conf.confdev = "n";		/* Devnone */
 
 	ARGBEGIN{
-	case 'a':
+	case 'a':			/* announce on this net */
 		ann = EARGF(usage());
 		if (nets >= Maxnets) {
 			fprint(2, "%s: too many networks to announce: %s\n",
@@ -247,10 +250,13 @@ main(int argc, char **argv)
 		}
 		annstrs[nets++] = ann;
 		break;
-	case 'f':
+	case 'c':			/* use new, faster cache layout */
+		oldcachefmt = 0;
+		break;
+	case 'f':			/* enter configuration mode first */
 		conf.configfirst++;
 		break;
-	case 'm':
+	case 'm':			/* name device-map file */
 		conf.devmap = EARGF(usage());
 		break;
 	default:

+ 2 - 0
sys/src/cmd/cwfs/mkfile

@@ -6,3 +6,5 @@ emelie.%:V:
 	cd emelie && mk $stem
 fs64.%:V:
 	cd fs64 && mk $stem
+
+cleanall:V: clean emelie.clean fs64.clean

+ 2 - 1
sys/src/cmd/fossil/9fsys.c

@@ -1383,7 +1383,8 @@ fsysCheck(Fsys *fsys, int argc, char *argv[])
 		}
 		blockPut(b);
 		if(super.current != NilBlock){
-			consPrint("cannot check fs while archiver is running; wait for it to finish\n");
+			consPrint("cannot check fs while archiver is running; "
+				"wait for it to finish\n");
 			goto Out;
 		}
 	}

+ 12 - 6
sys/src/cmd/fossil/cache.c

@@ -97,11 +97,10 @@ struct BAddr {
 
 struct FreeList {
 	VtLock *lk;
-	u32int last;	/* last block allocated */
-	u32int end;	/* end of data partition */
-	u32int nfree;	/* number of free blocks */
-	u32int nused;	/* number of used blocks */
-	u32int epochLow;	/* low epoch when last updated nfree and nused */
+	u32int last;		/* last block allocated */
+	u32int end;		/* end of data partition */
+	u32int nused;		/* number of used blocks */
+	u32int epochLow;	/* low epoch when last updated nused */
 };
 
 static FreeList *flAlloc(u32int end);
@@ -1556,7 +1555,14 @@ doRemoveLink(Cache *c, BList *p)
 	l = b->l;
 	l.state |= BsClosed;
 	l.epochClose = p->epoch;
-	blockSetLabel(b, &l, 0);
+	if(l.epochClose == l.epoch){
+		vtLock(c->fl->lk);
+		if(l.epoch == c->fl->epochLow)
+			c->fl->nused--;
+		blockSetLabel(b, &l, 0);
+		vtUnlock(c->fl->lk);
+	}else
+		blockSetLabel(b, &l, 0);
 	blockPut(b);
 }
 

+ 32 - 32
sys/src/cmd/fossil/dat.h

@@ -282,38 +282,38 @@ enum
 
 struct Fsck
 {
-/* filled in by caller */
-	int printblocks;
-	int useventi;
-	int flags;
-	int printdirs;
-	int printfiles;
-	int walksnapshots;
-	int walkfs;
-	Fs *fs;
-	int (*print)(char*, ...);
-	void (*clre)(Fsck*, Block*, int);
-	void (*clrp)(Fsck*, Block*, int);
-	void (*close)(Fsck*, Block*, u32int);
-	void (*clri)(Fsck*, char*, MetaBlock*, int, Block*);
-
-/* used internally */
-	Cache *cache;
-	uchar *amap;	/* all blocks seen so far */
-	uchar *emap;	/* all blocks seen in this epoch */
-	uchar *xmap;	/* all blocks in this epoch with parents in this epoch */
-	uchar *errmap;	/* blocks with errors */
-	uchar *smap;	/* walked sources */
-	int nblocks;
-	int bsize;
-	int walkdepth;
-	u32int hint;	/* where the next root probably is */
-	int nseen;
-	int quantum;
-	int nclre;
-	int nclrp;
-	int nclose;
-	int nclri;
+	/* filled in by caller */
+	int	printblocks;
+	int	useventi;
+	int	flags;
+	int	printdirs;
+	int	printfiles;
+	int	walksnapshots;
+	int	walkfs;
+	Fs	*fs;
+	int	(*print)(char*, ...);
+	void	(*clre)(Fsck*, Block*, int);
+	void	(*clrp)(Fsck*, Block*, int);
+	void	(*close)(Fsck*, Block*, u32int);
+	void	(*clri)(Fsck*, char*, MetaBlock*, int, Block*);
+
+	/* used internally */
+	Cache	*cache;
+	uchar	*amap;	/* all blocks seen so far */
+	uchar	*emap;	/* all blocks seen in this epoch */
+	uchar	*xmap;	/* all blocks in this epoch with parents in this epoch */
+	uchar	*errmap;	/* blocks with errors */
+	uchar	*smap;		/* walked sources */
+	int	nblocks;
+	int	bsize;
+	int	walkdepth;
+	u32int	hint;		/* where the next root probably is */
+	int	nseen;
+	int	quantum;
+	int	nclre;
+	int	nclrp;
+	int	nclose;
+	int	nclri;
 };
 
 /* disk partitions; keep in sync with partname[] in disk.c */

+ 21 - 18
sys/src/cmd/ip/ppp/ppp.c

@@ -1,3 +1,6 @@
+/*
+ * ppp - point-to-point protocol, rfc1331
+ */
 #include <u.h>
 #include <libc.h>
 #include <auth.h>
@@ -1024,24 +1027,24 @@ dropoption(Pstate *p, Lcpopt *o)
 	unsigned n = o->type;
 
 	switch(n){
-		case Oipaddr:
-			break;
-		case Oipdns:
-			p->optmask &= ~Fipdns;
-			break;
-		case Oipwins:
-			p->optmask &= ~Fipwins;
-			break;
-		case Oipdns2:
-			p->optmask &= ~Fipdns2;
-			break;
-		case Oipwins2:
-			p->optmask &= ~Fipwins2;
-			break;
-		default:
-			if(o->type < 8*sizeof(p->optmask))
-				p->optmask &= ~(1<<o->type);
-			break;
+	case Oipaddr:
+		break;
+	case Oipdns:
+		p->optmask &= ~Fipdns;
+		break;
+	case Oipwins:
+		p->optmask &= ~Fipwins;
+		break;
+	case Oipdns2:
+		p->optmask &= ~Fipdns2;
+		break;
+	case Oipwins2:
+		p->optmask &= ~Fipwins2;
+		break;
+	default:
+		if(o->type < 8*sizeof(p->optmask))
+			p->optmask &= ~(1<<o->type);
+		break;
 	}
 }
 

+ 4 - 0
sys/src/cmd/md5sum.c

@@ -28,6 +28,10 @@ sum(int fd, char *name)
 	s = md5(nil, 0, nil, nil);
 	while((n = read(fd, buf, sizeof buf)) > 0)
 		md5(buf, n, nil, s);
+	if(n < 0){
+		fprint(2, "reading %s: %r\n", name ? name : "stdin");
+		return;
+	}
 	md5(nil, 0, digest, s);
 	if(name == nil)
 		print("%M\n", digest);

+ 2 - 2
sys/src/cmd/ndb/convDNS2M.c

@@ -261,8 +261,8 @@ convRR2M(RR *rp, uchar *p, uchar *ep, Dict *dp)
 	case Tsrv:
 		USHORT(rp->srv->pri);
 		USHORT(rp->srv->weight);
-		USHORT(rp->srv->port);
-		STRING(rp->srv->target->name);
+		USHORT(rp->port);
+		STRING(rp->host->name);	/* rfc2782 sez no name compression */
 		break;
 	case Ttxt:
 		for(t = rp->txt; t != nil; t = t->next)

+ 14 - 5
sys/src/cmd/ndb/convM2DNS.c

@@ -406,8 +406,15 @@ retry:
 	case Tsrv:
 		USHORT(rp->srv->pri);
 		USHORT(rp->srv->weight);
-		USHORT(rp->srv->port);
-		rp->srv->target = dnlookup(NAME(dname), Cin, 1);
+		USHORT(rp->port);
+		/*
+		 * rfc2782 sez no name compression but to be
+		 * backward-compatible with rfc2052, we try to expand the name. 
+		 * if the length is under 64 bytes, either interpretation is
+		 * fine; if it's longer, we'll assume it's compressed,
+		 * as recommended by rfc3597.
+		 */
+		rp->host = dnlookup(NAME(dname), Cin, 1);
 		break;
 	case Ttxt:
 		l = &rp->txt;
@@ -464,13 +471,15 @@ retry:
 			// dnslog("convM2RR: got %R", rp);
 			return rp;
 		}
-		if (len > sp->p - data)
+		if (len > sp->p - data){
 			dnslog("bad %s RR len (%d bytes nominal, %lud actual): %R",
 				rrname(type, ptype, sizeof ptype), len,
 				sp->p - data, rp);
-		// sp->p = data + len;
+			rrfree(rp);
+			rp = nil;
+		}
 	}
-	// dnslog("convM2RR: got %R", rp);
+	// if(rp) dnslog("convM2RR: got %R", rp);
 	return rp;
 }
 

+ 5 - 6
sys/src/cmd/ndb/dblookup.c

@@ -505,11 +505,11 @@ srvrr(Ndbtuple *entry, Ndbtuple *pair)
 	RR *rp;
 
 	rp = rralloc(Tsrv);
-	rp->srv->target = dnlookup(pair->val, Cin, 1);
-	rp->srv->pri    = intval(entry, pair, "pri", 0);
+	rp->host = dnlookup(pair->val, Cin, 1);
+	rp->srv->pri = intval(entry, pair, "pri", 0);
 	rp->srv->weight = intval(entry, pair, "weight", 0);
 	/* TODO: translate service name to port # */
-	rp->srv->port   = intval(entry, pair, "port", 0);
+	rp->port = intval(entry, pair, "port", 0);
 	return rp;
 }
 
@@ -819,7 +819,6 @@ baddelegation(RR *rp, RR *nsrp, uchar *addr)
 			if(rp->host && cistrcmp(rp->host->name, nt->val) == 0)
 				break;
 		if(nt != nil && !inmyarea(rp->owner->name)){
-			dnslog("bad delegation %R from %I", rp, addr);
 			return 1;
 		}
 	}
@@ -960,7 +959,7 @@ addlocaldnsdomain(DN *dp, int class, char *domain)
 {
 	RR *rp;
 
-	/* A record */
+	/* ptr record */
 	rp = rralloc(Tptr);
 	rp->ptr = dnlookup(domain, class, 1);
 	rp->owner = dp;
@@ -1050,7 +1049,7 @@ createv4ptrs(void)
 			net[IPv4off+2] = atoi(f[0]);
 			mask[IPv4off+3] = 0;
 			break;
-		case 6:			/* rfc2317 */
+		case 6:		/* rfc2317: classless in-addr.arpa delegation */
 			net[IPv4off] = atoi(f[3]);
 			net[IPv4off+1] = atoi(f[2]);
 			net[IPv4off+2] = atoi(f[1]);

+ 86 - 49
sys/src/cmd/ndb/dn.c

@@ -140,6 +140,7 @@ Lock	dnlock;
 
 static ulong agefreq = Defagefreq;
 
+static int rrequiv(RR *r1, RR *r2);
 static int sencodefmt(Fmt*);
 
 void
@@ -212,6 +213,33 @@ dnlookup(char *name, int class, int enter)
 	return dp;
 }
 
+static int
+rrsame(RR *rr1, RR *rr2)
+{
+	return rr1 == rr2 || rr2 && rrequiv(rr1, rr2) &&
+		rr1->db == rr2->db && rr1->auth == rr2->auth;
+}
+
+static int
+rronlist(RR *rp, RR *lp)
+{
+	for(; lp; lp = lp->next)
+		if (rrsame(lp, rp)) {
+			dnslog("adding duplicate %R to list of %R", rp, lp);
+			return 1;
+		}
+	return 0;
+}
+
+static void
+ckrronlist(RR *rp, RR *lp)
+{
+	if (rronlist(rp, lp)) {
+		dnslog("adding duplicate %R to list of %R", rp, lp);
+		abort();
+	}
+}
+
 /*
  *  dump the cache
  */
@@ -254,10 +282,13 @@ dndump(char *file)
 	for(i = 0; i < HTLEN; i++)
 		for(dp = ht[i]; dp; dp = dp->next){
 			fprint(fd, "%s\n", dp->name);
-			for(rp = dp->rr; rp; rp = rp->next)
+			for(rp = dp->rr; rp; rp = rp->next) {
 				fprint(fd, "\t%R %c%c %lud/%lud\n",
 					rp, rp->auth? 'A': 'U',
 					rp->db? 'D': 'N', rp->expire, rp->ttl);
+				if (rronlist(rp, rp->next))
+					fprint(fd, "*** duplicate:\n");
+			}
 		}
 	unlock(&dnlock);
 	close(fd);
@@ -287,6 +318,15 @@ dnpurge(void)
 	unlock(&dnlock);
 }
 
+/* delete rp from *l, free rp */
+static void
+rrdelete(RR **l, RR *rp)
+{
+	*l = rp->next;
+	rp->cached = 0;		/* avoid blowing an assertion in rrfree */
+	rrfree(rp);
+}
+
 /*
  *  check the age of resource records, free any that have timed out
  */
@@ -305,14 +345,10 @@ dnage(DN *dp)
 	for(rp = dp->rr; rp; rp = next){
 		assert(rp->magic == RRmagic && rp->cached);
 		next = rp->next;
-		if(!rp->db)
-		if(rp->expire < now || diff > dnvars.oldest){
-			*l = next;
-			rp->cached = 0;
-			rrfree(rp);
-			continue;
-		}
-		l = &rp->next;
+		if(!rp->db && (rp->expire < now || diff > dnvars.oldest))
+			rrdelete(l, rp);
+		else
+			l = &rp->next;
 	}
 }
 
@@ -351,6 +387,7 @@ dnagenever(void)
 				case Tmf:
 				case Tns:
 				case Tmx:
+				case Tsrv:
 					MARK(rp->host);
 					break;
 				case Tmg:
@@ -376,9 +413,6 @@ dnagenever(void)
 					MARK(rp->host);
 					MARK(rp->rmb);
 					break;
-				case Tsrv:
-					MARK(rp->srv->target);
-					break;
 				}
 			}
 		}
@@ -402,7 +436,7 @@ void
 dnageall(int doit)
 {
 	DN *dp, **l;
-	int i, n;
+	int i;
 	RR *rp;
 	static ulong nextage;
 
@@ -454,6 +488,7 @@ dnageall(int doit)
 				case Tmf:
 				case Tns:
 				case Tmx:
+				case Tsrv:
 					REF(rp->host);
 					break;
 				case Tmg:
@@ -479,9 +514,6 @@ dnageall(int doit)
 					REF(rp->host);
 					REF(rp->rmb);
 					break;
-				case Tsrv:
-					REF(rp->srv->target);
-					break;
 				}
 			}
 
@@ -493,12 +525,6 @@ dnageall(int doit)
 				assert(dp->magic == DNmagic);
 				*l = dp->next;
 
-				for (n = 0; n < Maxlcks; n++)
-					if (canqlock(&dp->querylck[n]))
-						qunlock(&dp->querylck[n]);
-					else
-						dnslog("dnageall: %s querylck[%d] held when freeing",
-							dp->name, n);
 				if(dp->name)
 					free(dp->name);
 				dp->magic = ~dp->magic;
@@ -653,6 +679,7 @@ putactivity(int recursive)
  *	- Chain all RR's of the same type adjacent to one another
  *	- chain authoritative RR's ahead of non-authoritative ones
  *	- remove any expired RR's
+ *  If new is a stale duplicate, rrfree it.
  *  Must be called with dnlock held.
  */
 static void
@@ -689,49 +716,47 @@ rrattach1(RR *new, int auth)
 	 *  negative entries replace positive entries
 	 *  positive entries replace negative entries
 	 *  newer entries replace older entries with the same fields
+	 *
+	 *  look farther ahead than just the next entry when looking
+	 *  for duplicates; RRs of a given type can have different rdata
+	 *  fields (e.g. multiple NS servers).
 	 */
-	for(rp = *l; rp; rp = *l){
+	while ((rp = *l) != nil){
 		assert(rp->magic == RRmagic && rp->cached);
 		if(rp->type != new->type)
 			break;
 
 		if(rp->db == new->db && rp->auth == new->auth){
 			/* negative drives out positive and vice versa */
-			if(rp->negative != new->negative){
-				*l = rp->next;
-				rp->cached = 0;
-				rrfree(rp);
-				continue;
+			if(rp->negative != new->negative) {
+				rrdelete(l, rp);
+				continue;		/* *l == rp->next */
 			}
-
 			/* all things equal, pick the newer one */
-			if(rp->arg0 == new->arg0 && rp->arg1 == new->arg1 &&
-			    (rp->type != Tsrv || rp->srv == new->srv)){
+			else if(rp->arg0 == new->arg0 && rp->arg1 == new->arg1){
 				/* new drives out old */
-				if (new->ttl > rp->ttl ||
-				    new->expire > rp->expire){
-					*l = rp->next;
-					rp->cached = 0;
-					rrfree(rp);
-					continue;
-				} else {
+				if (new->ttl <= rp->ttl &&
+				    new->expire <= rp->expire) {
 					rrfree(new);
 					return;
 				}
+				rrdelete(l, rp);
+				continue;		/* *l == rp->next */
 			}
-
-			/*  Hack for pointer records.  This makes sure
+			/*
+			 *  Hack for pointer records.  This makes sure
 			 *  the ordering in the list reflects the ordering
 			 *  received or read from the database
 			 */
-			if(rp->type == Tptr)
-				if(!rp->negative && !new->negative
-				&& rp->ptr->ordinal > new->ptr->ordinal)
-					break;
+			else if(rp->type == Tptr &&
+			    !rp->negative && !new->negative &&
+			    rp->ptr->ordinal > new->ptr->ordinal)
+				break;
 		}
 		l = &rp->next;
 	}
 
+	ckrronlist(new, *l);
 	/*
 	 *  add to chain
 	 */
@@ -742,6 +767,9 @@ rrattach1(RR *new, int auth)
 
 /*
  *  Attach a list of resource records to a domain name.
+ *  May rrfree any stale duplicate RRs; dismembers the list.
+ *  Upon return, every RR in the list will have been rrfree-d
+ *  or attached to its domain name.
  *  See rrattach1 for properties preserved.
  */
 void
@@ -981,8 +1009,16 @@ tsame(int t1, int t2)
 RR*
 rrcat(RR **start, RR *rp)
 {
+	RR *olp, *nlp;
 	RR **last;
 
+	/* check for duplicates */
+	for (olp = *start; 0 && olp; olp = olp->next)
+		for (nlp = rp; nlp; nlp = nlp->next)
+			if (rrsame(nlp, olp))
+				dnslog("rrcat: duplicate RR: %R", nlp);
+	USED(olp);
+
 	last = start;
 	while(*last != nil)
 		last = &(*last)->next;
@@ -1124,7 +1160,7 @@ rrfmt(Fmt *f)
 		srv = rp->srv;
 		fmtprint(&fstr, "\t%ud %ud %ud %s",
 			(srv? srv->pri: 0), (srv? srv->weight: 0),
-			(srv? srv->port: 0), (srv? dnname(srv->target): ""));
+			rp->port, dnname(rp->host));
 		break;
 	case Tnull:
 		if (rp->null == nil)
@@ -1250,7 +1286,7 @@ rravfmt(Fmt *f)
 		srv = rp->srv;
 		fmtprint(&fstr, " pri=%ud weight=%ud port=%ud target=%s",
 			(srv? srv->pri: 0), (srv? srv->weight: 0),
-			(srv? srv->port: 0), (srv? dnname(srv->target): ""));
+			rp->port, dnname(rp->host));
 		break;
 	case Tnull:
 		if (rp->null == nil)
@@ -1440,6 +1476,8 @@ dncheck(void *p, int dolock)
 				assert(rp->magic == RRmagic);
 				assert(rp->cached);
 				assert(rp->owner == dp);
+				/* also check for duplicate rrs */
+				ckrronlist(rp, rp->next);
 			}
 		}
 	if(dolock)
@@ -1452,8 +1490,7 @@ rrequiv(RR *r1, RR *r2)
 	return r1->owner == r2->owner
 		&& r1->type == r2->type
 		&& r1->arg0 == r2->arg0
-		&& r1->arg1 == r2->arg1
-		&& (r1->type != Tsrv || r1->srv == r2->srv);
+		&& r1->arg1 == r2->arg1;
 }
 
 void
@@ -1524,7 +1561,7 @@ randomize(RR *rp)
 		rp = x->next;
 		x->next = nil;
 
-		if(n&1 && x->type == Tns /* && rrisslug(x) */ ){
+		if(n&1){
 			/* add to tail */
 			if(last == nil)
 				first = x;

+ 57 - 41
sys/src/cmd/ndb/dnresolve.c

@@ -155,39 +155,39 @@ dnresolve(char *name, int class, int type, Request *req, RR **cn, int depth,
 	 *  try the name directly
 	 */
 	rp = dnresolve1(name, class, type, req, depth, recurse);
-	if(rp) {
-		procsetname(procname);
-		free(procname);
-		return randomize(rp);
-	}
-
-	/* try it as a canonical name if we weren't told the name didn't exist */
-	dp = dnlookup(name, class, 0);
-	if(type != Tptr && dp->respcode != Rname)
-		for(loops = 0; rp == nil && loops < 32; loops++){
-			rp = dnresolve1(name, class, Tcname, req, depth, recurse);
-			if(rp == nil)
-				break;
-
-			if(rp->negative){
-				rrfreelist(rp);
-				rp = nil;
-				break;
-			}
+	if(rp == nil) {
+		/*
+		 * try it as a canonical name if we weren't told
+		 * that the name didn't exist
+		 */
+		dp = dnlookup(name, class, 0);
+		if(type != Tptr && dp->respcode != Rname)
+			for(loops = 0; rp == nil && loops < 32; loops++){
+				rp = dnresolve1(name, class, Tcname, req,
+					depth, recurse);
+				if(rp == nil)
+					break;
 
-			name = rp->host->name;
-			if(cn)
-				rrcat(cn, rp);
-			else
-				rrfreelist(rp);
+				if(rp->negative){
+					rrfreelist(rp);
+					rp = nil;
+					break;
+				}
 
-			rp = dnresolve1(name, class, type, req, depth, recurse);
-		}
+				name = rp->host->name;
+				if(cn)
+					rrcat(cn, rp);
+				else
+					rrfreelist(rp);
 
-	/* distinction between not found and not good */
-	if(rp == nil && status != nil && dp->respcode != 0)
-		*status = dp->respcode;
+				rp = dnresolve1(name, class, type, req,
+					depth, recurse);
+			}
 
+		/* distinction between not found and not good */
+		if(rp == nil && status != nil && dp->respcode != 0)
+			*status = dp->respcode;
+	}
 	procsetname(procname);
 	free(procname);
 	return randomize(rp);
@@ -1443,11 +1443,14 @@ udpquery(Query *qp, char *mntpt, int depth, int patient, int inns)
 static int
 netquery(Query *qp, int depth)
 {
-	int lock, rv, triedin, inname, lcktype;
-	char buf[32];
+	int lock, rv, triedin, inname, cnt;
+//	char buf[32];
 	RR *rp;
 	DN *dp;
+	Querylck *qlp;
+	static int whined;
 
+	rv = 0;				/* pessimism */
 	if(depth > 12)			/* in a recursive loop? */
 		return 0;
 
@@ -1462,11 +1465,12 @@ netquery(Query *qp, int depth)
 	 * don't lock before call to slave so only children can block.
 	 * just lock at top-level invocation.
 	 */
-	lock = depth <= 1 && qp->req->isslave != 0;
+	lock = depth <= 1 && qp->req->isslave;
 	dp = qp->dp;		/* ensure that it doesn't change underfoot */
+	qlp = nil;
 	if(lock) {
-		procsetname("query lock wait: %s %s from %s", dp->name,
-			rrname(qp->type, buf, sizeof buf), qp->req->from);
+//		procsetname("query lock wait: %s %s from %s", dp->name,
+//			rrname(qp->type, buf, sizeof buf), qp->req->from);
 		/*
 		 * don't make concurrent queries for this name.
 		 * dozens of processes blocking here probably indicates
@@ -1474,17 +1478,29 @@ netquery(Query *qp, int depth)
 		 * recognise a zone (area) as one of our own, thus
 		 * causing us to query other nameservers.
 		 */
-		lcktype = qtype2lck(qp->type);
-		qlock(&dp->querylck[lcktype]);
-	} else
-		lcktype = 0;
+		qlp = &dp->querylck[qtype2lck(qp->type)];
+		incref(qlp);
+		qlock(qlp);
+		cnt = qlp->Ref.ref;
+		qunlock(qlp);
+		if (cnt > 10) {
+			decref(qlp);
+			if (!whined) {
+				whined = 1;
+				dnslog("too many outstanding queries for %s; "
+					"dropping this one; "
+					"no further logging of drops",
+					dp->name);
+			}
+			return 0;
+		}
+	}
 	procsetname("netquery: %s", dp->name);
 
 	/* prepare server RR's for incremental lookup */
 	for(rp = qp->nsrp; rp; rp = rp->next)
 		rp->marker = 0;
 
-	rv = 0;				/* pessimism */
 	triedin = 0;
 
 	/*
@@ -1518,8 +1534,8 @@ netquery(Query *qp, int depth)
 //	if (rv == 0)		/* could ask /net.alt/dns directly */
 //		askoutdns(dp, qp->type);
 
-	if(lock)
-		qunlock(&dp->querylck[lcktype]);
+	if(lock && qlp)
+		decref(qlp);
 	return rv;
 }
 

+ 5 - 5
sys/src/cmd/ndb/dns.c

@@ -376,11 +376,11 @@ flushjob(int tag)
 void
 io(void)
 {
-	long n;
-	Mfile *mf;
-	uchar mdata[IOHDRSZ + Maxfdata];
-	Request req;
-	Job *job;
+	volatile long n;
+	volatile uchar mdata[IOHDRSZ + Maxfdata];
+	Job *volatile job;
+	Mfile *volatile mf;
+	volatile Request req;
 
 	memset(&req, 0, sizeof req);
 	/*

+ 14 - 5
sys/src/cmd/ndb/dns.h

@@ -1,3 +1,5 @@
+#include <thread.h>		/* for Ref */
+
 typedef struct Ndbtuple Ndbtuple;
 
 enum
@@ -179,6 +181,14 @@ struct Request
 	char	*from;		/* who asked us? */
 };
 
+typedef struct Querylck Querylck;
+struct Querylck
+{
+	QLock;
+//	Rendez;
+	Ref;
+};
+
 /*
  *  a domain name
  */
@@ -198,7 +208,7 @@ struct DN
 	uchar	respcode;	/* response code */
 /* was:	char	nonexistent; /* true if we get an authoritative nx for this domain */
 	/* permit only 1 query per (domain name, type) at a time */
-	QLock	querylck[Maxlcks];
+	Querylck querylck[Maxlcks];
 };
 
 /*
@@ -254,7 +264,7 @@ struct RR
 	RR	*next;
 	ulong	magic;
 	DN	*owner;		/* domain that owns this resource record */
-	uintptr	pc;
+	uintptr	pc;		/* for tracking memory allocation */
 	ulong	ttl;		/* time to live to be passed on */
 	ulong	expire;		/* time this entry expires locally */
 	ulong	marker;		/* used locally when scanning rrlists */
@@ -267,7 +277,7 @@ struct RR
 
 	union {			/* discriminated by negative & type */
 		DN	*negsoaowner;	/* soa for cached negative response */
-		DN	*host;	/* hostname - soa, cname, mb, md, mf, mx, ns */
+		DN	*host;	/* hostname - soa, cname, mb, md, mf, mx, ns, srv */
 		DN	*cpu;	/* cpu type - hinfo */
 		DN	*mb;	/* mailbox - mg, minfo */
 		DN	*ip;	/* ip address - a, aaaa */
@@ -281,6 +291,7 @@ struct RR
 		DN	*os;	/* operating system - hinfo */
 		ulong	pref;	/* preference value - mx */
 		ulong	local;	/* ns served from local database - ns */
+		ushort	port;	/* - srv */
 		uintptr	arg1;	/* arg[01] are compared to find dups in dn.c */
 	};
 	union {			/* discriminated by type */
@@ -325,8 +336,6 @@ struct Srv
 {
 	ushort	pri;
 	ushort	weight;
-	ushort	port;
-	DN	*target;
 };
 
 struct Rrlist

+ 1 - 2
sys/src/cmd/ndb/dnsdebug.c

@@ -186,8 +186,7 @@ prettyrrfmt(Fmt *f)
 		break;
 	case Tsrv:
 		seprint(p, e, "\t%ud %ud %ud %s",
-			rp->srv->pri, rp->srv->weight, rp->srv->port,
-			rp->srv->target->name);
+			rp->srv->pri, rp->srv->weight, rp->port, rp->host->name);
 		break;
 	case Tnull:
 		seprint(p, e, "\t%.*H", rp->null->dlen, rp->null->data);

+ 6 - 6
sys/src/cmd/ndb/dnstcp.c

@@ -38,12 +38,12 @@ usage(void)
 void
 main(int argc, char *argv[])
 {
-	int len, rcode;
-	char tname[32];
-	char *err, *ext = "";
-	uchar buf[64*1024], callip[IPaddrlen];
-	Request req;
-	DNSmsg reqmsg, repmsg;
+	volatile int len, rcode;
+	volatile char tname[32];
+	char *volatile err, *volatile ext = "";
+	volatile uchar buf[64*1024], callip[IPaddrlen];
+	volatile DNSmsg reqmsg, repmsg;
+	volatile Request req;
 
 	alarm(2*60*1000);
 	cfg.cachedb = 1;

+ 8 - 8
sys/src/cmd/ndb/dnudpserver.c

@@ -72,14 +72,14 @@ clientrxmit(DNSmsg *req, uchar *buf)
 void
 dnudpserver(char *mntpt)
 {
-	int fd, len, op, rcode;
-	uchar buf[Udphdrsize + Maxudp + 1024];
-	char *err;
-	char tname[32];
-	Request req;
-	DNSmsg reqmsg, repmsg;
-	Inprogress *p;
-	Udphdr *uh;
+	volatile int fd, len, op, rcode;
+	char *volatile err;
+	volatile char tname[32];
+	volatile uchar buf[Udphdrsize + Maxudp + 1024];
+	volatile DNSmsg reqmsg, repmsg;
+	Inprogress *volatile p;
+	volatile Request req;
+	Udphdr *volatile uh;
 
 	/* fork sharing text, data, and bss with parent */
 	switch(rfork(RFPROC|RFNOTEG|RFMEM|RFNOWAIT)){

+ 4 - 0
sys/src/cmd/sha1sum.c

@@ -28,6 +28,10 @@ sum(int fd, char *name)
 	s = sha1(nil, 0, nil, nil);
 	while((n = read(fd, buf, sizeof buf)) > 0)
 		sha1(buf, n, nil, s);
+	if(n < 0){
+		fprint(2, "reading %s: %r\n", name ? name : "stdin");
+		return;
+	}
 	sha1(nil, 0, digest, s);
 	if(name == nil)
 		print("%M\n", digest);

+ 6 - 4
sys/src/cmd/stats.c

@@ -32,7 +32,7 @@ enum
 	Maxmem,
 	Swap,
 	Maxswap,
-	
+
 	/* /dev/sysstats */
 	Procno	= 0,
 	Context,
@@ -470,7 +470,7 @@ filter(int fd)
 		close(fd);
 		close(p[0]);
 	}
-	return p[1];	
+	return p[1];
 }
 
 /*
@@ -530,14 +530,14 @@ old9p(int fd)
 		close(fd);
 		close(p[0]);
 	}
-	return p[1];	
+	return p[1];
 }
 
 
 /*
  * exportfs
  */
-int 
+int
 connectexportfs(char *addr)
 {
 	char buf[ERRMAX], dir[256], *na;
@@ -1361,6 +1361,8 @@ main(int argc, char *argv[])
 		parity = 1-parity;
 		for(i=0; i<nmach*ngraph; i++){
 			graph[i].newvalue(graph[i].mach, &v, &vmax, 0);
+			if (v > 1000000)
+				v = 1000000;	/* cap absurd values */
 			graph[i].update(&graph[i], v, vmax);
 		}
 		flushimage(display, 1);

+ 3 - 4
sys/src/libauth/auth_userpasswd.c

@@ -15,12 +15,11 @@ netresp(char *key, long chal, char *answer)
 {
 	uchar buf[8];
 
-	memset(buf, 0, 8);
-	sprint((char *)buf, "%lud", chal);
+	memset(buf, 0, sizeof buf);
+	snprint((char *)buf, sizeof buf, "%lud", chal);
 	if(encrypt(key, buf, 8) < 0)
 		abort();
-	chal = (buf[0]<<24)+(buf[1]<<16)+(buf[2]<<8)+buf[3];
-	sprint(answer, "%.8lux", chal);
+	sprint(answer, "%.8lux", buf[0]<<24 | buf[1]<<16 | buf[2]<<8 | buf[3]);
 }
 
 AuthInfo*

+ 4 - 0
sys/src/liboventi/plan9-io.c

@@ -25,6 +25,7 @@ vtMemAlloc(int size)
 	p = malloc(size);
 	if(p == 0)
 		vtFatal("vtMemAlloc: out of memory");
+	setmalloctag(p, getcallerpc(&size));
 	return p;
 }
 
@@ -33,6 +34,7 @@ vtMemAllocZ(int size)
 {
 	void *p = vtMemAlloc(size);
 	memset(p, 0, size);
+	setmalloctag(p, getcallerpc(&size));
 	return p;
 }
 
@@ -44,6 +46,7 @@ vtMemRealloc(void *p, int size)
 	p = realloc(p, size);
 	if(p == 0)
 		vtFatal("vtRealloc: out of memory");
+	setrealloctag(p, getcallerpc(&size));
 	return p;
 }
 
@@ -69,6 +72,7 @@ vtMemBrk(int n)
 	pad = (align - (uintptr)buf) & (align-1);
 	if(n + pad > nbuf) {
 		buf = vtMemAllocZ(ChunkSize);
+		setmalloctag(buf, getcallerpc(&n));
 		nbuf = ChunkSize;
 		pad = (align - (uintptr)buf) & (align-1);
 		nchunk++;

+ 1 - 0
sys/src/liboventi/plan9-thread.c

@@ -202,6 +202,7 @@ vtRendezAlloc(VtLock *p)
 
 	q = vtMemAllocZ(sizeof(VtRendez));
 	q->lk = p;
+	setmalloctag(q, getcallerpc(&p));
 	return q;
 }
 

+ 1 - 0
sys/src/liboventi/rpc.c

@@ -368,6 +368,7 @@ vtGetString(Packet *p, char **ret)
 		return 0;
 	}
 	s = vtMemAlloc(n+1);
+	setmalloctag(s, getcallerpc(&p));
 	if(!packetConsume(p, (uchar*)s, n)) {
 		vtMemFree(s);
 		return 0;

+ 1 - 0
sys/src/liboventi/server.c

@@ -13,6 +13,7 @@ vtServerAlloc(VtServerVtbl *vtbl)
 {
 	VtSession *z = vtAlloc();
 	z->vtbl = vtMemAlloc(sizeof(VtServerVtbl));
+	setmalloctag(z->vtbl, getcallerpc(&vtbl));
 	*z->vtbl = *vtbl;
 	return z;
 }

+ 1 - 0
sys/src/liboventi/strdup.c

@@ -13,6 +13,7 @@ vtStrDup(char *s)
 	n = strlen(s) + 1;
 	ss = vtMemAlloc(n);
 	memmove(ss, s, n);
+	setmalloctag(ss, getcallerpc(&s));
 	return ss;
 }