Browse Source

Plan 9 from Bell Labs 2007-10-05

David du Colombier 13 years ago
parent
commit
a9ad16818b

+ 18 - 22
dist/replica/_plan9.db

@@ -1,6 +1,6 @@
 386 - 20000000775 sys sys 1010957353 0
 386/9load - 775 sys sys 1186619808 326380
-386/9loaddebug - 775 sys sys 1190923617 435057
+386/9loaddebug - 775 sys sys 1191469884 435027
 386/9loadlite - 775 sys sys 1186619809 149672
 386/9loadlitedebug - 775 sys sys 1190923620 220555
 386/9pc - 775 sys sys 1189053434 2038499
@@ -55,7 +55,6 @@
 386/bin/auth/factotum - 775 sys sys 1188446836 321587
 386/bin/auth/fgui - 775 sys sys 1184731229 219079
 386/bin/auth/guard.srv - 775 sys sys 1188446841 144638
-386/bin/auth/iam - 775 sys sys 1085076981 50791
 386/bin/auth/keyfs - 775 sys sys 1191035876 116576
 386/bin/auth/login - 775 sys sys 1179372070 104816
 386/bin/auth/newns - 775 sys sys 1179372070 90035
@@ -147,7 +146,6 @@
 386/bin/aux/timesync - 775 sys sys 1179372078 128466
 386/bin/aux/tr2post - 775 sys sys 1104121987 176578
 386/bin/aux/trampoline - 775 sys sys 1178568259 82677
-386/bin/aux/typepasswd - 775 sys sys 1168402288 69738
 386/bin/aux/usage - 775 sys sys 1168402288 59809
 386/bin/aux/vga - 775 sys sys 1182482483 334774
 386/bin/aux/vmmousepoll - 775 sys sys 1032480572 41434
@@ -231,7 +229,7 @@
 386/bin/faces - 775 sys sys 1181507266 193265
 386/bin/factor - 775 sys sys 1168402307 61699
 386/bin/fcp - 775 sys sys 1168402307 82433
-386/bin/file - 775 sys sys 1188530150 128160
+386/bin/file - 775 sys sys 1191528973 128646
 386/bin/fmt - 775 sys sys 1168402307 65567
 386/bin/fortune - 775 sys sys 1168402308 67356
 386/bin/fossil - 20000000775 sys sys 1042005470 0
@@ -7432,7 +7430,7 @@ sys/man/1/nm - 664 sys sys 1148106943 1601
 sys/man/1/ns - 664 sys sys 1163208505 895
 sys/man/1/p - 664 sys sys 944959673 504
 sys/man/1/page - 664 sys sys 1087829646 5839
-sys/man/1/passwd - 664 sys sys 1181277007 1532
+sys/man/1/passwd - 664 sys sys 1191473503 1543
 sys/man/1/patch - 664 sys sys 1190830651 2566
 sys/man/1/pcc - 664 sys sys 1015024740 3478
 sys/man/1/pic - 664 sys sys 1022625353 8229
@@ -7684,7 +7682,7 @@ sys/man/3/pnp - 664 sys sys 1088560895 4547
 sys/man/3/proc - 664 sys sys 1138458595 12062
 sys/man/3/root - 664 sys sys 1046958450 632
 sys/man/3/rtc - 664 sys sys 954378857 667
-sys/man/3/sd - 664 sys sys 1176502187 5678
+sys/man/3/sd - 664 sys sys 1191480432 5659
 sys/man/3/sdaoe - 664 sys sys 1186965881 1320
 sys/man/3/segment - 664 sys sys 1017423721 2378
 sys/man/3/srv - 664 sys sys 958419690 1470
@@ -7808,7 +7806,7 @@ sys/man/8/INDEX.html - 664 sys sys 1183240488 8619
 sys/man/8/aan - 664 sys sys 1045501064 1670
 sys/man/8/aliasmail - 664 sys sys 1170818958 1350
 sys/man/8/apm - 664 sys sys 1017679308 1811
-sys/man/8/auth - 664 sys sys 1183580530 4981
+sys/man/8/auth - 664 sys sys 1191472798 4996
 sys/man/8/boot - 664 sys sys 1188515985 8331
 sys/man/8/booting - 664 sys sys 1015024984 4136
 sys/man/8/cpurc - 664 sys sys 1187227584 1522
@@ -7837,7 +7835,7 @@ sys/man/8/mouse - 664 sys sys 971455511 2476
 sys/man/8/na - 664 sys sys 958527089 859
 sys/man/8/ndb - 664 sys sys 1188515390 14031
 sys/man/8/newuser - 664 sys sys 1116954242 2418
-sys/man/8/nfsserver - 664 sys sys 1163208425 3587
+sys/man/8/nfsserver - 664 sys sys 1191524525 3576
 sys/man/8/pcmcia - 664 sys sys 944959679 408
 sys/man/8/pem - 664 sys sys 1060263669 1189
 sys/man/8/ping - 664 sys sys 1169105315 3650
@@ -8048,7 +8046,7 @@ sys/src/9/mtx/trap.c - 664 sys sys 1105030157 15882
 sys/src/9/mtx/uarti8250.c - 664 sys sys 1018721288 11590
 sys/src/9/pc - 20000000775 sys sys 1161233143 0
 sys/src/9/pc/a100p.cp - 444 sys sys 1159735144 21984
-sys/src/9/pc/ahci.h - 664 sys sys 1186366009 6314
+sys/src/9/pc/ahci.h - 664 sys sys 1191538081 6316
 sys/src/9/pc/apbootstrap.s - 664 sys sys 1131293655 3037
 sys/src/9/pc/apic.c - 664 sys sys 1174415344 8991
 sys/src/9/pc/apm.c - 664 sys sys 1131290210 3723
@@ -8132,7 +8130,7 @@ sys/src/9/pc/pcf - 664 sys sys 1181616886 1582
 sys/src/9/pc/pcfl - 664 sys sys 1188582378 1579
 sys/src/9/pc/pcflop - 664 sys sys 1190853787 1540
 sys/src/9/pc/pci.c - 664 sys sys 1185452613 29418
-sys/src/9/pc/pcmciamodem.c - 664 sys sys 1099761153 1586
+sys/src/9/pc/pcmciamodem.c - 664 sys sys 1191476436 1591
 sys/src/9/pc/pcmkfile - 664 sys sys 1109303822 101
 sys/src/9/pc/piix4smbus.c - 664 sys sys 1184467714 5324
 sys/src/9/pc/plan9l.s - 664 sys sys 1015014521 910
@@ -8146,7 +8144,7 @@ sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1170456695 55276
 sys/src/9/pc/sd53c8xx.i - 664 sys sys 1128547230 28453
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sd63xxesb.c - 664 sys sys 1190313935 36207
+sys/src/9/pc/sd63xxesb.c - 664 sys sys 1191481587 36230
 sys/src/9/pc/sdata.c - 664 sys sys 1186361525 52991
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1184467229 33837
 sys/src/9/pc/sdmylex.c - 664 sys sys 1189229947 28395
@@ -9400,25 +9398,25 @@ sys/src/cmd/9660srv/xfile.c - 664 sys sys 1113742177 2736
 sys/src/cmd/9nfs - 20000000775 sys sys 1071498519 0
 sys/src/cmd/9nfs/9auth.c - 664 sys sys 1017337812 1454
 sys/src/cmd/9nfs/9p.c - 664 sys sys 1083772192 3365
-sys/src/cmd/9nfs/all.h - 664 sys sys 1017337813 322
+sys/src/cmd/9nfs/all.h - 664 sys sys 1191523800 338
 sys/src/cmd/9nfs/auth.c - 664 sys sys 1017337813 424
 sys/src/cmd/9nfs/authhostowner.c - 664 sys sys 1071498519 4190
 sys/src/cmd/9nfs/chat.c - 664 sys sys 1017337813 2096
-sys/src/cmd/9nfs/dat.h - 664 sys sys 1146061147 4432
+sys/src/cmd/9nfs/dat.h - 664 sys sys 1191523808 4510
 sys/src/cmd/9nfs/fns.h - 664 sys sys 1146061148 1927
 sys/src/cmd/9nfs/listalloc.c - 664 sys sys 1131657407 297
 sys/src/cmd/9nfs/mkfile - 664 sys sys 1071498518 640
-sys/src/cmd/9nfs/mport.c - 664 sys sys 1178482676 3749
+sys/src/cmd/9nfs/mport.c - 664 sys sys 1191523814 3720
 sys/src/cmd/9nfs/nametest.c - 664 sys sys 1015090372 1723
 sys/src/cmd/9nfs/nfs.c - 664 sys sys 1131293679 9526
 sys/src/cmd/9nfs/nfs.h - 664 sys sys 1015090372 642
-sys/src/cmd/9nfs/nfsmount.c - 664 sys sys 1182190701 6447
+sys/src/cmd/9nfs/nfsmount.c - 664 sys sys 1191523847 6447
 sys/src/cmd/9nfs/nfsserver.c - 664 sys sys 1146061148 15831
 sys/src/cmd/9nfs/pcnfsd.c - 664 sys sys 1146061148 4068
-sys/src/cmd/9nfs/portmapper.c - 664 sys sys 1146061148 3273
-sys/src/cmd/9nfs/rpc.c - 664 sys sys 1017337815 5293
+sys/src/cmd/9nfs/portmapper.c - 664 sys sys 1191523856 3306
+sys/src/cmd/9nfs/rpc.c - 664 sys sys 1191523822 5647
 sys/src/cmd/9nfs/rpc.h - 664 sys sys 1017337815 1996
-sys/src/cmd/9nfs/server.c - 664 sys sys 1178482676 11229
+sys/src/cmd/9nfs/server.c - 664 sys sys 1191523839 11320
 sys/src/cmd/9nfs/string.c - 664 sys sys 1017337815 1659
 sys/src/cmd/9nfs/strparse.c - 664 sys sys 1015090373 506
 sys/src/cmd/9nfs/system.c - 664 sys sys 1017337815 437
@@ -9614,7 +9612,6 @@ sys/src/cmd/auth/factotum/sshrsa.c - 664 sys sys 1107633793 3416
 sys/src/cmd/auth/factotum/util.c - 664 sys sys 1182192267 18452
 sys/src/cmd/auth/factotum/wep.c - 664 sys sys 1107706104 2140
 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 1191007186 19129
 sys/src/cmd/auth/lib - 20000000775 sys sys 1045504996 0
 sys/src/cmd/auth/lib/error.c - 664 sys sys 1155994850 318
@@ -9788,7 +9785,7 @@ sys/src/cmd/aux/lines.c - 664 sys sys 1015008782 546
 sys/src/cmd/aux/lis - 775 sys sys 944960794 45
 sys/src/cmd/aux/listen.c - 664 sys sys 1181789265 9292
 sys/src/cmd/aux/listen1.c - 664 sys sys 1143759349 2005
-sys/src/cmd/aux/mkfile - 664 sys sys 1147022848 1021
+sys/src/cmd/aux/mkfile - 664 sys sys 1191473306 1008
 sys/src/cmd/aux/mklatinkbd.c - 664 sys sys 953253425 3813
 sys/src/cmd/aux/mnihongo - 20000000775 sys sys 1039727550 0
 sys/src/cmd/aux/mnihongo/README - 664 sys sys 944960789 475
@@ -9814,7 +9811,6 @@ sys/src/cmd/aux/statusbar.c - 664 sys sys 1138460096 6066
 sys/src/cmd/aux/stub.c - 664 sys sys 1098196222 2723
 sys/src/cmd/aux/timesync.c - 664 sys sys 1178482886 25828
 sys/src/cmd/aux/trampoline.c - 664 sys sys 1126104850 3790
-sys/src/cmd/aux/typepasswd.c - 664 sys sys 1143759348 1749
 sys/src/cmd/aux/unlock - 664 sys sys 944960793 0
 sys/src/cmd/aux/usage.c - 664 sys sys 1139744276 1095
 sys/src/cmd/aux/vga - 20000000775 sys sys 1115734902 0
@@ -10350,7 +10346,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 1172764226 28088
+sys/src/cmd/file.c - 664 sys sys 1191472670 28522
 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

+ 18 - 22
dist/replica/plan9.db

@@ -1,6 +1,6 @@
 386 - 20000000775 sys sys 1010957353 0
 386/9load - 775 sys sys 1186619808 326380
-386/9loaddebug - 775 sys sys 1190923617 435057
+386/9loaddebug - 775 sys sys 1191469884 435027
 386/9loadlite - 775 sys sys 1186619809 149672
 386/9loadlitedebug - 775 sys sys 1190923620 220555
 386/9pc - 775 sys sys 1189053434 2038499
@@ -55,7 +55,6 @@
 386/bin/auth/factotum - 775 sys sys 1188446836 321587
 386/bin/auth/fgui - 775 sys sys 1184731229 219079
 386/bin/auth/guard.srv - 775 sys sys 1188446841 144638
-386/bin/auth/iam - 775 sys sys 1085076981 50791
 386/bin/auth/keyfs - 775 sys sys 1191035876 116576
 386/bin/auth/login - 775 sys sys 1179372070 104816
 386/bin/auth/newns - 775 sys sys 1179372070 90035
@@ -147,7 +146,6 @@
 386/bin/aux/timesync - 775 sys sys 1179372078 128466
 386/bin/aux/tr2post - 775 sys sys 1104121987 176578
 386/bin/aux/trampoline - 775 sys sys 1178568259 82677
-386/bin/aux/typepasswd - 775 sys sys 1168402288 69738
 386/bin/aux/usage - 775 sys sys 1168402288 59809
 386/bin/aux/vga - 775 sys sys 1182482483 334774
 386/bin/aux/vmmousepoll - 775 sys sys 1032480572 41434
@@ -231,7 +229,7 @@
 386/bin/faces - 775 sys sys 1181507266 193265
 386/bin/factor - 775 sys sys 1168402307 61699
 386/bin/fcp - 775 sys sys 1168402307 82433
-386/bin/file - 775 sys sys 1188530150 128160
+386/bin/file - 775 sys sys 1191528973 128646
 386/bin/fmt - 775 sys sys 1168402307 65567
 386/bin/fortune - 775 sys sys 1168402308 67356
 386/bin/fossil - 20000000775 sys sys 1042005470 0
@@ -7432,7 +7430,7 @@ sys/man/1/nm - 664 sys sys 1148106943 1601
 sys/man/1/ns - 664 sys sys 1163208505 895
 sys/man/1/p - 664 sys sys 944959673 504
 sys/man/1/page - 664 sys sys 1087829646 5839
-sys/man/1/passwd - 664 sys sys 1181277007 1532
+sys/man/1/passwd - 664 sys sys 1191473503 1543
 sys/man/1/patch - 664 sys sys 1190830651 2566
 sys/man/1/pcc - 664 sys sys 1015024740 3478
 sys/man/1/pic - 664 sys sys 1022625353 8229
@@ -7684,7 +7682,7 @@ sys/man/3/pnp - 664 sys sys 1088560895 4547
 sys/man/3/proc - 664 sys sys 1138458595 12062
 sys/man/3/root - 664 sys sys 1046958450 632
 sys/man/3/rtc - 664 sys sys 954378857 667
-sys/man/3/sd - 664 sys sys 1176502187 5678
+sys/man/3/sd - 664 sys sys 1191480432 5659
 sys/man/3/sdaoe - 664 sys sys 1186965881 1320
 sys/man/3/segment - 664 sys sys 1017423721 2378
 sys/man/3/srv - 664 sys sys 958419690 1470
@@ -7808,7 +7806,7 @@ sys/man/8/INDEX.html - 664 sys sys 1183240488 8619
 sys/man/8/aan - 664 sys sys 1045501064 1670
 sys/man/8/aliasmail - 664 sys sys 1170818958 1350
 sys/man/8/apm - 664 sys sys 1017679308 1811
-sys/man/8/auth - 664 sys sys 1183580530 4981
+sys/man/8/auth - 664 sys sys 1191472798 4996
 sys/man/8/boot - 664 sys sys 1188515985 8331
 sys/man/8/booting - 664 sys sys 1015024984 4136
 sys/man/8/cpurc - 664 sys sys 1187227584 1522
@@ -7837,7 +7835,7 @@ sys/man/8/mouse - 664 sys sys 971455511 2476
 sys/man/8/na - 664 sys sys 958527089 859
 sys/man/8/ndb - 664 sys sys 1188515390 14031
 sys/man/8/newuser - 664 sys sys 1116954242 2418
-sys/man/8/nfsserver - 664 sys sys 1163208425 3587
+sys/man/8/nfsserver - 664 sys sys 1191524525 3576
 sys/man/8/pcmcia - 664 sys sys 944959679 408
 sys/man/8/pem - 664 sys sys 1060263669 1189
 sys/man/8/ping - 664 sys sys 1169105315 3650
@@ -8048,7 +8046,7 @@ sys/src/9/mtx/trap.c - 664 sys sys 1105030157 15882
 sys/src/9/mtx/uarti8250.c - 664 sys sys 1018721288 11590
 sys/src/9/pc - 20000000775 sys sys 1161233143 0
 sys/src/9/pc/a100p.cp - 444 sys sys 1159735144 21984
-sys/src/9/pc/ahci.h - 664 sys sys 1186366009 6314
+sys/src/9/pc/ahci.h - 664 sys sys 1191538081 6316
 sys/src/9/pc/apbootstrap.s - 664 sys sys 1131293655 3037
 sys/src/9/pc/apic.c - 664 sys sys 1174415344 8991
 sys/src/9/pc/apm.c - 664 sys sys 1131290210 3723
@@ -8132,7 +8130,7 @@ sys/src/9/pc/pcf - 664 sys sys 1181616886 1582
 sys/src/9/pc/pcfl - 664 sys sys 1188582378 1579
 sys/src/9/pc/pcflop - 664 sys sys 1190853787 1540
 sys/src/9/pc/pci.c - 664 sys sys 1185452613 29418
-sys/src/9/pc/pcmciamodem.c - 664 sys sys 1099761153 1586
+sys/src/9/pc/pcmciamodem.c - 664 sys sys 1191476436 1591
 sys/src/9/pc/pcmkfile - 664 sys sys 1109303822 101
 sys/src/9/pc/piix4smbus.c - 664 sys sys 1184467714 5324
 sys/src/9/pc/plan9l.s - 664 sys sys 1015014521 910
@@ -8146,7 +8144,7 @@ sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1170456695 55276
 sys/src/9/pc/sd53c8xx.i - 664 sys sys 1128547230 28453
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sd63xxesb.c - 664 sys sys 1190313935 36207
+sys/src/9/pc/sd63xxesb.c - 664 sys sys 1191481587 36230
 sys/src/9/pc/sdata.c - 664 sys sys 1186361525 52991
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1184467229 33837
 sys/src/9/pc/sdmylex.c - 664 sys sys 1189229947 28395
@@ -9400,25 +9398,25 @@ sys/src/cmd/9660srv/xfile.c - 664 sys sys 1113742177 2736
 sys/src/cmd/9nfs - 20000000775 sys sys 1071498519 0
 sys/src/cmd/9nfs/9auth.c - 664 sys sys 1017337812 1454
 sys/src/cmd/9nfs/9p.c - 664 sys sys 1083772192 3365
-sys/src/cmd/9nfs/all.h - 664 sys sys 1017337813 322
+sys/src/cmd/9nfs/all.h - 664 sys sys 1191523800 338
 sys/src/cmd/9nfs/auth.c - 664 sys sys 1017337813 424
 sys/src/cmd/9nfs/authhostowner.c - 664 sys sys 1071498519 4190
 sys/src/cmd/9nfs/chat.c - 664 sys sys 1017337813 2096
-sys/src/cmd/9nfs/dat.h - 664 sys sys 1146061147 4432
+sys/src/cmd/9nfs/dat.h - 664 sys sys 1191523808 4510
 sys/src/cmd/9nfs/fns.h - 664 sys sys 1146061148 1927
 sys/src/cmd/9nfs/listalloc.c - 664 sys sys 1131657407 297
 sys/src/cmd/9nfs/mkfile - 664 sys sys 1071498518 640
-sys/src/cmd/9nfs/mport.c - 664 sys sys 1178482676 3749
+sys/src/cmd/9nfs/mport.c - 664 sys sys 1191523814 3720
 sys/src/cmd/9nfs/nametest.c - 664 sys sys 1015090372 1723
 sys/src/cmd/9nfs/nfs.c - 664 sys sys 1131293679 9526
 sys/src/cmd/9nfs/nfs.h - 664 sys sys 1015090372 642
-sys/src/cmd/9nfs/nfsmount.c - 664 sys sys 1182190701 6447
+sys/src/cmd/9nfs/nfsmount.c - 664 sys sys 1191523847 6447
 sys/src/cmd/9nfs/nfsserver.c - 664 sys sys 1146061148 15831
 sys/src/cmd/9nfs/pcnfsd.c - 664 sys sys 1146061148 4068
-sys/src/cmd/9nfs/portmapper.c - 664 sys sys 1146061148 3273
-sys/src/cmd/9nfs/rpc.c - 664 sys sys 1017337815 5293
+sys/src/cmd/9nfs/portmapper.c - 664 sys sys 1191523856 3306
+sys/src/cmd/9nfs/rpc.c - 664 sys sys 1191523822 5647
 sys/src/cmd/9nfs/rpc.h - 664 sys sys 1017337815 1996
-sys/src/cmd/9nfs/server.c - 664 sys sys 1178482676 11229
+sys/src/cmd/9nfs/server.c - 664 sys sys 1191523839 11320
 sys/src/cmd/9nfs/string.c - 664 sys sys 1017337815 1659
 sys/src/cmd/9nfs/strparse.c - 664 sys sys 1015090373 506
 sys/src/cmd/9nfs/system.c - 664 sys sys 1017337815 437
@@ -9614,7 +9612,6 @@ sys/src/cmd/auth/factotum/sshrsa.c - 664 sys sys 1107633793 3416
 sys/src/cmd/auth/factotum/util.c - 664 sys sys 1182192267 18452
 sys/src/cmd/auth/factotum/wep.c - 664 sys sys 1107706104 2140
 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 1191007186 19129
 sys/src/cmd/auth/lib - 20000000775 sys sys 1045504996 0
 sys/src/cmd/auth/lib/error.c - 664 sys sys 1155994850 318
@@ -9788,7 +9785,7 @@ sys/src/cmd/aux/lines.c - 664 sys sys 1015008782 546
 sys/src/cmd/aux/lis - 775 sys sys 944960794 45
 sys/src/cmd/aux/listen.c - 664 sys sys 1181789265 9292
 sys/src/cmd/aux/listen1.c - 664 sys sys 1143759349 2005
-sys/src/cmd/aux/mkfile - 664 sys sys 1147022848 1021
+sys/src/cmd/aux/mkfile - 664 sys sys 1191473306 1008
 sys/src/cmd/aux/mklatinkbd.c - 664 sys sys 953253425 3813
 sys/src/cmd/aux/mnihongo - 20000000775 sys sys 1039727550 0
 sys/src/cmd/aux/mnihongo/README - 664 sys sys 944960789 475
@@ -9814,7 +9811,6 @@ sys/src/cmd/aux/statusbar.c - 664 sys sys 1138460096 6066
 sys/src/cmd/aux/stub.c - 664 sys sys 1098196222 2723
 sys/src/cmd/aux/timesync.c - 664 sys sys 1178482886 25828
 sys/src/cmd/aux/trampoline.c - 664 sys sys 1126104850 3790
-sys/src/cmd/aux/typepasswd.c - 664 sys sys 1143759348 1749
 sys/src/cmd/aux/unlock - 664 sys sys 944960793 0
 sys/src/cmd/aux/usage.c - 664 sys sys 1139744276 1095
 sys/src/cmd/aux/vga - 20000000775 sys sys 1115734902 0
@@ -10350,7 +10346,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 1172764226 28088
+sys/src/cmd/file.c - 664 sys sys 1191472670 28522
 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

+ 24 - 0
dist/replica/plan9.log

@@ -53001,3 +53001,27 @@
 1191443404 0 c 386/bin/venti/venti - 775 sys sys 1191442426 705674
 1191447003 0 c sys/src/boot/pc/ether.c - 664 sys sys 1191446356 5411
 1191447003 1 c sys/src/boot/pc/etherigbe.c - 664 sys sys 1191446222 41284
+1191470404 0 c 386/9loaddebug - 775 sys sys 1191469884 435027
+1191474004 0 c sys/man/1/passwd - 664 sys sys 1191473503 1543
+1191474004 1 c sys/man/8/auth - 664 sys sys 1191472798 4996
+1191474004 2 c sys/src/cmd/aux/mkfile - 664 sys sys 1191473306 1008
+1191474004 3 c sys/src/cmd/file.c - 664 sys sys 1191472670 28522
+1191474004 4 d sys/src/cmd/aux/typepasswd.c - 664 sys sys 1143759348 0
+1191474004 5 d sys/src/cmd/auth/iam.c - 664 sys sys 1015008430 0
+1191474004 6 d 386/bin/aux/typepasswd - 775 sys sys 1168402288 0
+1191474004 7 d 386/bin/auth/iam - 775 sys sys 1085076981 0
+1191477605 0 c sys/src/9/pc/pcmciamodem.c - 664 sys sys 1191476436 1591
+1191477605 1 c sys/src/9/pc/sd63xxesb.c - 664 sys sys 1191476401 36280
+1191481204 0 c sys/man/3/sd - 664 sys sys 1191480432 5659
+1191481204 1 c sys/src/9/pc/sd63xxesb.c - 664 sys sys 1191481276 36244
+1191483004 0 c sys/src/9/pc/sd63xxesb.c - 664 sys sys 1191481587 36230
+1191524403 0 c sys/man/8/nfsserver - 664 sys sys 1191524525 3576
+1191524403 1 c sys/src/cmd/9nfs/all.h - 664 sys sys 1191523800 338
+1191524403 2 c sys/src/cmd/9nfs/dat.h - 664 sys sys 1191523808 4510
+1191524403 3 c sys/src/cmd/9nfs/mport.c - 664 sys sys 1191523814 3720
+1191524403 4 c sys/src/cmd/9nfs/nfsmount.c - 664 sys sys 1191523847 6447
+1191524403 5 c sys/src/cmd/9nfs/portmapper.c - 664 sys sys 1191523856 3306
+1191524403 6 c sys/src/cmd/9nfs/rpc.c - 664 sys sys 1191523822 5647
+1191524403 7 c sys/src/cmd/9nfs/server.c - 664 sys sys 1191523839 11320
+1191529803 0 c 386/bin/file - 775 sys sys 1191528973 128646
+1191538805 0 c sys/src/9/pc/ahci.h - 664 sys sys 1191538081 6316

+ 3 - 2
sys/man/1/passwd

@@ -1,10 +1,10 @@
 .TH PASSWD 1
 .SH NAME
-passwd, netkey, iam \- change user password
+passwd, netkey \- change or verify user password
 .SH SYNOPSIS
 .B passwd
 [
-.I username\fR[@\fPdomain\fR]\fP
+.IR username [@ domain ]
 ]
 .PP
 .B netkey
@@ -44,6 +44,7 @@ in
 .IR authsrv (2),
 .IR encrypt (2),
 .IR cons (3),
+.IR auth (8),
 .IR securenet (8)
 .PP
 Robert Morris and Ken Thompson,

+ 6 - 7
sys/man/3/sd

@@ -1,4 +1,4 @@
-.TH SD 3 
+.TH SD 3
 .SH NAME
 sd \- storage device interface
 .SH SYNOPSIS
@@ -12,7 +12,6 @@ sd \- storage device interface
 \&...
 .fi
 .SH DESCRIPTION
-.PP
 The storage device interface serves a two-level directory
 giving access to multiple storage units,
 typically ATA(PI) or SCSI discs.
@@ -135,7 +134,7 @@ inquiry KENWOOD CD-ROM UCR-421  208E10/20/99  7.39  2 M0
 config 85C0 capabilities 0F00 dma 00550004 dmactl 00000000
 geometry 242725 2352
 part data 0 242725
-% 
+%
 .EE
 .PP
 The use of DMA and multi-sector read/write commands may be
@@ -216,12 +215,14 @@ is a known controller type such as
 .B ata
 or
 .BR scsi .
-Writing `\fIctlletter message\fR' to
+Writing `\c
+.BI sd "ctlletter message\fR'
+to
 .B /dev/sdctl
 passes
 .I message
 to
-.IR ctlletter 's
+.BI sd ctlletter\fR's
 .B wtopctl
 function with an
 .B sdev
@@ -239,8 +240,6 @@ or
 .SH SEE ALSO
 .IR scuzz (8)
 .SH BUGS
-Still in development.
-.PP
 LUNs (logical unit numbers) are not implemented.
 For (S)ATA drives,
 LUNs are not merely ignored but are actively

+ 2 - 1
sys/man/8/auth

@@ -246,13 +246,14 @@ RADIUS server id's.
 List of users in the Plan 9 database.
 .TP
 .B /adm/netkeys.who
-List of users in  the SecureNet database.
+List of users in the SecureNet database.
 .TP
 .B /sys/lib/httppasswords
 List of realms and passwords for HTTP access.
 .SH SOURCE
 .B /sys/src/cmd/auth
 .SH "SEE ALSO"
+.IR passwd (1),
 .I readnvram
 in
 .IR authsrv (2),

+ 4 - 4
sys/man/8/nfsserver

@@ -1,6 +1,6 @@
 .TH NFSSERVER 8
 .SH NAME
-nfsserver, portmapper, pcnfsd, 9auth \- NFS service
+nfsserver, portmapper, pcnfsd \- NFS service
 .SH SYNOPSIS
 .B aux/nfsserver
 [
@@ -108,10 +108,10 @@ Listen for incoming TCP calls, rather than UDP calls.
 .PP
 NFS clients must be in the Plan 9
 .B /lib/ndb
-database.  
-The machine name is deduced from the IP address via 
+database.
+The machine name is deduced from the IP address via
 .BR ndb/query .
-The machine name specified in the NFS Unix credentials 
+The machine name specified in the NFS Unix credentials
 is completely ignored.
 .PP
 .I Pcnfsd

+ 2 - 2
sys/src/9/pc/ahci.h

@@ -143,8 +143,8 @@ enum {
 /* cmd register bits */
 enum {
 	Aicc	= 1<<28,	/* interface communcations control. 4 bits */
-	Aasp	= 1<<27,	/* agressive slumber & partial sleep */
-	Aalpe 	= 1<<26,	/* agressive link pm enable */
+	Aasp	= 1<<27,	/* aggressive slumber & partial sleep */
+	Aalpe 	= 1<<26,	/* aggressive link pm enable */
 	Adlae	= 1<<25,	/* drive led on atapi */
 	Aatapi	= 1<<24,	/* device is atapi */
 	Aesp	= 1<<21,	/* external sata port */

+ 2 - 1
sys/src/9/pc/pcmciamodem.c

@@ -67,7 +67,8 @@ pcmciamodemlink(void)
 			if(usingcom2)
 				com2used = 1;
 			if(ioalloc(isa.port, 8, 0, modems[j]) < 0)
-				print("%s port %lux already in use\n", modems[j], isa.port);
+				print("%s port %lux already in use\n",
+					modems[j], isa.port);
 			print("%s in pcmcia slot %d port 0x%lux irq %d\n",
 				modems[j], slot, isa.port, isa.irq);
 		}

+ 23 - 26
sys/src/9/pc/sd63xxesb.c

@@ -13,9 +13,9 @@
 #include "../port/sd.h"
 #include "ahci.h"
 
-#define	dprint(...)	if(debug == 1)	iprint(__VA_ARGS__); else USED(debug)
-#define	idprint(...)	if(prid == 1)	print(__VA_ARGS__);  else USED(prid)
-#define	aprint(...)	if(datapi == 1)	iprint(__VA_ARGS__); else USED(datapi)
+#define	dprint(...)	if(debug)	iprint(__VA_ARGS__); else USED(debug)
+#define	idprint(...)	if(prid)	print(__VA_ARGS__);  else USED(prid)
+#define	aprint(...)	if(datapi)	iprint(__VA_ARGS__); else USED(datapi)
 
 enum {
 	NCtlr	= 4,
@@ -123,9 +123,9 @@ typedef struct {
 	int	driveno;	/* ctlr*NCtlrdrv + unit */
 	/* controller port # != driveno when not all ports are enabled */
 	int	portno;
-}Drive;
+} Drive;
 
-struct Ctlr{
+struct Ctlr {
 	Lock;
 
 	int	type;
@@ -220,7 +220,7 @@ ahciclear(void *v)
 	Asleep *s;
 
 	s = v;
-	return (s->p->ci&s->i) == 0;
+	return (s->p->ci & s->i) == 0;
 }
 
 static void
@@ -256,7 +256,7 @@ nop(Aportc *pc)
 	Actab *t;
 	Alist *l;
 
-	if((pc->m->feat&Dnop) == 0)
+	if((pc->m->feat & Dnop) == 0)
 		return -1;
 
 	t = pc->m->ctab;
@@ -816,18 +816,20 @@ countbits(ulong u)
 }
 
 static int
-ahciconf(Ctlr *c)
+ahciconf(Ctlr *ctlr)
 {
 	Ahba *h;
 	u32int u;
 
-	h = c->hba = (Ahba*)c->mmio;
+	h = ctlr->hba = (Ahba*)ctlr->mmio;
 	u = h->cap;
 
 	if((u&Hsam) == 0)
 		h->ghc |= Hae;
 
-	print("ahci hba sss %d; ncs %d; coal %d; mports %d; led %d; clo %d; ems %d;\n",
+	print("#S/sd%c: ahci: port %#p: hba sss %d; ncs %d; coal %d; "
+		"mports %d; led %d; clo %d; ems %d;\n",
+		ctlr->sdev->idno, h,
 		(u>>27) & 1, (u>>8) & 0x1f, (u>>7) & 1, u & 0x1f, (u>>25) & 1,
 		(u>>24) & 1, (u>>6) & 1);
 	return countbits(h->pi);
@@ -1777,6 +1779,10 @@ loop:
 		c->lmmio = (ulong*)c->mmio;
 		c->pci = p;
 		c->type = type;
+		s->ifc = &sd63xxesbifc;
+		s->idno = 'E' + niactlr;
+		s->ctlr = c;
+		c->sdev = s;
 		if(Intel(c->type) && p->did != 0x2681)
 			iasetupahci(c);
 		nunit = ahciconf(c);
@@ -1787,16 +1793,11 @@ loop:
 			vunmap(c->mmio, p->mem[0].size);
 			continue;
 		}
+		s->nunit = nunit;
 
 		i = (c->hba->cap >> 21) & 1;
-		print("%s: sata-%s ports with %d ports\n",
+		print("#S/sd%c: %s: sata-%s with %d ports\n", s->idno,
 			tname[c->type], "I\0II" + i*2, nunit);
-		s->ifc = &sd63xxesbifc;
-		s->ctlr = c;
-		s->nunit = nunit;
-		s->idno = 'E';
-		c->sdev = s;
-		c->ndrive = nunit;
 
 		/* map the drives -- they don't all need to be enabled. */
 		memset(c->rawdrive, 0, sizeof c->rawdrive);
@@ -1828,6 +1829,7 @@ loop:
 		}
 
 		niadrive += nunit;
+		niactlr++;
 		if(head)
 			tail->next = s;
 		else
@@ -1847,13 +1849,11 @@ static char* smarttab[] = {
 static char *
 pflag(char *s, char *e, uchar f)
 {
-	uchar i, m;
+	uchar i;
 
-	for(i = 0; i < 8; i++){
-		m = 1 << i;
-		if(f & m)
+	for(i = 0; i < 8; i++)
+		if(f & (1 << i))
 			s = seprint(s, e, "%s ", flagname[i]);
-	}
 	return seprint(s, e, "\n");
 }
 
@@ -2113,10 +2113,7 @@ iawtopctl(SDev *, Cmdbuf *cmd)
 		*v ^= 1;
 		break;
 	case 2:
-		if(strcmp(f[1], "on") == 0)
-			*v = 1;
-		else
-			*v = 0;
+		*v = (strcmp(f[1], "on") == 0);
 		break;
 	}
 	return 0;

+ 1 - 0
sys/src/cmd/9nfs/all.h

@@ -1,5 +1,6 @@
 #include <u.h>
 #include <libc.h>
+#include <ip.h>
 #include <bio.h>
 #include <auth.h>
 #include <authsrv.h>

+ 5 - 2
sys/src/cmd/9nfs/dat.h

@@ -89,12 +89,15 @@ struct Reject
 
 struct Rpccall
 {
+	/* corresponds to Udphdr */
 	uchar	prefix0[12];
-	ulong	host;		/* prefixed to RPC message */
+	ulong	host;		/* ipv4 subset: prefixed to RPC message */
 	uchar	prefix1[12];
-	ulong	lhost;		/* prefixed to RPC message */
+	ulong	lhost;		/* ipv4 subset: prefixed to RPC message */
+	/* ignore ifcaddr */
 	ulong	port;		/* prefixed to RPC message */
 	ulong	lport;		/* prefixed to RPC message */
+
 	ulong	xid;		/* transaction id */
 	ulong	mtype;		/* CALL or REPLY */
 	union{

+ 5 - 8
sys/src/cmd/9nfs/mport.c

@@ -24,7 +24,7 @@ void
 main(int argc, char **argv)
 {
 	char addr[64], dir[64], name[128];
-	char buf[32], *p;
+	char buf[33], *p;
 	uchar *dataptr, *argptr;
 	int i, fd, n, remport;
 
@@ -38,6 +38,7 @@ main(int argc, char **argv)
 	}ARGEND
 	if(argc != 1)
 		exits("usage");
+
 	snprint(addr, sizeof addr, "udp!%s!111", argv[0]);
 	r.data = dial(addr, 0, dir, &r.ctl);
 	if(r.data < 0){
@@ -56,7 +57,7 @@ main(int argc, char **argv)
 		fprint(2, "can't open %s: %r\n", name);
 		exits("remote");
 	}
-	n = read(fd, buf, sizeof buf);
+	n = read(fd, buf, sizeof buf-1);
 	if(n < 0){
 		fprint(2, "can't read %s: %r\n", name);
 		exits("remote");
@@ -116,15 +117,11 @@ main(int argc, char **argv)
 	i = rpccall(&r, dataptr-(uchar*)r.cmd.args);
 	fprint(2, "export: %d bytes returned\n", i);
 	argptr = r.reply.results;
-	for(;;){
-		if(GLONG() == 0)
-			break;
+	while (GLONG() != 0) {
 		n = GLONG();
 		p = GPTR(n);
 		print("%.*s\n", utfnlen(p, n), p);
-		for(;;){
-			if(GLONG() == 0)
-				break;
+		while (GLONG() != 0) {
 			n = GLONG();
 			p = GPTR(n);
 			print("\t%.*s\n", utfnlen(p, n), p);

+ 1 - 1
sys/src/cmd/9nfs/nfsmount.c

@@ -325,7 +325,7 @@ xfroot(char *name, int n)
 		p = strrchr(s->service, '!');	/* for -a tcp!foo */
 		if(p && strncmp(name, p+1, n) == 0)
 			return s->root;
-		p = strrchr(s->service, '/');	/* for -a /srv/foo */
+		p = strrchr(s->service, '/');	/* for -f /srv/foo */
 		if(p && strncmp(name, p+1, n) == 0)
 			return s->root;
 	}

+ 5 - 3
sys/src/cmd/9nfs/portmapper.c

@@ -1,7 +1,9 @@
+/*
+ * sunrpc portmapper
+ */
 #include "all.h"
 
 typedef struct Portmap	Portmap;
-
 struct Portmap
 {
 	int	prog;
@@ -11,8 +13,8 @@ struct Portmap
 };
 
 Portmap map[] = {
-	100003, 2, IPPROTO_UDP, 2049,	/* nfs */
-//	100003, 3, IPPROTO_UDP, 2049,	/* nfs */
+	100003, 2, IPPROTO_UDP, 2049,	/* nfs v2 */
+//	100003, 3, IPPROTO_UDP, 2049,	/* nfs v3 */
 	100005, 1, IPPROTO_UDP, 2049,	/* mount */
 	150001, 2, IPPROTO_UDP, 1111,	/* pcnfsd v2 */
 	150001, 1, IPPROTO_UDP, 1111,	/* pcnfsd v1 */

+ 24 - 14
sys/src/cmd/9nfs/rpc.c

@@ -6,24 +6,26 @@
 #define SKIPLONG	p += 4
 #define	PTR(x, n)	r->x = (void *)(p); p += ROUNDUP(n)
 
-uchar v4prefix[12] = {
-	0, 0, 0, 0,
-	0, 0, 0, 0,
-	0, 0, 0xff, 0xff,
-};
-
 int
 rpcM2S(void *ap, Rpccall *r, int n)
 {
-	uchar *p = ap;
 	int k;
+	uchar *p;
+	Udphdr *up;
 
-	p += 12;
+	/* copy IPv4 header fields from Udphdr */
+	up = ap;
+	p = &up->raddr[IPaddrlen - IPv4addrlen];
 	LONG(host);
-	p += 12;
+	USED(p);
+	p = &up->laddr[IPaddrlen - IPv4addrlen];
 	LONG(lhost);
+	USED(p);
+	/* ignore up->ifcaddr */
+	p = up->rport;
 	SHORT(port);
 	SHORT(lport);
+
 	LONG(xid);
 	LONG(mtype);
 	switch(r->mtype){
@@ -143,16 +145,24 @@ string2S(void *arg, String *r)
 int
 rpcS2M(Rpccall *r, int ndata, void *ap)
 {
-	uchar *p = ap;
+	uchar *p;
+	Udphdr *up;
 
-	memmove(p, v4prefix, 12);
-	p += 12;
+	/* copy header fields to Udphdr */
+	up = ap;
+	memmove(up->raddr, v4prefix, IPaddrlen);
+	p = &up->raddr[IPaddrlen - IPv4addrlen];
 	LONG(host);
-	memmove(p, v4prefix, 12);
-	p += 12;
+	USED(p);
+	memmove(up->laddr, v4prefix, IPaddrlen);
+	p = &up->laddr[IPaddrlen - IPv4addrlen];
 	LONG(lhost);
+	USED(p);
+	memmove(up->ifcaddr, IPnoaddr, sizeof up->ifcaddr);
+	p = up->rport;
 	SHORT(port);
 	SHORT(lport);
+
 	LONG(xid);
 	LONG(mtype);
 	switch(r->mtype){

+ 7 - 6
sys/src/cmd/9nfs/server.c

@@ -1,6 +1,5 @@
 #include "all.h"
 #include <ndb.h>
-#include <ip.h>
 
 static int	alarmflag;
 
@@ -144,7 +143,8 @@ tcpserver(int myport, Progmap *progmap)
 		if(actl < 0){
 			actl = announce(ds, adir);
 			if(actl < 0){
-				clog("%s: listening to tcp port %d\n", argv0, myport);
+				clog("%s: listening to tcp port %d\n",
+					argv0, myport);
 				clog("announcing: %r");
 				break;
 			}
@@ -169,12 +169,12 @@ tcpserver(int myport, Progmap *progmap)
 			if(data < 0)
 				exits(0);
 
+			/* pretend it's udp; fill in Udphdr */
 			getendpoints((Udphdr*)buf, ldir);
 
-			for(;;){
-				if(servemsg(data, readtcp, writetcp, myport, progmap) < 0)
-					break;
-			}
+			while (servemsg(data, readtcp, writetcp, myport,
+			    progmap) >= 0)
+				continue;
 			close(data);
 			exits(0);
 		}
@@ -328,6 +328,7 @@ getendpoint(char *dir, char *file, uchar *addr, uchar *port)
 	hnputs(port, n);
 }
 
+/* set Udhphdr values from protocol dir local & remote files */
 static void
 getendpoints(Udphdr *ep, char *dir)
 {

+ 0 - 49
sys/src/cmd/auth/iam.c

@@ -1,49 +0,0 @@
-#include <u.h>
-#include <libc.h>
-#include <authsrv.h>
-#include <ctype.h>
-#include "authcmdlib.h"
-
-void
-main(int argc, char **argv)
-{
-	char user[ANAMELEN];
-	char p9pass[32];
-	char key[DESKEYLEN];
-	int fd;
-
-	ARGBEGIN{
-	}ARGEND;
-
-	switch(argc){
-	case 2:
-		strncpy(user, argv[0], ANAMELEN);
-		user[ANAMELEN-1] = 0;
-		passtokey(key, argv[1]);
-		break;
-	case 1:
-		strncpy(user, argv[0], ANAMELEN);
-		user[ANAMELEN-1] = 0;
-		getpass(key, p9pass, 0, 0);
-		break;
-	case 0:
-		strcpy(user, getuser());
-		getpass(key, p9pass, 0, 0);
-		break;
-	default:
-		fprint(2, "usage: auth/iam [user [password]]\n");
-		break; 
-	}
-
-	fd = open("/dev/key", OWRITE);
-	if(fd < 0)
-		sysfatal("open key");
-	write(fd, key, DESKEYLEN);
-	close(fd);
-
-	fd = open("/dev/hostowner", OWRITE);
-	if(fd < 0)
-		sysfatal("open hostowner");
-	write(fd, user, strlen(user));
-	close(fd);
-}

+ 0 - 1
sys/src/cmd/aux/mkfile

@@ -33,7 +33,6 @@ TARG=\
 	stub\
 	timesync\
 	trampoline\
-	typepasswd\
 	usage\
 	write\
 	zerotrunc\

+ 0 - 107
sys/src/cmd/aux/typepasswd.c

@@ -1,107 +0,0 @@
-#include <u.h>
-#include <libc.h>
-#include <authsrv.h>
-
-int	readln(char*, char*, int);
-void	error(char*, ...);
-void	passwd(char*);
-
-void
-main(int argc, char *argv[])
-{
-	char np[64];
-
-	argc--;
-	argv0 = *argv;
-	if(argc){
-		fprint(2, "usage: typepasswd\n");
-		exits("usage");
-	}
-	if(access("#i/draw", AEXIST) < 0){
-		fprint(2, "typepasswd: must be run on a terminal\n");
-		exits("run typepasswd on a terminal");
-	}
-	readln("New password:", np, sizeof np);
-	passwd(np);
-	exits(0);
-}
-
-void
-passwd(char *p)
-{
-	char key[DESKEYLEN];
-	int fd;
-
-	if(passtokey(key, p) == 0)
-		error("bad password");
-	fd = open("/dev/key", OWRITE);
-	if(fd < 0)
-		error("can't open /dev/key");
-	if(write(fd, key, DESKEYLEN) != DESKEYLEN)
-		error("can't write key");
-	close(fd);
-	print("password changed\n");
-}
-
-int
-readln(char *prompt, char *line, int len)
-{
-	char *p;
-	int fd, ctl, n, nr;
-
-	fd = open("/dev/cons", ORDWR);
-	if(fd < 0)
-		error("couldn't open cons");
-	ctl = open("/dev/consctl", OWRITE);
-	if(ctl < 0)
-		error("couldn't set raw mode");
-	write(ctl, "rawon", 5);
-	fprint(fd, "%s", prompt);
-	nr = 0;
-	p = line;
-	for(;;){
-		n = read(fd, p, 1);
-		if(n < 0){
-			close(ctl);
-			close(fd);
-			return -1;
-		}
-		if(n == 0 || *p == '\n' || *p == '\r'){
-			*p = '\0';
-			write(fd, "\n", 1);
-			close(ctl);
-			close(fd);
-			return nr;
-		}
-		if(*p == '\b'){
-			if(nr > 0){
-				nr--;
-				p--;
-			}
-		}else{
-			nr++;
-			p++;
-		}
-		if(nr == len){
-			fprint(2, "line too long; try again\n");
-			nr = 0;
-			p = line;
-		}
-	}
-}
-
-void
-error(char *fmt, ...)
-{
-	va_list arg;
-	char buf[8192], *s;
-
-	s = buf;
-	s += sprint(s, "%s: ", argv0);
-	va_start(arg, fmt);
-	s = vseprint(s, buf + sizeof(buf) / sizeof(*buf), fmt, arg);
-	va_end(arg);
-	*s++ = '\n';
-	write(2, buf, s - buf);
-	exits(buf);
-}

+ 44 - 29
sys/src/cmd/file.c

@@ -188,9 +188,9 @@ int	(*call[])(void) =
 	islimbo,	/* limbo source */
 	isc,		/* c & alef compiler key words */
 	isas,		/* assembler key words */
-	ismung,		/* entropy compressed/encrypted */
 	isp9font,	/* plan 9 font */
 	isp9bit,	/* plan 9 image (as from /dev/window) */
+	ismung,		/* entropy compressed/encrypted */
 	isenglish,	/* char frequency English */
 	isrtf,		/* rich text format */
 	ismsdos,	/* msdos exe (virus file attachement) */
@@ -278,7 +278,7 @@ int
 fullrune1(char *p, int n)
 {
 	int c;
-	
+
 	if(n >= 1) {
 		c = *(uchar*)p;
 		if(c < 0x80)
@@ -298,7 +298,7 @@ chartorune1(Rune1 *rune, char *str)
 {
 	int c, c1, c2, c3, n;
 	Rune r;
-	
+
 	c = *(uchar*)str;
 	if(c < 0xF0){
 		r = 0;
@@ -775,7 +775,6 @@ struct	FILE_STRING
 	"%PDF",			"PDF",				4,	"application/pdf",
 	"<html>\n",		"HTML file",			7,	"text/html",
 	"<HTML>\n",		"HTML file",			7,	"text/html",
-	"compressed\n",		"Compressed image or subfont",	11,	"application/octet-stream",
 	"\111\111\052\000",	"tiff",				4,	"image/tiff",
 	"\115\115\000\052",	"tiff",				4,	"image/tiff",
 	"\377\330\377\340",	"jpeg",				4,	"image/jpeg",
@@ -839,7 +838,7 @@ struct offstr
 	ulong	off;
 	struct FILE_STRING;
 } offstrs[] = {
-	32*1024, "\001CD001\001",	"ISO9660 CD image",	7,	OCTET,	
+	32*1024, "\001CD001\001",	"ISO9660 CD image",	7,	OCTET,
 	0, 0, 0, 0, 0
 };
 
@@ -1227,75 +1226,85 @@ depthof(char *s, int *newp)
 	*newp = 1;
 	d = 0;
 	while(s<es && *s!=' '){
-		s++;	/* skip letter */
+		s++;			/* skip letter */
 		d += strtoul(s, &s, 10);
 	}
 
-	switch(d){
-	case 32:
-	case 24:
-	case 16:
-	case 8:
+	if(d % 8 == 0 || 8 % d == 0)
 		return d;
-	}
-	return -1;
+	else
+		return -1;
 }
 
 int
 isp9bit(void)
 {
-	int dep, lox, loy, hix, hiy, px, new;
+	int dep, lox, loy, hix, hiy, px, new, cmpr;
 	ulong t;
 	long len;
 	char *newlabel;
+	uchar *cp;
 
+	cp = buf;
+	cmpr = 0;
 	newlabel = "old ";
 
-	dep = depthof((char*)buf + 0*P9BITLEN, &new);
+	if(memcmp(cp, "compressed\n", 11) == 0) {
+		cmpr = 1;
+		cp = buf + 11;
+	}
+
+	dep = depthof((char*)cp + 0*P9BITLEN, &new);
 	if(new)
 		newlabel = "";
-	lox = p9bitnum(buf + 1*P9BITLEN);
-	loy = p9bitnum(buf + 2*P9BITLEN);
-	hix = p9bitnum(buf + 3*P9BITLEN);
-	hiy = p9bitnum(buf + 4*P9BITLEN);
+	lox = p9bitnum(cp + 1*P9BITLEN);
+	loy = p9bitnum(cp + 2*P9BITLEN);
+	hix = p9bitnum(cp + 3*P9BITLEN);
+	hiy = p9bitnum(cp + 4*P9BITLEN);
 	if(dep < 0 || lox < 0 || loy < 0 || hix < 0 || hiy < 0)
 		return 0;
 
 	if(dep < 8){
-		px = 8/dep;	/* pixels per byte */
+		px = 8/dep;		/* pixels per byte */
 		/* set l to number of bytes of data per scan line */
 		if(lox >= 0)
 			len = (hix+px-1)/px - lox/px;
-		else{	/* make positive before divide */
+		else{			/* make positive before divide */
 			t = (-lox)+px-1;
 			t = (t/px)*px;
 			len = (t+hix+px-1)/px;
 		}
 	}else
 		len = (hix-lox)*dep/8;
-	len *= (hiy-loy);		/* col length */
-	len += 5*P9BITLEN;		/* size of initial ascii */
+	len *= hiy - loy;		/* col length */
+	len += 5 * P9BITLEN;		/* size of initial ascii */
 
 	/*
+	 * for compressed images, don't look any further. otherwise:
 	 * for image file, length is non-zero and must match calculation above
 	 * for /dev/window and /dev/screen the length is always zero
 	 * for subfont, the subfont header should follow immediately.
 	 */
+	if (cmpr) {
+		print(mime ? OCTET : "Compressed %splan 9 image or subfont, depth %d\n",
+			newlabel, dep);
+		return 1;
+	}
 	if (len != 0 && mbuf->length == 0) {
-		print("%splan 9 image\n", newlabel);
+		print(mime ? OCTET : "%splan 9 image, depth %d\n", newlabel, dep);
 		return 1;
 	}
 	if (mbuf->length == len) {
-		print("%splan 9 image\n", newlabel);
+		print(mime ? OCTET : "%splan 9 image, depth %d\n", newlabel, dep);
 		return 1;
 	}
 	/* Ghostscript sometimes produces a little extra on the end */
 	if (mbuf->length < len+P9BITLEN) {
-		print("%splan 9 image\n", newlabel);
+		print(mime ? OCTET : "%splan 9 image, depth %d\n", newlabel, dep);
 		return 1;
 	}
 	if (p9subfont(buf+len)) {
-		print("%ssubfont file\n", newlabel);
+		print(mime ? OCTET : "%ssubfont file, depth %d\n", newlabel, dep);
 		return 1;
 	}
 	return 0;
@@ -1306,7 +1315,7 @@ p9subfont(uchar *p)
 {
 	int n, h, a;
 
-		/* if image too big, assume it's a subfont */
+	/* if image too big, assume it's a subfont */
 	if (p+3*P9BITLEN > buf+sizeof(buf))
 		return 1;
 
@@ -1442,6 +1451,7 @@ iself(void)
 
 	if (memcmp(buf, "\x7fELF", 4) == 0){
 		if (!mime){
+			int isdifend = 0;
 			int n = (buf[19] << 8) | buf[18];
 			char *p = "unknown";
 			char *t = "unknown";
@@ -1450,11 +1460,16 @@ iself(void)
 				p = cpu[n];
 			else {
 				/* try the other byte order */
+				isdifend = 1;
 				n = (buf[18] << 8) | buf[19];
 				if (n > 0 && n < nelem(cpu) && cpu[n])
 					p = cpu[n];
 			}
-			n = buf[16];
+			if(isdifend)
+				n = (buf[16]<< 8) | buf[17];
+			else
+				n = (buf[17]<< 8) | buf[16];
+
 			if(n>0 && n < nelem(type) && type[n])
 				t = type[n];
 			print("%s ELF %s\n", p, t);