Browse Source

Plan 9 from Bell Labs 2008-01-31

David du Colombier 12 years ago
parent
commit
1827648fd9

+ 28 - 7
dist/replica/_plan9.db

@@ -5524,7 +5524,7 @@ rc/bin/ipconf/inside - 775 sys sys 1058790955 427
 rc/bin/ipconf/lra - 775 sys sys 1058791152 1558
 rc/bin/ipconf/outside - 775 sys sys 1058790951 550
 rc/bin/ipconf/theworld - 775 sys sys 1058790940 1212
-rc/bin/ipso - 775 sys sys 1079377794 2838
+rc/bin/ipso - 775 sys sys 1201722823 3048
 rc/bin/ipv6on - 775 sys sys 1186362803 2047
 rc/bin/iwhois - 775 sys sys 1188682646 1792
 rc/bin/juke - 775 sys sys 1105565140 1131
@@ -7446,7 +7446,7 @@ sys/man/1/nm - 664 sys sys 1196638932 1601
 sys/man/1/ns - 664 sys sys 1196638935 895
 sys/man/1/p - 664 sys sys 1196638933 504
 sys/man/1/page - 664 sys sys 1196638935 5839
-sys/man/1/passwd - 664 sys sys 1196638935 1543
+sys/man/1/passwd - 664 sys sys 1201730866 1591
 sys/man/1/patch - 664 sys sys 1196638936 2588
 sys/man/1/pcc - 664 sys sys 1196638933 3478
 sys/man/1/pic - 664 sys sys 1196638933 8229
@@ -14475,8 +14475,8 @@ sys/src/cmd/vnc/vncv.h - 664 sys sys 1044880750 643
 sys/src/cmd/vnc/wsys.c - 664 sys sys 1138065372 4197
 sys/src/cmd/vt - 20000000775 sys sys 1039727677 0
 sys/src/cmd/vt/cons.h - 664 sys sys 1186695308 1812
-sys/src/cmd/vt/consctl.c - 664 sys sys 1135487947 1845
-sys/src/cmd/vt/event.c - 664 sys sys 1133808292 1071
+sys/src/cmd/vt/consctl.c - 664 sys sys 1201747864 1451
+sys/src/cmd/vt/event.c - 664 sys sys 1201747864 1013
 sys/src/cmd/vt/event.h - 664 sys sys 944961620 192
 sys/src/cmd/vt/hp.c - 664 sys sys 1133808292 3362
 sys/src/cmd/vt/main.c - 664 sys sys 1186696182 14785
@@ -14492,7 +14492,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 1172759957 10408
+sys/src/cmd/webfs/http.c - 664 sys sys 1201721955 10572
 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
@@ -14911,7 +14911,6 @@ sys/src/libc/9sys - 20000000775 sys sys 1117193453 0
 sys/src/libc/9sys/abort.c - 664 sys sys 944961712 75
 sys/src/libc/9sys/access.c - 664 sys sys 1019498851 421
 sys/src/libc/9sys/announce.c - 664 sys sys 1084468743 4614
-sys/src/libc/9sys/consctl.c - 664 sys sys 984709400 1487
 sys/src/libc/9sys/convD2M.c - 664 sys sys 1117193453 1399
 sys/src/libc/9sys/convM2D.c - 664 sys sys 1014927336 1419
 sys/src/libc/9sys/convM2S.c - 664 sys sys 1017679320 4969
@@ -15373,7 +15372,7 @@ sys/src/libip/myipaddr.c - 664 sys sys 1069766545 841
 sys/src/libip/parseether.c - 664 sys sys 944961726 318
 sys/src/libip/parseip.c - 664 sys sys 1169595542 2429
 sys/src/libip/ptclbsum.c - 664 sys sys 1132452948 1160
-sys/src/libip/readipifc.c - 664 sys sys 1161442538 4247
+sys/src/libip/readipifc.c - 664 sys sys 1201723612 4396
 sys/src/libip/testreadipifc.c - 664 sys sys 1021580003 400
 sys/src/liblex - 20000000775 sys sys 1039727690 0
 sys/src/liblex/allprint.c - 664 sys sys 944961728 473
@@ -15857,3 +15856,25 @@ 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/ftpfs - 775 sys sys 1201753335 271932
+386/bin/netstat - 775 sys sys 1201753371 85222
+386/bin/webfs - 775 sys sys 1201753380 360586
+386/bin/aquarela - 775 sys sys 1201753315 337721
+386/bin/auth/authsrv - 775 sys sys 1201753318 165370
+386/bin/auth/guard.srv - 775 sys sys 1201753321 144750
+386/bin/auth/secstored - 775 sys sys 1201753324 197600
+386/bin/cifscmd - 775 sys sys 1201753330 348567
+386/bin/ip/6in4 - 775 sys sys 1201753336 91799
+386/bin/ip/dhcpd - 775 sys sys 1201753339 151468
+386/bin/ip/ipconfig - 775 sys sys 1201753341 159810
+386/bin/ip/ping - 775 sys sys 1201753343 93276
+386/bin/ip/ppp - 775 sys sys 1201753347 220377
+386/bin/ip/pptpd - 775 sys sys 1201753349 124782
+386/bin/ip/rarpd - 775 sys sys 1201753351 111368
+386/bin/ip/rip - 775 sys sys 1201753352 90020
+386/bin/ndb/cs - 775 sys sys 1201753355 149092
+386/bin/ndb/dns - 775 sys sys 1201753360 296759
+386/bin/ndb/dnsdebug - 775 sys sys 1201753365 270779
+386/bin/ndb/dnstcp - 775 sys sys 1201753369 268660
+386/bin/vt - 775 sys sys 1201753374 176609
+386/lib/libip.a - 664 sys sys 1201753381 35036

+ 28 - 29
dist/replica/plan9.db

@@ -36,7 +36,7 @@
 386/bin/ape/stty - 775 sys sys 1148500571 41080
 386/bin/ape/tar - 775 sys sys 1168402264 62184
 386/bin/ape/uname - 775 sys sys 1173754552 134895
-386/bin/aquarela - 775 sys sys 1200631754 337609
+386/bin/aquarela - 775 sys sys 1201753315 337721
 386/bin/ar - 775 sys sys 1178939751 114363
 386/bin/archfs - 775 sys sys 1179372067 146788
 386/bin/ascii - 775 sys sys 1168402265 64884
@@ -44,7 +44,7 @@
 386/bin/auth - 20000000775 sys sys 1016920815 0
 386/bin/auth/aescbc - 775 sys sys 1188702764 140221
 386/bin/auth/asn12rsa - 775 sys sys 1188446816 121912
-386/bin/auth/authsrv - 775 sys sys 1188446820 165258
+386/bin/auth/authsrv - 775 sys sys 1201753318 165370
 386/bin/auth/changeuser - 775 sys sys 1178568246 96020
 386/bin/auth/convkeys - 775 sys sys 1188446822 87298
 386/bin/auth/convkeys2 - 775 sys sys 1188446825 87357
@@ -54,7 +54,7 @@
 386/bin/auth/enable - 775 sys sys 1020319057 134
 386/bin/auth/factotum - 775 sys sys 1200717245 321923
 386/bin/auth/fgui - 775 sys sys 1197732639 219095
-386/bin/auth/guard.srv - 775 sys sys 1188446841 144638
+386/bin/auth/guard.srv - 775 sys sys 1201753321 144750
 386/bin/auth/keyfs - 775 sys sys 1191035876 116576
 386/bin/auth/login - 775 sys sys 1196742440 104821
 386/bin/auth/newns - 775 sys sys 1179372070 90035
@@ -70,7 +70,7 @@
 386/bin/auth/rsagen - 775 sys sys 1178568249 151953
 386/bin/auth/secretpem - 775 sys sys 1045537944 118526
 386/bin/auth/secstore - 775 sys sys 1188702769 192724
-386/bin/auth/secstored - 775 sys sys 1188702773 197480
+386/bin/auth/secstored - 775 sys sys 1201753324 197600
 386/bin/auth/secuser - 775 sys sys 1188702776 149443
 386/bin/auth/status - 775 sys sys 1020319060 738
 386/bin/auth/uniq - 775 sys sys 1168402275 63314
@@ -177,7 +177,7 @@
 386/bin/cfs - 775 sys sys 1190863294 130565
 386/bin/chgrp - 775 sys sys 1168402294 59522
 386/bin/chmod - 775 sys sys 1168402294 62518
-386/bin/cifscmd - 775 sys sys 1200631760 348455
+386/bin/cifscmd - 775 sys sys 1201753330 348567
 386/bin/cleanname - 775 sys sys 1168402295 58541
 386/bin/clock - 775 sys sys 1197732691 157356
 386/bin/cmp - 775 sys sys 1157597609 40658
@@ -250,7 +250,7 @@
 386/bin/fs/v10fs - 775 sys sys 1178568274 94797
 386/bin/fs/v6fs - 775 sys sys 1178568274 93881
 386/bin/fs/zipfs - 775 sys sys 1178568274 108444
-386/bin/ftpfs - 775 sys sys 1188446930 271820
+386/bin/ftpfs - 775 sys sys 1201753335 271932
 386/bin/games - 20000000775 sys sys 1096298711 0
 386/bin/games/4s - 775 sys sys 1197732711 177612
 386/bin/games/5s - 775 sys sys 1197732721 179900
@@ -287,9 +287,9 @@
 386/bin/import - 775 sys sys 1188447232 103492
 386/bin/iostats - 775 sys sys 1178568280 98906
 386/bin/ip - 20000000775 sys sys 1016920851 0
-386/bin/ip/6in4 - 775 sys sys 1187061208 91687
+386/bin/ip/6in4 - 775 sys sys 1201753336 91799
 386/bin/ip/dhcpclient - 775 sys sys 1178568281 92992
-386/bin/ip/dhcpd - 775 sys sys 1198211701 151356
+386/bin/ip/dhcpd - 775 sys sys 1201753339 151468
 386/bin/ip/dhcpleases - 775 sys sys 1198211703 85140
 386/bin/ip/ftpd - 775 sys sys 1200262762 170828
 386/bin/ip/gping - 775 sys sys 1198211707 182214
@@ -305,16 +305,16 @@
 386/bin/ip/httpd/wikipost - 775 sys sys 1191273662 114183
 386/bin/ip/httpfile - 775 sys sys 1188447244 284004
 386/bin/ip/imap4d - 775 sys sys 1188447250 236867
-386/bin/ip/ipconfig - 775 sys sys 1186112228 159700
+386/bin/ip/ipconfig - 775 sys sys 1201753341 159810
 386/bin/ip/linklocal - 775 sys sys 1197732767 45613
-386/bin/ip/ping - 775 sys sys 1198211709 93164
-386/bin/ip/ppp - 775 sys sys 1188447254 220265
+386/bin/ip/ping - 775 sys sys 1201753343 93276
+386/bin/ip/ppp - 775 sys sys 1201753347 220377
 386/bin/ip/pppoe - 775 sys sys 1168402326 77787
 386/bin/ip/pptp - 775 sys sys 1184731239 127160
-386/bin/ip/pptpd - 775 sys sys 1178568289 124670
-386/bin/ip/rarpd - 775 sys sys 1178654264 111254
+386/bin/ip/pptpd - 775 sys sys 1201753349 124782
+386/bin/ip/rarpd - 775 sys sys 1201753351 111368
 386/bin/ip/rexexec - 775 sys sys 1179372096 90284
-386/bin/ip/rip - 775 sys sys 1178568290 89908
+386/bin/ip/rip - 775 sys sys 1201753352 90020
 386/bin/ip/rlogind - 775 sys sys 1178568290 66192
 386/bin/ip/telnetd - 775 sys sys 1196742496 121995
 386/bin/ip/tftpd - 775 sys sys 1179372096 130740
@@ -342,19 +342,19 @@
 386/bin/mug - 775 sys sys 1197732786 176443
 386/bin/mv - 775 sys sys 1168402336 66629
 386/bin/ndb - 20000000775 sys sys 985743147 0
-386/bin/ndb/cs - 775 sys sys 1188530160 148982
+386/bin/ndb/cs - 775 sys sys 1201753355 149092
 386/bin/ndb/csquery - 775 sys sys 1176488418 61652
-386/bin/ndb/dns - 775 sys sys 1201551691 296647
-386/bin/ndb/dnsdebug - 775 sys sys 1201551695 270667
+386/bin/ndb/dns - 775 sys sys 1201753360 296759
+386/bin/ndb/dnsdebug - 775 sys sys 1201753365 270779
 386/bin/ndb/dnsquery - 775 sys sys 1185334136 64350
-386/bin/ndb/dnstcp - 775 sys sys 1201551700 268548
+386/bin/ndb/dnstcp - 775 sys sys 1201753369 268660
 386/bin/ndb/ipquery - 775 sys sys 1178568296 95524
 386/bin/ndb/mkdb - 775 sys sys 1168402340 64211
 386/bin/ndb/mkhash - 775 sys sys 1178568296 83312
 386/bin/ndb/mkhosts - 775 sys sys 1178568296 84355
 386/bin/ndb/query - 775 sys sys 1188447268 82960
 386/bin/netkey - 775 sys sys 1168402341 72717
-386/bin/netstat - 775 sys sys 1169612032 85184
+386/bin/netstat - 775 sys sys 1201753371 85222
 386/bin/news - 775 sys sys 1168402341 71956
 386/bin/nfs - 775 sys sys 1184731239 320151
 386/bin/nm - 775 sys sys 1188530182 130190
@@ -517,11 +517,11 @@
 386/bin/venti/write - 775 sys sys 1190716792 155215
 386/bin/vncs - 775 sys sys 1188447411 471527
 386/bin/vncv - 775 sys sys 1188447423 518952
-386/bin/vt - 775 sys sys 1197732850 176867
+386/bin/vt - 775 sys sys 1201753374 176609
 386/bin/vtdump - 775 sys sys 1196742626 161697
 386/bin/wc - 775 sys sys 1148500701 41191
 386/bin/webcookies - 775 sys sys 1179372114 166178
-386/bin/webfs - 775 sys sys 1200262801 360416
+386/bin/webfs - 775 sys sys 1201753380 360586
 386/bin/webfsget - 775 sys sys 1148500702 39177
 386/bin/wikifs - 775 sys sys 1200025151 203038
 386/bin/winwatch - 775 sys sys 1200262804 155342
@@ -570,7 +570,7 @@
 386/lib/libgeometry.a - 664 sys sys 1168402366 50470
 386/lib/libhtml.a - 664 sys sys 1186370975 229202
 386/lib/libhttpd.a - 664 sys sys 1191273745 100822
-386/lib/libip.a - 664 sys sys 1198211711 34710
+386/lib/libip.a - 664 sys sys 1201753381 35036
 386/lib/libl.a - 664 sys sys 1168402367 5372
 386/lib/libmach.a - 664 sys sys 1196972899 807480
 386/lib/libmemdraw.a - 664 sys sys 1168402369 284092
@@ -5524,7 +5524,7 @@ rc/bin/ipconf/inside - 775 sys sys 1058790955 427
 rc/bin/ipconf/lra - 775 sys sys 1058791152 1558
 rc/bin/ipconf/outside - 775 sys sys 1058790951 550
 rc/bin/ipconf/theworld - 775 sys sys 1058790940 1212
-rc/bin/ipso - 775 sys sys 1079377794 2838
+rc/bin/ipso - 775 sys sys 1201722823 3048
 rc/bin/ipv6on - 775 sys sys 1186362803 2047
 rc/bin/iwhois - 775 sys sys 1188682646 1792
 rc/bin/juke - 775 sys sys 1105565140 1131
@@ -7446,7 +7446,7 @@ sys/man/1/nm - 664 sys sys 1196638932 1601
 sys/man/1/ns - 664 sys sys 1196638935 895
 sys/man/1/p - 664 sys sys 1196638933 504
 sys/man/1/page - 664 sys sys 1196638935 5839
-sys/man/1/passwd - 664 sys sys 1196638935 1543
+sys/man/1/passwd - 664 sys sys 1201730866 1591
 sys/man/1/patch - 664 sys sys 1196638936 2588
 sys/man/1/pcc - 664 sys sys 1196638933 3478
 sys/man/1/pic - 664 sys sys 1196638933 8229
@@ -14475,8 +14475,8 @@ sys/src/cmd/vnc/vncv.h - 664 sys sys 1044880750 643
 sys/src/cmd/vnc/wsys.c - 664 sys sys 1138065372 4197
 sys/src/cmd/vt - 20000000775 sys sys 1039727677 0
 sys/src/cmd/vt/cons.h - 664 sys sys 1186695308 1812
-sys/src/cmd/vt/consctl.c - 664 sys sys 1135487947 1845
-sys/src/cmd/vt/event.c - 664 sys sys 1133808292 1071
+sys/src/cmd/vt/consctl.c - 664 sys sys 1201747864 1451
+sys/src/cmd/vt/event.c - 664 sys sys 1201747864 1013
 sys/src/cmd/vt/event.h - 664 sys sys 944961620 192
 sys/src/cmd/vt/hp.c - 664 sys sys 1133808292 3362
 sys/src/cmd/vt/main.c - 664 sys sys 1186696182 14785
@@ -14492,7 +14492,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 1172759957 10408
+sys/src/cmd/webfs/http.c - 664 sys sys 1201721955 10572
 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
@@ -14911,7 +14911,6 @@ sys/src/libc/9sys - 20000000775 sys sys 1117193453 0
 sys/src/libc/9sys/abort.c - 664 sys sys 944961712 75
 sys/src/libc/9sys/access.c - 664 sys sys 1019498851 421
 sys/src/libc/9sys/announce.c - 664 sys sys 1084468743 4614
-sys/src/libc/9sys/consctl.c - 664 sys sys 984709400 1487
 sys/src/libc/9sys/convD2M.c - 664 sys sys 1117193453 1399
 sys/src/libc/9sys/convM2D.c - 664 sys sys 1014927336 1419
 sys/src/libc/9sys/convM2S.c - 664 sys sys 1017679320 4969
@@ -15373,7 +15372,7 @@ sys/src/libip/myipaddr.c - 664 sys sys 1069766545 841
 sys/src/libip/parseether.c - 664 sys sys 944961726 318
 sys/src/libip/parseip.c - 664 sys sys 1169595542 2429
 sys/src/libip/ptclbsum.c - 664 sys sys 1132452948 1160
-sys/src/libip/readipifc.c - 664 sys sys 1161442538 4247
+sys/src/libip/readipifc.c - 664 sys sys 1201723612 4396
 sys/src/libip/testreadipifc.c - 664 sys sys 1021580003 400
 sys/src/liblex - 20000000775 sys sys 1039727690 0
 sys/src/liblex/allprint.c - 664 sys sys 944961728 473

+ 29 - 0
dist/replica/plan9.log

@@ -18363,3 +18363,32 @@
 1201552204 1 c 386/bin/ndb/dnsdebug - 775 sys sys 1201551695 270667
 1201552204 2 c 386/bin/ndb/dnstcp - 775 sys sys 1201551700 268548
 1201552204 3 c 386/bin/upas/smtpd - 775 sys sys 1201551707 332410
+1201671004 0 d sys/src/libc/9sys/consctl.c - 664 sys sys 984709400 0
+1201723205 0 c rc/bin/ipso - 775 sys sys 1201722823 3048
+1201723205 1 c sys/src/cmd/webfs/http.c - 664 sys sys 1201721955 10572
+1201723205 2 c sys/src/libip/readipifc.c - 664 sys sys 1201723612 4396
+1201732204 0 c sys/man/1/passwd - 664 sys sys 1201730866 1591
+1201748404 0 c sys/src/cmd/vt/consctl.c - 664 sys sys 1201747864 1451
+1201748404 1 c sys/src/cmd/vt/event.c - 664 sys sys 1201747864 1013
+1201753804 0 c 386/bin/ftpfs - 775 sys sys 1201753335 271932
+1201753804 1 c 386/bin/netstat - 775 sys sys 1201753371 85222
+1201753804 2 c 386/bin/webfs - 775 sys sys 1201753380 360586
+1201753804 3 c 386/bin/aquarela - 775 sys sys 1201753315 337721
+1201753804 4 c 386/bin/auth/authsrv - 775 sys sys 1201753318 165370
+1201753804 5 c 386/bin/auth/guard.srv - 775 sys sys 1201753321 144750
+1201753804 6 c 386/bin/auth/secstored - 775 sys sys 1201753324 197600
+1201753804 7 c 386/bin/cifscmd - 775 sys sys 1201753330 348567
+1201753804 8 c 386/bin/ip/6in4 - 775 sys sys 1201753336 91799
+1201753804 9 c 386/bin/ip/dhcpd - 775 sys sys 1201753339 151468
+1201753804 10 c 386/bin/ip/ipconfig - 775 sys sys 1201753341 159810
+1201753804 11 c 386/bin/ip/ping - 775 sys sys 1201753343 93276
+1201753804 12 c 386/bin/ip/ppp - 775 sys sys 1201753347 220377
+1201753804 13 c 386/bin/ip/pptpd - 775 sys sys 1201753349 124782
+1201753804 14 c 386/bin/ip/rarpd - 775 sys sys 1201753351 111368
+1201753804 15 c 386/bin/ip/rip - 775 sys sys 1201753352 90020
+1201753804 16 c 386/bin/ndb/cs - 775 sys sys 1201753355 149092
+1201753804 17 c 386/bin/ndb/dns - 775 sys sys 1201753360 296759
+1201753804 18 c 386/bin/ndb/dnsdebug - 775 sys sys 1201753365 270779
+1201753804 19 c 386/bin/ndb/dnstcp - 775 sys sys 1201753369 268660
+1201753804 20 c 386/bin/vt - 775 sys sys 1201753374 176609
+1201753804 21 c 386/lib/libip.a - 664 sys sys 1201753381 35036

+ 8 - 2
rc/bin/ipso

@@ -1,10 +1,12 @@
 #!/bin/rc
-
-if(! ~ $service terminal){
+# ipso - edit secstore files, reload factotum keys
+if(! ~ $service terminal &&
+    ! ~ $user `{ ls -ld /mnt/factotum/ctl | awk '{print $4}' }){
 	echo >[1=2] ipso should be run only on the terminal
 	exit terminal
 }
 
+rfork e
 path=(/bin)
 home=(/tmp)
 editor = (acme -c1)
@@ -45,6 +47,10 @@ fn editedfiles{
 		ls -tr | sed '1,/^_timestamp$/d'
 }
 
+edexp=`{grep '^editor=' /mnt/plumb/rules >[2]/dev/null}
+if(~ $#edexp 1)
+	eval $edexp
+
 while(~ $1 -*){
 	switch($1){
 	case -s

+ 3 - 2
sys/man/1/passwd

@@ -54,5 +54,6 @@ Vol 63 (1984), pp. 1649-1672
 .SH BUGS
 Now that
 .I cpu
-connections are always encrypted, there's no good reason
-to require that these commands be run only on terminals.
+connections are always encrypted, the only good reason
+to require that these commands be run only on terminals
+is concern that the CPU server might be subverted.

+ 9 - 36
sys/src/cmd/vt/consctl.c

@@ -3,27 +3,6 @@
 #include <draw.h>
 #include "cons.h"
 
-/*
- *  create a shared segment.  Make is start 2 meg higher than the current
- *  end of process memory.
- */
-static void*
-share(ulong len)
-{
-	uchar *vastart;
-
-	vastart = sbrk(0);
-	if(vastart == (void*)-1)
-		return 0;
-	vastart += 2*1024*1024;
-
-	if(segattach(0, "shared", vastart, len) == (void*)-1)
-		return 0;
-	memset(vastart, 0, len);
-
-	return vastart;
-}
-
 /*
  *  bind a pipe onto consctl and keep reading it to
  *  get changes to console state.
@@ -31,34 +10,28 @@ share(ulong len)
 Consstate*
 consctl(void)
 {
-	int i, n;
-	int fd;
-	int tries;
+	int i, n, fd, tries;
 	char buf[128];
 	Consstate *x;
 	char *field[10];
 
-	x = share(sizeof(Consstate));
-	if(x == 0)
-		return 0;
+	x = segattach(0, "shared", 0, sizeof *x);
+	if(x == (void*)-1)
+		sysfatal("segattach: %r");
 
 	/* a pipe to simulate consctl */
 	if(bind("#|", "/mnt/cons/consctl", MBEFORE) < 0
-	|| bind("/mnt/cons/consctl/data1", "/dev/consctl", MREPL) < 0){
-		fprint(2, "error simulating consctl\n");
-		exits("/dev/consctl");
-	}
+	|| bind("/mnt/cons/consctl/data1", "/dev/consctl", MREPL) < 0)
+		sysfatal("bind consctl: %r");
 
 	/* a pipe to simulate the /dev/cons */
 	if(bind("#|", "/mnt/cons/cons", MREPL) < 0
-	|| bind("/mnt/cons/cons/data1", "/dev/cons", MREPL) < 0){
-		fprint(2, "error simulating cons\n");
-		exits("/dev/cons");
-	}
+	|| bind("/mnt/cons/cons/data1", "/dev/cons", MREPL) < 0)
+		sysfatal("bind cons: %r");
 
 	switch(fork()){
 	case -1:
-		return 0;
+		sysfatal("fork: %r");
 	case 0:
 		break;
 	default:

+ 0 - 4
sys/src/cmd/vt/event.c

@@ -26,10 +26,6 @@ start_host(void)
 	int	fd;
 
 	cs = consctl();
-	if(cs == 0){
-		perror("consctl");
-		exits("consctl");
-	}
 
 	switch((hostpid = rfork(RFPROC|RFNAMEG|RFFDG|RFNOTEG))) {
 	case 0:

+ 10 - 5
sys/src/cmd/webfs/http.c

@@ -160,6 +160,7 @@ error:
 	free(up);
 	free(spec);
 	snprint(hs->autherror, sizeof hs->autherror, "%r");
+	fprint(2, "%s: Authentication failed: %r\n", argv0);
 }
 
 struct {
@@ -282,8 +283,12 @@ httpopen(Client *c, Url *url)
 	Error:
 		if(httpdebug)
 			fprint(2, "iodial: %r\n");
+		free(hs->location);
+		free(hs->setcookie);
 		free(hs->netaddr);
-		close(hs->fd);
+		free(hs->credentials);
+		if(fd >= 0)
+			ioclose(io, hs->fd);
 		hs->fd = -1;
 		free(hs);
 		c->aux = nil;
@@ -474,7 +479,7 @@ httpopen(Client *c, Url *url)
 				werrstr("%s", hs->autherror);
 			else
 				werrstr("unauthorized; no www-authenticate: header");
-			return -1;
+			goto Error;
 		}
 		c->authenticate = hs->credentials;
 		hs->credentials = nil;
@@ -482,7 +487,7 @@ httpopen(Client *c, Url *url)
 	if(redirect){
 		if(!hs->location){
 			werrstr("redirection without Location: header");
-			return -1;
+			goto Error;
 		}
 		c->redirect = hs->location;
 		hs->location = nil;
@@ -513,7 +518,8 @@ httpclose(Client *c)
 	hs = c->aux;
 	if(hs == nil)
 		return;
-	ioclose(c->io, hs->fd);
+	if(hs->fd >= 0)
+		ioclose(c->io, hs->fd);
 	hs->fd = -1;
 	free(hs->location);
 	free(hs->setcookie);
@@ -522,4 +528,3 @@ httpclose(Client *c)
 	free(hs);
 	c->aux = nil;
 }
-

+ 0 - 87
sys/src/libc/9sys/consctl.c

@@ -1,87 +0,0 @@
-#include <u.h>
-#include <libc.h>
-
-/*  console state (for consctl) */
-typedef struct Consstate	Consstate;
-struct Consstate{
-	int raw;
-	int hold;
-};
-
-/*
- *  create a shared segment.  Make is start 2 meg higher than the current
- *  end of process memory.
- */
-static void*
-share(int len)
-{
-	ulong vastart;
-
-	vastart = ((ulong)sbrk(0)) + 2*1024*1024;
-
-	if(segattach(0, "shared", (void *)vastart, len) < 0)
-		return 0;
-
-	return (void*)vastart;
-}
-
-/*
- *  bind a pipe onto consctl and keep reading it to
- *  get changes to console state.
- */
-Consstate*
-consctl(void)
-{
-	int i, n;
-	int fd;
-	int tries;
-	char buf[128];
-	Consstate *x;
-	char *field[10];
-
-	x = share(sizeof(Consstate));
-	if(x == 0)
-		return 0;
-
-	if(bind("#|", "/mnt/term", MBEFORE) < 0
-	|| bind("/mnt/term/data1", "/dev/consctl", MREPL) < 0)
-		return 0;
-
-	switch(fork()){
-	case -1:
-		return 0;
-	case 0:
-		break;
-	default:
-		return x;
-	}
-
-	setfields(" ");
-	for(tries = 0; tries < 100; tries++){
-		x->raw = 0;
-		x->hold = 0;
-		fd = open("/mnt/term/data", OREAD);
-		if(fd < 0)
-			continue;
-		tries = 0;
-		for(;;){
-			n = read(fd, buf, sizeof(buf)-1);
-			if(n <= 0)
-				break;
-			buf[n] = 0;
-			n = getmfields(buf, field, 10);
-			for(i = 0; i < n; i++){
-				if(strcmp(field[i], "rawon") == 0)
-					x->raw = 1;
-				else if(strcmp(field[i], "rawoff") == 0)
-					x->raw = 0;
-				else if(strcmp(field[i], "holdon") == 0)
-					x->hold = 1;
-				else if(strcmp(field[i], "holdoff") == 0)
-					x->hold = 0;
-			}
-		}
-		close(fd);
-	}
-	exits(0);
-}

+ 11 - 4
sys/src/libip/readipifc.c

@@ -61,7 +61,7 @@ _readipifc(char *file, Ipifc **l, int index)
 	char buf[4*1024];
 	char *line[32];
 	char *f[64];
-	Ipifc *ifc;
+	Ipifc *ifc, **l0;
 	Iplifc *lifc, **ll;
 
 	/* read the file */
@@ -76,11 +76,14 @@ _readipifc(char *file, Ipifc **l, int index)
 
 	if(strncmp(buf, "device", 6) != 0)
 		return _readoldipifc(buf, l, index);
-
+	/* ignore ifcs with no associated device */
+	if(strncmp(buf+6, "  ", 2) == 0)
+		return l;
 	/* allocate new interface */
 	*l = ifc = mallocz(sizeof(Ipifc), 1);
 	if(ifc == nil)
 		return l;
+	l0 = l;
 	l = &ifc->next;
 	ifc->index = index;
 
@@ -88,10 +91,14 @@ _readipifc(char *file, Ipifc **l, int index)
 
 	/* pick off device specific info(first line) */
 	n = tokenize(line[0], f, nelem(f));
+	if(n%2 != 0)
+		goto lose;
 	strncpy(ifc->dev, findfield("device", f, n), sizeof(ifc->dev));
 	ifc->dev[sizeof(ifc->dev)-1] = 0;
 	if(ifc->dev[0] == 0){
+lose:
 		free(ifc);
+		*l0 = nil;
 		return l;
 	}
 	ifc->mtu = strtoul(findfield("maxtu", f, n), nil, 10);
@@ -110,7 +117,7 @@ _readipifc(char *file, Ipifc **l, int index)
 	ifc->pktout = strtoul(findfield("pktout", f, n), nil, 10);
 	ifc->errin = strtoul(findfield("errin", f, n), nil, 10);
 	ifc->errout = strtoul(findfield("errout", f, n), nil, 10);
-	
+
 	/* now read the addresses */
 	ll = &ifc->lifc;
 	for(i = 1; i < lines; i++){
@@ -178,7 +185,7 @@ readipifc(char *net, Ipifc *ifc, int index)
 			return nil;
 		n = dirreadall(fd, &dir);
 		close(fd);
-	
+
 		for(i = 0; i < n; i++){
 			if(strcmp(dir[i].name, "clone") == 0)
 				continue;