Browse Source

Plan 9 from Bell Labs 2007-03-02

David du Colombier 13 years ago
parent
commit
48295da6b9

+ 38 - 32
dist/replica/_plan9.db

@@ -19,7 +19,7 @@
 386/bin/8l - 775 sys sys 1148500567 115711
 386/bin/9660srv - 775 sys sys 1168402261 104975
 386/bin/aan - 775 sys sys 1168402261 131298
-386/bin/acid - 775 sys sys 1172203052 401181
+386/bin/acid - 775 sys sys 1172780590 402190
 386/bin/acme - 775 sys sys 1168402263 432256
 386/bin/ape - 20000000775 sys sys 1016944144 0
 386/bin/ape/basename - 775 sys sys 1136656314 132873
@@ -95,7 +95,7 @@
 386/bin/aux/cropmarks - 775 sys sys 1020319062 1808
 386/bin/aux/data2s - 775 sys sys 1168402278 60761
 386/bin/aux/depend - 775 sys sys 1168402279 146101
-386/bin/aux/disksim - 775 sys sys 1168402279 150825
+386/bin/aux/disksim - 775 sys sys 1172780591 150851
 386/bin/aux/download - 775 sys sys 1087442506 176016
 386/bin/aux/faxreceive - 775 sys sys 1168402279 84186
 386/bin/aux/faxsend - 775 sys sys 1168402280 89693
@@ -176,7 +176,7 @@
 386/bin/cat - 775 sys sys 1148500611 37482
 386/bin/cb - 775 sys sys 1168402293 77628
 386/bin/cdfs - 775 sys sys 1168402294 167435
-386/bin/cfs - 775 sys sys 1172175927 128780
+386/bin/cfs - 775 sys sys 1172780592 131665
 386/bin/chgrp - 775 sys sys 1168402294 59522
 386/bin/chmod - 775 sys sys 1168402294 62518
 386/bin/cifscmd - 775 sys sys 1169612022 343611
@@ -543,7 +543,7 @@
 386/lib/ape/libregexp.a - 664 sys sys 1143777857 47500
 386/lib/ape/libutf.a - 664 sys sys 1146156980 88500
 386/lib/ape/libv.a - 664 sys sys 1143777858 19668
-386/lib/lib9p.a - 664 sys sys 1168402362 90956
+386/lib/lib9p.a - 664 sys sys 1172780592 91012
 386/lib/libString.a - 664 sys sys 1168402362 22126
 386/lib/libauth.a - 664 sys sys 1171743876 58570
 386/lib/libauthsrv.a - 664 sys sys 1171830301 35838
@@ -5464,7 +5464,7 @@ rc/bin/kill - 775 sys sys 1143389260 142
 rc/bin/kmem - 775 sys sys 1141940177 468
 rc/bin/label - 775 sys sys 945617207 34
 rc/bin/lc - 775 sys sys 945617207 24
-rc/bin/leak - 775 sys sys 1139744263 1052
+rc/bin/leak - 775 sys sys 1172760642 1921
 rc/bin/lookman - 775 sys sys 1017679344 686
 rc/bin/lp - 775 sys sys 1162105982 5201
 rc/bin/mail - 775 sys sys 1045504003 138
@@ -5624,7 +5624,7 @@ sys/doc/8½/fig1.ps - 664 sys sys 1020895859 473747
 sys/doc/8½/mkfile - 664 sys sys 1138459303 214
 sys/doc/9.ms - 664 sys sys 1138396402 84662
 sys/doc/9.ps - 664 sys sys 960837924 508340
-sys/doc/acid.ms - 664 sys sys 1168701270 65160
+sys/doc/acid.ms - 664 sys sys 1172764379 65609
 sys/doc/acid.ps - 664 sys sys 1015012454 426359
 sys/doc/acidpaper.ms - 664 sys sys 1138396403 44851
 sys/doc/acidpaper.ps - 664 sys sys 960837913 359639
@@ -7339,7 +7339,7 @@ sys/man/1/jpg - 664 sys sys 1166760721 4841
 sys/man/1/kbmap - 664 sys sys 1159419894 846
 sys/man/1/kill - 664 sys sys 1018369246 1193
 sys/man/1/ktrace - 664 sys sys 957920006 1330
-sys/man/1/leak - 664 sys sys 1168893962 3457
+sys/man/1/leak - 664 sys sys 1172760642 4097
 sys/man/1/lens - 664 sys sys 1130425868 1272
 sys/man/1/lex - 664 sys sys 1113743328 1520
 sys/man/1/look - 664 sys sys 1113743326 1357
@@ -7615,7 +7615,7 @@ sys/man/4/INDEX.html - 664 sys sys 1141352366 5045
 sys/man/4/acme - 664 sys sys 1142172883 10392
 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 1015024813 1758
+sys/man/4/cfs - 664 sys sys 1172762903 1813
 sys/man/4/consolefs - 664 sys sys 1144424854 4245
 sys/man/4/dossrv - 664 sys sys 1168307403 4334
 sys/man/4/execnet - 664 sys sys 1019866708 1069
@@ -7648,7 +7648,7 @@ sys/man/4/tapefs - 664 sys sys 1140965924 1861
 sys/man/4/telco - 664 sys sys 1015024814 4359
 sys/man/4/u9fs - 664 sys sys 1043769139 4748
 sys/man/4/upasfs - 664 sys sys 1034348505 6212
-sys/man/4/usb - 664 sys sys 1167253879 4649
+sys/man/4/usb - 664 sys sys 1172764045 4682
 sys/man/4/usbd - 664 sys sys 1164149441 712
 sys/man/4/vacfs - 664 sys sys 1084333062 1545
 sys/man/4/webcookies - 664 sys sys 1019828742 3525
@@ -9321,12 +9321,12 @@ 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/acid - 20000000775 sys sys 1063859225 0
-sys/src/cmd/acid/acid.h - 664 sys sys 1131289460 4273
-sys/src/cmd/acid/builtin.c - 664 sys sys 1168034619 20982
-sys/src/cmd/acid/dbg.y - 664 sys sys 1131289463 5568
+sys/src/cmd/acid/acid.h - 664 sys sys 1172764379 4305
+sys/src/cmd/acid/builtin.c - 664 sys sys 1172764379 21752
+sys/src/cmd/acid/dbg.y - 664 sys sys 1172764472 5552
 sys/src/cmd/acid/dot.c - 664 sys sys 1131289462 2162
 sys/src/cmd/acid/exec.c - 664 sys sys 1132674180 8383
-sys/src/cmd/acid/expr.c - 664 sys sys 1168034614 15242
+sys/src/cmd/acid/expr.c - 664 sys sys 1172799792 15425
 sys/src/cmd/acid/lex.c - 664 sys sys 1131289460 7963
 sys/src/cmd/acid/list.c - 664 sys sys 1131289462 3680
 sys/src/cmd/acid/main.c - 664 sys sys 1143695038 8549
@@ -9477,7 +9477,7 @@ sys/src/cmd/astro/venust.c - 664 sys sys 944960761 739
 sys/src/cmd/auth - 20000000775 sys sys 1071334976 0
 sys/src/cmd/auth/asn12rsa.c - 664 sys sys 1048614959 1192
 sys/src/cmd/auth/authcmdlib.h - 664 sys sys 1155994851 1421
-sys/src/cmd/auth/authsrv.c - 664 sys sys 1143694958 18403
+sys/src/cmd/auth/authsrv.c - 664 sys sys 1172776678 18383
 sys/src/cmd/auth/challenge.c - 664 sys sys 1015008432 980
 sys/src/cmd/auth/changeuser.c - 664 sys sys 1155994851 2949
 sys/src/cmd/auth/convbio.c - 664 sys sys 1015008432 2212
@@ -9507,7 +9507,7 @@ sys/src/cmd/auth/factotum/secstore.c - 664 sys sys 1140272941 14955
 sys/src/cmd/auth/factotum/sshrsa.c - 664 sys sys 1107633793 3416
 sys/src/cmd/auth/factotum/util.c - 664 sys sys 1143694878 18460
 sys/src/cmd/auth/factotum/wep.c - 664 sys sys 1107706104 2140
-sys/src/cmd/auth/guard.srv.c - 664 sys sys 1143759354 2412
+sys/src/cmd/auth/guard.srv.c - 664 sys sys 1172776773 2873
 sys/src/cmd/auth/iam.c - 664 sys sys 1015008430 841
 sys/src/cmd/auth/keyfs.c - 664 sys sys 1140272942 17633
 sys/src/cmd/auth/lib - 20000000775 sys sys 1045504996 0
@@ -9522,7 +9522,7 @@ sys/src/cmd/auth/lib/netcheck.c - 664 sys sys 1155994850 2065
 sys/src/cmd/auth/lib/okpasswd.c - 664 sys sys 1155994850 707
 sys/src/cmd/auth/lib/querybio.c - 664 sys sys 1015008430 1344
 sys/src/cmd/auth/lib/rdbio.c - 664 sys sys 1015008430 958
-sys/src/cmd/auth/lib/readarg.c - 664 sys sys 1155994850 298
+sys/src/cmd/auth/lib/readarg.c - 664 sys sys 1172776607 311
 sys/src/cmd/auth/lib/readln.c - 664 sys sys 1155994851 2057
 sys/src/cmd/auth/lib/readn.c - 664 sys sys 1155994851 264
 sys/src/cmd/auth/lib/readwrite.c - 664 sys sys 1155994851 1441
@@ -9553,13 +9553,13 @@ sys/src/cmd/auth/secstore/dirls.c - 664 sys sys 1062277640 1842
 sys/src/cmd/auth/secstore/mkfile - 664 sys sys 1106577499 836
 sys/src/cmd/auth/secstore/pak.c - 664 sys sys 1140272943 9314
 sys/src/cmd/auth/secstore/password.c - 664 sys sys 1106577427 2929
-sys/src/cmd/auth/secstore/secchk.c - 664 sys sys 1055698993 560
+sys/src/cmd/auth/secstore/secchk.c - 664 sys sys 1172776633 565
 sys/src/cmd/auth/secstore/secstore.c - 664 sys sys 1143465894 12678
 sys/src/cmd/auth/secstore/secstore.h - 664 sys sys 1106575526 859
 sys/src/cmd/auth/secstore/secstored.c - 664 sys sys 1140272944 8087
 sys/src/cmd/auth/secstore/secuser.c - 664 sys sys 1143465899 5136
 sys/src/cmd/auth/secstore/util.c - 664 sys sys 1143694883 1741
-sys/src/cmd/auth/secureidcheck.c - 664 sys sys 1168307802 9787
+sys/src/cmd/auth/secureidcheck.c - 664 sys sys 1172776708 9914
 sys/src/cmd/auth/status - 775 sys sys 1015008430 738
 sys/src/cmd/auth/uniq.c - 664 sys sys 1140272945 1440
 sys/src/cmd/auth/userpasswd.c - 664 sys sys 1015008432 591
@@ -9886,14 +9886,14 @@ sys/src/cmd/cdfs/mmc.c - 664 sys sys 1146318348 17198
 sys/src/cmd/cfs - 20000000775 sys sys 1045505024 0
 sys/src/cmd/cfs/bcache.c - 664 sys sys 1172123361 2964
 sys/src/cmd/cfs/bcache.h - 664 sys sys 1014925220 797
-sys/src/cmd/cfs/cformat.h - 664 sys sys 1172125152 1400
-sys/src/cmd/cfs/cfs.c - 664 sys sys 1172123357 16567
-sys/src/cmd/cfs/disk.c - 664 sys sys 1172123358 5900
-sys/src/cmd/cfs/disk.h - 664 sys sys 1172123358 471
+sys/src/cmd/cfs/cformat.h - 664 sys sys 1172762903 1386
+sys/src/cmd/cfs/cfs.c - 664 sys sys 1172801081 17100
+sys/src/cmd/cfs/disk.c - 664 sys sys 1172801077 6106
+sys/src/cmd/cfs/disk.h - 664 sys sys 1172762904 482
 sys/src/cmd/cfs/file.c - 664 sys sys 1172123358 5088
 sys/src/cmd/cfs/file.h - 664 sys sys 944960876 225
-sys/src/cmd/cfs/inode.c - 664 sys sys 1172123357 6939
-sys/src/cmd/cfs/inode.h - 664 sys sys 944960876 1145
+sys/src/cmd/cfs/inode.c - 664 sys sys 1172762904 6963
+sys/src/cmd/cfs/inode.h - 664 sys sys 1172762905 1152
 sys/src/cmd/cfs/lru.c - 664 sys sys 944960876 1013
 sys/src/cmd/cfs/lru.h - 664 sys sys 944960876 197
 sys/src/cmd/cfs/mkfile - 664 sys sys 1032457443 663
@@ -10170,7 +10170,7 @@ sys/src/cmd/fax/receiverc - 775 sys sys 944960990 581
 sys/src/cmd/fax/send.c - 664 sys sys 944960990 923
 sys/src/cmd/fax/subr.c - 664 sys sys 1015090401 1245
 sys/src/cmd/fcp.c - 664 sys sys 1136651872 3799
-sys/src/cmd/file.c - 664 sys sys 1166761867 28088
+sys/src/cmd/file.c - 664 sys sys 1172764226 28088
 sys/src/cmd/fmt.c - 664 sys sys 1137603598 4078
 sys/src/cmd/fortune.c - 664 sys sys 1072729222 1779
 sys/src/cmd/fossil - 20000000775 sys sys 1087005595 0
@@ -12269,7 +12269,7 @@ sys/src/cmd/gzip/zip.h - 664 sys sys 954778719 1428
 sys/src/cmd/hget.c - 664 sys sys 1161442159 25962
 sys/src/cmd/history.c - 664 sys sys 1136378274 6098
 sys/src/cmd/hoc - 20000000775 sys sys 1039727559 0
-sys/src/cmd/hoc/code.c - 664 sys sys 1172257358 10061
+sys/src/cmd/hoc/code.c - 664 sys sys 1172800014 10063
 sys/src/cmd/hoc/hoc.h - 664 sys sys 944960999 2358
 sys/src/cmd/hoc/hoc.y - 664 sys sys 1155364037 9666
 sys/src/cmd/hoc/init.c - 664 sys sys 944960999 1441
@@ -14108,12 +14108,12 @@ sys/src/cmd/upas/vf/mkfile - 664 sys sys 1064393881 241
 sys/src/cmd/upas/vf/vf.c - 664 sys sys 1143759341 20030
 sys/src/cmd/usb - 20000000775 sys sys 1091205029 0
 sys/src/cmd/usb/audio - 20000000775 sys sys 1091204980 0
-sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1143759340 18169
-sys/src/cmd/usb/audio/audiosub.c - 664 sys sys 1140695061 8085
+sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1172764045 18191
+sys/src/cmd/usb/audio/audiosub.c - 664 sys sys 1172764044 8275
 sys/src/cmd/usb/audio/mkfile - 664 sys sys 1091204980 349
-sys/src/cmd/usb/audio/usbaudio.c - 664 sys sys 1140695061 10155
+sys/src/cmd/usb/audio/usbaudio.c - 664 sys sys 1172764045 10358
 sys/src/cmd/usb/audio/usbaudio.h - 664 sys sys 1140695062 1889
-sys/src/cmd/usb/audio/usbaudioctl.c - 664 sys sys 1140695062 18245
+sys/src/cmd/usb/audio/usbaudioctl.c - 664 sys sys 1172764044 18825
 sys/src/cmd/usb/audio/usbaudioctl.h - 664 sys sys 1140695062 618
 sys/src/cmd/usb/lib - 20000000775 sys sys 1091204979 0
 sys/src/cmd/usb/lib/device.c - 664 sys sys 1168308464 3284
@@ -14320,7 +14320,7 @@ sys/src/cmd/webfs/cookies.c - 664 sys sys 1128664611 21888
 sys/src/cmd/webfs/dat.h - 664 sys sys 1128664462 1621
 sys/src/cmd/webfs/fns.h - 664 sys sys 1032665987 1453
 sys/src/cmd/webfs/fs.c - 664 sys sys 1128664603 10944
-sys/src/cmd/webfs/http.c - 664 sys sys 1161484900 10381
+sys/src/cmd/webfs/http.c - 664 sys sys 1172759957 10408
 sys/src/cmd/webfs/io.c - 664 sys sys 1034736588 1384
 sys/src/cmd/webfs/main.c - 664 sys sys 1128664462 1083
 sys/src/cmd/webfs/mkfile - 664 sys sys 1032665986 340
@@ -14585,7 +14585,7 @@ sys/src/lib9p/intmap.c - 664 sys sys 1016833881 2255
 sys/src/lib9p/listen.c - 664 sys sys 1134335266 1626
 sys/src/lib9p/mem.c - 664 sys sys 1015023310 765
 sys/src/lib9p/mkfile - 664 sys sys 1134337555 387
-sys/src/lib9p/parse.c - 664 sys sys 1032324435 2050
+sys/src/lib9p/parse.c - 664 sys sys 1172760149 2089
 sys/src/lib9p/post.c - 664 sys sys 1134346047 1559
 sys/src/lib9p/ramfs.c - 664 sys sys 1134335266 2657
 sys/src/lib9p/req.c - 664 sys sys 1089299187 1652
@@ -15685,3 +15685,9 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/acid - 775 sys sys 1172808055 401961
+386/bin/cfs - 775 sys sys 1172808057 131665
+386/bin/hoc - 775 sys sys 1172808058 100101
+386/bin/auth/authsrv - 775 sys sys 1172808056 166692
+386/bin/auth/guard.srv - 775 sys sys 1172808056 145120
+386/bin/auth/secstored - 775 sys sys 1172808057 198043

+ 36 - 36
dist/replica/plan9.db

@@ -19,7 +19,7 @@
 386/bin/8l - 775 sys sys 1148500567 115711
 386/bin/9660srv - 775 sys sys 1168402261 104975
 386/bin/aan - 775 sys sys 1168402261 131298
-386/bin/acid - 775 sys sys 1172203052 401181
+386/bin/acid - 775 sys sys 1172808055 401961
 386/bin/acme - 775 sys sys 1168402263 432256
 386/bin/ape - 20000000775 sys sys 1016944144 0
 386/bin/ape/basename - 775 sys sys 1136656314 132873
@@ -45,7 +45,7 @@
 386/bin/auth - 20000000775 sys sys 1016920815 0
 386/bin/auth/aescbc - 775 sys sys 1171830297 141337
 386/bin/auth/asn12rsa - 775 sys sys 1168402266 120828
-386/bin/auth/authsrv - 775 sys sys 1169612018 166651
+386/bin/auth/authsrv - 775 sys sys 1172808056 166692
 386/bin/auth/changeuser - 775 sys sys 1168402267 97488
 386/bin/auth/convkeys - 775 sys sys 1171830297 88680
 386/bin/auth/convkeys2 - 775 sys sys 1171830297 88739
@@ -55,7 +55,7 @@
 386/bin/auth/enable - 775 sys sys 1020319057 134
 386/bin/auth/factotum - 775 sys sys 1171830298 322644
 386/bin/auth/fgui - 775 sys sys 1168402269 218990
-386/bin/auth/guard.srv - 775 sys sys 1169612018 143828
+386/bin/auth/guard.srv - 775 sys sys 1172808056 145120
 386/bin/auth/iam - 775 sys sys 1085076981 50791
 386/bin/auth/keyfs - 775 sys sys 1171830298 116576
 386/bin/auth/login - 775 sys sys 1168402270 104747
@@ -72,7 +72,7 @@
 386/bin/auth/rsagen - 775 sys sys 1168402273 153528
 386/bin/auth/secretpem - 775 sys sys 1045537944 118526
 386/bin/auth/secstore - 775 sys sys 1171830299 196463
-386/bin/auth/secstored - 775 sys sys 1169612019 198002
+386/bin/auth/secstored - 775 sys sys 1172808057 198043
 386/bin/auth/secuser - 775 sys sys 1168402275 153231
 386/bin/auth/status - 775 sys sys 1020319060 738
 386/bin/auth/uniq - 775 sys sys 1168402275 63314
@@ -95,7 +95,7 @@
 386/bin/aux/cropmarks - 775 sys sys 1020319062 1808
 386/bin/aux/data2s - 775 sys sys 1168402278 60761
 386/bin/aux/depend - 775 sys sys 1168402279 146101
-386/bin/aux/disksim - 775 sys sys 1168402279 150825
+386/bin/aux/disksim - 775 sys sys 1172780591 150851
 386/bin/aux/download - 775 sys sys 1087442506 176016
 386/bin/aux/faxreceive - 775 sys sys 1168402279 84186
 386/bin/aux/faxsend - 775 sys sys 1168402280 89693
@@ -176,7 +176,7 @@
 386/bin/cat - 775 sys sys 1148500611 37482
 386/bin/cb - 775 sys sys 1168402293 77628
 386/bin/cdfs - 775 sys sys 1168402294 167435
-386/bin/cfs - 775 sys sys 1172175927 128780
+386/bin/cfs - 775 sys sys 1172808057 131665
 386/bin/chgrp - 775 sys sys 1168402294 59522
 386/bin/chmod - 775 sys sys 1168402294 62518
 386/bin/cifscmd - 775 sys sys 1169612022 343611
@@ -274,7 +274,7 @@
 386/bin/hayes - 775 sys sys 1168402314 64793
 386/bin/hget - 775 sys sys 1169612024 233943
 386/bin/history - 775 sys sys 1168402314 75705
-386/bin/hoc - 775 sys sys 1172289653 100101
+386/bin/hoc - 775 sys sys 1172808058 100101
 386/bin/html2ms - 775 sys sys 1168402315 66321
 386/bin/htmlfmt - 775 sys sys 1168402315 163476
 386/bin/htmlroff - 775 sys sys 1168402315 148450
@@ -543,7 +543,7 @@
 386/lib/ape/libregexp.a - 664 sys sys 1143777857 47500
 386/lib/ape/libutf.a - 664 sys sys 1146156980 88500
 386/lib/ape/libv.a - 664 sys sys 1143777858 19668
-386/lib/lib9p.a - 664 sys sys 1168402362 90956
+386/lib/lib9p.a - 664 sys sys 1172780592 91012
 386/lib/libString.a - 664 sys sys 1168402362 22126
 386/lib/libauth.a - 664 sys sys 1171743876 58570
 386/lib/libauthsrv.a - 664 sys sys 1171830301 35838
@@ -5464,7 +5464,7 @@ rc/bin/kill - 775 sys sys 1143389260 142
 rc/bin/kmem - 775 sys sys 1141940177 468
 rc/bin/label - 775 sys sys 945617207 34
 rc/bin/lc - 775 sys sys 945617207 24
-rc/bin/leak - 775 sys sys 1139744263 1052
+rc/bin/leak - 775 sys sys 1172760642 1921
 rc/bin/lookman - 775 sys sys 1017679344 686
 rc/bin/lp - 775 sys sys 1162105982 5201
 rc/bin/mail - 775 sys sys 1045504003 138
@@ -5624,7 +5624,7 @@ sys/doc/8½/fig1.ps - 664 sys sys 1020895859 473747
 sys/doc/8½/mkfile - 664 sys sys 1138459303 214
 sys/doc/9.ms - 664 sys sys 1138396402 84662
 sys/doc/9.ps - 664 sys sys 960837924 508340
-sys/doc/acid.ms - 664 sys sys 1168701270 65160
+sys/doc/acid.ms - 664 sys sys 1172764379 65609
 sys/doc/acid.ps - 664 sys sys 1015012454 426359
 sys/doc/acidpaper.ms - 664 sys sys 1138396403 44851
 sys/doc/acidpaper.ps - 664 sys sys 960837913 359639
@@ -7339,7 +7339,7 @@ sys/man/1/jpg - 664 sys sys 1166760721 4841
 sys/man/1/kbmap - 664 sys sys 1159419894 846
 sys/man/1/kill - 664 sys sys 1018369246 1193
 sys/man/1/ktrace - 664 sys sys 957920006 1330
-sys/man/1/leak - 664 sys sys 1168893962 3457
+sys/man/1/leak - 664 sys sys 1172760642 4097
 sys/man/1/lens - 664 sys sys 1130425868 1272
 sys/man/1/lex - 664 sys sys 1113743328 1520
 sys/man/1/look - 664 sys sys 1113743326 1357
@@ -7615,7 +7615,7 @@ sys/man/4/INDEX.html - 664 sys sys 1141352366 5045
 sys/man/4/acme - 664 sys sys 1142172883 10392
 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 1015024813 1758
+sys/man/4/cfs - 664 sys sys 1172762903 1813
 sys/man/4/consolefs - 664 sys sys 1144424854 4245
 sys/man/4/dossrv - 664 sys sys 1168307403 4334
 sys/man/4/execnet - 664 sys sys 1019866708 1069
@@ -7648,7 +7648,7 @@ sys/man/4/tapefs - 664 sys sys 1140965924 1861
 sys/man/4/telco - 664 sys sys 1015024814 4359
 sys/man/4/u9fs - 664 sys sys 1043769139 4748
 sys/man/4/upasfs - 664 sys sys 1034348505 6212
-sys/man/4/usb - 664 sys sys 1167253879 4649
+sys/man/4/usb - 664 sys sys 1172764045 4682
 sys/man/4/usbd - 664 sys sys 1164149441 712
 sys/man/4/vacfs - 664 sys sys 1084333062 1545
 sys/man/4/webcookies - 664 sys sys 1019828742 3525
@@ -9321,12 +9321,12 @@ 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/acid - 20000000775 sys sys 1063859225 0
-sys/src/cmd/acid/acid.h - 664 sys sys 1131289460 4273
-sys/src/cmd/acid/builtin.c - 664 sys sys 1168034619 20982
-sys/src/cmd/acid/dbg.y - 664 sys sys 1131289463 5568
+sys/src/cmd/acid/acid.h - 664 sys sys 1172764379 4305
+sys/src/cmd/acid/builtin.c - 664 sys sys 1172764379 21752
+sys/src/cmd/acid/dbg.y - 664 sys sys 1172764472 5552
 sys/src/cmd/acid/dot.c - 664 sys sys 1131289462 2162
 sys/src/cmd/acid/exec.c - 664 sys sys 1132674180 8383
-sys/src/cmd/acid/expr.c - 664 sys sys 1168034614 15242
+sys/src/cmd/acid/expr.c - 664 sys sys 1172799792 15425
 sys/src/cmd/acid/lex.c - 664 sys sys 1131289460 7963
 sys/src/cmd/acid/list.c - 664 sys sys 1131289462 3680
 sys/src/cmd/acid/main.c - 664 sys sys 1143695038 8549
@@ -9477,7 +9477,7 @@ sys/src/cmd/astro/venust.c - 664 sys sys 944960761 739
 sys/src/cmd/auth - 20000000775 sys sys 1071334976 0
 sys/src/cmd/auth/asn12rsa.c - 664 sys sys 1048614959 1192
 sys/src/cmd/auth/authcmdlib.h - 664 sys sys 1155994851 1421
-sys/src/cmd/auth/authsrv.c - 664 sys sys 1143694958 18403
+sys/src/cmd/auth/authsrv.c - 664 sys sys 1172776678 18383
 sys/src/cmd/auth/challenge.c - 664 sys sys 1015008432 980
 sys/src/cmd/auth/changeuser.c - 664 sys sys 1155994851 2949
 sys/src/cmd/auth/convbio.c - 664 sys sys 1015008432 2212
@@ -9507,7 +9507,7 @@ sys/src/cmd/auth/factotum/secstore.c - 664 sys sys 1140272941 14955
 sys/src/cmd/auth/factotum/sshrsa.c - 664 sys sys 1107633793 3416
 sys/src/cmd/auth/factotum/util.c - 664 sys sys 1143694878 18460
 sys/src/cmd/auth/factotum/wep.c - 664 sys sys 1107706104 2140
-sys/src/cmd/auth/guard.srv.c - 664 sys sys 1143759354 2412
+sys/src/cmd/auth/guard.srv.c - 664 sys sys 1172776773 2873
 sys/src/cmd/auth/iam.c - 664 sys sys 1015008430 841
 sys/src/cmd/auth/keyfs.c - 664 sys sys 1140272942 17633
 sys/src/cmd/auth/lib - 20000000775 sys sys 1045504996 0
@@ -9522,7 +9522,7 @@ sys/src/cmd/auth/lib/netcheck.c - 664 sys sys 1155994850 2065
 sys/src/cmd/auth/lib/okpasswd.c - 664 sys sys 1155994850 707
 sys/src/cmd/auth/lib/querybio.c - 664 sys sys 1015008430 1344
 sys/src/cmd/auth/lib/rdbio.c - 664 sys sys 1015008430 958
-sys/src/cmd/auth/lib/readarg.c - 664 sys sys 1155994850 298
+sys/src/cmd/auth/lib/readarg.c - 664 sys sys 1172776607 311
 sys/src/cmd/auth/lib/readln.c - 664 sys sys 1155994851 2057
 sys/src/cmd/auth/lib/readn.c - 664 sys sys 1155994851 264
 sys/src/cmd/auth/lib/readwrite.c - 664 sys sys 1155994851 1441
@@ -9553,13 +9553,13 @@ sys/src/cmd/auth/secstore/dirls.c - 664 sys sys 1062277640 1842
 sys/src/cmd/auth/secstore/mkfile - 664 sys sys 1106577499 836
 sys/src/cmd/auth/secstore/pak.c - 664 sys sys 1140272943 9314
 sys/src/cmd/auth/secstore/password.c - 664 sys sys 1106577427 2929
-sys/src/cmd/auth/secstore/secchk.c - 664 sys sys 1055698993 560
+sys/src/cmd/auth/secstore/secchk.c - 664 sys sys 1172776633 565
 sys/src/cmd/auth/secstore/secstore.c - 664 sys sys 1143465894 12678
 sys/src/cmd/auth/secstore/secstore.h - 664 sys sys 1106575526 859
 sys/src/cmd/auth/secstore/secstored.c - 664 sys sys 1140272944 8087
 sys/src/cmd/auth/secstore/secuser.c - 664 sys sys 1143465899 5136
 sys/src/cmd/auth/secstore/util.c - 664 sys sys 1143694883 1741
-sys/src/cmd/auth/secureidcheck.c - 664 sys sys 1168307802 9787
+sys/src/cmd/auth/secureidcheck.c - 664 sys sys 1172776708 9914
 sys/src/cmd/auth/status - 775 sys sys 1015008430 738
 sys/src/cmd/auth/uniq.c - 664 sys sys 1140272945 1440
 sys/src/cmd/auth/userpasswd.c - 664 sys sys 1015008432 591
@@ -9886,14 +9886,14 @@ sys/src/cmd/cdfs/mmc.c - 664 sys sys 1146318348 17198
 sys/src/cmd/cfs - 20000000775 sys sys 1045505024 0
 sys/src/cmd/cfs/bcache.c - 664 sys sys 1172123361 2964
 sys/src/cmd/cfs/bcache.h - 664 sys sys 1014925220 797
-sys/src/cmd/cfs/cformat.h - 664 sys sys 1172125152 1400
-sys/src/cmd/cfs/cfs.c - 664 sys sys 1172123357 16567
-sys/src/cmd/cfs/disk.c - 664 sys sys 1172123358 5900
-sys/src/cmd/cfs/disk.h - 664 sys sys 1172123358 471
+sys/src/cmd/cfs/cformat.h - 664 sys sys 1172762903 1386
+sys/src/cmd/cfs/cfs.c - 664 sys sys 1172801081 17100
+sys/src/cmd/cfs/disk.c - 664 sys sys 1172801077 6106
+sys/src/cmd/cfs/disk.h - 664 sys sys 1172762904 482
 sys/src/cmd/cfs/file.c - 664 sys sys 1172123358 5088
 sys/src/cmd/cfs/file.h - 664 sys sys 944960876 225
-sys/src/cmd/cfs/inode.c - 664 sys sys 1172123357 6939
-sys/src/cmd/cfs/inode.h - 664 sys sys 944960876 1145
+sys/src/cmd/cfs/inode.c - 664 sys sys 1172762904 6963
+sys/src/cmd/cfs/inode.h - 664 sys sys 1172762905 1152
 sys/src/cmd/cfs/lru.c - 664 sys sys 944960876 1013
 sys/src/cmd/cfs/lru.h - 664 sys sys 944960876 197
 sys/src/cmd/cfs/mkfile - 664 sys sys 1032457443 663
@@ -10170,7 +10170,7 @@ sys/src/cmd/fax/receiverc - 775 sys sys 944960990 581
 sys/src/cmd/fax/send.c - 664 sys sys 944960990 923
 sys/src/cmd/fax/subr.c - 664 sys sys 1015090401 1245
 sys/src/cmd/fcp.c - 664 sys sys 1136651872 3799
-sys/src/cmd/file.c - 664 sys sys 1166761867 28088
+sys/src/cmd/file.c - 664 sys sys 1172764226 28088
 sys/src/cmd/fmt.c - 664 sys sys 1137603598 4078
 sys/src/cmd/fortune.c - 664 sys sys 1072729222 1779
 sys/src/cmd/fossil - 20000000775 sys sys 1087005595 0
@@ -12269,7 +12269,7 @@ sys/src/cmd/gzip/zip.h - 664 sys sys 954778719 1428
 sys/src/cmd/hget.c - 664 sys sys 1161442159 25962
 sys/src/cmd/history.c - 664 sys sys 1136378274 6098
 sys/src/cmd/hoc - 20000000775 sys sys 1039727559 0
-sys/src/cmd/hoc/code.c - 664 sys sys 1172257358 10061
+sys/src/cmd/hoc/code.c - 664 sys sys 1172800014 10063
 sys/src/cmd/hoc/hoc.h - 664 sys sys 944960999 2358
 sys/src/cmd/hoc/hoc.y - 664 sys sys 1155364037 9666
 sys/src/cmd/hoc/init.c - 664 sys sys 944960999 1441
@@ -14108,12 +14108,12 @@ sys/src/cmd/upas/vf/mkfile - 664 sys sys 1064393881 241
 sys/src/cmd/upas/vf/vf.c - 664 sys sys 1143759341 20030
 sys/src/cmd/usb - 20000000775 sys sys 1091205029 0
 sys/src/cmd/usb/audio - 20000000775 sys sys 1091204980 0
-sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1143759340 18169
-sys/src/cmd/usb/audio/audiosub.c - 664 sys sys 1140695061 8085
+sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1172764045 18191
+sys/src/cmd/usb/audio/audiosub.c - 664 sys sys 1172764044 8275
 sys/src/cmd/usb/audio/mkfile - 664 sys sys 1091204980 349
-sys/src/cmd/usb/audio/usbaudio.c - 664 sys sys 1140695061 10155
+sys/src/cmd/usb/audio/usbaudio.c - 664 sys sys 1172764045 10358
 sys/src/cmd/usb/audio/usbaudio.h - 664 sys sys 1140695062 1889
-sys/src/cmd/usb/audio/usbaudioctl.c - 664 sys sys 1140695062 18245
+sys/src/cmd/usb/audio/usbaudioctl.c - 664 sys sys 1172764044 18825
 sys/src/cmd/usb/audio/usbaudioctl.h - 664 sys sys 1140695062 618
 sys/src/cmd/usb/lib - 20000000775 sys sys 1091204979 0
 sys/src/cmd/usb/lib/device.c - 664 sys sys 1168308464 3284
@@ -14320,7 +14320,7 @@ sys/src/cmd/webfs/cookies.c - 664 sys sys 1128664611 21888
 sys/src/cmd/webfs/dat.h - 664 sys sys 1128664462 1621
 sys/src/cmd/webfs/fns.h - 664 sys sys 1032665987 1453
 sys/src/cmd/webfs/fs.c - 664 sys sys 1128664603 10944
-sys/src/cmd/webfs/http.c - 664 sys sys 1161484900 10381
+sys/src/cmd/webfs/http.c - 664 sys sys 1172759957 10408
 sys/src/cmd/webfs/io.c - 664 sys sys 1034736588 1384
 sys/src/cmd/webfs/main.c - 664 sys sys 1128664462 1083
 sys/src/cmd/webfs/mkfile - 664 sys sys 1032665986 340
@@ -14585,7 +14585,7 @@ sys/src/lib9p/intmap.c - 664 sys sys 1016833881 2255
 sys/src/lib9p/listen.c - 664 sys sys 1134335266 1626
 sys/src/lib9p/mem.c - 664 sys sys 1015023310 765
 sys/src/lib9p/mkfile - 664 sys sys 1134337555 387
-sys/src/lib9p/parse.c - 664 sys sys 1032324435 2050
+sys/src/lib9p/parse.c - 664 sys sys 1172760149 2089
 sys/src/lib9p/post.c - 664 sys sys 1134346047 1559
 sys/src/lib9p/ramfs.c - 664 sys sys 1134335266 2657
 sys/src/lib9p/req.c - 664 sys sys 1089299187 1652

+ 41 - 0
dist/replica/plan9.log

@@ -47568,3 +47568,44 @@
 1172680206 3 c sys/src/fs/emelie/fns.h - 664 sys sys 1172679929 2168
 1172680206 4 c sys/src/fs/fs/fns.h - 664 sys sys 1172679929 2168
 1172680206 5 c sys/src/fs/fs64/fns.h - 664 sys sys 1172679929 2330
+1172761206 0 c rc/bin/leak - 775 sys sys 1172760642 1921
+1172761206 1 c sys/man/1/leak - 664 sys sys 1172760642 4097
+1172761206 2 c sys/src/cmd/webfs/http.c - 664 sys sys 1172759957 10408
+1172761206 3 c sys/src/lib9p/parse.c - 664 sys sys 1172760149 2089
+1172763005 0 c sys/man/4/cfs - 664 sys sys 1172762903 1813
+1172763005 1 c sys/src/cmd/cfs/cformat.h - 664 sys sys 1172762903 1386
+1172763005 2 c sys/src/cmd/cfs/cfs.c - 664 sys sys 1172762904 17108
+1172763005 3 c sys/src/cmd/cfs/disk.c - 664 sys sys 1172762904 6213
+1172763005 4 c sys/src/cmd/cfs/disk.h - 664 sys sys 1172762904 482
+1172763005 5 c sys/src/cmd/cfs/inode.c - 664 sys sys 1172762904 6963
+1172763005 6 c sys/src/cmd/cfs/inode.h - 664 sys sys 1172762905 1152
+1172764806 0 c sys/doc/acid.ms - 664 sys sys 1172764379 65609
+1172764806 1 c sys/man/4/usb - 664 sys sys 1172764045 4682
+1172764806 2 c sys/src/cmd/acid/acid.h - 664 sys sys 1172764379 4305
+1172764806 3 c sys/src/cmd/acid/builtin.c - 664 sys sys 1172764379 21752
+1172764806 4 c sys/src/cmd/acid/dbg.y - 664 sys sys 1172764472 5552
+1172764806 5 c sys/src/cmd/acid/expr.c - 664 sys sys 1172764472 15694
+1172764806 6 c sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1172764045 18191
+1172764806 7 c sys/src/cmd/usb/audio/audiosub.c - 664 sys sys 1172764044 8275
+1172764806 8 c sys/src/cmd/usb/audio/usbaudio.c - 664 sys sys 1172764045 10358
+1172764806 9 c sys/src/cmd/usb/audio/usbaudioctl.c - 664 sys sys 1172764044 18825
+1172764806 10 c sys/src/cmd/file.c - 664 sys sys 1172764226 28088
+1172777407 0 c sys/src/cmd/auth/authsrv.c - 664 sys sys 1172776678 18383
+1172777407 1 c sys/src/cmd/auth/guard.srv.c - 664 sys sys 1172776773 2873
+1172777407 2 c sys/src/cmd/auth/lib/readarg.c - 664 sys sys 1172776607 311
+1172777407 3 c sys/src/cmd/auth/secstore/secchk.c - 664 sys sys 1172776633 565
+1172777407 4 c sys/src/cmd/auth/secureidcheck.c - 664 sys sys 1172776708 9914
+1172781006 0 c 386/bin/acid - 775 sys sys 1172780590 402190
+1172781006 1 c 386/bin/cfs - 775 sys sys 1172780592 131665
+1172781006 2 c 386/bin/aux/disksim - 775 sys sys 1172780591 150851
+1172781006 3 c 386/lib/lib9p.a - 664 sys sys 1172780592 91012
+1172800806 0 c sys/src/cmd/acid/expr.c - 664 sys sys 1172799792 15425
+1172800806 1 c sys/src/cmd/hoc/code.c - 664 sys sys 1172800014 10063
+1172802606 0 c sys/src/cmd/cfs/cfs.c - 664 sys sys 1172801081 17100
+1172802606 1 c sys/src/cmd/cfs/disk.c - 664 sys sys 1172801077 6106
+1172809806 0 c 386/bin/acid - 775 sys sys 1172808055 401961
+1172809806 1 c 386/bin/cfs - 775 sys sys 1172808057 131665
+1172809806 2 c 386/bin/hoc - 775 sys sys 1172808058 100101
+1172809806 3 c 386/bin/auth/authsrv - 775 sys sys 1172808056 166692
+1172809806 4 c 386/bin/auth/guard.srv - 775 sys sys 1172808056 145120
+1172809806 5 c 386/bin/auth/secstored - 775 sys sys 1172808057 198043

+ 55 - 14
rc/bin/leak

@@ -2,21 +2,28 @@
 
 rfork e
 
-flagfmt='b,s,f binary,r res,x width'
+flagfmt='a,b,c,d,s,f binary,r res,x width'
 args='name | pid list'
 if(! ifs=() eval `{aux/getflags $*} || ~ $#* 0){
 	aux/usage
 	exit usage
 }
 
-if(~ $#flags 1 && ~ $#flagb 1){
-	echo 'cannot use both -b and -s' >[1=2]
+conflicting=($flagb $flagc $flags)
+if(~ $#conflicting 2 || ~ $#conflicting 3){
+	echo 'can only use one of -b, -c or -s' >[1=2]
 	exit usage
 }
 
 leakflags=()
 if(~ $#flags 1)
 	leakflags=($leakflags -s)
+if(~ $#flaga 1)
+	leakflags=($leakflags -a)
+if(~ $#flagc 1)
+	leakflags=($leakflags -c)
+if(~ $#flagd 1)
+	leakflags=($leakflags -d)
 if(~ $#flagf 1)
 	leakflags=($leakflags -f $flagf)
 
@@ -41,14 +48,48 @@ if(! test -d /proc/$1) {
 
 pidlist=`{echo $"* | tr ' ' ,}
 
-echo 'leakdump({'$pidlist'})' | 
-	acid -lpool -lleak $1 $flagf | 
-	aux/acidleak $acidleakflags $flagf |
-	{
-		if(~ $#flags 1)
-			awk '{print $4}' |
-				sort | uniq -c | sort -nr |
-				sed 's! *(.*) (0x.*)!src(\2); // \1!'
-		if not
-			cat
-	}
+echo 'leakdump({'$pidlist'})' | acid -lpool -lleak $1 $flagf | 
+{
+	if(~ $#flaga 1 && ~ $#flagd 1)
+		grep 'block|free'
+	if not
+	if(~ $#flaga 1)
+		grep block
+	if not
+	if(~ $#flagd 1)
+		grep free 
+	if not
+		aux/acidleak $acidleakflags $flagf
+} |
+{
+	if(~ $#flags 1)
+		awk '{print $4}' |
+			sort | uniq -c | sort -nr |
+			sed 's! *(.*) (0x.*)!src(\2); // \1!'
+	if not
+	if(~ $#flagc 1)
+		awk 'BEGIN {
+				for(i=0; i<16; i++)
+					_unhex[sprintf("%x", i)] = _unhex[sprintf("%X", i)] = i
+			}
+			function unhex(s, i, v) {
+				sub("^0[xX]0*","",s)
+				for (i=1; i<=length(s); i++)
+					v = v*16 + _unhex[substr(s,i,1)]
+				return v
+			}
+			{	sum[$4] += unhex($3);
+				count[$4]++;
+				alloc[$4] = $6;
+			}
+			END {
+				for (v in sum) {
+					printf("src(%s);\t// %d\t%d\t%d\t%s\n", v, sum[v], count[v], sum[v] / count[v], alloc[v])
+					total += sum[v]
+				}
+				printf("// %d\n", total);
+			}
+		'  | sort -nr +2
+	if not
+		cat
+}	

+ 32 - 0
sys/doc/acid.ms

@@ -1202,6 +1202,38 @@ acid: print(main\eX, "\et", *main)
 .\"
 .\"
 .\"
+.Ip fmt fmtof item "Get format
+.CW fmtof
+evaluates the expression
+.I item
+and returns the format of the result.
+.Ex
+acid: +fmtof(33)
+W
+acid: +fmtof("string")
+s
+.Ee
+.\"
+.\"
+.\"
+.Ip integer fmtsize item "Get format size
+.CW fmtsize
+evaluates the expression
+.I item
+and returns the size in bytes of a single element of result's format.
+.Ex
+acid: +fmtsize('c')
+8
+acid: +fmtsize('c'\ec)
+1
+acid: +fmtsize(0\eX)
+4
+acid: +fmtsize('c'\e3)
+10
+.Ee
+.\"
+.\"
+.\"
 .Ip list fnbound integer "Find start and end address of a function
 .CW fnbound
 interprets its

+ 37 - 4
sys/man/1/leak

@@ -4,7 +4,7 @@ leak, kmem \- help find memory leaks
 .SH SYNOPSIS
 .B leak
 [
-.B -bs
+.B -abcds
 ]
 [
 .B -f
@@ -37,12 +37,13 @@ the shared bss segment as well as each process's registers.
 .PP
 Unless directed otherwise,
 .I leak
-prints, for each block, a line with five space-separated fields:
+prints, for each block, a line with seven space-separated fields:
 the string
 .BR block ,
 the address of the block,
 the size of the block, 
-and the first two words of the block.
+the first two words of the block,
+and the function names represented by the first two words of the block.
 Usually, the first two words of the block
 contain the malloc and realloc tags
 (see
@@ -51,14 +52,46 @@ useful for finding who allocated the leaked blocks.
 .PP
 If the
 .B -s
+or the
+.B -c
 option is given,
 .I leak 
 will instead present a sequence of
 .IR acid (1)
 commands that show each leaky allocation site.
-A comment appears next to each command to 
+With
+.B -s
+a comment appears next to each command to 
 indicate how many lost blocks were allocated
 at that point in the program.
+With
+.B -c
+the comments are extended to indicate also the total
+number of bytes lost at that point in the program,
+and an additional comment line gives the
+overall total number of bytes.
+.PP
+If the
+.B -a
+option is given,
+.I leak 
+will print information as decribed above,
+but for all allocated blocks,
+not only leaked ones.
+If the
+.B -d
+option is given,
+.I leak 
+will print information as decribed above,
+but for all free blocks,
+i.e. those freed,
+or those that are not yet
+in use (fragmentation?).
+The
+.B -a
+and
+.B -d
+options can be combined.
 .PP
 If the
 .B -b

+ 6 - 8
sys/man/4/cfs

@@ -4,14 +4,14 @@ cfs \- cache file system
 .SH SYNOPSIS
 .B cfs
 .B -s
-.RB [ -rdS ]
+.RB [ -krdS ]
 .RB [ -f
 .IR partition ]
 .PP
 .B cfs 
 .B -a
 .I netaddr
-.RB [ -rdS ]
+.RB [ -krdS ]
 .RB [ -f
 .IR partition ]
 .RI [ mtpt ]
@@ -66,6 +66,10 @@ sides and latencies.
 use file
 .I partition
 as the cache disk partition.
+.TP
+.BI k
+Keep cache contents even if they might have come from a different server.
+Cfs will obey the -r flag even if -k is given.
 .PP
 All 9P messages except
 .BR read ,
@@ -77,12 +81,6 @@ and
 are passed through
 .I cfs
 unchanged to the remote server.
-A
-.B clone
-followed immediately by a
-.B walk
-is converted into a
-.BR clwalk .
 If possible, a
 .B read
 is satisfied by cached data.

+ 2 - 1
sys/man/4/usb

@@ -108,7 +108,8 @@ speed out 44100
 .PP
 This file can be written using the same syntax.  The keyword
 .I out
-may be omitted.  Settings are given as percentages of the range.
+may be omitted.  Settings are given as percentages of the range,
+except for speed which is in Hz.
 .PP
 The file
 .B audioctl

+ 2 - 0
sys/src/cmd/acid/acid.h

@@ -53,8 +53,10 @@ Extern Node*	prnt;
 Extern List*	tracelist;
 Extern int	initialising;
 Extern int	quiet;
+
 extern void	(*expop[])(Node*, Node*);
 #define expr(n, r) (r)->comt=0; (*expop[(n)->op])(n, r);
+extern int	fmtsize(Value *v) ;
 
 enum
 {

+ 48 - 0
sys/src/cmd/acid/builtin.c

@@ -40,6 +40,8 @@ void	interpret(Node*, Node*);
 void	include(Node*, Node*);
 void	regexp(Node*, Node*);
 void	dosysr1(Node*, Node*);
+void	fmtof(Node*, Node*) ;
+void	dofmtsize(Node*, Node*) ;
 
 typedef struct Btab Btab;
 struct Btab
@@ -80,6 +82,8 @@ struct Btab
 	"interpret",	interpret,
 	"include",	include,
 	"regexp",	regexp,
+	"fmtof",	fmtof,
+	"fmtsize",	dofmtsize,
 	0
 };
 
@@ -1265,3 +1269,47 @@ pcline(Node *r, Node *args)
 		error("pcline(addr): funny file %s", buf);
 	r->ival = strtol(p+1, 0, 0);	
 }
+
+void fmtof(Node *r, Node *args)
+{
+	Node *av[Maxarg];
+	Node res;
+
+	na = 0;
+	flatten(av, args);
+	if(na < 1)
+		error("fmtof(obj): no argument");
+	if(na > 1)
+		error("fmtof(obj): too many arguments") ;
+	expr(av[0], &res);
+
+	r->op = OCONST;
+	r->type = TINT ;
+	r->ival = res.fmt ;
+	r->fmt = 'c';
+}
+
+void dofmtsize(Node *r, Node *args)
+{
+	Node *av[Maxarg];
+	Node res;
+	Store * s ;
+	Value v ;
+
+	na = 0;
+	flatten(av, args);
+	if(na < 1)
+		error("fmtsize(obj): no argument");
+	if(na > 1)
+		error("fmtsize(obj): too many arguments") ;
+	expr(av[0], &res);
+
+	v.type = res.type ;
+	s = &v.Store ;
+	*s = res ;
+
+	r->op = OCONST;
+	r->type = TINT ;
+	r->ival = fmtsize(&v) ;
+	r->fmt = 'D';
+}

+ 1 - 2
sys/src/cmd/acid/dbg.y

@@ -281,8 +281,7 @@ monexpr		: term
 		}
 		| '+' monexpr
 		{
-			$$ = con(0);
-			$$ = an(OADD, $2, $$);
+			$$ = an(OADD, $2, ZN);
 		}
 		| '-' monexpr
 		{

+ 9 - 0
sys/src/cmd/acid/expr.c

@@ -201,13 +201,22 @@ oindex(Node *n, Node *res)
 void
 oappend(Node *n, Node *res)
 {
+	Value *v;
 	Node r, l;
+	int  empty;
 
 	expr(n->left, &l);
 	expr(n->right, &r);
 	if(l.type != TLIST)
 		error("must append to list");
+	empty = (l.l == nil && (n->left->op == ONAME));
 	append(res, &l, &r);
+	if(empty) {
+		v = n->left->sym->v;
+		v->type = res->type;
+		v->Store = res->Store;
+		v->comt = res->comt;
+	}
 }
 
 void

+ 15 - 15
sys/src/cmd/auth/authsrv.c

@@ -65,7 +65,7 @@ main(int argc, char *argv[])
 	for(;;){
 		if(readn(0, buf, TICKREQLEN) <= 0)
 			exits(0);
-	
+
 		convM2TR(buf, &tr);
 		switch(buf[0]){
 		case AuthTreq:
@@ -246,7 +246,7 @@ changepasswd(Ticketreq *tr)
 	safecpy(t.suid, tr->uid, sizeof(t.suid));
 	convT2M(&t, tbuf+1, okey);
 	write(1, tbuf, sizeof(tbuf));
-		
+
 	/* loop trying passwords out */
 	for(;;){
 		if(readn(0, prbuf, PASSREQLEN) < 0)
@@ -323,7 +323,7 @@ http(Ticketreq *tr)
 			p++;
 		passtokey(key, p);
 	}
-	
+
 	/* send back a ticket encrypted with the key */
 	randombytes((uchar*)t.chal, CHALLEN);
 	mkkey(t.key);
@@ -390,7 +390,7 @@ apop(Ticketreq *tr, int type)
 	USED(tr);
 
 	/*
-	 *  Create a challenge and send it.  
+	 *  Create a challenge and send it.
 	 */
 	randombytes((uchar*)rb, sizeof(rb));
 	p = chal;
@@ -410,7 +410,7 @@ apop(Ticketreq *tr, int type)
 		tr = &treq;
 		if(tr->type != type)
 			exits(0);
-	
+
 		/*
 		 * read response
 		 */
@@ -418,7 +418,7 @@ apop(Ticketreq *tr, int type)
 			exits(0);
 		for(i = 0; i < MD5dlen; i++)
 			resp[i] = (h2b(buf[2*i])<<4)|h2b(buf[2*i+1]);
-	
+
 		/*
 		 * lookup
 		 */
@@ -431,7 +431,7 @@ apop(Ticketreq *tr, int type)
 				return;
 			continue;
 		}
-	
+
 		/*
 		 *  check for match
 		 */
@@ -504,7 +504,7 @@ vnc(Ticketreq *tr)
 	int i;
 
 	/*
-	 *  Create a challenge and send it.  
+	 *  Create a challenge and send it.
 	 */
 	randombytes(chal+6, VNCchallen);
 	chal[0] = AuthOKvar;
@@ -569,7 +569,7 @@ chap(Ticketreq *tr)
 	OChapreply reply;
 
 	/*
-	 *  Create a challenge and send it.  
+	 *  Create a challenge and send it.
 	 */
 	randombytes((uchar*)chal, sizeof(chal));
 	write(1, chal, sizeof(chal));
@@ -646,7 +646,7 @@ mschap(Ticketreq *tr)
 	uchar digest[SHA1dlen];
 
 	/*
-	 *  Create a challenge and send it.  
+	 *  Create a challenge and send it.
 	 */
 	randombytes((uchar*)chal, sizeof(chal));
 	write(1, chal, sizeof(chal));
@@ -656,7 +656,7 @@ mschap(Ticketreq *tr)
 	 */
 	if(readn(0, &reply, sizeof(reply)) < 0)
 		exits(0);
-	
+
 	safecpy(tr->uid, reply.uid, sizeof(tr->uid));
 	/*
 	 * lookup
@@ -712,7 +712,7 @@ nthash(uchar hash[MShashlen], char *passwd)
 {
 	uchar buf[512];
 	int i;
-	
+
 	for (i = 0; *passwd && i + 1 < sizeof(buf);) {
 		Rune r;
 		passwd += chartorune(&r, passwd);
@@ -750,7 +750,7 @@ mschalresp(uchar resp[MSresplen], uchar hash[MShashlen], uchar chal[MSchallen])
 {
 	int i;
 	uchar buf[21];
-	
+
 	memset(buf, 0, sizeof(buf));
 	memcpy(buf, hash, MShashlen);
 
@@ -781,13 +781,13 @@ speaksfor(char *speaker, char *user)
 	Ndbs s;
 	int ok;
 	char notuser[Maxpath];
-	
+
 	if(strcmp(speaker, user) == 0)
 		return 1;
 
 	if(db == 0)
 		return 0;
-	
+
 	tp = ndbsearch(db, &s, "hostid", speaker);
 	if(tp == 0)
 		return 0;

+ 35 - 9
sys/src/cmd/auth/guard.srv.c

@@ -1,3 +1,6 @@
+/*
+ * guard service
+ */
 #include <u.h>
 #include <libc.h>
 #include <fcall.h>
@@ -6,6 +9,10 @@
 #include <authsrv.h>
 #include "authcmdlib.h"
 
+enum {
+	Pinlen = 4,
+};
+
 /*
  * c -> a	client
  * a -> c	challenge prompt
@@ -24,11 +31,11 @@ Ndb	*db;
 void
 main(int argc, char *argv[])
 {
-	char ukey[DESKEYLEN], resp[32], buf[NETCHLEN];
-	long chal;
 	int n;
-	Ndb *db2;
+	long chal;
 	char *err;
+	char ukey[DESKEYLEN], resp[32], buf[NETCHLEN];
+	Ndb *db2;
 
 	ARGBEGIN{
 	case 'd':
@@ -43,6 +50,7 @@ main(int argc, char *argv[])
 	if(db2 == 0)
 		syslog(0, AUTHLOG, "no /lib/ndb/local");
 	db = ndbcat(db, db2);
+	werrstr("");
 
 	strcpy(raddr, "unknown");
 	if(argc >= 1)
@@ -66,27 +74,45 @@ main(int argc, char *argv[])
 	n = strlen(buf) + 1;
 	if(write(1, buf, n) != n){
 		if(debug)
-			syslog(0, AUTHLOG, "g-fail %s@%s :%r sending chal",
+			syslog(0, AUTHLOG, "g-fail %s@%s: %r sending chal",
 				user, raddr);
 		exits("replying to server");
 	}
 	alarm(3*60*1000);
+	werrstr("");
 	if(readarg(0, resp, sizeof resp) < 0){
 		if(debug)
-			syslog(0, AUTHLOG, "g-fail %s@%s :%r reading resp",
+			syslog(0, AUTHLOG, "g-fail %s@%s: %r reading resp",
 				user, raddr);
 		fail(0);
 	}
 	alarm(0);
 
+	/* remove password login from guard.research.bell-labs.com, sucre, etc. */
+//	if(!findkey(KEYDB,    user, ukey) || !netcheck(ukey, chal, resp))
 	if(!findkey(NETKEYDB, user, ukey) || !netcheck(ukey, chal, resp))
-	/* if(!findkey(KEYDB, user, ukey) || !netcheck(ukey, chal, resp)) /* remove password login from guard.research.bell-labs.com, sucre, etc. */
 	if((err = secureidcheck(user, resp)) != nil){
 		print("NO %s", err);
 		write(1, "NO", 2);
-		if(debug)
-			syslog(0, AUTHLOG, "g-fail %s@%s: %s %s to %lud",
-				err, user, raddr, resp, chal);
+		if(debug) {
+			char *r;
+
+			/*
+			 * don't log the entire response, since the first
+			 * Pinlen digits may be the user's secure-id pin.
+			 */
+			if (strlen(resp) < Pinlen)
+				r = strdup("<too short for pin>");
+			else if (strlen(resp) == Pinlen)
+				r = strdup("<pin only>");
+			else
+				r = smprint("%.*s%s", Pinlen,
+					"******************", resp + Pinlen);
+			syslog(0, AUTHLOG,
+				"g-fail %s@%s: %s: resp %s to chal %lud",
+				user, raddr, err, r, chal);
+			free(r);
+		}
 		fail(user);
 	}
 	write(1, "OK", 2);

+ 3 - 3
sys/src/cmd/auth/lib/readarg.c

@@ -10,9 +10,8 @@ readarg(int fd, char *arg, int len)
 	int i;
 
 	i = 0;
-	for(;;){
-		if(read(fd, buf, 1) != 1)
-			return -1;
+	memset(arg, 0, len);
+	while(read(fd, buf, 1) == 1){
 		if(i < len - 1)
 			arg[i++] = *buf;
 		if(*buf == '\0'){
@@ -20,4 +19,5 @@ readarg(int fd, char *arg, int len)
 			return 0;
 		}
 	}
+	return -1;
 }

+ 4 - 1
sys/src/cmd/auth/secstore/secchk.c

@@ -4,6 +4,7 @@
 #include <ndb.h>
 
 extern char* secureidcheck(char *user, char *response);
+
 Ndb *db;
 
 void
@@ -12,9 +13,10 @@ main(int argc, char **argv)
 	Ndb *db2;
 
 	if(argc!=2){
-		fprint(2,"usage %s pinsecurid\n", argv[0]);
+		fprint(2, "usage: %s pinsecurid\n", argv[0]);
 		exits("usage");
 	}
+
 	db = ndbopen("/lib/ndb/auth");
 	if(db == 0)
 		syslog(0, "secstore", "no /lib/ndb/auth");
@@ -22,6 +24,7 @@ main(int argc, char **argv)
 	if(db2 == 0)
 		syslog(0, "secstore", "no /lib/ndb/local");
 	db = ndbcat(db, db2);
+
 	print("user=%s\n", getenv("user"));
 	print("%s\n", secureidcheck(getenv("user"), argv[1]));
 	exits(0);

+ 79 - 70
sys/src/cmd/auth/secureidcheck.c

@@ -1,14 +1,14 @@
 /*
-	This code uses RADIUS as a portable way to validate tokens such as SecurID.
-	It is relatively simple to send a UDP packet and get a response, but various
-	things can go wrong.  Speaking the proprietary ACE protocol would allow
-	handling "next token code" and other error messages.  More importantly, the
-	timeout threshold is inherently hard to pick.  We observe responses taking
-	longer than 10 seconds in normal times.  That is a long time to wait before
-	retrying on a second server.  Moreover, if the UDP response is lost, retrying
-	on a second server will also fail because the valid token code may be
-	presented only once.  This whole approach is flawed, but best we can do.
-*/
+ * This code uses RADIUS as a portable way to validate tokens such as SecurID.
+ * It is relatively simple to send a UDP packet and get a response, but various
+ * things can go wrong.  Speaking the proprietary ACE protocol would allow
+ * handling "next token code" and other error messages.  More importantly, the
+ * timeout threshold is inherently hard to pick.  We observe responses taking
+ * longer than 10 seconds in normal times.  That is a long time to wait before
+ * retrying on a second server.  Moreover, if the UDP response is lost, retrying
+ * on a second server will also fail because the valid token code may be
+ * presented only once.  This whole approach is flawed, but best we can do.
+ */
 /* RFC2138 */
 #include <u.h>
 #include <libc.h>
@@ -18,39 +18,41 @@
 #include <libsec.h>
 #include <bio.h>
 #include <ndb.h>
+
 #define AUTHLOG "auth"
 
-enum{	R_AccessRequest=1,	/* Packet code */
-	R_AccessAccept=2,
-	R_AccessReject=3,
+enum{
+	R_AccessRequest	=1,	/* Packet code */
+	R_AccessAccept	=2,
+	R_AccessReject	=3,
 	R_AccessChallenge=11,
-	R_UserName=1,
-	R_UserPassword=2,
-	R_NASIPAddress=4,
-	R_ReplyMessage=18,
-	R_State=24,
-	R_NASIdentifier=32
+	R_UserName	=1,
+	R_UserPassword	=2,
+	R_NASIPAddress	=4,
+	R_ReplyMessage	=18,
+	R_State		=24,
+	R_NASIdentifier	=32,
 };
 
 typedef struct Secret{
-	uchar *s;
-	int len;
+	uchar	*s;
+	int	len;
 } Secret;
 
 typedef struct Attribute{
 	struct Attribute *next;
-	uchar type;
-	uchar len;	// number of bytes in value
-	uchar val[256];
+	uchar	type;
+	uchar	len;		/* number of bytes in value */
+	uchar	val[256];
 } Attribute;
 
 typedef struct Packet{
-	uchar code, ID;
-	uchar authenticator[16];
+	uchar	code, ID;
+	uchar	authenticator[16];
 	Attribute first;
 } Packet;
 
-// assumes pass is at most 16 chars
+/* assumes pass is at most 16 chars */
 void
 hide(Secret *shared, uchar *auth, Secret *pass, uchar *x)
 {
@@ -62,7 +64,7 @@ hide(Secret *shared, uchar *auth, Secret *pass, uchar *x)
 	if(n > 16)
 		n = 16;
 	for(i = 0; i < n; i++)
-		x[i] ^= (pass->s)[i];
+		x[i] ^= pass->s[i];
 }
 
 int
@@ -71,9 +73,9 @@ authcmp(Secret *shared, uchar *buf, int m, uchar *auth)
 	DigestState *M;
 	uchar x[16];
 
-	M = md5(buf, 4, nil, nil); // Code+ID+Length
-	M = md5(auth, 16, nil, M); // RequestAuth
-	M = md5(buf+20, m-20, nil, M); // Attributes
+	M = md5(buf, 4, nil, nil);	/* Code+ID+Length */
+	M = md5(auth, 16, nil, M);	/* RequestAuth */
+	M = md5(buf+20, m-20, nil, M);	/* Attributes */
 	md5(shared->s, shared->len, x, M);
 	return memcmp(x, buf+4, 16);
 }
@@ -128,7 +130,7 @@ rpc(char *dest, Secret *shared, Packet *req)
 	Attribute *a;
 	int m, n, fd, try;
 
-	// marshal request
+	/* marshal request */
 	e = buf + sizeof buf;
 	buf[0] = req->code;
 	buf[1] = req->ID;
@@ -146,7 +148,7 @@ rpc(char *dest, Secret *shared, Packet *req)
 	buf[2] = n>>8;
 	buf[3] = n;
 
-	// send request, wait for reply
+	/* send request, wait for reply */
 	fd = dial(dest, 0, 0, 0);
 	if(fd < 0){
 		syslog(0, AUTHLOG, "%s: rpc can't get udp channel", dest);
@@ -155,11 +157,15 @@ rpc(char *dest, Secret *shared, Packet *req)
 	atnotify(ding, 1);
 	m = -1;
 	for(try = 0; try < 2; try++){
-		/* increased timeout from 4sec to 15sec because corporate server really takes that long */
+		/*
+		 * increased timeout from 4sec to 15sec because
+		 * corporate server really takes that long.
+		 */
 		alarm(15000);
 		m = write(fd, buf, n);
 		if(m != n){
-			syslog(0, AUTHLOG, "%s: rpc write err %d %d: %r", dest, m, n);
+			syslog(0, AUTHLOG, "%s: rpc write err %d %d: %r",
+				dest, m, n);
 			m = -1;
 			break;
 		}
@@ -167,9 +173,9 @@ rpc(char *dest, Secret *shared, Packet *req)
 		alarm(0);
 		if(m < 0){
 			syslog(0, AUTHLOG, "%s rpc read err %d: %r", dest, m);
-			break; // failure
+			break;			/* failure */
 		}
-		if(m == 0 || buf2[1] != buf[1]){  // need matching ID
+		if(m == 0 || buf2[1] != buf[1]){	/* need matching ID */
 			syslog(0, AUTHLOG, "%s unmatched reply %d", dest, m);
 			continue;
 		}
@@ -181,7 +187,7 @@ rpc(char *dest, Secret *shared, Packet *req)
 	if(m <= 0)
 		return nil;
 
-	// unmarshal reply
+	/* unmarshal reply */
 	b = buf2;
 	e = buf2+m;
 	resp = (Packet*)malloc(sizeof(*resp));
@@ -203,18 +209,18 @@ rpc(char *dest, Secret *shared, Packet *req)
 	for(;;){
 		if(b >= e){
 			a->next = nil;
-			break;			// exit loop
+			break;		/* exit loop */
 		}
 		a->type = *b++;
 		a->len = (*b++) - 2;
-		if(b + a->len > e){ // corrupt packet
+		if(b + a->len > e){	/* corrupt packet */
 			a->next = nil;
 			freePacket(resp);
 			return nil;
 		}
 		memmove(a->val, b, a->len);
 		b += a->len;
-		if(b < e){  // any more attributes?
+		if(b < e){		/* any more attributes? */
 			a->next = (Attribute*)malloc(sizeof(*a));
 			if(a->next == nil){
 				free(req);
@@ -241,7 +247,7 @@ setAttribute(Packet *p, uchar type, uchar *s, int n)
 	}
 	a->type = type;
 	a->len = n;
-	if(a->len > 253 )  // RFC2138, section 5
+	if(a->len > 253)	/* RFC2138, section 5 */
 		a->len = 253;
 	memmove(a->val, s, a->len);
 	return 0;
@@ -254,14 +260,13 @@ replymsg(Packet *p)
 	Attribute *a;
 	static char buf[255];
 
-	for(a = &p->first; a; a = a->next){
+	for(a = &p->first; a; a = a->next)
 		if(a->type == R_ReplyMessage){
 			if(a->len >= sizeof buf)
 				a->len = sizeof(buf)-1;
 			memmove(buf, a->val, a->len);
 			buf[a->len] = 0;
 		}
-	}
 	return buf;
 }
 
@@ -272,16 +277,16 @@ Attribute *stateattr;
 void
 logPacket(Packet *p)
 {
-	Attribute *a;
-	char buf[255];
-	char pbuf[4*1024];
-	uchar *au = p->authenticator;
 	int i;
 	char *np, *e;
+	char buf[255], pbuf[4*1024];
+	uchar *au = p->authenticator;
+	Attribute *a;
 
 	e = pbuf + sizeof(pbuf);
 
-	np = seprint(pbuf, e, "Packet ID=%d auth=%x %x %x... ", p->ID, au[0], au[1], au[2]);
+	np = seprint(pbuf, e, "Packet ID=%d auth=%x %x %x... ",
+		p->ID, au[0], au[1], au[2]);
 	switch(p->code){
 	case R_AccessRequest:
 		np = seprint(np, e, "request\n");
@@ -305,7 +310,7 @@ logPacket(Packet *p)
 			a->len = 253;
 		memmove(buf, a->val, a->len);
 		np = seprint(np, e, " [%d]", a->type);
-		for(i = 0; i<a->len; i++)
+		for(i = 0; i < a->len; i++)
 			if(isprint(a->val[i]))
 				np = seprint(np, e, "%c", a->val[i]);
 			else
@@ -331,7 +336,8 @@ getipv4addr(void)
 	ifc = readipifc("/net", ifc, -1);
 	for(nifc = ifc; nifc; nifc = nifc->next)
 		for(lifc = nifc->lifc; lifc; lifc = lifc->next)
-			if(ipcmp(lifc->ip, IPnoaddr) != 0 && ipcmp(lifc->ip, v4prefix) != 0)
+			if (ipcmp(lifc->ip, IPnoaddr) != 0 &&
+			    ipcmp(lifc->ip, v4prefix) != 0)
 				return lifc->ip;
 	return nil;
 }
@@ -342,17 +348,16 @@ extern Ndb *db;
 char*
 secureidcheck(char *user, char *response)
 {
-	Packet *req = nil, *resp = nil;
-	ulong u[4];
-	uchar x[16];
-	char *radiussecret;
-	char ruser[ 64];
-	char dest[3*IPaddrlen+20];
-	Secret shared, pass;
+	char *radiussecret = nil;
 	char *rv = "authentication failed";
-	Ndbs s;
-	Ndbtuple *t, *nt, *tt;
+	char dest[3*IPaddrlen+20], ruser[64];
 	uchar *ip;
+	uchar x[16];
+	ulong u[4];
+	Ndbs s;
+	Ndbtuple *t = nil, *nt, *tt;
+	Packet *req = nil, *resp = nil;
+	Secret shared, pass;
 	static Ndb *netdb;
 
 	if(netdb == nil)
@@ -371,15 +376,15 @@ secureidcheck(char *user, char *response)
 
 	/* translate user name if we have to */
 	strcpy(ruser, user);
-	for(nt = t; nt; nt = nt->entry){
+	for(nt = t; nt; nt = nt->entry)
 		if(strcmp(nt->attr, "uid") == 0 && strcmp(nt->val, user) == 0)
 			for(tt = nt->line; tt != nt; tt = tt->line)
 				if(strcmp(tt->attr, "rid") == 0){
 					strcpy(ruser, tt->val);
 					break;
 				}
-	}
 	ndbfree(t);
+	t = nil;
 
 	u[0] = fastrand();
 	u[1] = fastrand();
@@ -415,7 +420,7 @@ secureidcheck(char *user, char *response)
 		if(strcmp(nt->attr, "ip") != 0)
 			continue;
 
-		snprint(dest,sizeof dest,"udp!%s!radius", nt->val);
+		snprint(dest, sizeof dest, "udp!%s!radius", nt->val);
 		resp = rpc(dest, &shared, req);
 		if(resp == nil){
 			syslog(0, AUTHLOG, "%s nil response", dest);
@@ -428,29 +433,33 @@ secureidcheck(char *user, char *response)
 			resp = nil;
 			continue;
 		}
-	
+
 		switch(resp->code){
 		case R_AccessAccept:
 			syslog(0, AUTHLOG, "%s accepted ruser=%s", dest, ruser);
 			rv = nil;
 			break;
 		case R_AccessReject:
-			syslog(0, AUTHLOG, "%s rejected ruser=%s %s", dest, ruser, replymsg(resp));
+			syslog(0, AUTHLOG, "%s rejected ruser=%s %s",
+				dest, ruser, replymsg(resp));
 			rv = "secureid failed";
 			break;
 		case R_AccessChallenge:
-			syslog(0, AUTHLOG, "%s challenge ruser=%s %s", dest, ruser, replymsg(resp));
+			syslog(0, AUTHLOG, "%s challenge ruser=%s %s",
+				dest, ruser, replymsg(resp));
 			rv = "secureid out of sync";
 			break;
 		default:
-			syslog(0, AUTHLOG, "%s code=%d ruser=%s %s", dest, resp->code, ruser, replymsg(resp));
+			syslog(0, AUTHLOG, "%s code=%d ruser=%s %s",
+				dest, resp->code, ruser, replymsg(resp));
 			break;
 		}
-		break; // we have a proper reply, no need to ask again
+		break;	/* we have a proper reply, no need to ask again */
 	}
-	ndbfree(t);
-	free(radiussecret);
 out:
+	if (t)
+		ndbfree(t);
+	free(radiussecret);
 	freePacket(req);
 	freePacket(resp);
 	return rv;

+ 2 - 2
sys/src/cmd/cfs/cformat.h

@@ -15,7 +15,7 @@ enum
 	Amagic= 	0xbebeefed,	/* allocation block magic */
 	Imagic=		0xbadc00ce,	/* inode block magic */
 	BtoUL=		8*sizeof(ulong),/* bits in a ulong */
-	KNAMELEN=	28	/* old NAMELEN: BUG */
+	CACHENAMELEN=	128
 };
 #define	Indbno		0x80000000	/* indirect block */
 #define	Notabno		0xFFFFFFFF	/* not a block number */
@@ -29,7 +29,7 @@ struct Dahdr
 {
 	ulong	magic;
 	ulong	bsize;		/* logical block size */
-	char	name[KNAMELEN];
+	char	name[CACHENAMELEN];
 	short	nab;		/* number of allocation blocks */
 };
 struct Dalloc

+ 30 - 9
sys/src/cmd/cfs/cfs.c

@@ -81,7 +81,7 @@ void	sendmsg(P9fs*, Fcall*);
 void	rcvmsg(P9fs*, Fcall*);
 int	delegate(void);
 int	askserver(void);
-void	cachesetup(int, char*);
+void	cachesetup(int, char*, char*);
 int	ctltest(Mfile*);
 void	genstats(void);
 
@@ -119,8 +119,8 @@ char *mname[]={
 void
 usage(void)
 {
-	fprint(2, "usage:\tcfs -s [-rd] [-f partition]");
-	fprint(2, "\tcfs [-rd] [-f partition] [-a netaddr] [mt-pt]\n");
+	fprint(2, "usage:\tcfs -s [-krd] [-f partition]\n");
+	fprint(2, "\tcfs [-krd] [-f partition] [-a netaddr] [mt-pt]\n");
 	exits("usage");
 }
 
@@ -133,10 +133,14 @@ main(int argc, char *argv[])
 	char *server;
 	char *mtpt;
 
+	int chkid;
+	NetConnInfo * snci;
+
 	std = 0;
 	format = 0;
+	chkid = 1;
 	part = "/dev/sdC0/cache";
-	server = "tcp!edith";
+	server = "tcp!fs";
 	mtpt = "/tmp";
 
 	ARGBEGIN{
@@ -158,6 +162,9 @@ main(int argc, char *argv[])
 	case 'd':
 		debug = 1;
 		break;
+	case 'k':
+		chkid = 0;
+		break;
 	default:
 		usage();
 	}ARGEND
@@ -167,8 +174,6 @@ main(int argc, char *argv[])
 	if(debug)
 		fmtinstall('F', fcallfmt);
 
-	cachesetup(format, part);
-
 	c.name = "client";
 	s.name = "server";
 	if(std){
@@ -177,6 +182,17 @@ main(int argc, char *argv[])
 	}else
 		mountinit(server, mtpt);
 
+	if(chkid){
+		if((snci = getnetconninfo(nil, s.fd[0])) == nil)
+			/* Failed to lookup information; format */
+			cachesetup(1, nil, part);
+		else
+			/* Do partition check */
+			cachesetup(0, snci->raddr, part);
+	}else
+		/* Obey -f w/o regard to cache vs. remote server */
+		cachesetup(format, nil, part);
+
 	switch(fork()){
 	case 0:
 		io();
@@ -189,7 +205,7 @@ main(int argc, char *argv[])
 }
 
 void
-cachesetup(int format, char *partition)
+cachesetup(int format, char *name, char *partition)
 {
 	int f;
 	int secsize;
@@ -204,8 +220,13 @@ cachesetup(int format, char *partition)
 	if(f < 0)
 		error("opening partition");
 
-	if(format || iinit(&ic, f, secsize)<0){
-		if(iformat(&ic, f, inodes, "bootes", blocksize, secsize) < 0)
+	if(format || iinit(&ic, f, secsize, name) < 0){
+		/*
+		 * If we need to format and don't have a name, fall
+		 * back to our old behavior of using "bootes"
+		 */
+		name = (name == nil? "bootes": name);
+		if(iformat(&ic, f, inodes, name, blocksize, secsize) < 0)
 			error("formatting failed");
 	}
 }

+ 8 - 2
sys/src/cmd/cfs/disk.c

@@ -12,7 +12,7 @@ int	icformat(Disk*, ulong);
  *  is inconsistent.
  */
 int
-dinit(Disk *d, int f, int psize)
+dinit(Disk *d, int f, int psize, char *expname)
 {
 	ulong	i;
 	uvlong	length;
@@ -59,7 +59,13 @@ dinit(Disk *d, int f, int psize)
 	d->b2b = (d->bsize - sizeof(Dahdr))*8;
 	d->nab = (d->nb+d->b2b-1)/d->b2b;
 	d->p2b = d->bsize/sizeof(Dptr);
-	strncpy(d->name, ba->name, sizeof(d->name));
+	strncpy(d->name, ba->name, sizeof d->name);
+
+	if (expname != nil && strncmp(d->name, expname, sizeof d->name) != 0) {
+		/* Mismatch with recorded name; fail here to force a format */
+		fprint(2, "cfs: name mismatch\n");
+		return -1;
+	}
 
 	/*
 	 *  check allocation blocks for consistency

+ 2 - 2
sys/src/cmd/cfs/disk.h

@@ -10,10 +10,10 @@ struct Disk
 	ulong	nab;	/* number of allocation blocks */
 	int	b2b;	/* allocation bits to a block */
 	int	p2b;	/* Dptr's per page */
-	char	name[KNAMELEN];
+	char	name[CACHENAMELEN];
 };
 
-int	dinit(Disk*, int, int);
+int	dinit(Disk*, int, int, char*);
 int	dformat(Disk*, int, char*, ulong, ulong);
 ulong	dalloc(Disk*, Dptr*);
 ulong	dpalloc(Disk*, Dptr*);

+ 3 - 3
sys/src/cmd/cfs/inode.c

@@ -18,7 +18,7 @@
  *  nab is the first inode block.
  */
 int
-iinit(Icache *ic, int f, int psize)
+iinit(Icache *ic, int f, int psize, char* name)
 {
 	Ibuf *b;
 	Imap *m;
@@ -29,7 +29,7 @@ iinit(Icache *ic, int f, int psize)
 	/*
 	 *  get basic sizes and allocation info from disk
 	 */
-	if(dinit(ic, f, psize) < 0)
+	if(dinit(ic, f, psize, name) < 0)
 		return -1;
 
 	/*
@@ -141,7 +141,7 @@ iformat(Icache *ic, int f, ulong nino, char *name, int bsize, int psize)
 
 	bcsync(ic);
 
-	return iinit(ic, f, psize);
+	return iinit(ic, f, psize, name);
 }
 
 /*

+ 1 - 1
sys/src/cmd/cfs/inode.h

@@ -52,7 +52,7 @@ Ibuf*	ialloc(Icache*, ulong);
 Ibuf*	iget(Icache*, Qid);
 Ibuf*	iread(Icache*, ulong);
 int	iformat(Icache*, int, ulong, char*, int, int);
-int	iinit(Icache*, int, int);
+int	iinit(Icache*, int, int, char*);
 int	iremove(Icache*, ulong);
 int	iupdate(Icache*, ulong, Qid);
 int	iwrite(Icache*, Ibuf*);

+ 12 - 12
sys/src/cmd/file.c

@@ -790,18 +790,18 @@ struct	FILE_STRING
 	"P3\n",			"ppm",				3,	"image/ppm",
 	"P6\n",			"ppm",				3,	"image/ppm",
 	"/* XPM */\n",	"xbm",				10,	"image/xbm",
-	".HTML ",		"troff -ms input",	6,	"text/plain",
-	".LP",			"troff -ms input",	3,	"text/plain",
-	".ND",			"troff -ms input",	3,	"text/plain",
-	".PP",			"troff -ms input",	3,	"text/plain",
-	".TL",			"troff -ms input",	3,	"text/plain",
-	".TR",			"troff -ms input",	3,	"text/plain",
-	".TH",			"manual page",		3,	"text/plain",
-	".\\\"",		"troff input",		3,	"text/plain",
-	".de",			"troff input",		3,	"text/plain",
-	".if",			"troff input",		3,	"text/plain",
-	".nr",			"troff input",		3,	"text/plain",
-	".tr",			"troff input",		3,	"text/plain",
+	".HTML ",		"troff -ms input",	6,	"text/troff",
+	".LP",			"troff -ms input",	3,	"text/troff",
+	".ND",			"troff -ms input",	3,	"text/troff",
+	".PP",			"troff -ms input",	3,	"text/troff",
+	".TL",			"troff -ms input",	3,	"text/troff",
+	".TR",			"troff -ms input",	3,	"text/troff",
+	".TH",			"manual page",		3,	"text/troff",
+	".\\\"",		"troff input",		3,	"text/troff",
+	".de",			"troff input",		3,	"text/troff",
+	".if",			"troff input",		3,	"text/troff",
+	".nr",			"troff input",		3,	"text/troff",
+	".tr",			"troff input",		3,	"text/troff",
 	"vac:",			"venti score",		4,	"text/plain",
 	0,0,0,0
 };

+ 1 - 1
sys/src/cmd/hoc/code.c

@@ -161,7 +161,7 @@ call(void) 		/* call a function */
 
 	Symbol *sp = (Symbol *)pc[0]; /* symbol table entry */
 				      /* for function */
-	if (fp >= &frame[NFRAME])
+	if (fp >= &frame[NFRAME-1])
 		execerror(sp->name, "call nested too deeply");
 	fp++;
 	fp->sp = sp;

+ 2 - 2
sys/src/cmd/usb/audio/audiofs.c

@@ -349,7 +349,7 @@ rwalk(Fid *f)
 	for(i = 0; i < thdr.nwname; i++){
 		rv = dowalk(f, thdr.wname[i]);
 		if(rv != nil){
-			if(nf != nil)	
+			if(nf != nil)
 				rclunk(nf);
 			else
 				f->dir = savedir;
@@ -720,7 +720,7 @@ rwrite(Fid *f)
 				if (debug) fprint(2, "bad3\n");
 				return Ebadctl;
 			}
-			if (f->dir == &dirs[Qvolume] && c->min != Undef  && c->max != Undef){
+			if (f->dir == &dirs[Qvolume] && ctl != Speed_control && c->min != Undef && c->max != Undef){
 				nnf = tokenize(fields[nf-1], subfields, nelem(subfields));
 				if (nnf <= 0 || nnf > 8){
 					if (debug) fprint(2, "bad4\n");

+ 5 - 0
sys/src/cmd/usb/audio/audiosub.c

@@ -8,8 +8,10 @@
 Namelist terminal_types[] = {
 	{	0x100, "USB Terminal, undefined type"},
 	{	0x101, "USB Streaming"},
+	{	0x201, "Microphone"},
 	{	0x301, "Speaker"},
 	{	0x603, "Line connector"},
+	{	0x605, "S/PDIF"},
 	{	0, nil }
 };
 
@@ -153,6 +155,9 @@ audio_interface(Device *d, int n, ulong csp, void *bb, int nb) {
 					if (selectorid[u] >= 0)
 						fprint(2, "Second selector (%d, %d) on %s\n", selectorid[u], b[3], u?"record":"playback");
 					selectorid[u] = b[3];
+					controls[u][Selector_control].readable = 1;
+					controls[u][Selector_control].settable = 1;
+					controls[u][Selector_control].chans = 0;
 				}
 			}
 			break;

+ 11 - 4
sys/src/cmd/usb/audio/usbaudio.c

@@ -354,15 +354,22 @@ threadmain(int argc, char **argv)
 	if (endpt[Record] >= 0){
 		if(verbose)
 			fprint(2, "Setting default record parameters: %d Hz, %d channels at %d bits\n",
-				defaultspeed[Play], 2, 16);
-		if(findalt(Record, 2, 16, defaultspeed[Record]) < 0){
-			if(findalt(Record, 2, 16, 48000) < 0)
+				defaultspeed[Record], 2, 16);
+		i = 2;
+		while(findalt(Record, i, 16, defaultspeed[Record]) < 0){
+			if(i == 2 && controls[Record][Channel_control].max == 1){
+				fprint(2, "Warning, can't configure stereo recording, configuring mono instead\n");
+				i = 1;
+				continue;
+			}
+			if(findalt(Record, i, 16, 48000) < 0)
 				sysfatal("Can't configure record for %d or %d Hz", defaultspeed[Record], 48000);
 			fprint(2, "Warning, can't configure record for %d Hz, configuring for %d Hz instead\n",
 				defaultspeed[Record], 48000);
 			defaultspeed[Record] = 48000;
+			break;
 		}
-		value[0] = 2;
+		value[0] = i;
 		if (setcontrol(Record, "channels", value) == Undef)
 			sysfatal("Can't set record channels\n");
 		value[0] = 16;

+ 49 - 24
sys/src/cmd/usb/audio/usbaudioctl.c

@@ -197,24 +197,32 @@ setspeed(int rec, int speed)
 		buf[0] = speed;
 		buf[1] = speed >> 8;
 		buf[2] = speed >> 16;
-		if(setupcmd(ad->ep[0], RH2D|Rclass|Rendpt, SET_CUR, sampling_freq_control<<8, endpt[rec], buf, 3) < 0){
+		n = endpt[rec];
+		if (rec)
+			n |= 0x80;
+		if(setupcmd(ad->ep[0], RH2D|Rclass|Rendpt, SET_CUR, sampling_freq_control<<8, n, buf, 3) < 0){
 			fprint(2, "Error in setupcmd\n");
 			return Undef;
 		}
-		if (setupreq(ad->ep[0], RD2H|Rclass|Rendpt, GET_CUR, sampling_freq_control<<8, endpt[rec], 3) < 0){
+		if (setupreq(ad->ep[0], RD2H|Rclass|Rendpt, GET_CUR, sampling_freq_control<<8, n, 3) < 0){
 			fprint(2, "Error in setupreq\n");
 			return Undef;
 		}
 		n = setupreply(ad->ep[0], buf, 3);
 		if (n != 3)
 			fprint(2, "Error in setupreply: %d\n", n);
-		else if (buf[2]){
-			if (debug & Dbgcontrol)
-				fprint(2, "Speed out of bounds %d (0x%x)\n",
-					buf[0] | buf[1] << 8 | buf[2] << 16,
-					buf[0] | buf[1] << 8 | buf[2] << 16);
-		}else
-			speed = buf[0] | buf[1] << 8 | buf[2] << 16;
+		else{
+			n = buf[0] | buf[1] << 8 | buf[2] << 16;
+			if (buf[2] || n == 0){
+				if (debug & Dbgcontrol)
+					fprint(2, "Speed out of bounds %d (0x%x)\n", n, n);
+			}else if (n != speed && ad->vid == 0x077d && (ad->did == 0x0223 || ad->did == 0x07af)){
+				/* Griffin iMic responds incorrectly to sample rate inquiry */
+				if (debug & Dbgcontrol)
+					fprint(2, " reported as %d (iMic bug?);", n);
+			}else
+				speed = n;
+		}
 		if (debug & Dbgcontrol)
 			fprint(2, " speed now %d Hz;", speed);
 	}
@@ -229,7 +237,7 @@ setspeed(int rec, int speed)
 	if (debug & Dbgcontrol)
 		fprint(2, "Configuring %s endpoint for %d Hz\n",
 				rec?"record":"playback", speed);
-	sprint(cmdbuf, "ep %d %d %c %ld %d", endpt[rec], da->interval, rec?'r':'w', 
+	sprint(cmdbuf, "ep %d %d %c %ld %d", endpt[rec], da->interval, rec?'r':'w',
 		controls[rec][Channel_control].value[0]*controls[rec][Resolution_control].value[0]/8,
 		speed);
 	if (write(ad->ctl, cmdbuf, strlen(cmdbuf)) != strlen(cmdbuf)){
@@ -256,7 +264,7 @@ getspeed(int rec, int which)
 	if (endpt[rec] < 0)
 		sysfatal("endpt[%s] not set\n", rec?"Record":"Playback");
 	if(debug & Dbgcontrol)
-		fprint(2, "getspeed: curalt[%d] == %d\n", rec, endpt[rec]);
+		fprint(2, "getspeed: endpt[%d] == %d\n", rec, endpt[rec]);
 	ep = ad->ep[endpt[rec]];
 	if (ep->iface == nil)
 		sysfatal("no interface");
@@ -274,7 +282,10 @@ getspeed(int rec, int which)
 	if (a->caps & has_setspeed){
 		if(debug & Dbgcontrol)
 			fprint(2, "getspeed: has_setspeed, ask\n");
-		if (setupreq(ad->ep[0], RD2H|Rclass|Rendpt, which, sampling_freq_control<<8, endpt[rec], 3) < 0)
+		n = endpt[rec];
+		if (rec)
+			n |= 0x80;
+		if (setupreq(ad->ep[0], RD2H|Rclass|Rendpt, which, sampling_freq_control<<8, n, 3) < 0)
 			return Undef;
 		n = setupreply(ad->ep[0], buf, 3);
 		if(n == 3){
@@ -411,8 +422,8 @@ setcontrol(int rec, char *name, long *value)
 		break;
 	case Selector_control:
 		type = RH2D|Rclass|Rinterface;
-		control = ctl<<8;
-		index = selectorid[rec];
+		control = 0;
+		index = selectorid[rec]<<8;
 		break;
 	case Channel_control:
 		control = findalt(rec, value[0], controls[rec][Resolution_control].value[0], defaultspeed[rec]);
@@ -463,10 +474,11 @@ getspecialcontrol(int rec, int ctl, int req, long *value)
 {
 	byte buf[3];
 	int m, n, i;
-	int type, control, index, count;
+	int type, control, index, count, signedbyte;
 	short svalue;
 
 	count = 1;
+	signedbyte = 0;
 	switch(ctl){
 	default:
 		return Undef;
@@ -488,22 +500,29 @@ getspecialcontrol(int rec, int ctl, int req, long *value)
 	case Delay_control:
 		count = 2;
 		/* fall through */
-	case Mute_control:
 	case Bass_control:
 	case Mid_control:
 	case Treble_control:
 	case Equalizer_control:
-	case Agc_control:
-	case Bassboost_control:
-	case Loudness_control:
+		signedbyte = 1;
 		type = RD2H|Rclass|Rinterface;
 		control = ctl<<8;
 		index = featureid[rec]<<8;
 		break;
 	case Selector_control:
 		type = RD2H|Rclass|Rinterface;
+		control = 0;
+		index = selectorid[rec]<<8;
+		break;
+	case Mute_control:
+	case Agc_control:
+	case Bassboost_control:
+	case Loudness_control:
+		if (req != GET_CUR)
+			return Undef;
+		type = RD2H|Rclass|Rinterface;
 		control = ctl<<8;
-		index = selectorid[rec];
+		index = featureid[rec]<<8;
 		break;
 	}
 	if (controls[rec][ctl].chans){
@@ -528,12 +547,15 @@ getspecialcontrol(int rec, int ctl, int req, long *value)
 						value[0] = svalue;
 					break;
 				case 1:
+					svalue = buf[0];
+					if (signedbyte && (svalue&0x80))
+						svalue |= 0xFF00;
 					if (req == GET_CUR){
-						value[i] = buf[0];
-						value[0] += buf[0];
+						value[i] = svalue;
+						value[0] += svalue;
 						m++;
 					}else
-						value[0] = buf[0];
+						value[0] = svalue;
 				}
 			}
 		}
@@ -552,7 +574,10 @@ getspecialcontrol(int rec, int ctl, int req, long *value)
 		value[0] = svalue;
 		break;
 	case 1:
-		value[0] = buf[0];
+		svalue = buf[0];
+		if (signedbyte && (svalue&0x80))
+			svalue |= 0xFF00;
+		value[0] = svalue;
 	}
 	return 0;
 }

+ 1 - 0
sys/src/cmd/webfs/http.c

@@ -359,6 +359,7 @@ httpopen(Client *c, Url *url)
 
 	case 301:	/* Moved Permanently */
 	case 302:	/* Moved Temporarily */
+	case 303:	/* See Other */
 	case 307: /* Temporary Redirect  */
 		redirect = 1;
 		break;

+ 1 - 0
sys/src/lib9p/parse.c

@@ -76,6 +76,7 @@ respondcmderror(Req *r, Cmdbuf *cb, char *fmt, ...)
 	p = vseprint(err, e, fmt, arg);
 	va_end(arg);
 	p = seprint(p, e, ": \"");
+	quotefmtinstall();	/* just in case */
 	for(i=0; i<cb->nf; i++){
 		if(i > 0)
 			p = seprint(p, e, " ");