Browse Source

Plan 9 from Bell Labs 2003-06-17

David du Colombier 21 years ago
parent
commit
2e8135eed5
5 changed files with 23 additions and 26 deletions
  1. 4 5
      dist/replica/plan9.db
  2. 5 0
      dist/replica/plan9.log
  3. 2 0
      sys/games/lib/fortunes
  4. 12 3
      sys/src/cmd/auth/keyfs.c
  5. 0 18
      sys/src/fs/words

+ 4 - 5
dist/replica/plan9.db

@@ -59,7 +59,7 @@
 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 1046656931 116514
+386/bin/auth/keyfs - 775 sys sys 1055797591 116737
 386/bin/auth/login - 775 sys sys 1053200894 101393
 386/bin/auth/newns - 775 sys sys 1053200894 86051
 386/bin/auth/pemdecode - 775 sys sys 1048622918 59616
@@ -3207,7 +3207,7 @@ sys/doc/venti/venti.pdf - 755 sys sys 1020384352 139090
 sys/doc/venti/venti.ps - 664 sys sys 1019852320 2012620
 sys/games - 20000000775 sys sys 952648872 0
 sys/games/lib - 20000000775 sys sys 952648879 0
-sys/games/lib/fortunes - 664 sys sys 1054049159 243650
+sys/games/lib/fortunes - 664 sys sys 1055817277 243905
 sys/include - 20000000775 sys sys 1016902416 0
 sys/include/9p.h - 664 sys sys 1044836327 4309
 sys/include/String.h - 664 sys sys 1055701304 1291
@@ -4584,7 +4584,7 @@ sys/man/2/arith3 - 664 sys sys 969499887 4397
 sys/man/2/assert - 664 sys sys 960089153 371
 sys/man/2/atof - 664 sys sys 1015091517 2766
 sys/man/2/auth - 664 sys sys 1017423719 7539
-sys/man/2/authsrv - 664 sys sys 1018386774 4043
+sys/man/2/authsrv - 664 sys sys 1055734550 4145
 sys/man/2/bin - 664 sys sys 985023077 1880
 sys/man/2/bind - 664 sys sys 1015091518 4685
 sys/man/2/bio - 664 sys sys 1017423720 6538
@@ -6575,7 +6575,7 @@ sys/src/cmd/auth/factotum/util.c - 664 sys sys 1048614988 17031
 sys/src/cmd/auth/factotum/wep.c - 664 sys sys 1048614986 2205
 sys/src/cmd/auth/guard.srv.c - 664 sys sys 1032497638 2334
 sys/src/cmd/auth/iam.c - 664 sys sys 1015008430 841
-sys/src/cmd/auth/keyfs.c - 664 sys sys 1032497639 17288
+sys/src/cmd/auth/keyfs.c - 664 sys sys 1055797577 17594
 sys/src/cmd/auth/lib - 20000000775 sys sys 1015008430 0
 sys/src/cmd/auth/lib/error.c - 664 sys sys 1015008430 301
 sys/src/cmd/auth/lib/fs.c - 664 sys sys 1015008430 228
@@ -10807,7 +10807,6 @@ sys/src/fs/sony/fns.h - 664 sys sys 1037805175 1968
 sys/src/fs/sony/io.h - 664 sys sys 1037805175 6576
 sys/src/fs/sony/mem.h - 664 sys sys 1015110103 2865
 sys/src/fs/sony/mkfile - 664 sys sys 1037805175 1583
-sys/src/fs/words - 664 sys sys 1015110099 661
 sys/src/fs/worms - 664 sys sys 1015110031 2806
 sys/src/lib9p - 20000000775 sys sys 1015023311 0
 sys/src/lib9p/_post.c - 664 sys sys 1044836326 1641

+ 5 - 0
dist/replica/plan9.log

@@ -12310,3 +12310,8 @@
 1055709063 3 c sys/src/cmd/venti/syncarena.c - 664 sys sys 1055707444 4116
 1055709063 4 c sys/src/cmd/venti/utils.c - 664 sys sys 1055707445 4602
 1055719875 0 c sys/src/libauthsrv/readnvram.c - 664 sys sys 1055718668 8534
+1055736087 0 c sys/man/2/authsrv - 664 sys sys 1055734550 4145
+1055797304 0 d sys/src/fs/words - 664 sys sys 1015110099 0
+1055799107 0 c 386/bin/auth/keyfs - 775 sys sys 1055797591 116737
+1055799107 1 c sys/src/cmd/auth/keyfs.c - 664 sys sys 1055797577 17594
+1055818924 0 c sys/games/lib/fortunes - 664 sys sys 1055817277 243905

+ 2 - 0
sys/games/lib/fortunes

@@ -3967,3 +3967,5 @@ Homeland security begins at home.  - Seattle mayor Greg Nickels
 Has Your Life Been Ruined by Evil?
 smtpdaemon is needed by diskcheck-1.4.2 	- Red Hat Linux
 You want to make your way in the CS field? Simple. Calculate rough time of amnesia (hell, 10 years is plenty, probably 10 months is plenty), go to the dusty archives, dig out something fun, and go for it.   It's worked for many people, and it can work for you.  - Ron Minnich
+Recent studies have proven what most people already know: That most Penis Enlargement Pills are completely useless. We set out to design a program that really works.
+From a Walgreen's receipt: I'm JESUS.  I'm here to serve you with our "7 Service Basics"

+ 12 - 3
sys/src/cmd/auth/keyfs.c

@@ -24,14 +24,17 @@ enum{
 	Qmax,
 
 	Nuser	= 512,
-	MAXBAD	= 50,			/* max number of bad attempts before disabling the account */
+	MAXBAD	= 10,			/* max number of bad attempts before disabling the account */
 	Namelen	= ANAMELEN,		/* file must be randomly addressible, so names have fixed length */
 };
 
 enum{
 	Sok,
 	Sdisabled,
+	Stempdisabled,
 	Smax,
+
+	PurgatorySecs=	MAXBAD,		/* averages out to 1 attempt a second */
 };
 
 struct Fid{
@@ -52,6 +55,7 @@ struct User{
 	int	ref;
 	char	removed;
 	uchar	warnings;
+	long	purgatory;		/* time purgatory ends */
 	ulong	uniq;
 	User	*link;
 };
@@ -395,6 +399,8 @@ Read(Fid *f)
 	case Qkey:
 		if(f->user->status != Sok)
 			return "user disabled";
+		if(f->user->purgatory > time(0))
+			return "user in purgatory";
 		if(f->user->expire != 0 && f->user->expire < time(0))
 			return "user expired";
 		if(off != 0)
@@ -407,6 +413,8 @@ Read(Fid *f)
 	case Qsecret:
 		if(f->user->status != Sok)
 			return "user disabled";
+		if(f->user->purgatory > time(0))
+			return "user in purgatory";
 		if(f->user->expire != 0 && f->user->expire < time(0))
 			return "user expired";
 		if(off != 0)
@@ -528,8 +536,8 @@ Write(Fid *f)
 		else
 			f->user->bad++;
 		if(f->user->bad >= MAXBAD){
-			f->user->status = Sdisabled;
-			break;
+			f->user->purgatory = time(0) + PurgatorySecs;
+			f->user->bad = 0;
 		}
 		return 0;
 	case Qwarnings:
@@ -836,6 +844,7 @@ installuser(char *name)
 		error("malloc failed: %r");
 	u->removed = 0;
 	u->ref = 0;
+	u->purgatory = 0;
 	u->expire = 0;
 	u->status = Sok;
 	u->bad = 0;

+ 0 - 18
sys/src/fs/words

@@ -1,18 +0,0 @@
-This is an intermediate version of the fileserver kernel.
-
-'emelie' is for any PC with supported hardware excluding the SONY jukebox,
-and will make an object '9pcfs'.
-'sony' is the same but has the SONY jukebox code instead of the HP code,
-and will make an object '9sonyfs'.
-Both use a 16KB block size.
-
-To spin-off a new version to play with, say 'test':
-	cd /sys/src/fs
-	mkdir test
-	cp emelie/9pcfs.c test/9testfs.c
-	cp emelie/dat.h emelie/fns.h emelie/io.h emelie/mem.h test
-	sed '1s/pc/test/' <emelie/mkfile >test/mkfile
-and hack as appropriate.
-
-The mkfiles aren't quite right yet to make this as automatic as it
-should be. There are a lot of rough edges.