Browse Source

Plan 9 from Bell Labs 2008-04-15

David du Colombier 11 years ago
parent
commit
19c597aab5
7 changed files with 59 additions and 34 deletions
  1. 6 5
      dist/replica/_plan9.db
  2. 6 6
      dist/replica/plan9.db
  3. 6 0
      dist/replica/plan9.log
  4. 7 5
      lib/areacodes
  5. 1 0
      sys/man/8/ipserv
  6. 1 1
      sys/src/cmd/cdfs/main.c
  7. 32 17
      sys/src/cmd/ip/ftpd.c

+ 6 - 5
dist/replica/_plan9.db

@@ -176,7 +176,7 @@
 386/bin/calendar - 775 sys sys 1200262736 79060
 386/bin/cat - 775 sys sys 1148500611 37482
 386/bin/cb - 775 sys sys 1168402293 77628
-386/bin/cdfs - 775 sys sys 1206559723 173155
+386/bin/cdfs - 775 sys sys 1208201049 173189
 386/bin/cec - 775 sys sys 1193714267 75896
 386/bin/cfs - 775 sys sys 1190863294 130565
 386/bin/chgrp - 775 sys sys 1168402294 59522
@@ -907,7 +907,7 @@ dist/replica/plan9.proto - 664 sys sys 1196638558 2871
 env - 20000000775 sys sys 1104813586 0
 fd - 20000000775 sys sys 1020896384 0
 lib - 20000000775 sys sys 1161442421 0
-lib/areacodes - 664 sys sys 1032057527 26182
+lib/areacodes - 664 sys sys 1208190057 26367
 lib/cmap - 20000000775 sys sys 1039727323 0
 lib/cmap/5.oclock.shado - 664 sys sys 954523185 3872
 lib/cmap/559.56 - 664 sys sys 954523185 3344
@@ -7859,7 +7859,7 @@ sys/man/8/gpsfs - 664 sys sys 1196638947 4918
 sys/man/8/httpd - 664 sys sys 1196638947 6866
 sys/man/8/init - 664 sys sys 1196638947 1430
 sys/man/8/ipconfig - 664 sys sys 1205960389 8284
-sys/man/8/ipserv - 664 sys sys 1202161489 3268
+sys/man/8/ipserv - 664 sys sys 1208190062 3272
 sys/man/8/kfscmd - 664 sys sys 1196638947 4514
 sys/man/8/listen - 664 sys sys 1205796105 4090
 sys/man/8/lp - 664 sys sys 1205960257 2490
@@ -10031,7 +10031,7 @@ sys/src/cmd/cdfs - 20000000775 sys sys 1039727558 0
 sys/src/cmd/cdfs/buf.c - 664 sys sys 1205271166 1923
 sys/src/cmd/cdfs/dat.h - 664 sys sys 1206046829 4619
 sys/src/cmd/cdfs/fns.h - 664 sys sys 969542122 297
-sys/src/cmd/cdfs/main.c - 664 sys sys 1206379554 12449
+sys/src/cmd/cdfs/main.c - 664 sys sys 1208195235 12480
 sys/src/cmd/cdfs/mkfile - 664 sys sys 1204937991 153
 sys/src/cmd/cdfs/mmc.c - 664 sys sys 1206476551 31404
 sys/src/cmd/cec - 20000000775 sys sys 1193683647 0
@@ -12497,7 +12497,7 @@ sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1198186463 1225
 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 1188195412 33395
+sys/src/cmd/ip/ftpd.c - 664 sys sys 1208210293 33592
 sys/src/cmd/ip/ftpfs - 20000000775 sys sys 1048312051 0
 sys/src/cmd/ip/ftpfs/file.c - 664 sys sys 1014925642 4208
 sys/src/cmd/ip/ftpfs/ftpfs.c - 664 sys sys 1116737713 13860
@@ -15883,3 +15883,4 @@ 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/ip/ftpd - 775 sys sys 1208230201 172192

+ 6 - 6
dist/replica/plan9.db

@@ -176,7 +176,7 @@
 386/bin/calendar - 775 sys sys 1200262736 79060
 386/bin/cat - 775 sys sys 1148500611 37482
 386/bin/cb - 775 sys sys 1168402293 77628
-386/bin/cdfs - 775 sys sys 1206559723 173155
+386/bin/cdfs - 775 sys sys 1208201049 173189
 386/bin/cec - 775 sys sys 1193714267 75896
 386/bin/cfs - 775 sys sys 1190863294 130565
 386/bin/chgrp - 775 sys sys 1168402294 59522
@@ -295,7 +295,7 @@
 386/bin/ip/dhcpclient - 775 sys sys 1178568281 92992
 386/bin/ip/dhcpd - 775 sys sys 1207453634 152879
 386/bin/ip/dhcpleases - 775 sys sys 1204292497 86370
-386/bin/ip/ftpd - 775 sys sys 1204292500 172031
+386/bin/ip/ftpd - 775 sys sys 1208230201 172192
 386/bin/ip/gping - 775 sys sys 1198211707 182214
 386/bin/ip/hogports - 775 sys sys 1148500655 42914
 386/bin/ip/httpd - 20000000775 sys sys 1068385801 0
@@ -907,7 +907,7 @@ dist/replica/plan9.proto - 664 sys sys 1196638558 2871
 env - 20000000775 sys sys 1104813586 0
 fd - 20000000775 sys sys 1020896384 0
 lib - 20000000775 sys sys 1161442421 0
-lib/areacodes - 664 sys sys 1032057527 26182
+lib/areacodes - 664 sys sys 1208190057 26367
 lib/cmap - 20000000775 sys sys 1039727323 0
 lib/cmap/5.oclock.shado - 664 sys sys 954523185 3872
 lib/cmap/559.56 - 664 sys sys 954523185 3344
@@ -7859,7 +7859,7 @@ sys/man/8/gpsfs - 664 sys sys 1196638947 4918
 sys/man/8/httpd - 664 sys sys 1196638947 6866
 sys/man/8/init - 664 sys sys 1196638947 1430
 sys/man/8/ipconfig - 664 sys sys 1205960389 8284
-sys/man/8/ipserv - 664 sys sys 1202161489 3268
+sys/man/8/ipserv - 664 sys sys 1208190062 3272
 sys/man/8/kfscmd - 664 sys sys 1196638947 4514
 sys/man/8/listen - 664 sys sys 1205796105 4090
 sys/man/8/lp - 664 sys sys 1205960257 2490
@@ -10031,7 +10031,7 @@ sys/src/cmd/cdfs - 20000000775 sys sys 1039727558 0
 sys/src/cmd/cdfs/buf.c - 664 sys sys 1205271166 1923
 sys/src/cmd/cdfs/dat.h - 664 sys sys 1206046829 4619
 sys/src/cmd/cdfs/fns.h - 664 sys sys 969542122 297
-sys/src/cmd/cdfs/main.c - 664 sys sys 1206379554 12449
+sys/src/cmd/cdfs/main.c - 664 sys sys 1208195235 12480
 sys/src/cmd/cdfs/mkfile - 664 sys sys 1204937991 153
 sys/src/cmd/cdfs/mmc.c - 664 sys sys 1206476551 31404
 sys/src/cmd/cec - 20000000775 sys sys 1193683647 0
@@ -12497,7 +12497,7 @@ sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1198186463 1225
 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 1188195412 33395
+sys/src/cmd/ip/ftpd.c - 664 sys sys 1208210293 33592
 sys/src/cmd/ip/ftpfs - 20000000775 sys sys 1048312051 0
 sys/src/cmd/ip/ftpfs/file.c - 664 sys sys 1014925642 4208
 sys/src/cmd/ip/ftpfs/ftpfs.c - 664 sys sys 1116737713 13860

+ 6 - 0
dist/replica/plan9.log

@@ -18984,3 +18984,9 @@
 1207960204 0 c sys/man/4/cdfs - 664 sys sys 1207959658 4803
 1208111404 0 c rc/bin/fax - 775 sys sys 1208110476 2401
 1208111404 1 c sys/man/4/telco - 664 sys sys 1208111302 4561
+1208190604 0 c lib/areacodes - 664 sys sys 1208190057 26367
+1208190604 1 c sys/man/8/ipserv - 664 sys sys 1208190062 3272
+1208196003 0 c sys/src/cmd/cdfs/main.c - 664 sys sys 1208195235 12480
+1208201404 0 c 386/bin/cdfs - 775 sys sys 1208201049 173189
+1208210404 0 c sys/src/cmd/ip/ftpd.c - 664 sys sys 1208210293 33592
+1208230204 0 c 386/bin/ip/ftpd - 775 sys sys 1208230201 172192

+ 7 - 5
lib/areacodes

@@ -30,7 +30,7 @@
 242 -- [-5] Bahamas 
 246 -- [-4] Barbados 
 248 MI [-5] Michigan: Oakland county (split from 810 ) 
-250 BC [-8] Canada: British Columbia (see 604 ) 
+250 BC [-8] Canada: British Columbia outside of Greater Vancouver (overlay 778; see 604) 
 251 AL [-6] S Alabama: Mobile (incl Auburn/Opelika, Montgomery, Mobile and coastal areas; split from 334 , eff 6/18/01; see also 205, 256) 
 252 NC [-5] E North Carolina (Rocky Mount; split from 919 ) 
 253 WA [-8] Washington: South Tier - Tacoma, Federal Way (split from 206 , see also 425 ; overlay 564 ) 
@@ -90,7 +90,7 @@
 386 FL [-5] N central Florida: Lake City (split from 904 , perm 2/15/01, mand 11-05-01) 
 401 RI [-5] Rhode Island 
 402 NE [-6] E Nebraska: Omaha, Lincoln 
-403 AB [-7] Canada: Southern Alberta (see 780 , 867 ) 
+403 AB [-7] Canada: Southern Alberta (overlay 587; see 780, 867 ) 
 404 GA [-5] N Georgia: Atlanta and suburbs (see overlay 678 , split 770 ) 
 405 OK [-6] W Oklahoma: Oklahoma City (see 580 ) 
 406 MT [-7] Montana 
@@ -105,7 +105,7 @@
 415 CA [-8] San Francisco, California (see 650 ) 
 416 ON [-5] Canada: S Cent. Ontario: Toronto (see overlay 647 , eff 3/5/01) 
 417 MO [-6] SW Missouri: Springfield 
-418 QC [-5/-4] Canada: NE Quebec: Quebec 
+418 QC [-5/-4] Canada: NE Quebec: Quebec (overlay 581)
 419 OH [-5] NW Ohio: Toledo (see overlay 567 , perm 1/1/02) 
 420 WI [-6] Wisconsin (not sure what area / split) 
 423 TN [-5] E Tennessee: Chattanooga (see split 865 ; part of what used to be 615 ) 
@@ -167,8 +167,10 @@
 573 MO [-6] SE Missouri: excluding St Louis metro area, includes Central/East Missouri 
 574 IN [-5] N Indiana (split from 219 ) 
 580 OK [-6] W Oklahoma (rural areas outside Oklahoma City; split from 405 ) 
+581 QC [-5/-4] Canada: NE Quebec: Quebec (overlays 418; eff 2008-09-19)
 585 NY [-5] NW New York: Rochester (split from 716 ) 
 586 MI [-5] Michigan: Macomb County (split from 810 ; perm 9/22/01, mand 3/23/02) 
+587 AB [-7] Alberta (overlays 403 and 778; perm 2008-06-23, mand 2008-09-08)
 590 -- [-4] French West Indies Carribean Islands: St. Barthelemy (French), St. martin (Dutch & French) (time zones?) 
 600 -- [--] Canadian Services 
 601 MS [-6] Mississippi: Jackson area (see splits 228 , 662 ) 
@@ -259,8 +261,8 @@
 773 IL [-6] Illinois: city of Chicago, outside the loop (see 312 ; overlay 872 ) 
 774 MA [-5] Cent. Massachusetts: Framingham; Cape Cod (see split 978 , overlaid on 508 , eff 4/2/2001) 
 775 NV [-8] Nevada: Reno (all of NV except Clark County area; see 702 ) 
-778 BC [-8] Canada: British Columbia: Greater Vancouver (overlaid on 604 , per 11/3/01; see also 250) 
-780 AB [-7] Canada: Northern Alberta, north of Lacombe (see 403 ) 
+778 BC [-8] Canada: British Columbia (overlays 250 and 604) 
+780 AB [-7] Canada: Northern Alberta, north of Lacombe (overlay 587; see 403) 
 781 MA [-5] Massachusetts: Boston surburbs, to the north and west (see splits 617 , 508 ; overlay 339 ) 
 784 -- [-4] St. Vincent & Grenadines (split from 809 ) 
 785 KS [-6] N & W Kansas: Topeka (split from 913 ) 

+ 1 - 0
sys/man/8/ipserv

@@ -150,6 +150,7 @@ options are:
 .TP 4
 .B a
 allow anonymous access
+.TP
 .B A
 allow
 .I only

+ 1 - 1
sys/src/cmd/cdfs/main.c

@@ -231,7 +231,7 @@ disctype(Drive *drive)
 	rw = "";
 	if (drive->mmctype != Mmcnone && drive->dvdtype == nil)
 		if (drive->erasable)
-			rw = "rw";
+			rw = drive->mmctype == Mmcbd? "re": "rw";
 		else if (drive->recordable)
 			rw = "r";
 		else

+ 32 - 17
sys/src/cmd/ip/ftpd.c

@@ -12,7 +12,7 @@ enum
 {
 	/* telnet control character */
 	Iac=		255,
-	
+
 	/* representation types */
 	Tascii=		0,
 	Timage=		1,
@@ -307,10 +307,10 @@ main(int argc, char **argv)
 			 *  comes out as something unrecognizable instead of
 			 *  IAC's.  Certainly a Plan 9 bug but I can't find it.
 			 *  This is a major hack to avoid the problem. -- presotto
-			 */ 
+			 */
 			i = strlen(cmd);
 			if(i > 4 && strcmp(cmd+i-4, "abor") == 0){
-				abortcmd(0);	
+				abortcmd(0);
 			} else{
 				logit("%s (%s) command not implemented", cmd, arg?arg:"");
 				reply("502 %s command not implemented", cmd);
@@ -511,6 +511,19 @@ loginuser(char *user, char *nsfile, int gotoslash)
 	return reply("230 Logged in");
 }
 
+static void
+slowdown(void)
+{
+	static ulong pause;
+
+	if (pause) {
+		sleep(pause);			/* deter guessers */
+		if (pause < (1UL << 20))
+			pause *= 2;
+	} else
+		pause = 1000;
+}
+
 /*
  *  get a user id, reply with a challenge.  The users 'anonymous'
  *  and 'ftp' are equivalent to 'none'.  The user 'none' requires
@@ -519,6 +532,8 @@ loginuser(char *user, char *nsfile, int gotoslash)
 int
 usercmd(char *name)
 {
+	slowdown();
+
 	logit("user %s %s", name, nci->rsys);
 	if(loggedin)
 		return reply("530 Already logged in as %s", user);
@@ -537,21 +552,27 @@ usercmd(char *name)
 		strcpy(user, "none");
 	else if(anon_everybody)
 		strcpy(user,"none");
-	if(strcmp(user, "*none") == 0){
+
+	if(strcmp(user, "Administrator") == 0 || strcmp(user, "admin") == 0)
+		return reply("530 go away, script kiddie");
+	else if(strcmp(user, "*none") == 0){
 		if(!anon_ok)
 			return reply("530 Not logged in: anonymous disallowed");
 		return loginuser("none", namespace, 1);
 	}
-	if(strcmp(user, "none") == 0){
+	else if(strcmp(user, "none") == 0){
 		if(!anon_ok)
 			return reply("530 Not logged in: anonymous disallowed");
 		return reply("331 Send email address as password");
 	}
-	if(anon_only)
+	else if(anon_only)
 		return reply("530 Not logged in: anonymous access only");
+
 	isnoworld = noworld(name);
 	if(isnoworld)
 		return reply("331 OK");
+
+	/* consult the auth server */
 	if(ch)
 		auth_freechal(ch);
 	if((ch = auth_challenge("proto=p9cr role=server user=%q", user)) == nil)
@@ -592,16 +613,10 @@ passcmd(char *response)
 		ch->resp = response;
 		ch->nresp = strlen(response);
 		ai = auth_response(ch);
-		if(ai == nil) {
-			static long delay = 100;
-
-			sleep(delay);		/* deter password-guessers */
-			if (delay < 60*1000)
-				delay *= 2;
+		if(ai == nil || auth_chuid(ai, nil) < 0) {
+			slowdown();
 			return reply("530 Not logged in: %r");
 		}
-		if(auth_chuid(ai, nil) < 0)
-			return reply("530 Not logged in: %r");
 		auth_freechal(ch);
 		ch = nil;
 
@@ -896,7 +911,7 @@ listfile(Biobufhdr *b, char *name, int lflag, char *dname)
 			d->length = 512;
 		} else
 			links = 1;
-		
+
 		Bprint(b, "%s %3d %-8s %-8s %7lld %s ",
 			mode2asc(d->mode), links,
 			d->uid, d->gid, d->length, ts+4);
@@ -978,7 +993,7 @@ listdir(char *name, Biobufhdr *b, int lflag, int *printname, Globlist *gl)
 		}
 		Bprint(b, "total %ulld\r\n", total/512);
 	}
-	
+
 	qsort(p, n, sizeof(Dir), dircomp);
 	for(i = 0; i < n; i++){
 		if(Rflag && (p[i].qid.type & QTDIR)){
@@ -1058,7 +1073,7 @@ list(char *arg, int lflag)
 		gl = glob(argv[i]);
 		if(gl == nil)
 			continue;
-		
+
 		printname = gl->first != nil && gl->first->next != nil;
 		maxnamelen = 8;