Browse Source

Plan 9 from Bell Labs 2003-06-21

David du Colombier 16 years ago
parent
commit
5f2831708a

+ 5 - 5
dist/replica/plan9.db

@@ -2735,7 +2735,7 @@ mail/lib/lazyqmail - 775 upas upas 999900927 116
 mail/lib/namefiles - 664 upas upas 960222586 63
 mail/lib/names.local - 664 upas upas 960222620 92
 mail/lib/patterns - 664 upas upas 957549063 602
-mail/lib/pipeto.lib - 664 upas upas 1053275597 2715
+mail/lib/pipeto.lib - 664 upas upas 1056143135 2024
 mail/lib/qmail - 775 upas upas 954266750 180
 mail/lib/remotemail - 775 upas upas 959722371 180
 mail/lib/rewrite - 664 upas upas 964036209 295
@@ -6173,7 +6173,7 @@ sys/src/boot/pc/kfs.h - 664 sys sys 1032215924 861
 sys/src/boot/pc/kfsboot.c - 664 sys sys 1032215914 4788
 sys/src/boot/pc/l.s - 664 sys sys 1056073258 12963
 sys/src/boot/pc/lib.h - 664 sys sys 1015007952 3485
-sys/src/boot/pc/load.c - 664 sys sys 1056073257 7908
+sys/src/boot/pc/load.c - 664 sys sys 1056087197 7987
 sys/src/boot/pc/mbr.s - 664 sys sys 1015007953 6234
 sys/src/boot/pc/mem.h - 664 sys sys 1015007953 3407
 sys/src/boot/pc/memory.c - 664 sys sys 1019533021 10272
@@ -10339,7 +10339,7 @@ sys/src/cmd/unix/u9fs/safecpy.c - 664 sys sys 1043768486 212
 sys/src/cmd/unix/u9fs/strecpy.c - 664 sys sys 1015092353 193
 sys/src/cmd/unix/u9fs/sun-inttypes.h - 664 sys sys 1039110816 441
 sys/src/cmd/unix/u9fs/tokenize.c - 664 sys sys 1015092353 602
-sys/src/cmd/unix/u9fs/u9fs.c - 664 sys sys 1055699455 30811
+sys/src/cmd/unix/u9fs/u9fs.c - 664 sys sys 1056163716 30830
 sys/src/cmd/unix/u9fs/u9fs.h - 664 sys sys 1043768488 649
 sys/src/cmd/unix/u9fs/u9fsauth.h - 664 sys sys 1015092354 126
 sys/src/cmd/unix/u9fs/utfrune.c - 664 sys sys 1015092354 387
@@ -10376,11 +10376,11 @@ sys/src/cmd/upas/filterkit/token.c - 664 sys sys 1018549521 1312
 sys/src/cmd/upas/fs - 20000000775 sys sys 988250018 0
 sys/src/cmd/upas/fs/dat.h - 664 sys sys 1047490337 4267
 sys/src/cmd/upas/fs/fs.c - 664 sys sys 1045505917 27332
-sys/src/cmd/upas/fs/imap4.c - 664 sys sys 1047490338 16071
+sys/src/cmd/upas/fs/imap4.c - 664 sys sys 1056155537 16374
 sys/src/cmd/upas/fs/mbox.c - 664 sys sys 1047490342 28282
 sys/src/cmd/upas/fs/mkfile - 664 sys sys 1047490336 321
 sys/src/cmd/upas/fs/plan9.c - 664 sys sys 1047490343 7464
-sys/src/cmd/upas/fs/pop3.c - 664 sys sys 1055699607 11699
+sys/src/cmd/upas/fs/pop3.c - 664 sys sys 1056155538 11716
 sys/src/cmd/upas/fs/readdir.c - 664 sys sys 944961331 203
 sys/src/cmd/upas/fs/strtotm.c - 664 sys sys 1041137528 1904
 sys/src/cmd/upas/fs/tester.c - 664 sys sys 985037420 1418

+ 5 - 0
dist/replica/plan9.log

@@ -12335,3 +12335,8 @@
 1056074484 5 c sys/src/boot/pc/l.s - 664 sys sys 1056073258 12963
 1056074484 6 c sys/src/boot/pc/load.c - 664 sys sys 1056073257 7908
 1056074484 7 c sys/src/boot/pc/mkfile - 664 sys sys 1056073256 2926
+1056088900 0 c sys/src/boot/pc/load.c - 664 sys sys 1056087197 7987
+1056143143 0 c mail/lib/pipeto.lib - 664 upas upas 1056143135 2024
+1056155485 0 c sys/src/cmd/upas/fs/imap4.c - 664 sys sys 1056155537 16374
+1056155485 1 c sys/src/cmd/upas/fs/pop3.c - 664 sys sys 1056155538 11716
+1056164491 0 c sys/src/cmd/unix/u9fs/u9fs.c - 664 sys sys 1056163716 30830

+ 1 - 24
mail/lib/pipeto.lib

@@ -5,7 +5,7 @@ bind -c /mail/tmp /tmp
 # caller should set KEY and USER
 
 if(! ~ $#USER 1)
-	exit 'bad pipeto: no USER variable'
+	USER=`{echo $1 | sed 's/local!//;s/[+\-].*//'}
 if(! ~ $#KEY 1)
 	KEY=plan9
 
@@ -92,29 +92,6 @@ fn listupdate {
 	$BIN/list add $PF $D/from $D/to $D/cc $D/sender
 }
 
-# alternative to token-based approach
-# bayesian classification.  run /mail/lib/setup.bayes to start.
-fn isspam {
-	for(i in _prof.mbox _prof.spam _bounced){
-		if(! test -f $i){
-			echo 'need '^$i >[1=2]
-			exit 'need '^$i
-		}
-	}
-	upas/msgcat $TMP.msg |upas/msgtok |grep -v '^....................(.*)	' >$TMP.tok
-	x=`{upas/bayes -k _prof.mbox _prof.spam ~ $TMP.tok | sed 's/_prof.//'}
-	where=$x(1)
-	prob=$x(2)
-	prob1000=`{echo $prob '*1000' | hoc | sed 's/\..*//'}
-	echo `{sed 's/^From ([^ ]+) (.*)/\2 from \1/' $D/unixheader} $x >>_bounced
-	if(~ $where spam && test $prob1000 -lt 999)
-		where=mbox
-	upas/addhash -o _prof.$where _prof.$where 1 $TMP.tok 1
-	if(~ $where spam)
-		where=''
-	status=$where
-}
-
 # save and parse the mail file
 sed '/^$/,$ s/^From / From /' >$TMP.msg
 upas/fs -f $TMP.msg || exit $status

+ 12 - 0
sys/src/boot/pc/load.c

@@ -42,6 +42,16 @@ Type types[] = {
 #include "sd.h"
 
 extern SDifc sdataifc;
+
+#ifdef NOSCSI
+
+SDifc* sdifc[] = {
+	&sdataifc,
+	nil,
+};
+
+#else
+
 extern SDifc sdmylexifc;
 extern SDifc sd53c8xxifc;
 SDifc* sdifc[] = {
@@ -51,6 +61,8 @@ SDifc* sdifc[] = {
 	nil,
 };
 
+#endif NOSCSI
+
 typedef struct Mode Mode;
 
 enum {

+ 2 - 1
sys/src/cmd/unix/u9fs/u9fs.c

@@ -406,7 +406,8 @@ rattach(Fcall *rx, Fcall *tx)
 	if(defaultuser)
 		rx->uname = defaultuser;
 
-	if((u = uname2user(rx->uname)) == nil || u->id == 0){
+	if((u = uname2user(rx->uname)) == nil
+	|| (!defaultuser && u->id == 0)){
 		/* we don't know anyone named root... */
 		seterror(tx, Eunknownuser);
 		freefid(fid);

+ 16 - 8
sys/src/cmd/upas/fs/imap4.c

@@ -138,7 +138,8 @@ static char*
 imap4resp(Imap *imap)
 {
 	char *line, *p, *ep, *op, *q, *r, *en, *verb;
-	int n;
+	int i, n;
+	static char error[256];
 
 	while(p = Brdline(&imap->bin, '\n')){
 		ep = p+Blinelen(&imap->bin);
@@ -214,10 +215,17 @@ imap4resp(Imap *imap)
 							imap->data = imap->base;
 							imap->size = n+1;
 						}
-						if(n >= imap->size)
-							return Eio;
-						if(Bread(&imap->bin, imap->data, n) != n)
-							return Eio;
+						if(n >= imap->size){
+							// friggin microsoft - reallocate
+							i = imap->data - imap->base;
+							imap->base = erealloc(imap->base, i+n+1);
+							imap->data = imap->base + i;
+							imap->size = n+1;
+						}
+						if((i = Bread(&imap->bin, imap->data, n)) != n){
+							snprint(error, sizeof error, "short read from server %d != %d\n", i, n);
+							return error;
+						}
 						imap->data[n] = '\0';
 						imap->data += n;
 						imap->size -= n;
@@ -493,7 +501,7 @@ imap4fetch(Mailbox *mb, Message *m)
 	if(imap->size == 0)
 		return "didn't get size from size command";
 
-	sz = imap->size+200;	/* 200: slop */
+	sz = imap->size;
 	p = emalloc(sz+1);
 	free(imap->base);
 	imap->base = p;
@@ -638,7 +646,7 @@ imap4read(Imap *imap, Mailbox *mb, int doplumb)
 	}
 	waitpid();
 
-	if(nnew){
+	if(nnew || mb->vers == 0){
 		mb->vers++;
 		henter(PATH(0, Qtop), mb->name,
 			(Qid){PATH(mb->id, Qmbox), mb->vers, QTDIR}, nil, mb);
@@ -791,7 +799,7 @@ imap4mbox(Mailbox *mb, char *path)
 
 	imap = emalloc(sizeof(*imap));
 	imap->fd = -1;
-	imap->debug = 0;
+	imap->debug = debug;
 	imap->freep = path;
 	imap->mustssl = mustssl;
 	imap->host = f[2];

+ 1 - 1
sys/src/cmd/upas/fs/pop3.c

@@ -469,7 +469,7 @@ pop3read(Pop *pop, Mailbox *mb, int doplumb)
 	if(pop->pipeline)
 		waitpid();
 
-	if(nnew) {
+	if(nnew || mb->vers == 0) {
 		mb->vers++;
 		henter(PATH(0, Qtop), mb->name,
 			(Qid){PATH(mb->id, Qmbox), mb->vers, QTDIR}, nil, mb);