Browse Source

Plan 9 from Bell Labs 2003-03-03

David du Colombier 16 years ago
parent
commit
5c62e005fb

+ 3 - 3
acme/bin/source/win/main.c

@@ -37,7 +37,7 @@ threadmain(int argc, char *argv[])
 	ARGBEGIN{
 	case 'd':
 		debug = 1;
-		chatty9p =1;
+		chatty9p++;
 		break;
 	case 'e':
 		eraseinput = 1;
@@ -283,10 +283,10 @@ fsloop(void*)
 		case 'f':
 			for(l=&q; *l; l=&(*l)->aux){
 				if(*l == r->oldreq){
-					*l = r->oldreq->aux;
+					*l = (*l)->aux;
 					if(*l == nil)
 						eq = l;
-					closereq(r->oldreq);
+					respond(r->oldreq, "interrupted");
 					break;
 				}
 			}

+ 1 - 0
acme/bin/source/win/mkfile

@@ -9,6 +9,7 @@ OFILES=\
 	win.$O
 
 HFILES=dat.h
+LIB=/$objtype/lib/lib9p.a
 
 BIN=/acme/bin/$objtype
 </sys/src/cmd/mkone

+ 53 - 52
dist/replica/plan9.db

@@ -40,7 +40,7 @@
 386/bin/ape/stty - 775 sys sys 1039758529 41577
 386/bin/ape/tar - 775 sys sys 1039758529 60413
 386/bin/ape/uname - 775 sys sys 1038443082 135133
-386/bin/ar - 775 sys sys 1045537937 113125
+386/bin/ar - 775 sys sys 1046656902 113306
 386/bin/archfs - 775 sys sys 1045537938 141436
 386/bin/ascii - 775 sys sys 1039758530 63264
 386/bin/astro - 775 sys sys 1039758530 139263
@@ -48,34 +48,34 @@
 386/bin/auth/aescbc - 775 sys sys 1045537938 120957
 386/bin/auth/authsrv - 775 sys sys 1045537939 161978
 386/bin/auth/changeuser - 775 sys sys 1045537939 96090
-386/bin/auth/convkeys - 775 sys sys 1045537939 84016
-386/bin/auth/convkeys2 - 775 sys sys 1045537940 84036
+386/bin/auth/convkeys - 775 sys sys 1046656929 86221
+386/bin/auth/convkeys2 - 775 sys sys 1046656929 86237
 386/bin/auth/cron - 775 sys sys 1045537940 140015
 386/bin/auth/debug - 775 sys sys 1045537941 98167
 386/bin/auth/disable - 775 sys sys 1020319057 146
 386/bin/auth/enable - 775 sys sys 1020319057 134
-386/bin/auth/factotum - 775 sys sys 1045537941 305369
+386/bin/auth/factotum - 775 sys sys 1046656931 305986
 386/bin/auth/fgui - 775 sys sys 1045537942 211917
 386/bin/auth/guard.srv - 775 sys sys 1045537943 139879
 386/bin/auth/iam - 775 sys sys 1039758534 51077
-386/bin/auth/keyfs - 775 sys sys 1045537943 114313
+386/bin/auth/keyfs - 775 sys sys 1046656931 116514
 386/bin/auth/login - 775 sys sys 1045537944 100738
 386/bin/auth/printnetkey - 775 sys sys 1039758534 40969
 386/bin/auth/secretpem - 775 sys sys 1045537944 118526
-386/bin/auth/secstore - 775 sys sys 1045537945 186312
+386/bin/auth/secstore - 775 sys sys 1046656932 186912
 386/bin/auth/secstored - 775 sys sys 1045537945 193098
 386/bin/auth/secuser - 775 sys sys 1045537946 149562
 386/bin/auth/status - 775 sys sys 1020319060 738
 386/bin/auth/uniq - 775 sys sys 1039758536 61773
 386/bin/auth/warning - 775 sys sys 1045537946 97726
-386/bin/auth/wrkey - 775 sys sys 1039758536 71296
+386/bin/auth/wrkey - 775 sys sys 1046656932 73497
 386/bin/aux - 20000000775 sys sys 1016920817 0
 386/bin/aux/9pcon - 775 sys sys 1039758536 96151
 386/bin/aux/LOCK - 775 sys sys 1045537946 58692
 386/bin/aux/X509gen - 775 sys sys 1045537947 126470
 386/bin/aux/accupoint - 775 sys sys 1039758537 41111
 386/bin/aux/acidleak - 775 sys sys 1039758537 67904
-386/bin/aux/apm - 775 sys sys 1045537947 174544
+386/bin/aux/apm - 775 sys sys 1046656928 174552
 386/bin/aux/astarld - 775 sys sys 1039758537 63522
 386/bin/aux/cddb - 775 sys sys 1039758537 70432
 386/bin/aux/clog - 775 sys sys 1039758538 65408
@@ -111,7 +111,7 @@
 386/bin/aux/nfsmount - 775 sys sys 1046368786 231402
 386/bin/aux/nfsserver - 775 sys sys 1045537954 171046
 386/bin/aux/olefs - 775 sys sys 1045537954 144352
-386/bin/aux/p9bitpost - 775 sys sys 1039758543 127979
+386/bin/aux/p9bitpost - 775 sys sys 1046656928 128070
 386/bin/aux/pcmcia - 775 sys sys 1039758543 46790
 386/bin/aux/pcnfsd - 775 sys sys 1045537955 126750
 386/bin/aux/portmap - 775 sys sys 1046368787 140955
@@ -165,11 +165,11 @@
 386/bin/cmp - 775 sys sys 1039758552 41134
 386/bin/colors - 775 sys sys 1045537968 147404
 386/bin/comm - 775 sys sys 1039758552 60001
-386/bin/con - 775 sys sys 1039758552 76698
+386/bin/con - 775 sys sys 1046656902 76495
 386/bin/cp - 775 sys sys 1045537969 62690
 386/bin/cpp - 775 sys sys 1045537969 148380
 386/bin/cpu - 775 sys sys 1042640741 137389
-386/bin/crop - 775 sys sys 1039758553 115496
+386/bin/crop - 775 sys sys 1046656903 115587
 386/bin/date - 775 sys sys 1039758553 43976
 386/bin/db - 775 sys sys 1046368788 323629
 386/bin/dc - 775 sys sys 1045537970 97871
@@ -182,7 +182,7 @@
 386/bin/disk/exsort - 775 sys sys 1039758556 58789
 386/bin/disk/fdisk - 775 sys sys 1045537972 106865
 386/bin/disk/format - 775 sys sys 1045537972 91869
-386/bin/disk/kfs - 775 sys sys 1045537973 247159
+386/bin/disk/kfs - 775 sys sys 1046656927 248048
 386/bin/disk/kfscmd - 775 sys sys 1039758557 38719
 386/bin/disk/ksync - 775 sys sys 1020319074 302
 386/bin/disk/mbr - 775 sys sys 1045537973 72337
@@ -199,7 +199,7 @@
 386/bin/eqn - 775 sys sys 1038443124 243040
 386/bin/execnet - 775 sys sys 1045537976 172468
 386/bin/exportfs - 775 sys sys 1045537976 145636
-386/bin/faces - 775 sys sys 1045537977 189109
+386/bin/faces - 775 sys sys 1046656908 189109
 386/bin/factor - 775 sys sys 1039758559 60135
 386/bin/file - 775 sys sys 1045537977 117151
 386/bin/fmt - 775 sys sys 1039758560 63811
@@ -232,7 +232,7 @@
 386/bin/hoc - 775 sys sys 1045538014 98958
 386/bin/html2ms - 775 sys sys 1039758564 64730
 386/bin/htmlfmt - 775 sys sys 1045538015 158912
-386/bin/iconv - 775 sys sys 1039758564 112738
+386/bin/iconv - 775 sys sys 1046656908 112829
 386/bin/idiff - 775 sys sys 1045538015 75495
 386/bin/import - 775 sys sys 1045538015 87318
 386/bin/iostats - 775 sys sys 1045538016 98803
@@ -240,7 +240,7 @@
 386/bin/ip/dhcpclient - 775 sys sys 1045538016 91665
 386/bin/ip/dhcpd - 775 sys sys 1045538017 144977
 386/bin/ip/dhcpleases - 775 sys sys 1045538017 84658
-386/bin/ip/ftpd - 775 sys sys 1045538018 166805
+386/bin/ip/ftpd - 775 sys sys 1046656917 166930
 386/bin/ip/gping - 775 sys sys 1045538018 179663
 386/bin/ip/hogports - 775 sys sys 1039758567 43296
 386/bin/ip/httpd - 20000000775 sys sys 1016920846 0
@@ -272,7 +272,7 @@
 386/bin/lex - 775 sys sys 1039758573 97530
 386/bin/lnfs - 775 sys sys 1045538028 100759
 386/bin/look - 775 sys sys 1039758574 64460
-386/bin/ls - 775 sys sys 1045538029 80925
+386/bin/ls - 775 sys sys 1046656916 81368
 386/bin/mc - 775 sys sys 1045538029 129044
 386/bin/md5sum - 775 sys sys 1039758574 59713
 386/bin/mk - 775 sys sys 1045538030 141372
@@ -336,14 +336,14 @@
 386/bin/replica/scan - 775 sys sys 1020319083 39
 386/bin/replica/setupdirs - 775 sys sys 1020319083 44
 386/bin/replica/updatedb - 775 sys sys 1045538046 95942
-386/bin/resample - 775 sys sys 1039758586 120283
+386/bin/resample - 775 sys sys 1046656917 120374
 386/bin/rio - 775 sys sys 1046368790 302875
 386/bin/rm - 775 sys sys 1045538047 60036
 386/bin/rtstats - 775 sys sys 1045538048 177343
 386/bin/rx - 775 sys sys 1045538048 78437
 386/bin/sam - 775 sys sys 1045538049 156896
 386/bin/scat - 775 sys sys 1045538050 282041
-386/bin/scp - 775 sys sys 1045538050 159554
+386/bin/scp - 775 sys sys 1046656918 159647
 386/bin/scuzz - 775 sys sys 1039758589 110998
 386/bin/sed - 775 sys sys 1039758589 88430
 386/bin/seq - 775 sys sys 1039758589 38817
@@ -355,13 +355,13 @@
 386/bin/sniffer - 775 sys sys 1038443185 99028
 386/bin/snoopy - 775 sys sys 1045538053 153925
 386/bin/sort - 775 sys sys 1039758591 81296
-386/bin/spin - 775 sys sys 1045538055 652380
+386/bin/spin - 775 sys sys 1046656920 652411
 386/bin/split - 775 sys sys 1045538055 74227
 386/bin/srv - 775 sys sys 1045538056 80168
 386/bin/srvfs - 775 sys sys 1039758592 39914
 386/bin/srvold9p - 775 sys sys 1045538056 130539
-386/bin/ssh - 775 sys sys 1045538057 209753
-386/bin/sshnet - 775 sys sys 1045538058 283791
+386/bin/ssh - 775 sys sys 1046656921 209700
+386/bin/sshnet - 775 sys sys 1046656922 283799
 386/bin/stats - 775 sys sys 1045538058 186569
 386/bin/strings - 775 sys sys 1039758593 60879
 386/bin/strip - 775 sys sys 1045538058 60829
@@ -379,9 +379,9 @@
 386/bin/time - 775 sys sys 1039758596 59810
 386/bin/tlsclient - 775 sys sys 1045538062 191932
 386/bin/tlssrv - 775 sys sys 1045538062 192262
-386/bin/togif - 775 sys sys 1045538063 188996
-386/bin/topng - 775 sys sys 1039758597 137880
-386/bin/toppm - 775 sys sys 1045538064 164433
+386/bin/togif - 775 sys sys 1046656904 189087
+386/bin/topng - 775 sys sys 1046656905 137971
+386/bin/toppm - 775 sys sys 1046656905 164524
 386/bin/touch - 775 sys sys 1039758597 63209
 386/bin/tprof - 775 sys sys 1045538064 273469
 386/bin/tr - 775 sys sys 1039758598 60540
@@ -439,7 +439,7 @@
 386/bin/venti/verifyarena - 775 sys sys 1045538088 105156
 386/bin/venti/wrarena - 775 sys sys 1045538089 178907
 386/bin/venti/write - 775 sys sys 1045538089 100592
-386/bin/vncs - 775 sys sys 1046265125 438048
+386/bin/vncs - 775 sys sys 1046656907 438139
 386/bin/vncv - 775 sys sys 1045776649 266165
 386/bin/vt - 775 sys sys 1045538092 170883
 386/bin/vtdump - 775 sys sys 1045538093 160937
@@ -466,7 +466,7 @@
 386/lib - 20000000775 sys sys 1016826328 0
 386/lib/ape - 20000000775 sys sys 944969312 0
 386/lib/ape/lib9.a - 664 sys sys 1038237538 6378
-386/lib/ape/libap.a - 664 sys sys 1046356069 780602
+386/lib/ape/libap.a - 664 sys sys 1046656925 780562
 386/lib/ape/libbsd.a - 664 sys sys 1038237542 171922
 386/lib/ape/libl.a - 664 sys sys 1038237542 8666
 386/lib/ape/libnet.a - 664 sys sys 1038237543 16604
@@ -475,7 +475,7 @@
 386/lib/lib9p.a - 664 sys sys 1045538115 80508
 386/lib/libString.a - 664 sys sys 1045538115 18554
 386/lib/libauth.a - 664 sys sys 1045538115 52988
-386/lib/libauthsrv.a - 664 sys sys 1045538115 31942
+386/lib/libauthsrv.a - 664 sys sys 1046656925 33706
 386/lib/libbin.a - 664 sys sys 1045538115 2556
 386/lib/libbio.a - 664 sys sys 1045538115 28390
 386/lib/libc.a - 664 sys sys 1045538117 496970
@@ -490,7 +490,7 @@
 386/lib/libip.a - 664 sys sys 1045538121 32560
 386/lib/libl.a - 664 sys sys 1045538121 5412
 386/lib/libmach.a - 664 sys sys 1045538123 743792
-386/lib/libmemdraw.a - 664 sys sys 1045538124 292324
+386/lib/libmemdraw.a - 664 sys sys 1046656926 292604
 386/lib/libmemlayer.a - 664 sys sys 1046182506 47256
 386/lib/libmp.a - 664 sys sys 1045538125 77064
 386/lib/libndb.a - 664 sys sys 1045538125 52836
@@ -565,7 +565,7 @@ acme/bin/386/acd - 775 sys sys 1032232412 137068
 acme/bin/386/adict - 775 sys sys 1015011247 99806
 acme/bin/386/mkwnew - 775 sys sys 1045538113 39475
 acme/bin/386/spout - 775 sys sys 1045538113 60277
-acme/bin/386/win - 775 sys sys 1045538114 178505
+acme/bin/386/win - 775 sys sys 1046656923 178512
 acme/bin/Battery - 775 sys sys 1017457907 451
 acme/bin/Perl - 775 sys sys 1015011260 230
 acme/bin/README - 664 sys sys 1015011256 174
@@ -613,8 +613,8 @@ acme/bin/source/spout.c - 664 sys sys 1015011255 1868
 acme/bin/source/win - 20000000775 sys sys 1015011255 0
 acme/bin/source/win/dat.h - 664 sys sys 1017679345 1992
 acme/bin/source/win/fs.c - 664 sys sys 1045503982 2713
-acme/bin/source/win/main.c - 664 sys sys 1037256658 12536
-acme/bin/source/win/mkfile - 664 sys sys 1030450915 283
+acme/bin/source/win/main.c - 664 sys sys 1046654935 12544
+acme/bin/source/win/mkfile - 664 sys sys 1046654934 309
 acme/bin/source/win/pipe.c - 664 sys sys 1017679345 2807
 acme/bin/source/win/util.c - 664 sys sys 1017679346 1169
 acme/bin/source/win/win.c - 664 sys sys 1015011255 4240
@@ -4563,7 +4563,7 @@ sys/man/2/INDEX - 664 sys sys 1045538129 20216
 sys/man/2/INDEX.html - 664 sys sys 1019918562 26387
 sys/man/2/abort - 664 sys sys 944959693 331
 sys/man/2/abs - 664 sys sys 944959693 461
-sys/man/2/access - 664 sys sys 984709630 1251
+sys/man/2/access - 664 sys sys 1046657167 1102
 sys/man/2/addpt - 664 sys sys 958249501 2964
 sys/man/2/aes - 664 sys sys 1032058672 997
 sys/man/2/allocimage - 664 sys sys 984709630 7300
@@ -4656,7 +4656,7 @@ sys/man/2/plumb - 664 sys sys 1015091524 4816
 sys/man/2/pool - 664 sys sys 1017423720 8134
 sys/man/2/postnote - 664 sys sys 944959695 790
 sys/man/2/prime - 664 sys sys 1017251165 2018
-sys/man/2/print - 664 sys sys 1039759892 8890
+sys/man/2/print - 664 sys sys 1046620831 8889
 sys/man/2/privalloc - 664 sys sys 984709633 651
 sys/man/2/proto - 664 sys sys 969499889 2948
 sys/man/2/pushssl - 664 sys sys 958249503 1032
@@ -5856,7 +5856,7 @@ sys/src/ape/lib/ap/plan9/pipe.c - 664 sys sys 1014921984 476
 sys/src/ape/lib/ap/plan9/profile.c - 664 sys sys 1014921985 2521
 sys/src/ape/lib/ap/plan9/raise.c - 664 sys sys 1014921985 120
 sys/src/ape/lib/ap/plan9/read.c - 664 sys sys 1014921984 767
-sys/src/ape/lib/ap/plan9/rename.c - 664 sys sys 1014921985 1259
+sys/src/ape/lib/ap/plan9/rename.c - 664 sys sys 1046643006 1282
 sys/src/ape/lib/ap/plan9/rmdir.c - 664 sys sys 1014921985 188
 sys/src/ape/lib/ap/plan9/setgid.c - 664 sys sys 1014921985 145
 sys/src/ape/lib/ap/plan9/setpgid.c - 664 sys sys 1014921985 463
@@ -5879,7 +5879,7 @@ sys/src/ape/lib/ap/plan9/ttyname.c - 664 sys sys 1014921985 133
 sys/src/ape/lib/ap/plan9/umask.c - 664 sys sys 1014921985 182
 sys/src/ape/lib/ap/plan9/uname.c - 664 sys sys 1014921985 408
 sys/src/ape/lib/ap/plan9/unlink.c - 664 sys sys 1038237528 1505
-sys/src/ape/lib/ap/plan9/utime.c - 664 sys sys 1014921985 526
+sys/src/ape/lib/ap/plan9/utime.c - 664 sys sys 1046643007 469
 sys/src/ape/lib/ap/plan9/wait.c - 664 sys sys 1043681702 1133
 sys/src/ape/lib/ap/plan9/write.c - 664 sys sys 1038237529 348
 sys/src/ape/lib/ap/posix - 20000000775 sys sys 1014921981 0
@@ -6480,7 +6480,7 @@ sys/src/cmd/acme/ecmd.c - 664 sys sys 1045504838 23562
 sys/src/cmd/acme/edit.c - 664 sys sys 1015701171 12055
 sys/src/cmd/acme/edit.h - 664 sys sys 969500816 2466
 sys/src/cmd/acme/elog.c - 664 sys sys 1045504839 6830
-sys/src/cmd/acme/exec.c - 664 sys sys 1044626079 26945
+sys/src/cmd/acme/exec.c - 664 sys sys 1046620931 27023
 sys/src/cmd/acme/file.c - 664 sys sys 1044626079 5717
 sys/src/cmd/acme/fns.h - 664 sys sys 1044626080 2920
 sys/src/cmd/acme/fsys.c - 664 sys sys 1022512648 12727
@@ -6494,7 +6494,7 @@ sys/src/cmd/acme/time.c - 664 sys sys 1014926095 1783
 sys/src/cmd/acme/util.c - 664 sys sys 1045546057 6435
 sys/src/cmd/acme/wind.c - 664 sys sys 1016833877 11063
 sys/src/cmd/acme/xfid.c - 664 sys sys 1044626081 19191
-sys/src/cmd/ar.c - 664 sys sys 1014926693 23801
+sys/src/cmd/ar.c - 664 sys sys 1046643027 23717
 sys/src/cmd/archfs.c - 664 sys sys 1014925694 3871
 sys/src/cmd/ascii.c - 664 sys sys 964457138 3989
 sys/src/cmd/astro - 20000000775 sys sys 964456342 0
@@ -6549,7 +6549,7 @@ sys/src/cmd/auth/factotum/confirm.c - 664 sys sys 1044829586 3103
 sys/src/cmd/auth/factotum/dat.h - 664 sys sys 1044829587 4814
 sys/src/cmd/auth/factotum/fgui.c - 664 sys sys 1044829587 15948
 sys/src/cmd/auth/factotum/fs.c - 664 sys sys 1044829588 10363
-sys/src/cmd/auth/factotum/log.c - 664 sys sys 1015008431 1767
+sys/src/cmd/auth/factotum/log.c - 664 sys sys 1046655068 1781
 sys/src/cmd/auth/factotum/mkfile - 664 sys sys 1044829592 512
 sys/src/cmd/auth/factotum/p9any.c - 664 sys sys 1044829588 8207
 sys/src/cmd/auth/factotum/p9cr.c - 664 sys sys 1044829589 6618
@@ -6584,6 +6584,7 @@ sys/src/cmd/auth/lib/wrbio.c - 664 sys sys 1015008430 755
 sys/src/cmd/auth/login.c - 664 sys sys 1045524275 3959
 sys/src/cmd/auth/mkfile - 664 sys sys 1035833798 1737
 sys/src/cmd/auth/netkey.c - 664 sys sys 1015008431 741
+sys/src/cmd/auth/newns.c - 664 sys sys 1046644507 421
 sys/src/cmd/auth/passwd.c - 664 sys sys 1022163987 2902
 sys/src/cmd/auth/printnetkey.c - 664 sys sys 1015008430 732
 sys/src/cmd/auth/respond.c - 664 sys sys 1015008432 472
@@ -6613,7 +6614,7 @@ sys/src/cmd/aux/9pcon.c - 664 sys sys 1032059259 6283
 sys/src/cmd/aux/X509gen.c - 664 sys sys 1037575307 1763
 sys/src/cmd/aux/accupoint.c - 664 sys sys 985124882 2166
 sys/src/cmd/aux/acidleak.c - 664 sys sys 1014925120 5664
-sys/src/cmd/aux/apm.c - 664 sys sys 1045504910 20260
+sys/src/cmd/aux/apm.c - 664 sys sys 1046654953 20263
 sys/src/cmd/aux/astarld.c - 664 sys sys 1015008684 4638
 sys/src/cmd/aux/cddb.c - 664 sys sys 1032059267 4303
 sys/src/cmd/aux/clog.c - 664 sys sys 1014925109 1000
@@ -6851,9 +6852,9 @@ sys/src/cmd/cmp.c - 664 sys sys 1019525053 2098
 sys/src/cmd/colors.c - 664 sys sys 951763912 3186
 sys/src/cmd/comm.c - 664 sys sys 944961350 2140
 sys/src/cmd/con - 20000000775 sys sys 944961996 0
-sys/src/cmd/con/con.c - 664 sys sys 1032059372 15523
+sys/src/cmd/con/con.c - 664 sys sys 1046654774 15214
 sys/src/cmd/con/hayes.c - 664 sys sys 1014925263 3865
-sys/src/cmd/con/mkfile - 664 sys sys 1022049384 214
+sys/src/cmd/con/mkfile - 664 sys sys 1046654774 204
 sys/src/cmd/con/rufilio.h - 664 sys sys 944960877 595
 sys/src/cmd/con/rusignal.h - 664 sys sys 944960877 1659
 sys/src/cmd/con/rustream.h - 664 sys sys 944960877 2758
@@ -7069,7 +7070,7 @@ sys/src/cmd/faces - 20000000775 sys sys 952888246 0
 sys/src/cmd/faces/dblook.c - 664 sys sys 944961084 359
 sys/src/cmd/faces/facedb.c - 664 sys sys 1021579994 8976
 sys/src/cmd/faces/faces.h - 664 sys sys 1045419243 1071
-sys/src/cmd/faces/main.c - 664 sys sys 1045419249 13505
+sys/src/cmd/faces/main.c - 664 sys sys 1046643825 13572
 sys/src/cmd/faces/mkfile - 664 sys sys 1035698248 378
 sys/src/cmd/faces/plumb.c - 664 sys sys 1045505116 7132
 sys/src/cmd/faces/util.c - 664 sys sys 1035698250 569
@@ -8975,7 +8976,7 @@ sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 956275654 1881
 sys/src/cmd/ip/dhcpd/testlook.c - 664 sys sys 950389140 4640
 sys/src/cmd/ip/dhcpd/testlookup.c - 664 sys sys 950389140 3195
 sys/src/cmd/ip/dhcpd/testping.c - 664 sys sys 950389141 352
-sys/src/cmd/ip/ftpd.c - 664 sys sys 1045505176 32914
+sys/src/cmd/ip/ftpd.c - 664 sys sys 1046643070 32813
 sys/src/cmd/ip/ftpfs - 20000000775 sys sys 1014925642 0
 sys/src/cmd/ip/ftpfs/file.c - 664 sys sys 1014925642 4208
 sys/src/cmd/ip/ftpfs/ftpfs.c - 664 sys sys 1035122891 13478
@@ -9186,7 +9187,7 @@ sys/src/cmd/lp/lpdsend.c - 664 sys sys 1039145206 9527
 sys/src/cmd/lp/lpsend.c - 664 sys sys 1015090024 6180
 sys/src/cmd/lp/lpsend.rc - 775 sys sys 953344615 361
 sys/src/cmd/lp/mkfile - 664 sys sys 953344616 535
-sys/src/cmd/ls.c - 664 sys sys 1045505418 5440
+sys/src/cmd/ls.c - 664 sys sys 1046649572 5378
 sys/src/cmd/map - 20000000775 sys sys 944961024 0
 sys/src/cmd/map/index.c - 664 sys sys 956282376 4345
 sys/src/cmd/map/iplot.h - 664 sys sys 944961024 1398
@@ -9924,15 +9925,15 @@ sys/src/cmd/ssh/ciphernone.c - 664 sys sys 1016466379 317
 sys/src/cmd/ssh/cipherrc4.c - 664 sys sys 1016466379 674
 sys/src/cmd/ssh/ciphertwiddle.c - 664 sys sys 1016466379 380
 sys/src/cmd/ssh/cmsg.c - 664 sys sys 1038371942 8382
-sys/src/cmd/ssh/mkfile - 664 sys sys 1038371941 1325
+sys/src/cmd/ssh/mkfile - 664 sys sys 1046654890 1226
 sys/src/cmd/ssh/msg.c - 664 sys sys 1038293465 7740
 sys/src/cmd/ssh/pubkey.c - 664 sys sys 1019928902 3974
-sys/src/cmd/ssh/scp.c - 664 sys sys 1016466380 13768
+sys/src/cmd/ssh/scp.c - 664 sys sys 1046643068 13708
 sys/src/cmd/ssh/smsg.c - 664 sys sys 1016466380 4225
-sys/src/cmd/ssh/ssh.c - 664 sys sys 1042424644 9603
+sys/src/cmd/ssh/ssh.c - 664 sys sys 1046654892 9615
 sys/src/cmd/ssh/ssh.h - 664 sys sys 1038293464 6011
 sys/src/cmd/ssh/ssh_genkey.c - 664 sys sys 1016466380 1563
-sys/src/cmd/ssh/sshnet.c - 664 sys sys 1045505611 17656
+sys/src/cmd/ssh/sshnet.c - 664 sys sys 1046655072 17660
 sys/src/cmd/ssh/sshserve.c - 664 sys sys 1019678647 5940
 sys/src/cmd/ssh/util.c - 664 sys sys 1038293465 5506
 sys/src/cmd/stats.c - 664 sys sys 1045059499 26965
@@ -10307,7 +10308,7 @@ sys/src/cmd/upas/common/aux.c - 664 sys sys 1019498851 2300
 sys/src/cmd/upas/common/become.c - 664 sys sys 1015009623 430
 sys/src/cmd/upas/common/common.h - 664 sys sys 1015009623 1921
 sys/src/cmd/upas/common/config.c - 664 sys sys 944961316 254
-sys/src/cmd/upas/common/libsys.c - 664 sys sys 1018974178 14071
+sys/src/cmd/upas/common/libsys.c - 664 sys sys 1046643066 13823
 sys/src/cmd/upas/common/mail.c - 664 sys sys 944961315 1346
 sys/src/cmd/upas/common/makefile - 664 sys sys 944961315 366
 sys/src/cmd/upas/common/mkfile - 664 sys sys 1031707285 251
@@ -10353,7 +10354,7 @@ sys/src/cmd/upas/misc/remotemail - 775 sys sys 954266541 113
 sys/src/cmd/upas/misc/rewrite - 664 sys sys 954264578 661
 sys/src/cmd/upas/mkfile - 664 sys sys 1035832987 1903
 sys/src/cmd/upas/ml - 20000000775 sys sys 1015096763 0
-sys/src/cmd/upas/ml/common.c - 664 sys sys 1015096762 3385
+sys/src/cmd/upas/ml/common.c - 664 sys sys 1046643067 3371
 sys/src/cmd/upas/ml/dat.h - 664 sys sys 1015096762 517
 sys/src/cmd/upas/ml/mkfile - 664 sys sys 1031707313 549
 sys/src/cmd/upas/ml/ml.c - 664 sys sys 1031707314 2703
@@ -10833,7 +10834,7 @@ sys/src/libauthsrv/mkfile - 664 sys sys 1035389776 409
 sys/src/libauthsrv/nvcsum.c - 664 sys sys 1015091654 192
 sys/src/libauthsrv/opasstokey.c - 664 sys sys 1015091654 448
 sys/src/libauthsrv/passtokey.c - 664 sys sys 1015091654 517
-sys/src/libauthsrv/readnvram.c - 664 sys sys 1032060993 7585
+sys/src/libauthsrv/readnvram.c - 664 sys sys 1046644259 8446
 sys/src/libbin - 20000000775 sys sys 984777332 0
 sys/src/libbin/bin.c - 664 sys sys 1045502972 1811
 sys/src/libbin/mkfile - 664 sys sys 1035389776 197
@@ -11478,7 +11479,7 @@ sys/src/libmach/xc/mips2ureg.h - 664 sys sys 964540563 886
 sys/src/libmach/xc/x.out.h - 664 sys sys 950325899 3232
 sys/src/libmach/xobj.c - 664 sys sys 964540518 2320
 sys/src/libmemdraw - 20000000775 sys sys 985020762 0
-sys/src/libmemdraw/alloc.c - 664 sys sys 1039752932 3152
+sys/src/libmemdraw/alloc.c - 664 sys sys 1046640198 3234
 sys/src/libmemdraw/alpha.hoc - 664 sys sys 944961741 220
 sys/src/libmemdraw/arc.c - 664 sys sys 1039752932 2608
 sys/src/libmemdraw/arctest.c - 664 sys sys 1045502219 865

+ 56 - 0
dist/replica/plan9.log

@@ -18111,3 +18111,59 @@
 1046368792 5 c 386/lib/libsunrpc.a - 664 sys sys 1046368791 357146
 1046368792 6 c sys/man/4/nfs - 664 sys sys 1046367663 2740
 1046442658 0 c lib/ndb/common - 664 sys sys 1046441675 5245
+1046620854 0 c acme/bin/source/win/main.c - 664 sys sys 1046620771 12546
+1046620854 1 c sys/man/2/print - 664 sys sys 1046620831 8889
+1046621046 0 c sys/src/cmd/acme/exec.c - 664 sys sys 1046620931 27023
+1046637258 0 c acme/bin/386/win - 775 sys sys 1046637223 178522
+1046640662 0 c sys/src/libmemdraw/alloc.c - 664 sys sys 1046640198 3234
+1046644262 0 c sys/src/ape/lib/ap/plan9/rename.c - 664 sys sys 1046643006 1282
+1046644262 1 c sys/src/ape/lib/ap/plan9/utime.c - 664 sys sys 1046643007 469
+1046644262 2 c sys/src/cmd/ip/ftpd.c - 664 sys sys 1046643070 32813
+1046644262 3 c sys/src/cmd/faces/main.c - 664 sys sys 1046643825 13572
+1046644262 4 c sys/src/cmd/ssh/scp.c - 664 sys sys 1046643068 13708
+1046644262 5 c sys/src/cmd/upas/common/libsys.c - 664 sys sys 1046643066 13823
+1046644262 6 c sys/src/cmd/upas/ml/common.c - 664 sys sys 1046643067 3371
+1046644262 7 c sys/src/cmd/ar.c - 664 sys sys 1046643027 23717
+1046644262 8 c sys/src/libauthsrv/readnvram.c - 664 sys sys 1046644259 8446
+1046646062 0 a sys/src/cmd/auth/newns.c - 664 sys sys 1046644507 421
+1046649672 0 c sys/src/cmd/ls.c - 664 sys sys 1046649572 5378
+1046655072 0 c acme/bin/386/win - 775 sys sys 1046654936 179888
+1046655072 1 c acme/bin/source/win/main.c - 664 sys sys 1046654935 12544
+1046655072 2 c acme/bin/source/win/mkfile - 664 sys sys 1046654934 309
+1046655072 3 c sys/src/cmd/auth/factotum/log.c - 664 sys sys 1046655068 1781
+1046655072 4 c sys/src/cmd/aux/apm.c - 664 sys sys 1046654953 20263
+1046655072 5 c sys/src/cmd/con/con.c - 664 sys sys 1046654774 15214
+1046655072 6 c sys/src/cmd/con/mkfile - 664 sys sys 1046654774 204
+1046655072 7 c sys/src/cmd/ssh/mkfile - 664 sys sys 1046654890 1226
+1046655072 8 c sys/src/cmd/ssh/ssh.c - 664 sys sys 1046654892 9615
+1046655072 9 c sys/src/cmd/ssh/sshnet.c - 664 sys sys 1046655072 17660
+1046657484 0 c 386/bin/ar - 775 sys sys 1046656902 113306
+1046657484 1 c 386/bin/con - 775 sys sys 1046656902 76495
+1046657484 2 c 386/bin/crop - 775 sys sys 1046656903 115587
+1046657484 3 c 386/bin/faces - 775 sys sys 1046656908 189109
+1046657484 4 c 386/bin/iconv - 775 sys sys 1046656908 112829
+1046657484 5 c 386/bin/resample - 775 sys sys 1046656917 120374
+1046657484 6 c 386/bin/topng - 775 sys sys 1046656905 137971
+1046657484 7 c 386/bin/vncs - 775 sys sys 1046656907 438139
+1046657484 8 c 386/bin/ls - 775 sys sys 1046656916 81368
+1046657484 9 c 386/bin/scp - 775 sys sys 1046656918 159647
+1046657484 10 c 386/bin/spin - 775 sys sys 1046656920 652411
+1046657484 11 c 386/bin/ssh - 775 sys sys 1046656921 209700
+1046657484 12 c 386/bin/auth/convkeys - 775 sys sys 1046656929 86221
+1046657484 13 c 386/bin/auth/convkeys2 - 775 sys sys 1046656929 86237
+1046657484 14 c 386/bin/auth/factotum - 775 sys sys 1046656931 305986
+1046657484 15 c 386/bin/auth/keyfs - 775 sys sys 1046656931 116514
+1046657484 16 c 386/bin/auth/secstore - 775 sys sys 1046656932 186912
+1046657484 17 c 386/bin/auth/wrkey - 775 sys sys 1046656932 73497
+1046657484 18 c 386/bin/aux/apm - 775 sys sys 1046656928 174552
+1046657484 19 c 386/bin/aux/p9bitpost - 775 sys sys 1046656928 128070
+1046657484 20 c 386/bin/disk/kfs - 775 sys sys 1046656927 248048
+1046657484 21 c 386/bin/ip/ftpd - 775 sys sys 1046656917 166930
+1046657484 22 c 386/bin/sshnet - 775 sys sys 1046656922 283799
+1046657484 23 c 386/bin/togif - 775 sys sys 1046656904 189087
+1046657484 24 c 386/bin/toppm - 775 sys sys 1046656905 164524
+1046657484 25 c 386/lib/ape/libap.a - 664 sys sys 1046656925 780562
+1046657484 26 c 386/lib/libauthsrv.a - 664 sys sys 1046656925 33706
+1046657484 27 c 386/lib/libmemdraw.a - 664 sys sys 1046656926 292604
+1046657484 28 c acme/bin/386/win - 775 sys sys 1046656923 178512
+1046657484 29 c sys/man/2/access - 664 sys sys 1046657167 1102

+ 1 - 5
sys/man/2/access

@@ -29,7 +29,7 @@ must permit searches.
 Zero is returned if the desired access is permitted,
 \-1 if not.
 .PP
-Only access bits are checked.
+Only access for open is checked.
 A file may look executable, but
 .IR exec (2)
 will fail unless it is in proper format.
@@ -58,7 +58,3 @@ must open the file to check permissions.
 (It calls
 .IR stat (2)
 to check simple existence.)
-Besides giving misleading information about the writability of directories,
-this is as expensive as the open that
-.I access
-is often intended to avoid.

+ 1 - 1
sys/man/2/print

@@ -395,7 +395,7 @@ void fatal(char *msg, ...)
 	char buf[1024], *out;
 	va_list arg;
 
-	out = vseprint(buf, buf+sizeof(buf), "Fatal error: ");
+	out = seprint(buf, buf+sizeof(buf), "Fatal error: ");
 	va_start(arg, msg);
 	out = vseprint(out, buf+sizeof(buf), msg, arg);
 	va_end(arg);

+ 4 - 3
sys/src/ape/lib/ap/plan9/rename.c

@@ -12,7 +12,7 @@ rename(const char *from, const char *to)
 {
 	int n, i;
 	char *f, *t;
-	Dir *d;
+	Dir *d, nd;
 	long mode;
 
 	if(access(to, 0) >= 0){
@@ -38,8 +38,9 @@ rename(const char *from, const char *to)
 	if(f-from==t-to && strncmp(from, to, f-from)==0){
 		/* from and to are in same directory (we miss some cases) */
 		i = strlen(t);
-		d->name = t;
-		if(_dirwstat(from, d) < 0){
+		_nulldir(&nd);
+		nd.name = t;
+		if(_dirwstat(from, &nd) < 0){
 			_syserrno();
 			n = -1;
 		}

+ 7 - 11
sys/src/ape/lib/ap/plan9/utime.c

@@ -11,24 +11,20 @@ int
 utime(const char *path, const struct utimbuf *times)
 {
 	int n;
-	Dir *d;
+	Dir nd;
 	time_t curt;
 
-	if((d = _dirstat(path)) == nil){
-		_syserrno();
-		return -1;
-	}
+	_nulldir(&nd);
 	if(times == 0) {
 		curt = time(0);
-		d->atime = curt;
-		d->mtime = curt;
+		nd.atime = curt;
+		nd.mtime = curt;
 	} else {
-		d->atime = times->actime;
-		d->mtime = times->modtime;
+		nd.atime = times->actime;
+		nd.mtime = times->modtime;
 	}
-	n = _dirwstat(path, d);
+	n = _dirwstat(path, &nd);
 	if(n < 0)
 		_syserrno();
-	free(d);
 	return n;
 }

+ 2 - 1
sys/src/cmd/acme/exec.c

@@ -528,7 +528,8 @@ putfile(File *f, int q0, int q1, Rune *namer, int nname)
 	name = runetobyte(namer, nname);
 	d = dirstat(name);
 	if(d!=nil && runeeq(namer, nname, f->name, f->nname)){
-		if(f->dev!=d->dev || f->qidpath!=d->qid.path || f->mtime<d->mtime){
+		/* f->mtime+1 because when talking over NFS it's often off by a second */
+		if(f->dev!=d->dev || f->qidpath!=d->qid.path || f->mtime+1<d->mtime){
 			f->dev = d->dev;
 			f->qidpath = d->qid.path;
 			f->mtime = d->mtime;

+ 5 - 10
sys/src/cmd/ar.c

@@ -345,7 +345,7 @@ xcmd(char *arname, int count, char **files)
 {
 	int fd, f, mode, i;
 	Armember *bp;
-	Dir *dx;
+	Dir dx;
 
 	fd = openar(arname, OREAD, 0);
 	Binit(&bar, fd, OREAD);
@@ -364,16 +364,11 @@ xcmd(char *arname, int count, char **files)
 				if (write(f, bp->member, bp->size) < 0)
 					wrerr();
 				if(oflag) {
-					dx = dirfstat(f);
-					if(dx == nil)
+					nulldir(&dx);
+					dx.atime = bp->date;
+					dx.mtime = bp->date;
+					if(dirwstat(file, &dx) < 0)
 						perror(file);
-					else {
-						dx->atime = bp->date;
-						dx->mtime = bp->date;
-						if(dirwstat(file, dx) < 0)
-							perror(file);
-						free(dx);
-					}
 				}
 				free(bp->member);
 				close(f);

+ 1 - 1
sys/src/cmd/auth/factotum/log.c

@@ -62,7 +62,7 @@ logbufflush(Logbuf *lb, Req *r)
 			r->aux = nil;
 			if(*l == nil)
 				lb->waitlast = l;
-			closereq(r);
+			respond(r, "interrupted");
 			break;
 		}
 	}

+ 31 - 0
sys/src/cmd/auth/newns.c

@@ -0,0 +1,31 @@
+#include <u.h>
+#include <libc.h>
+#include <auth.h>
+
+void
+usage(void)
+{
+	fprint(2, "usage: newns [-f file] command\n");
+	exits("usage");
+}
+
+void
+main(int argc, char **argv)
+{
+	char *nsfile;
+
+	nsfile = "/lib/namespace";
+	ARGBEGIN{
+	case 'f':
+		nsfile = ARGF();
+		break;
+	default:
+		usage();
+		break;
+	}ARGEND
+	if(argc == 0)
+		usage();
+	newns(getuser(), nsfile);
+	exec(argv[0], argv);
+	sysfatal("exec: %s: %r", argv[0]);
+}	

+ 2 - 2
sys/src/cmd/aux/apm.c

@@ -128,7 +128,7 @@ static char *error[256] = {
 [0x0B]	"interface not engaged",
 [0x0C]	"function not supported",
 [0x0D]	"resume timer disabled",
-[0x60]	"unable to enter requestsed state",
+[0x60]	"unable to enter requested state",
 [0x80]	"no power mgmt events pending",
 [0x86]	"apm not present",
 };
@@ -925,7 +925,7 @@ flushthread(void*)
 				*rq = or->aux;
 				if(tailp==&or->aux)
 					tailp = rq;
-				respond(or, "flushed");
+				respond(or, "interrupted");
 				break;
 			}
 		}

+ 6 - 25
sys/src/cmd/con/con.c

@@ -37,7 +37,6 @@ long	iwrite(int, void*, int);
 int	menu(int);
 void	msgfromkbd(int);
 void	msgfromnet(int);
-void	msgnotifyf(void*, char*);
 int	msgwrite(int, void*, int);
 void	notifyf(void*, char*);
 void	pass(int, int, int);
@@ -256,6 +255,8 @@ notifyf(void *a, char *msg)
 {
 	USED(a);
 
+	if(strstr(msg, "yankee"))
+		noted(NDFLT);
 	if(strstr(msg, "closed pipe")
 	|| strcmp(msg, "interrupt") == 0
 	|| strcmp(msg, "hangup") == 0)
@@ -389,14 +390,14 @@ stdcon(int net)
 	case 0:
 		notify(notifyf);
 		fromnet(net);
-		postnote(PNPROC, ttypid, "");
+		postnote(PNPROC, ttypid, "die yankee dog");
 		exits(0);
 	default:
 		notify(notifyf);
 		fromkbd(net);
 		if(notkbd)
 			for(;;)sleep(0);
-		postnote(PNPROC, netpid, "");
+		postnote(PNPROC, netpid, "die yankee dog");
 		exits(0);
 	}
 }
@@ -418,7 +419,7 @@ fromkbd(int net)
 		n = read(0, buf, sizeof(buf));
 		if(n < 0){
 			if(wasintr()){
-				if(cooked){
+				if(!raw){
 					buf[0] = 0x7f;
 					n = 1;
 				} else
@@ -435,7 +436,7 @@ fromkbd(int net)
 			if(menu(net) < 0)
 				return;
 		}else{
-			if(cooked && n==0){
+			if(!raw && n==0){
 				buf[0] = 0x4;
 				n = 1;
 			}
@@ -687,26 +688,6 @@ struct Msg {
 	char b[MAXMSG];
 };
 
-/*
- *  convert certain interrupts into mesgld messages
- */
-void
-msgnotifyf(void *a, char *msg)
-{
-	USED(a);
-
-	if(strstr(msg, "closed pipe"))
-		noted(NCONT);
-	if(strcmp(msg, "interrupt") == 0){
-		sendctl1(msgfd, M_SIGNAL, SIGINT);
-		noted(NCONT);
-	}
-	if(strcmp(msg, "hangup") == 0){
-		sendctl(msgfd, M_HANGUP);
-		noted(NCONT);
-	}
-	noted(NDFLT);
-}
 
 /*
  *  send an empty mesgld message

+ 3 - 2
sys/src/cmd/con/mkfile

@@ -7,8 +7,9 @@ TARG=con\
 
 BIN=/$objtype/bin
 
-UPDATE=mkfile\
-	${TARG:%=/386/bin/%}\
+UPDATE=\
+	mkfile\
+	$HFILES\
 	${TARG:%=%.c}\
 	/sys/man/1/con\
 

+ 3 - 1
sys/src/cmd/faces/main.c

@@ -14,6 +14,8 @@ enum
 {
 	Facesep = 6,	/* must be even to avoid damaging background stipple */
 	Infolines = 9,
+
+	HhmmTime = 18*60*60,	/* max age of face to display hh:mm time */
 };
 
 enum
@@ -280,7 +282,7 @@ updatetimes(void)
 		f = faces[i];
 		if(f == nil)
 			continue;
-		if(((long)(now - f->time) <= 23*60*60) != f->recent)
+		if(((long)(now - f->time) <= HhmmTime) != f->recent)
 			drawface(f, i);
 	}	
 }

+ 4 - 9
sys/src/cmd/ip/ftpd.c

@@ -1532,7 +1532,7 @@ rnfrcmd(char *from)
 int
 rntocmd(char *to)
 {
-	Dir *d;
+	Dir nd;
 	char *fp;
 	char *tp;
 
@@ -1554,15 +1554,10 @@ rntocmd(char *to)
 	if(tp)
 		to = tp+1;
 
-	d = dirstat(filepath);
-	if(d == nil)
-		return reply("550 Can't rename %s: %r\n", filepath);
-	d->name = to;
-	if(dirwstat(filepath, d) < 0){
-		free(d);
+	nulldir(&nd);
+	nd.name = to;
+	if(dirwstat(filepath, &nd) < 0)
 		return reply("550 Can't rename %s to %s: %r\n", filepath, to);
-	}
-	free(d);
 
 	filepath[0] = 0;
 	return reply("250 %s now %s", filepath, to);

+ 2 - 6
sys/src/cmd/ls.c

@@ -89,12 +89,6 @@ ls(char *s, int multi)
 	char *p;
 	Dir *db;
 
-	for(;;) {
-		p = utfrrune(s, '/');
-		if(p == 0 || p[1] != 0 || p == s)
-			break;
-		*p = 0;
-	}
 	db = dirstat(s);
 	if(db == nil){
     error:
@@ -109,6 +103,7 @@ ls(char *s, int multi)
 		n = dirreadall(fd, &db);
 		if(n < 0)
 			goto error;
+		cleanname(s);
 		growto(ndir+n);
 		for(i=0; i<n; i++){
 			dirbuf[ndir+i].d = db+i;
@@ -121,6 +116,7 @@ ls(char *s, int multi)
 		growto(ndir+1);
 		dirbuf[ndir].d = db;
 		dirbuf[ndir].prefix = 0;
+		cleanname(s);
 		p = utfrrune(s, '/');
 		if(p){
 			dirbuf[ndir].prefix = s;

+ 0 - 141
sys/src/cmd/ssh/authrsafile.c

@@ -1,141 +0,0 @@
-#include "ssh.h"
-
-static int
-authrsafilefn(Conn *c)
-{
-	char *home, *file;
-	Biobuf *b;
-
-	home = getenv("home");
-	if(home == nil){
-		werrstr("no $home");
-		return -1;
-	}
-	file = smprint("%s/lib/userkeyring", home);
-	free(home);
-	if(file == nil){
-		werrstr("smprint failed: %r");
-		return -1;
-	}
-
-	b = Bopen(file, '\n');
-	free(file);
-	if(b == nil){
-		werrstr("Bopen: %r");
-		return -1;
-	}
-
-	
-	
-	uchar chalbuf[32+SESSIDLEN], response[MD5dlen];
-	char *s, *p;
-	int afd, ret;
-	AuthRpc *rpc;
-	Msg *m;
-	mpint *chal, *decr, *unpad, *mod;
-
-	debug(DBG_AUTH, "rsa!\n");
-
-	if((afd = open("/mnt/factotum/rpc", ORDWR)) < 0){
-		debug(DBG_AUTH, "open /mnt/factotum/rpc: %r\n");
-		return -1;
-	}
-	if((rpc = auth_allocrpc(afd)) == nil){
-		debug(DBG_AUTH, "auth_allocrpc: %r\n");
-		close(afd);
-		return -1;
-	}
-	s = "proto=sshrsa role=client";
-	if(auth_rpc(rpc, "start", s, strlen(s)) != ARok){
-		debug(DBG_AUTH, "auth_rpc start %s failed: %r\n", s);
-		auth_freerpc(rpc);
-		close(afd);
-		return -1;
-	}
-
-	ret = -1;
-	debug(DBG_AUTH, "trying factotum rsa keys\n");
-	while(auth_rpc(rpc, "read", nil, 0) == ARok){
-		debug(DBG_AUTH, "try %s\n", (char*)rpc->arg);
-		mod = strtomp(rpc->arg, nil, 16, nil);
-		m = allocmsg(c, SSH_CMSG_AUTH_RSA, 16+(mpsignif(mod)+7/8));
-		putmpint(m, mod);
-		sendmsg(m);
-		mpfree(mod);
-		m = recvmsg(c, 0);
-		if(m == nil)
-			badmsg(m, 0);
-		switch(m->type){
-		case SSH_SMSG_FAILURE:
-			debug(DBG_AUTH, "\tnot accepted\n", (char*)rpc->arg);
-			free(m);
-			continue;
-		default:
-			badmsg(m, 0);
-		case SSH_SMSG_AUTH_RSA_CHALLENGE:
-			break;
-		}
-		chal = getmpint(m);
-		debug(DBG_AUTH, "\tgot challenge %B\n", chal);
-		free(m);
-		p = mptoa(chal, 16, nil, 0);
-		mpfree(chal);
-		if(p == nil){
-			debug(DBG_AUTH, "\tmptoa failed: %r\n");
-			unpad = mpnew(0);
-			goto Keepgoing;
-		}
-		if(auth_rpc(rpc, "write", p, strlen(p)) != ARok){
-			debug(DBG_AUTH, "\tauth_rpc write failed: %r\n");
-			free(p);
-			unpad = mpnew(0);	/* it will fail, we'll go round again */
-			goto Keepgoing;
-		}
-		free(p);
-		if(auth_rpc(rpc, "read", nil, 0) != ARok){
-			debug(DBG_AUTH, "\tauth_rpc read failed: %r\n");
-			unpad = mpnew(0);
-			goto Keepgoing;
-		}
-		decr = strtomp(rpc->arg, nil, 16, nil);
-		debug(DBG_AUTH, "\tdecrypted %B\n", decr);
-		unpad = rsaunpad(decr);
-		debug(DBG_AUTH, "\tunpadded %B\n", unpad);
-		mpfree(decr);
-	Keepgoing:
-		mptoberjust(unpad, chalbuf, 32);
-		mpfree(unpad);
-		debug(DBG_AUTH, "\trjusted %.*H\n", 32, chalbuf);
-		memmove(chalbuf+32, c->sessid, SESSIDLEN);
-		debug(DBG_AUTH, "\tappend sesskey %.*H\n", 32, chalbuf);
-		md5(chalbuf, 32+SESSIDLEN, response, nil);
-		m = allocmsg(c, SSH_CMSG_AUTH_RSA_RESPONSE, MD5dlen);
-		putbytes(m, response, MD5dlen);
-		sendmsg(m);
-
-		m = recvmsg(c, 0);
-		if(m == nil)
-			badmsg(m, 0);
-		switch(m->type){
-		case SSH_SMSG_FAILURE:
-			free(m);
-			continue;
-		default:
-			badmsg(m, 0);
-		case SSH_SMSG_SUCCESS:
-			break;
-		}
-		ret = 0;
-		break;
-	}
-	auth_freerpc(rpc);
-	close(afd);
-	return ret;
-}
-
-Auth authrsafile =
-{
-	SSH_AUTH_RSA,
-	"rsafile",
-	authrsafilefn,
-};

+ 0 - 6
sys/src/cmd/ssh/mkfile

@@ -44,12 +44,6 @@ UPDATE=\
 	${AUTHSRVOFILES:%.$O=%.c}\
 	${CIPHEROFILES:%.$O=%.c}\
 	${TARG:%=%.c}\
-	/386/bin/scp\
-	/386/bin/ssh\
-	/386/bin/sshnet\
-	/386/bin/aux/sshserve\
-	/386/bin/aux/ssh_genkey\
-
 
 </sys/src/cmd/mkmany
 

+ 20 - 18
sys/src/cmd/ssh/scp.c

@@ -335,6 +335,7 @@ readhdr(char *p, int n)
 Dir *
 receivedir(char *dir, int exists, Dir *d, int settimes, ulong atime, ulong mtime, ulong mode)
 {
+	Dir nd;
 	int setmodes;
 
 	setmodes = pflag;
@@ -353,19 +354,22 @@ receivedir(char *dir, int exists, Dir *d, int settimes, ulong atime, ulong mtime
 	}
 	receive(dir);
 	if(settimes || setmodes){
-		free(d);
-		if((d = dirstat(dir)) == 0){
-			scperror(0, "can't stat %s: %r", dir);
-			return d;
-		}
+		nulldir(&nd);
 		if(settimes){
-			d->atime = atime;
-			d->mtime = mtime;
+			nd.atime = atime;
+			nd.mtime = mtime;
+			d->atime = nd.atime;
+			d->mtime = nd.mtime;
+		}
+		if(setmodes){
+			nd.mode = DMDIR | (mode & 0777);
+			d->mode = nd.mode;
 		}
-		if(setmodes)
-			d->mode = (d->mode & ~0777) | (mode & 0777);
-		if(dirwstat(dir, d))
+		if(dirwstat(dir, &nd) < 0){
 			scperror(0, "can't wstat %s: %r", dir);
+			free(d);
+			return nil;
+		}
 	}
 	return d;
 }
@@ -380,6 +384,7 @@ receive(char *dest)
 	char buf[8192], *p;
 	char name[1024];
 	Dir *d;
+	Dir nd;
 
 	mtime = 0L;
 	atime = 0L;
@@ -495,17 +500,14 @@ receive(char *dest)
 			if(errors)
 				scperror(0, "%s: write error: %r", name);
 			else if(settimes || (exists && (d->mode&0777) != (mode&0777))){
-				if(!exists && (d = dirfstat(fd)) == nil){
-					scperror(0, "can't stat %s: %r", name);
-					continue;
-				}
+				nulldir(&nd);
 				if(settimes){
 					settimes = 0;
-					d->atime = atime;
-					d->mtime = mtime;
+					nd.atime = atime;
+					nd.mtime = mtime;
 				}
-				d->mode = (d->mode & ~0777) | (mode & 0777);
-				if(dirwstat(name, d) < 0)
+				nd.mode = (d->mode & ~0777) | (mode&0777);
+				if(dirwstat(name, &nd) < 0)
 					scperror(0, "can't wstat %s: %r", name);
 			}
 			free(d);

+ 2 - 4
sys/src/cmd/ssh/ssh.c

@@ -195,10 +195,10 @@ main(int argc, char **argv)
 		m = allocmsg(&c, SSH_CMSG_EXEC_SHELL, 0);
 	sendmsg(m);
 
+	fromstdin(&c);
+	rfork(RFNOTEG);	/* only fromstdin gets notes */
 	if(dowinchange)
 		winchanges(&c);
-
-	fromstdin(&c);
 	fromnet(&c);
 	exits(0);
 }
@@ -516,7 +516,6 @@ fromstdin(Conn *c)
 	case 0:
 		break;
 	default:
-		rfork(RFNOTEG);
 		atexitkill(pid);
 		return;
 	}
@@ -579,7 +578,6 @@ winchanges(Conn *c)
 	case 0:
 		break;
 	default:
-		rfork(RFNOTEG);
 		atexitkill(pid);
 		return;
 	}

+ 1 - 1
sys/src/cmd/ssh/sshnet.c

@@ -821,7 +821,7 @@ fsflush(Req *r)
 
 	for(i=0; i<nclient; i++)
 		if(findreq(client[i], r->oldreq))
-			respond(r->oldreq, "flushed");
+			respond(r->oldreq, "interrupted");
 	respond(r, nil);
 }
 

+ 16 - 31
sys/src/cmd/upas/common/libsys.c

@@ -99,6 +99,7 @@ openlockfile(Mlock *l)
 {
 	int fd;
 	Dir *d;
+	Dir nd;
 	char *p;
 
 	fd = open(s_to_c(l->name), OREAD);
@@ -113,12 +114,9 @@ openlockfile(Mlock *l)
 		/* try creating it */
 		fd = create(s_to_c(l->name), OREAD, DMEXCL|0666);
 		if(fd >= 0){
-			d = dirfstat(fd);
-			if(d != nil){
-				d->mode |= DMEXCL|0666;
-				dirfwstat(fd, d);
-				free(d);
-			}
+			nulldir(&nd);
+			nd.mode = DMEXCL|0666;
+			dirfwstat(fd, &nd);
 			l->fd = fd;
 			return 0;
 		}
@@ -260,7 +258,7 @@ sysopen(char *path, char *mode, ulong perm)
 	int docreate;
 	int append;
 	int truncate;
-	Dir *d;
+	Dir *d, nd;
 	Biobuf *bp;
 
 	/*
@@ -332,12 +330,9 @@ sysopen(char *path, char *mode, ulong perm)
 			fd = create(path, sysmode, sysperm|perm);
 			if(fd < 0)
 				return 0;
-			d = dirfstat(fd);
-			if(d != nil){
-				d->mode |= sysperm|perm;
-				dirfwstat(fd, d);
-				free(d);
-			}
+			nulldir(&nd);
+			nd.mode = sysperm|perm;
+			dirfwstat(fd, &nd);
 		} else {
 			free(d);
 			return 0;
@@ -400,18 +395,13 @@ sysmkdir(char *file, ulong perm)
 int
 syschgrp(char *file, char *group)
 {
-	Dir *d;
-	int rv;
+	Dir nd;
 
 	if(group == 0)
 		return -1;
-	d = dirstat(file);
-	if(d == nil)
-		return -1;
-	strncpy(d->gid, group, sizeof(d->gid));
-	rv = dirwstat(file, d);
-	free(d);
-	return rv;
+	nulldir(&nd);
+	nd.gid = group;
+	return dirwstat(file, &nd);
 }
 
 extern int
@@ -562,7 +552,7 @@ sysremove(char *path)
 extern int
 sysrename(char *old, char *new)
 {
-	Dir *d;
+	Dir d;
 	char *obase;
 	char *nbase;
 	int rv;
@@ -580,14 +570,9 @@ sysrename(char *old, char *new)
 			return -1;
 		nbase = new;
 	}
-	d = dirstat(old);
-	if(d == nil)
-		return -1;
-	memset(d->name, 0, sizeof(d->name));
-	strcpy(d->name, nbase);
-	rv = dirwstat(old, d);
-	free(d);
-	return rv;
+	nulldir(&d);
+	d.name = nbase;
+	return dirwstat(old, &d);
 }
 
 /*

+ 4 - 5
sys/src/cmd/upas/ml/common.c

@@ -30,17 +30,16 @@ void
 writeaddr(char *file, char *addr, int rem, char *listname)
 {
 	int fd;
-	Dir *d;
+	Dir nd;
 
 	fd = open(file, OWRITE);
 	if(fd < 0){
 		fd = create(file, OWRITE, DMAPPEND|0666);
 		if(fd < 0)
 			sysfatal("creating address list %s: %r", file);
-		d = dirstat(file);
-		d->mode = DMAPPEND|0666;
-		dirwstat(file, d);
-		free(d);
+		nulldir(&nd);
+		nd.mode = DMAPPEND|0666;
+		dirwstat(file, &nd);
 	} else
 		seek(fd, 0, 2);
 	if(rem)

+ 46 - 11
sys/src/libauthsrv/readnvram.c

@@ -29,6 +29,8 @@ static struct {
 	"pc", "#S/sdC0/9fat", -1, sizeof(Nvrsafe),
 	"pc", "#S/sd00/nvram", 0, sizeof(Nvrsafe),
 	"pc", "#S/sd00/9fat", -1, sizeof(Nvrsafe),
+	"pc", "#S/sd01/nvram", 0, sizeof(Nvrsafe),
+	"pc", "#S/sd01/9fat", -1, sizeof(Nvrsafe),
 	"pc", "#f/fd0disk", -1, 512,	/* 512: #f requires whole sector reads */
 	"pc", "#f/fd1disk", -1, 512,
 	"mips", "#r/nvram", 1024+900, sizeof(Nvrsafe),
@@ -118,13 +120,14 @@ readcons(char *prompt, char *def, int raw, char *buf, int nbuf)
 int
 readnvram(Nvrsafe *safep, int flag)
 {
-	char buf[1024], in[128], *cputype;
+	char buf[1024], in[128], *cputype, *nvrfile, *nvrlen, *nvroff, *v[2];
 	int fd, err, i, safeoff, safelen;
 	Nvrsafe *safe;
 
 	err = 0;
 	memset(safep, 0, sizeof(*safep));
 
+	nvrfile = getenv("nvram");
 	cputype = getenv("cputype");
 	if(cputype == nil)
 		cputype = "mips";
@@ -136,22 +139,54 @@ readnvram(Nvrsafe *safep, int flag)
 	fd = -1;
 	safeoff = -1;
 	safelen = -1;
-	for(i=0; i<nelem(nvtab); i++){
-		if(strcmp(cputype, nvtab[i].cputype) != 0)
-			continue;
-		if((fd = open(nvtab[i].file, ORDWR)) < 0)
-			continue;
-		safeoff = nvtab[i].off;
-		safelen = nvtab[i].len;
-		if(safeoff == -1){
-			safeoff = finddosfile(fd, "plan9.nvr");
+	if(nvrfile != nil){
+		/* accept device and device!file */
+		i = gettokens(nvrfile, v, nelem(v), "!");
+		fd = open(v[0], ORDWR);
+		safelen = sizeof(Nvrsafe);
+		if(strstr(v[0], "/9fat") == nil)
+			safeoff = 0;
+		nvrlen = getenv("nvrlen");
+		if(nvrlen != nil)
+			safelen = atoi(nvrlen);
+		nvroff = getenv("nvroff");
+		if(nvroff != nil){
+			if(strcmp(nvroff, "dos") == 0)
+				safeoff = -1;
+			else
+				safeoff = atoi(nvroff);
+		}
+		if(safeoff < 0 && fd >= 0){
+			safelen = 512;
+			safeoff = finddosfile(fd, i == 2 ? v[1] : "plan9.nvr");
 			if(safeoff < 0){
 				close(fd);
 				fd = -1;
+			}
+		}
+		free(nvrfile);
+		if(nvrlen != nil)
+			free(nvrlen);
+		if(nvroff != nil)
+			free(nvroff);
+	}else{
+		for(i=0; i<nelem(nvtab); i++){
+			if(strcmp(cputype, nvtab[i].cputype) != 0)
+				continue;
+			if((fd = open(nvtab[i].file, ORDWR)) < 0)
 				continue;
+			safeoff = nvtab[i].off;
+			safelen = nvtab[i].len;
+			if(safeoff == -1){
+				safeoff = finddosfile(fd, "plan9.nvr");
+				if(safeoff < 0){
+					close(fd);
+					fd = -1;
+					continue;
+				}
 			}
+			break;
 		}
-		break;
 	}
 
 	if(fd < 0

+ 4 - 0
sys/src/libmemdraw/alloc.c

@@ -27,6 +27,10 @@ allocmemimaged(Rectangle r, ulong chan, Memdata *md)
 	ulong l;
 	Memimage *i;
 
+	if(Dx(r) <= 0 || Dy(r) <= 0){
+		werrstr("bad rectangle %R", r);
+		return nil;
+	}
 	if((d = chantodepth(chan)) == 0) {
 		werrstr("bad channel descriptor %.8lux", chan);
 		return nil;