Browse Source

Plan 9 from Bell Labs 2007-10-19

David du Colombier 16 years ago
parent
commit
3e71fe5d53

+ 12 - 10
dist/replica/_plan9.db

@@ -49,10 +49,10 @@
 386/bin/auth/convkeys - 775 sys sys 1188446822 87298
 386/bin/auth/convkeys2 - 775 sys sys 1188446825 87357
 386/bin/auth/cron - 775 sys sys 1188446828 140446
-386/bin/auth/debug - 775 sys sys 1168402268 101566
+386/bin/auth/debug - 775 sys sys 1192762780 102504
 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 1188446836 321587
+386/bin/auth/factotum - 775 sys sys 1192762786 321861
 386/bin/auth/fgui - 775 sys sys 1184731229 219079
 386/bin/auth/guard.srv - 775 sys sys 1188446841 144638
 386/bin/auth/keyfs - 775 sys sys 1191035876 116576
@@ -361,7 +361,7 @@
 386/bin/p - 775 sys sys 1168402343 65220
 386/bin/page - 775 sys sys 1191208765 236255
 386/bin/paqfs - 775 sys sys 1188447270 109707
-386/bin/passwd - 775 sys sys 1168402344 84333
+386/bin/passwd - 775 sys sys 1192762788 85264
 386/bin/pbd - 775 sys sys 1085077087 4661
 386/bin/pcc - 775 sys sys 1168402344 68241
 386/bin/pic - 775 sys sys 1184529905 308725
@@ -553,7 +553,7 @@
 386/lib/lib9p.a - 664 sys sys 1184529909 91012
 386/lib/libString.a - 664 sys sys 1168402362 22126
 386/lib/libauth.a - 664 sys sys 1179372118 58864
-386/lib/libauthsrv.a - 664 sys sys 1188447437 36076
+386/lib/libauthsrv.a - 664 sys sys 1192762788 36198
 386/lib/libbin.a - 664 sys sys 1168402363 2534
 386/lib/libbio.a - 664 sys sys 1168402363 25980
 386/lib/libc.a - 664 sys sys 1188447448 502352
@@ -5473,6 +5473,7 @@ rc/bin/B - 775 sys sys 945617206 645
 rc/bin/C - 775 sys sys 1169492077 980
 rc/bin/Kill - 775 sys sys 1018637942 115
 rc/bin/a: - 775 sys sys 1063856406 255
+rc/bin/addpsfonts - 775 sys sys 1192741348 293
 rc/bin/ap - 775 sys sys 1175869448 645
 rc/bin/ape - 20000000775 sys sys 1155362042 0
 rc/bin/ape/ar89 - 775 sys sys 1139744263 240
@@ -5507,10 +5508,11 @@ rc/bin/doc2ps - 775 sys sys 1069793831 244
 rc/bin/doc2txt - 775 sys sys 1025197880 563
 rc/bin/doctype - 775 sys sys 1162921755 1727
 rc/bin/dosmnt - 775 sys sys 1109288224 303
+rc/bin/dpost - 755 sys sys 1192741346 220
 rc/bin/eject - 775 sys sys 945617207 123
 rc/bin/fax - 775 sys sys 1127394677 2385
 rc/bin/fedex - 775 sys sys 1060187356 1244
-rc/bin/fshalt - 775 sys sys 1180592582 1669
+rc/bin/fshalt - 775 sys sys 1192741344 1862
 rc/bin/homespool - 775 sys sys 945617207 339
 rc/bin/ipconf - 20000000775 sys sys 1058791152 0
 rc/bin/ipconf/inside - 775 sys sys 1058790955 427
@@ -7479,7 +7481,7 @@ sys/man/1/time - 664 sys sys 944959673 380
 sys/man/1/touch - 664 sys sys 1018369246 461
 sys/man/1/tr - 664 sys sys 944959675 1730
 sys/man/1/trace - 664 sys sys 1159419931 1499
-sys/man/1/troff - 664 sys sys 944959675 3102
+sys/man/1/troff - 664 sys sys 1192741763 3659
 sys/man/1/troff2html - 664 sys sys 1113743328 1924
 sys/man/1/tweak - 664 sys sys 957920008 4762
 sys/man/1/uniq - 664 sys sys 944959674 995
@@ -7515,10 +7517,10 @@ sys/man/2/arith3 - 664 sys sys 1162102967 4393
 sys/man/2/assert - 664 sys sys 1102868467 377
 sys/man/2/atof - 664 sys sys 1171668702 2778
 sys/man/2/auth - 664 sys sys 1190243345 7537
-sys/man/2/authsrv - 664 sys sys 1171690308 4505
+sys/man/2/authsrv - 664 sys sys 1192737581 4583
 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 1151854125 6546
+sys/man/2/bio - 664 sys sys 1192742374 6648
 sys/man/2/blowfish - 664 sys sys 1032058672 1280
 sys/man/2/brk - 664 sys sys 944959694 1179
 sys/man/2/cachechars - 664 sys sys 1082222350 7061
@@ -14134,7 +14136,7 @@ sys/src/cmd/upas/common/process.c - 664 sys sys 1098803900 3012
 sys/src/cmd/upas/common/sys.h - 664 sys sys 1055699577 2223
 sys/src/cmd/upas/filterkit - 20000000775 sys sys 1063854806 0
 sys/src/cmd/upas/filterkit/dat.h - 664 sys sys 1018549520 107
-sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1135083942 1070
+sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1192743256 1153
 sys/src/cmd/upas/filterkit/list.c - 664 sys sys 1174155504 4945
 sys/src/cmd/upas/filterkit/mkfile - 664 sys sys 1048645255 264
 sys/src/cmd/upas/filterkit/pipefrom.sample - 775 sys sys 1041184939 380
@@ -14642,7 +14644,7 @@ sys/src/libauth/noworld.c - 664 sys sys 1014929318 779
 sys/src/libauthsrv - 20000000775 sys sys 1055718668 0
 sys/src/libauthsrv/_asgetticket.c - 664 sys sys 1015091652 280
 sys/src/libauthsrv/_asrdresp.c - 664 sys sys 1015091652 874
-sys/src/libauthsrv/authdial.c - 664 sys sys 1078840018 687
+sys/src/libauthsrv/authdial.c - 664 sys sys 1192737014 850
 sys/src/libauthsrv/convA2M.c - 664 sys sys 1015091652 501
 sys/src/libauthsrv/convM2A.c - 664 sys sys 1015091652 470
 sys/src/libauthsrv/convM2PR.c - 664 sys sys 1015091653 610

+ 12 - 10
dist/replica/plan9.db

@@ -49,10 +49,10 @@
 386/bin/auth/convkeys - 775 sys sys 1188446822 87298
 386/bin/auth/convkeys2 - 775 sys sys 1188446825 87357
 386/bin/auth/cron - 775 sys sys 1188446828 140446
-386/bin/auth/debug - 775 sys sys 1168402268 101566
+386/bin/auth/debug - 775 sys sys 1192762780 102504
 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 1188446836 321587
+386/bin/auth/factotum - 775 sys sys 1192762786 321861
 386/bin/auth/fgui - 775 sys sys 1184731229 219079
 386/bin/auth/guard.srv - 775 sys sys 1188446841 144638
 386/bin/auth/keyfs - 775 sys sys 1191035876 116576
@@ -361,7 +361,7 @@
 386/bin/p - 775 sys sys 1168402343 65220
 386/bin/page - 775 sys sys 1191208765 236255
 386/bin/paqfs - 775 sys sys 1188447270 109707
-386/bin/passwd - 775 sys sys 1168402344 84333
+386/bin/passwd - 775 sys sys 1192762788 85264
 386/bin/pbd - 775 sys sys 1085077087 4661
 386/bin/pcc - 775 sys sys 1168402344 68241
 386/bin/pic - 775 sys sys 1184529905 308725
@@ -553,7 +553,7 @@
 386/lib/lib9p.a - 664 sys sys 1184529909 91012
 386/lib/libString.a - 664 sys sys 1168402362 22126
 386/lib/libauth.a - 664 sys sys 1179372118 58864
-386/lib/libauthsrv.a - 664 sys sys 1188447437 36076
+386/lib/libauthsrv.a - 664 sys sys 1192762788 36198
 386/lib/libbin.a - 664 sys sys 1168402363 2534
 386/lib/libbio.a - 664 sys sys 1168402363 25980
 386/lib/libc.a - 664 sys sys 1188447448 502352
@@ -5473,6 +5473,7 @@ rc/bin/B - 775 sys sys 945617206 645
 rc/bin/C - 775 sys sys 1169492077 980
 rc/bin/Kill - 775 sys sys 1018637942 115
 rc/bin/a: - 775 sys sys 1063856406 255
+rc/bin/addpsfonts - 775 sys sys 1192741348 293
 rc/bin/ap - 775 sys sys 1175869448 645
 rc/bin/ape - 20000000775 sys sys 1155362042 0
 rc/bin/ape/ar89 - 775 sys sys 1139744263 240
@@ -5507,10 +5508,11 @@ rc/bin/doc2ps - 775 sys sys 1069793831 244
 rc/bin/doc2txt - 775 sys sys 1025197880 563
 rc/bin/doctype - 775 sys sys 1162921755 1727
 rc/bin/dosmnt - 775 sys sys 1109288224 303
+rc/bin/dpost - 755 sys sys 1192741346 220
 rc/bin/eject - 775 sys sys 945617207 123
 rc/bin/fax - 775 sys sys 1127394677 2385
 rc/bin/fedex - 775 sys sys 1060187356 1244
-rc/bin/fshalt - 775 sys sys 1180592582 1669
+rc/bin/fshalt - 775 sys sys 1192741344 1862
 rc/bin/homespool - 775 sys sys 945617207 339
 rc/bin/ipconf - 20000000775 sys sys 1058791152 0
 rc/bin/ipconf/inside - 775 sys sys 1058790955 427
@@ -7479,7 +7481,7 @@ sys/man/1/time - 664 sys sys 944959673 380
 sys/man/1/touch - 664 sys sys 1018369246 461
 sys/man/1/tr - 664 sys sys 944959675 1730
 sys/man/1/trace - 664 sys sys 1159419931 1499
-sys/man/1/troff - 664 sys sys 944959675 3102
+sys/man/1/troff - 664 sys sys 1192741763 3659
 sys/man/1/troff2html - 664 sys sys 1113743328 1924
 sys/man/1/tweak - 664 sys sys 957920008 4762
 sys/man/1/uniq - 664 sys sys 944959674 995
@@ -7515,10 +7517,10 @@ sys/man/2/arith3 - 664 sys sys 1162102967 4393
 sys/man/2/assert - 664 sys sys 1102868467 377
 sys/man/2/atof - 664 sys sys 1171668702 2778
 sys/man/2/auth - 664 sys sys 1190243345 7537
-sys/man/2/authsrv - 664 sys sys 1171690308 4505
+sys/man/2/authsrv - 664 sys sys 1192737581 4583
 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 1151854125 6546
+sys/man/2/bio - 664 sys sys 1192742374 6648
 sys/man/2/blowfish - 664 sys sys 1032058672 1280
 sys/man/2/brk - 664 sys sys 944959694 1179
 sys/man/2/cachechars - 664 sys sys 1082222350 7061
@@ -14134,7 +14136,7 @@ sys/src/cmd/upas/common/process.c - 664 sys sys 1098803900 3012
 sys/src/cmd/upas/common/sys.h - 664 sys sys 1055699577 2223
 sys/src/cmd/upas/filterkit - 20000000775 sys sys 1063854806 0
 sys/src/cmd/upas/filterkit/dat.h - 664 sys sys 1018549520 107
-sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1135083942 1070
+sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1192743256 1153
 sys/src/cmd/upas/filterkit/list.c - 664 sys sys 1174155504 4945
 sys/src/cmd/upas/filterkit/mkfile - 664 sys sys 1048645255 264
 sys/src/cmd/upas/filterkit/pipefrom.sample - 775 sys sys 1041184939 380
@@ -14642,7 +14644,7 @@ sys/src/libauth/noworld.c - 664 sys sys 1014929318 779
 sys/src/libauthsrv - 20000000775 sys sys 1055718668 0
 sys/src/libauthsrv/_asgetticket.c - 664 sys sys 1015091652 280
 sys/src/libauthsrv/_asrdresp.c - 664 sys sys 1015091652 874
-sys/src/libauthsrv/authdial.c - 664 sys sys 1078840018 687
+sys/src/libauthsrv/authdial.c - 664 sys sys 1192737014 850
 sys/src/libauthsrv/convA2M.c - 664 sys sys 1015091652 501
 sys/src/libauthsrv/convM2A.c - 664 sys sys 1015091652 470
 sys/src/libauthsrv/convM2PR.c - 664 sys sys 1015091653 610

+ 13 - 0
dist/replica/plan9.log

@@ -53076,3 +53076,16 @@
 1192305605 1 c sys/games/lib/fortunes - 664 sys sys 1192305216 267301
 1192564804 0 c sys/src/9/port/devmouse.c - 664 sys sys 1192564555 13904
 1192579205 0 c sys/man/1/spell - 664 sys sys 1192579418 1898
+1192737604 0 c sys/man/2/authsrv - 664 sys sys 1192737581 4583
+1192737604 1 c sys/src/libauthsrv/authdial.c - 664 sys sys 1192737014 850
+1192741205 0 c sys/man/1/troff - 664 sys sys 1192741278 3713
+1192743004 0 c rc/bin/fshalt - 775 sys sys 1192741344 1862
+1192743004 1 a rc/bin/addpsfonts - 775 sys sys 1192741348 293
+1192743004 2 a rc/bin/dpost - 755 sys sys 1192741346 220
+1192743004 3 c sys/man/1/troff - 664 sys sys 1192741763 3659
+1192743004 4 c sys/man/2/bio - 664 sys sys 1192742374 6648
+1192743004 5 c sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1192743256 1153
+1192762803 0 c 386/bin/passwd - 775 sys sys 1192762788 85264
+1192762803 1 c 386/bin/auth/debug - 775 sys sys 1192762780 102504
+1192762803 2 c 386/bin/auth/factotum - 775 sys sys 1192762786 321861
+1192762803 3 c 386/lib/libauthsrv.a - 664 sys sys 1192762788 36198

+ 7 - 0
rc/bin/addpsfonts

@@ -0,0 +1,7 @@
+#!/bin/rc
+# addpsfonts [file]... - add postscript fonts named in %%DocumentFonts comments
+#	of postscript input
+echo %!PS-Adobe-2.0
+# rsc recommends adding -r/sys/lib/postscript/font/lw+,
+# but i haven't seen the benefit yet.
+exec aux/download -f -H/sys/lib/postscript/font -mfontmap -plw+ $*

+ 10 - 0
rc/bin/dpost

@@ -0,0 +1,10 @@
+#!/bin/rc
+# dpost [-f] [file...] - convert troff output to postscript,
+#	optionally include font def'ns
+# exec lp -dstdout $*
+if (! ~ $#* 0 && ~ $1 -f) {
+	shift
+	aux/tr2post $* | addpsfonts
+}
+if not
+	exec aux/tr2post $*

+ 9 - 2
rc/bin/fshalt

@@ -15,6 +15,10 @@ case *
 path=(/bin)
 builtin cd /
 
+# start venti flushing
+venti/sync -h localhost >[2]/dev/null &
+venti/sync  >[2]/dev/null &
+
 unmount /mnt/consoles >[2]/dev/null
 kill consolefs | rc			# don't compete with /mnt/consoles
 sleep 1
@@ -27,15 +31,18 @@ for(i in $f) @ {
 	echo -n $i...
 	{
 		echo
-		dial/drain
+		dial/drain &
+		sleep 2
 		echo fsys all sync
 		if(! dial/expect -t 120 ': ')
 			echo -n 'not synced...' > /dev/cons
 	} < $i >> $i
 }
 
+# flush the last bit of possible fossil traffic
 echo -n venti...
-venti/sync >[2]/dev/null &
+venti/sync -h localhost >[2]/dev/null &
+venti/sync  >[2]/dev/null &
 sleep 30
 
 for (i in $k){

+ 50 - 11
sys/man/1/troff

@@ -1,6 +1,6 @@
 .TH TROFF 1
 .SH NAME
-troff, nroff \- text formatting and typesetting
+troff, nroff, dpost \- text formatting and typesetting
 .SH SYNOPSIS
 .B troff
 [
@@ -10,6 +10,13 @@ troff, nroff \- text formatting and typesetting
 .I file ...
 ]
 .PP
+.B dpost
+[
+.B -f
+] [
+.I file ...
+]
+.PP
 .B nroff
 [
 .I option ...
@@ -22,10 +29,32 @@ troff, nroff \- text formatting and typesetting
 formats text in the named
 .I files
 for
-printing on a typesetter.
+printing on a typesetter,
+emitting a textual intermediate format called
+`typesetter-independent
+.I troff
+output',
+understood by programs such as
+.IR proof (1)
+and
+.IR lp (1),
+but also by a
+.I troff
+post-processor named
+.IR dpost ,
+which emits corresponding Postscript.
+Under
+.BR -f ,
+.I dpost
+also emits Postscript font definitions as needed.
 .I Nroff
-does the same, but produces output suitable
-for typewriter-like devices.
+does the same as
+.IR troff ,
+but produces output suitable
+for typewriter-like devices,
+usually without further post-processing,
+but see
+.IR col (1).
 .PP
 If no
 .I file
@@ -43,7 +72,7 @@ Print pages in the comma-separated
 of numbers and ranges.
 A range
 .IB N - M
-means 
+means
 .I N
 through
 .IR M ;
@@ -110,7 +139,7 @@ Regular PostScript printers
 .PD0
 .TP
 .B -T202
-Mergenthaler Linotron 202 
+Mergenthaler Linotron 202
 .RE
 .PD
 .TP "\w'\fL-m\f2name 'u"
@@ -175,23 +204,33 @@ font width tables for
 .I troff
 .SH SOURCE
 .B /sys/src/cmd/troff
+.br
+.B /rc/bin/dpost
+.br
+.ne 3
 .SH "SEE ALSO"
 .IR lp (1),
 .IR proof (1),
-.IR eqn (1), 
-.IR tbl (1), 
-.IR pic (1), 
+.IR page (1),
+.IR eqn (1),
+.IR tbl (1),
+.IR pic (1),
 .IR grap (1),
-.IR doctype (1), 
+.IR doctype (1),
 .IR ms (6),
 .IR image (6),
 .IR tex (1),
-.IR deroff (1)
+.IR deroff (1),
+.IR col (1)
 .br
 J. F. Ossanna and B. W. Kernighan,
 ``Troff User's Manual''
 .br
 B. W. Kernighan,
+``A Typesetter-Independent TROFF'',
+CSTR #97
+.br
+B. W. Kernighan,
 ``A TROFF Tutorial'',
 .I
 Unix Research System Programmer's Manual,

+ 3 - 1
sys/man/2/authsrv

@@ -53,7 +53,6 @@ int	_asgetticket(int fd, char *trbuf, char *tbuf);
 .B
 int	_asrdresp(int fd, char *buf, int len);
 .SH DESCRIPTION
-.PP
 .I Authdial
 dials an authentication server over the
 network rooted at
@@ -78,6 +77,9 @@ the former having precedence,
 and which also contains an
 .B auth
 attribute.
+If it finds neither, it tries
+.BI p9auth. ad
+in DNS as the authentication server.
 The string dialed is then
 .I netroot\fP!\fIserver\fP!ticket
 where

+ 7 - 0
sys/man/2/bio

@@ -343,6 +343,13 @@ At the cost of allocating a buffer,
 .I Brdstr
 sidesteps these issues.
 .PP
+Only the low byte of
+.IR Brdstr 's
+.I delim
+is examined, so
+.I delim
+cannot be an arbitrary rune.
+.PP
 The data returned by
 .I Brdline
 may be overwritten by calls to any other

+ 5 - 3
sys/src/cmd/upas/filterkit/deliver.c

@@ -1,3 +1,6 @@
+/*
+ * deliver recipient fromfile mbox - append stdin to mbox with locking & logging
+ */
 #include "dat.h"
 #include "common.h"
 
@@ -11,12 +14,11 @@ usage(void)
 void
 main(int argc, char **argv)
 {
-	int fd;
+	int bytes, fd;
 	char now[30];
-	Addr *a;
 	char *deliveredto;
+	Addr *a;
 	Mlock *l;
-	int bytes;
 
 	ARGBEGIN{
 	}ARGEND;

+ 20 - 15
sys/src/libauthsrv/authdial.c

@@ -9,23 +9,28 @@ authdial(char *netroot, char *dom)
 {
 	char *p;
 	int rv;
-	
-	if(dom != nil){
-		/* look up an auth server in an authentication domain */
-		p = csgetvalue(netroot, "authdom", dom, "auth", nil);
 
-		/* if that didn't work, just try the IP domain */
-		if(p == nil)
-			p = csgetvalue(netroot, "dom", dom, "auth", nil);
-		if(p == nil){
-			werrstr("no auth server found for %s", dom);
-			return -1;
-		}
-		rv = dial(netmkaddr(p, netroot, "ticket"), 0, 0, 0);
-		free(p);
-		return rv;
-	} else {
+	if(dom == nil)
 		/* look for one relative to my machine */
 		return dial(netmkaddr("$auth", netroot, "ticket"), 0, 0, 0);
+
+	/* look up an auth server in an authentication domain */
+	p = csgetvalue(netroot, "authdom", dom, "auth", nil);
+
+	/* if that didn't work, just try the IP domain */
+	if(p == nil)
+		p = csgetvalue(netroot, "dom", dom, "auth", nil);
+	/*
+	 * if that didn't work, try p9auth.$dom.  this is very helpful if
+	 * you can't edit /lib/ndb.
+	 */
+	if(p == nil)
+		p = smprint("p9auth.%s", dom);
+	if(p == nil){			/* should no longer ever happen */
+		werrstr("no auth server found for %s", dom);
+		return -1;
 	}
+	rv = dial(netmkaddr(p, netroot, "ticket"), 0, 0, 0);
+	free(p);
+	return rv;
 }