DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T s

⟦01c6c6bc1⟧ TextFile

    Length: 98032 (0x17ef0)
    Types: TextFile
    Names: »sessext.ps«

Derivation

└─⟦4f9d7c866⟧ Bits:30007245 EUUGD6: Sikkerheds distributionen
    └─⟦this⟧ »./papers/sessext.ps« 

TextFile

%!PS
%%Version: 3.1
%%DocumentFonts: (atend)
%%Pages: (atend)
%%EndComments
%
% Version 3.1 prologue for troff files.
%

/#copies 1 store
/aspectratio 1 def
/formsperpage 1 def
/landscape false def
/linewidth .3 def
/magnification 1 def
/margin 0 def
/orientation 0 def
/resolution 720 def
/xoffset 0 def
/yoffset 0 def

/roundpage true def
/useclippath true def
/pagebbox [0 0 612 792] def

/R  /Times-Roman def
/I  /Times-Italic def
/B  /Times-Bold def
/BI /Times-BoldItalic def
/H  /Helvetica def
/HI /Helvetica-Oblique def
/HB /Helvetica-Bold def
/HX /Helvetica-BoldOblique def
/CW /Courier def
/CO /Courier def
/CI /Courier-Oblique def
/CB /Courier-Bold def
/CX /Courier-BoldOblique def
/PA /Palatino-Roman def
/PI /Palatino-Italic def
/PB /Palatino-Bold def
/PX /Palatino-BoldItalic def
/Hr /Helvetica-Narrow def
/Hi /Helvetica-Narrow-Oblique def
/Hb /Helvetica-Narrow-Bold def
/Hx /Helvetica-Narrow-BoldOblique def
/KR /Bookman-Light def
/KI /Bookman-LightItalic def
/KB /Bookman-Demi def
/KX /Bookman-DemiItalic def
/AR /AvantGarde-Book def
/AI /AvantGarde-BookOblique def
/AB /AvantGarde-Demi def
/AX /AvantGarde-DemiOblique def
/NR /NewCenturySchlbk-Roman def
/NI /NewCenturySchlbk-Italic def
/NB /NewCenturySchlbk-Bold def
/NX /NewCenturySchlbk-BoldItalic def
/ZD /ZapfDingbats def
/ZI /ZapfChancery-MediumItalic def
/VR /Varitimes#Roman def
/VI /Varitimes#Italic def
/VB /Varitimes#Bold def
/VX /Varitimes#BoldItalic def
/S  /S def
/S1 /S1 def
/GR /Symbol def

/inch {72 mul} bind def
/min {2 copy gt {exch} if pop} bind def

/setup {
	counttomark 2 idiv {def} repeat pop

	landscape {/orientation 90 orientation add def} if
	/scaling 72 resolution div def
	linewidth setlinewidth
	1 setlinecap

	pagedimensions
	xcenter ycenter translate
	orientation neg rotate
	width 2 div neg height 2 div translate
	xoffset inch yoffset inch neg translate
	margin 2 div dup neg translate
	magnification dup aspectratio mul scale
	scaling scaling scale

	/Symbol /S Sdefs cf
	/Times-Roman /S1 S1defs cf
	0 0 moveto
} def

/pagedimensions {
	useclippath userdict /gotpagebbox known not and {
		/pagebbox [clippath pathbbox newpath] def
		roundpage currentdict /roundpagebbox known and {roundpagebbox} if
	} if
	pagebbox aload pop
	4 -1 roll exch 4 1 roll 4 copy
	landscape {4 2 roll} if
	sub /width exch def
	sub /height exch def
	add 2 div /xcenter exch def
	add 2 div /ycenter exch def
	userdict /gotpagebbox true put
} def

/pagesetup {
	/page exch def
	currentdict /pagedict known currentdict page known and {
		page load pagedict exch get cvx exec
	} if
} def

/decodingdefs [
	{counttomark 2 idiv {y moveto show} repeat}
	{neg /y exch def counttomark 2 idiv {y moveto show} repeat}
	{neg moveto {2 index stringwidth pop sub exch div 0 32 4 -1 roll widthshow} repeat}
	{neg moveto {spacewidth sub 0.0 32 4 -1 roll widthshow} repeat}
	{counttomark 2 idiv {y moveto show} repeat}
	{neg setfunnytext}
] def

/setdecoding {/t decodingdefs 3 -1 roll get bind def} bind def

/w {neg moveto show} bind def
/m {neg dup /y exch def moveto} bind def
/done {/lastpage where {pop lastpage} if} def

/f {
	dup /font exch def findfont exch
	dup /ptsize exch def scaling div dup /size exch def scalefont setfont
	linewidth ptsize mul scaling 10 mul div setlinewidth
	/spacewidth ( ) stringwidth pop def
} bind def

/sf {f} bind def

/cf {
	dup length 2 idiv
	/entries exch def
	/chtab exch def
	/newfont exch def

	findfont dup length 1 add dict
	/newdict exch def
	{1 index /FID ne {newdict 3 1 roll put} {pop pop} ifelse} forall

	newdict /Metrics entries dict put
	newdict /Metrics get
	begin
		chtab aload pop
		1 1 entries {pop def} for
		newfont newdict definefont pop
	end
} bind def

%
% A few arrays used to adjust reference points and character widths in some
% of the printer resident fonts. If square roots are too high try changing
% the lines describing /radical and /radicalex to,
%
%	/radical	[0 -75 550 0]
%	/radicalex	[-50 -75 500 0]
%

/Sdefs [
	/bracketlefttp		[220 500]
	/bracketleftbt		[220 500]
	/bracketrighttp		[-70 380]
	/bracketrightbt		[-70 380]
	/braceleftbt		[220 490]
	/bracketrightex		[220 -125 500 0]
	/radical		[0 0 550 0]
	/radicalex		[-50 0 500 0]
	/parenleftex		[-20 -170 0 0]
	/integral		[100 -50 500 0]
	/infinity		[10 -75 730 0]
] def

/S1defs [
	/underscore		[0 80 500 0]
	/endash			[7 90 650 0]
] def
%%EndProlog
%%BeginSetup
mark
/resolution 720 def
setup
2 setdecoding
%%EndSetup
%%Page: 1 1
save
mark
1 pagesetup
14 B f
(The ``Session Tty'' Manager)3 1747 1 2006 880 t
12 I f
(S.M. Bellovin)1 661 1 2549 1120 t
(ulysses!smb)2593 1280 w
(AT&T Bell Laboratories)2 1204 1 2278 1520 t
( 07974)1 380(Murray Hill, NJ)2 798 2 2291 1680 t
10 I f
(ABSTRACT)2643 1960 w
10 R f
(In many U)2 473 1 1220 2260 t
8 R f
(NIX)1693 2260 w
10 S f
(\322)1835 2260 w
10 R f
(systems, it is possible for a program to retain access to the)11 2578 1 1962 2260 t
( poses obvious security risks)4 1208( This)1 252( out.)1 194(login terminal after the user has logged)6 1666 4 1220 2380 t
( V)1 105( solve this for System)4 939( We)1 214(and can also confuse the modem control signals.)7 2062 4 1220 2500 t
(by adding a layer of indirection known as the)8 1904 1 1220 2620 t
10 I f
(session tty)1 426 1 3161 2620 t
10 R f
( login time,)2 483(driver. At)1 433 2 3624 2620 t
( programs have access)3 939( User)1 261( device is linked to the physical terminal.)7 1748(a session)1 372 4 1220 2740 t
( logout or)2 411( Upon)1 291( device only, and may not open the physical line.)9 2055(to the session)2 563 4 1220 2860 t
( new session)2 561( login sessions are given)4 1085( New)1 273(carrier drop, the link is severed.)5 1401 4 1220 2980 t
( session)1 354( of)1 149( Use)1 254(devices, and are thus insulated from persistent processes.)7 2563 4 1220 3100 t
(devices is controlled by a new system process known as the)10 2555 1 1220 3220 t
10 I f
(session manager)1 687 1 3817 3220 t
10 R f
(;)4512 3220 w
( facility)1 318(by means of suitable plumbing primitives, a ``reconnect after line drop'')10 3002 2 1220 3340 t
(can easily be implemented.)3 1111 1 1220 3460 t
9 B f
(1. INTRODUCTION)1 848 1 720 3740 t
10 I f
(``Any software problem can be solved)5 1557 1 2101 4040 t
(by adding another layer of indirection.'')5 1661 1 2049 4160 t
10 R f
(When a user logs on to a U)7 1140 1 720 4460 t
8 R f
(NIX)1860 4460 w
10 S f
(\322)2002 4460 w
10 R f
( \256le descriptors 0, 1, and 2 connected to)8 1664(system, a shell is \256red up with)6 1262 2 2114 4460 t
( user are descendants of the shell, and)7 1661( commands executed by that)4 1229( All)1 209(the physical tty device used.)4 1221 4 720 4580 t
( associations \320 so fundamental to the)6 1653( These)1 318( output.)1 328(normally use the same tty device for input and)8 2021 4 720 4700 t
( by)1 140( problems may be solved)4 1063( These)1 312(design of the system \320 cause trouble under certain circumstances.)9 2805 4 720 4820 t
(adding a level of indirection called the ``session manager''.)8 2439 1 720 4940 t
( There)1 302( it claims to cure.)4 739(Before we discuss the solution, it is, of course, helpful to know what problems)13 3279 3 720 5120 t
(are several, mostly having to do with ending conditions:)8 2310 1 720 5240 t
( when carrier has dropped,)4 1124( the physical device receives an external close indication \320 i.e.,)10 2708(1. When)1 413 3 795 5420 t
( is received \320)3 615(the user's terminal has been turned off or disconnected, or a network close request)13 3455 2 970 5540 t
( is not suf\256cient to send)5 1093( It)1 146(this fact must be propagated to all processes using that terminal.)10 2831 3 970 5660 t
10 CW f
(SIGHUP)970 5780 w
10 R f
( processes may have the signal ignored; others may not have the device as their)14 3376(. Some)1 326 2 1338 5780 t
( case, the result is the same:)6 1196( either)1 265( In)1 154(controlling tty, and hence will not receive the signal at all.)10 2455 4 970 5900 t
(the next user of the line can receive some strange and wondrous garbage.)12 3013 1 970 6020 t
( is\) should)2 437( the login shell \320 the process group leader \320 exits, the ``session'' \(whatever that)14 3395(2. When)1 413 3 795 6200 t
( child processes should be revoked, regardless of)7 2175( rights to the terminal by any)6 1353(end. Access)1 542 3 970 6320 t
( a network connection,)3 963( we are dealing with)4 877( If)1 141(whether the physical connection has been broken.)6 2089 4 970 6440 t
( complete the protocol)3 962(such a disassociation may be needed to)6 1702 2 970 6560 t
10 CW f
(close)3681 6560 w
10 R f
( system)1 325(processing. The)1 687 2 4028 6560 t
( to deal with this by sending)6 1260(currently attempts)1 745 2 970 6680 t
10 CW f
(SIGHUP)3022 6680 w
10 R f
(when a process group leader ends; as)6 1611 1 3429 6680 t
(noted, this is often insuf\256cient.)4 1271 1 970 6800 t
( terminal session has ended,)4 1254( the host signals external equipment \(i.e., modems\) that a)9 2578(3. When)1 413 3 795 6980 t
( must then immediately spawn a new)6 1548(typically by dropping DTR, it)4 1240 2 970 7100 t
10 CW f
(getty)3794 7100 w
10 R f
(process, and re-enable)2 910 1 4130 7100 t
( may try to read from the line)7 1355( other process)2 604( some)1 294( to do either causes trouble:)5 1226(DTR. Failure)1 591 5 970 7220 t
(instead of)1 399 1 970 7340 t
10 CW f
(getty)1402 7340 w
7 R f
(1)1710 7300 w
10 R f
(, or the line may appear to be dead, thus blocking a telephone ``hunt group''.)14 3181 1 1745 7340 t
(- 1 -)2 182 1 2789 7728 t
cleartomark
showpage
restore
%%EndPage: 1 1
%%Page: 2 2
save
mark
2 pagesetup
10 R f
( versions of the U)4 790( Most)1 284( fruitful source of bugs.)4 1020(Historically, these requirements have been a very)6 2084 4 720 960 t
8 R f
(NIX)4898 960 w
10 R f
( to avoid them \(i.e.,)4 932(system either suffer from such bugs, contain large amounts of code to try)12 3388 2 720 1080 t
10 I f
(forceclose)720 1200 w
10 R f
(\(\) in the 9th Edition and 4.)6 1196 1 1138 1200 t
10 I f
(n)2334 1200 w
8 R f
(BSD)2384 1200 w
10 R f
( of these solutions is particularly)5 1422( None)1 298(kernels\), or both.)2 730 3 2590 1200 t
(satisfactory.)720 1320 w
( physical tty device from the)5 1210(The session tty mechanism avoids all of these problems by decoupling the)11 3110 2 720 1500 t
( logical connection is established at login time; it is severed when either)12 2983( A)1 139( user.)1 225(tty device visible to the)4 973 4 720 1620 t
(the physical device notices that the connection has dropped, or when the login shell exits.)14 3685 1 720 1740 t
(In addition to solving the original problem, there are several other bene\256ts to session ttys:)14 3695 1 720 1920 t
( a user to reconnect to a session after a physical hangup is easy.)13 2637(1. Permitting)1 598 2 795 2100 t
( sessions can be assigned ``tty'' names for)7 1751( login)1 239(2. Remote)1 486 3 795 2280 t
10 CW f
(/etc/utmp)3305 2280 w
10 R f
(entries; thus, they will show)4 1161 1 3879 2280 t
(up via)1 255 1 970 2400 t
10 I f
(who)1258 2400 w
10 R f
(.)1433 2400 w
(3. The)1 330 1 795 2580 t
10 CW f
(/etc/utmp)1160 2580 w
10 R f
( child processes persist.)3 976(entry for the login session will remain around while any)9 2329 2 1735 2580 t
(This helps system administrators track down hidden resource consumers.)8 2985 1 970 2700 t
( allocated to a session \320 say, a tape drive assigned to a user for the duration of several)18 3660(4. Resources)1 585 2 795 2880 t
( current systems, it is very hard to)7 1494( In)1 161( the session ends.)3 754(commands \320 should be revoked when)5 1661 4 970 3000 t
(determine when this is true.)4 1139 1 970 3120 t
( must be beyond the user's control \(i.e, encryption or audit)10 2521( stream modules whose usage)4 1255(5. Certain)1 469 3 795 3300 t
(modules\) can be protected from tampering.)5 1764 1 970 3420 t
( network connections,)2 897( sessions \320 circuit-based)3 1042(6. Non-login)1 586 3 795 3600 t
10 I f
(cron)3354 3600 w
10 R f
(jobs, etc. \320 can have)4 895 1 3571 3600 t
10 CW f
(utmp)4500 3600 w
10 R f
(entries)4774 3600 w
(as well.)1 313 1 970 3720 t
( design questions that are not yet clear, session ttys may provide a clean)13 3167( on certain)2 465(7. Depending)1 613 3 795 3900 t
(solution to the problem of which window is logged in when using)11 2718 1 970 4020 t
10 I f
(layers)3721 4020 w
10 R f
(.)3973 4020 w
( two-way traf\256c may)3 879( depending on certain as-yet unresolved questions, use of tty lines for)11 2922(8. Again,)1 444 3 795 4200 t
(become signi\256cantly cleaner and easier.)4 1625 1 970 4320 t
( on)1 140( as it heavily relies)4 805( 3,)1 108( Release)1 349( V)1 105(The implementation discussed here is for System)6 2049 6 720 4500 t
10 I f
(streams)4316 4500 w
7 R f
([1])4635 4460 w
10 R f
(and on)1 284 1 4756 4500 t
( unique features, such as multiplexor devices and clone devices.)9 2688(several other)1 526 2 720 4620 t
7 R f
(2)3934 4580 w
10 R f
(Some features not in the)4 1031 1 4009 4620 t
( is possible to)3 641( It)1 150( used.)1 264(standard system, such as a streams-based terminal line discipline, are also)10 3265 4 720 4740 t
( U)1 110(implement the session manager on other versions of the)8 2321 2 720 4860 t
8 R f
(NIX)3151 4860 w
10 R f
(system, but it is somewhat more dif\256cult)6 1709 1 3331 4860 t
(to do so.)2 358 1 720 4980 t
9 B f
( IT'S DONE)2 495(2. HOW)1 358 2 720 5220 t
10 R f
( the)1 197(There are three key components to the new design:)8 2170 2 720 5400 t
10 I f
(session manager)1 686 1 3129 5400 t
10 R f
(, a multiplexed device driver)4 1217 1 3823 5400 t
(known as)1 406 1 720 5520 t
10 I f
(sesstty)1177 5520 w
10 R f
(, and one or more)4 805 1 1446 5520 t
10 I f
(line managers)1 595 1 2302 5520 t
10 R f
( on the exact hardware and software)6 1589(. Depending)1 546 2 2905 5520 t
( an existing ``listener'' process, or part)6 1609(con\256guration, the line manager may be a separate process, part of)10 2711 2 720 5640 t
(of the session manager itself.)4 1194 1 720 5760 t
9 B f
( Current Structure)2 745(2.1 The)1 323 2 720 5940 t
10 R f
( When)1 306( structure.)1 409(Before we discuss the new implementation, let us review the current login management)12 3605 3 720 6120 t
(the system makes a transition to multi-user state,)7 2040 1 720 6240 t
10 CW f
(/etc/init)2798 6240 w
10 R f
(creates a child process for each tty line,)7 1664 1 3376 6240 t
( in)1 124(as de\256ned)1 422 2 720 6360 t
10 B f
(/etc/inittab)1312 6360 w
10 R f
(; each child process in turn executes)6 1567 1 1773 6360 t
10 CW f
(/etc/getty)3386 6360 w
10 R f
(, which opens the actual)4 1046 1 3994 6360 t
( the open succeeds,)3 803(device. When)1 592 2 720 6480 t
10 CW f
(getty)2151 6480 w
10 R f
( environment \(principally the line speed\),)5 1703(sets up the hardware)3 850 2 2487 6480 t
( to)1 118(collects the user's login id, and passes control)7 1929 2 720 6600 t
10 CW f
(/bin/login)2807 6600 w
10 R f
( noted earlier, the physical device)5 1416(. As)1 209 2 3415 6600 t
8 S1 f
(__________________)720 6780 w
8 R f
( security implications of this are amusing; it allows a process to imitate)12 2560(1. The)1 250 2 720 6900 t
8 CW f
(getty)3575 6900 w
8 R f
(and)3860 6900 w
8 CW f
(login)4020 6900 w
8 R f
(, thus capturing users')3 774 1 4266 6900 t
(passwords.)846 6990 w
( the glossary at the end.)5 781(2. See)1 241 2 720 7110 t
10 R f
(- 2 -)2 182 1 2789 7728 t
cleartomark
showpage
restore
%%EndPage: 2 2
%%Page: 3 3
save
mark
3 pagesetup
10 R f
(opened by)1 421 1 720 960 t
10 CW f
(getty)1174 960 w
10 R f
(is passed directly to)3 815 1 1507 960 t
10 CW f
(login)2355 960 w
10 R f
(.)2663 960 w
10 CW f
(Login)2754 960 w
10 R f
(validates the login id \(i.e., veri\256es a password\),)7 1952 1 3088 960 t
(creates an entry in)3 761 1 720 1080 t
10 CW f
(/etc/utmp)1517 1080 w
7 R f
(3)2065 1040 w
10 R f
( user's environment, and passes control to the user's shell.)9 2435(, sets up the)3 505 2 2100 1080 t
(The only)1 370 1 720 1200 t
10 I f
(fork)1127 1200 w
10 R f
(\(\) operation in the entire process is the one performed by)10 2387 1 1296 1200 t
10 CW f
(init)3720 1200 w
10 R f
( user's shell is thus a)5 885(; the)1 187 2 3968 1200 t
(direct descendant of)2 837 1 720 1320 t
10 CW f
(init)1599 1320 w
10 R f
(, with a process id known to)6 1232 1 1847 1320 t
10 CW f
(init)3122 1320 w
10 R f
( refer to that process as a)6 1099(. We)1 239 2 3370 1320 t
10 I f
(session)4751 1320 w
(process)720 1440 w
10 R f
( off \320)2 282( the shell terminates \320 that is, when the user logs)10 2080(. When)1 330 3 1033 1440 t
10 CW f
(init)3758 1440 w
10 R f
(is noti\256ed of the process)4 1009 1 4031 1440 t
(id; it cleans up the)4 765 1 720 1560 t
10 CW f
(utmp)1518 1560 w
10 R f
(entry and spawns another)3 1041 1 1791 1560 t
10 CW f
(getty)2865 1560 w
10 R f
(process for that line.)3 839 1 3198 1560 t
(The following table summarizes the process:)5 1829 1 720 1740 t
10 B f
(TABLE 1.)1 448 1 2086 1920 t
10 R f
(Division of Responsibility)2 1073 1 2600 1920 t
10 S f
(_ ___________________________________________________________________)1 3386 1 1187 2000 t
10 I f
( triggers)1 350( External)1 1310(Program Function)1 1111 3 1237 2120 t
10 S f
(_ ___________________________________________________________________)1 3386 1 1187 2140 t
10 CW f
(/etc/init)1237 2260 w
10 R f
(Fork and invoke)2 671 1 1987 2260 t
10 CW f
(getty)2691 2260 w
10 R f
(Previous session process died)3 1209 1 3314 2260 t
(Clean up)1 366 1 1987 2380 t
10 CW f
(/etc/utmp)2386 2380 w
10 R f
(entry)2959 2380 w
10 S f
(_ ___________________________________________________________________)1 3386 1 1187 2400 t
10 CW f
(/etc/getty)1237 2520 w
10 R f
( open succeeds)2 614( Line)1 336(Hardware environment setup)2 1174 3 1987 2520 t
(Collect login id)2 639 1 1987 2640 t
10 S f
(_ ___________________________________________________________________)1 3386 1 1187 2660 t
10 CW f
(/bin/login)1237 2780 w
10 R f
(Validate login id)2 688 1 1987 2780 t
(Software environment setup)2 1142 1 1987 2900 t
(Create)1987 3020 w
10 CW f
(/etc/utmp)2280 3020 w
10 R f
(entry)2853 3020 w
10 S f
(_ ___________________________________________________________________)1 3386 1 1187 3040 t
10 CW f
(/bin/sh)1237 3160 w
10 R f
(\(user session\))1 554 1 1987 3160 t
( logs off or line drops)5 903(exit User)1 1515 2 1987 3280 t
10 S f
( \347)1 -3386(_ ___________________________________________________________________)1 3386 2 1187 3300 t
(\347)1187 3200 w
(\347)1187 3100 w
(\347)1187 3000 w
(\347)1187 2900 w
(\347)1187 2800 w
(\347)1187 2700 w
(\347)1187 2600 w
(\347)1187 2500 w
(\347)1187 2400 w
(\347)1187 2300 w
(\347)1187 2200 w
(\347)1187 2100 w
(\347)4573 3300 w
(\347)4573 3200 w
(\347)4573 3100 w
(\347)4573 3000 w
(\347)4573 2900 w
(\347)4573 2800 w
(\347)4573 2700 w
(\347)4573 2600 w
(\347)4573 2500 w
(\347)4573 2400 w
(\347)4573 2300 w
(\347)4573 2200 w
(\347)4573 2100 w
10 R f
( way.)1 247(Network tty connections do not differ in any fundamental)8 2542 2 720 3480 t
10 CW f
(/etc/init)3598 3480 w
10 R f
(is no longer in the)4 846 1 4194 3480 t
( in turn is responsible for)5 1122( It)1 143( child of some network listener process.)6 1733(picture; the login shell will be)5 1322 4 720 3600 t
(cleaning up any)2 648 1 720 3720 t
10 CW f
(utmp)1401 3720 w
10 R f
(entries.)1674 3720 w
10 CW f
(Getty)2031 3720 w
10 R f
(may or may not be used.)5 1022 1 2364 3720 t
9 B f
( Brave New World)3 740(2.2 A)1 238 2 720 3900 t
10 R f
( is no longer passed directly)5 1163(The primary conceptual change in the new system is that the physical device)12 3157 2 720 4080 t
(to)720 4200 w
10 CW f
(login)839 4200 w
10 R f
( a software pseudo-device \320)4 1227(. Rather,)1 390 2 1147 4200 t
10 CW f
(sesstty)2805 4200 w
10 R f
( guessed \320 is opened by)5 1071(, as you probably)3 736 2 3233 4200 t
10 CW f
(getty)720 4320 w
10 R f
( dint of the)3 460(. By)1 208 2 1028 4320 t
10 I f
(clone)1729 4320 w
10 R f
(device driver, a separate)3 995 1 1979 4320 t
10 CW f
(sesstty)3008 4320 w
10 R f
( Next,)1 286(device is used for each session.)5 1292 2 3462 4320 t
(the physical line is spliced to the)6 1365 1 720 4440 t
10 CW f
(sesstty)2120 4440 w
10 R f
(device by the)2 552 1 2575 4440 t
10 CW f
(I_LINK)3162 4440 w
10 I f
(ioctl)3557 4440 w
10 R f
( duration of this)3 663( the)1 157( For)1 207(\(\) call.)1 270 4 3743 4440 t
(session, all references to the line, including its)7 1915 1 720 4560 t
10 CW f
(/etc/utmp)2670 4560 w
10 R f
(entry, are via the)3 700 1 3245 4560 t
10 CW f
(sesstty)3980 4560 w
10 R f
(device instead.)1 604 1 4436 4560 t
(The following diagram summarizes the situation:)5 2008 1 720 4680 t
8 S1 f
(__________________)720 6839 w
8 R f
( speaking, the)2 462(3. Strictly)1 360 2 720 6959 t
8 CW f
(/etc/utmp)1573 6959 w
8 R f
( created by)2 368(entry is)1 247 2 2036 6959 t
8 CW f
(init)2681 6959 w
8 R f
( is primarily a bookkeeping entry, however; the signi\256cant)8 1943(. This)1 218 2 2879 6959 t
(entry \320 i.e., the one showing that someone has logged in \320 is created by)14 2435 1 846 7049 t
8 CW f
(login)3307 7049 w
8 R f
(.)3553 7049 w
10 R f
(- 3 -)2 182 1 2789 7728 t
cleartomark
showpage
restore
%%EndPage: 3 3
%%Page: 4 4
save
mark
4 pagesetup
cleartomark restore
%%BeginGlobal
%
% Version 3.1 drawing procedures for dpost. Automatically pulled in, but only
% when needed.
%

/inpath false def
/savematrix matrix currentmatrix def

/Dl {
	inpath
		{pop pop neg lineto}
		{newpath neg moveto neg lineto stroke}
	ifelse
} bind def

/De {
	/y1 exch 2 div def
	/x1 exch 2 div def
	neg exch x1 add exch translate
	x1 y1 scale
	0 0 1 0 360
	inpath
		{1 0 moveto arc savematrix setmatrix}
		{newpath arc savematrix setmatrix stroke}
	ifelse
} bind def

/Da {
	/dy2 exch def
	/dx2 exch def
	/dy1 exch def
	/dx1 exch def
	dy1 add neg exch dx1 add exch
	dx1 dx1 mul dy1 dy1 mul add sqrt
	dy1 dx1 neg atan
	dy2 neg dx2 atan
	inpath
		{arc}
		{newpath arc stroke}
	ifelse
} bind def

/DA {
	/dy2 exch def
	/dx2 exch def
	/dy1 exch def
	/dx1 exch def
	dy1 add neg exch dx1 add exch
	dx1 dx1 mul dy1 dy1 mul add sqrt
	dy1 dx1 neg atan
	dy2 neg dx2 atan
	inpath
		{arcn}
		{newpath arcn stroke}
	ifelse
} bind def

/Ds {
	/y2 exch def
	/x2 exch def
	/y1 exch def
	/x1 exch def
	/y0 exch def
	/x0 exch def
	x0 5 x1 mul add 6 div
	y0 5 y1 mul add -6 div
	x2 5 x1 mul add 6 div
	y2 5 y1 mul add -6 div
	x1 x2 add 2 div
	y1 y2 add -2 div
	inpath
		{curveto}
		{newpath x0 x1 add 2 div y0 y1 add -2 div moveto curveto stroke}
	ifelse
} bind def
%%EndGlobal
save mark
8 R f
2542 1176 2542 1410 Dl
3217 1176 2542 1176 Dl
3217 1410 3217 1176 Dl
2542 1410 3217 1410 Dl
(user)2813 1248 w
(command)2722 1368 w
2879 1620 2879 1410 Dl
2879 1620 2861 1548 Dl
2880 1620 2898 1548 Dl
2542 1620 2542 1854 Dl
3217 1620 2542 1620 Dl
3217 1854 3217 1620 Dl
2542 1854 3217 1854 Dl
(user)2813 1693 w
(shell)2804 1813 w
2879 2064 2879 1854 Dl
2879 2065 2861 1993 Dl
2880 2065 2898 1993 Dl
2475 2245 810 360 De
8 CW f
(/dev/sess07)2615 2261 w
2879 2635 2879 2425 Dl
2879 2635 2861 2563 Dl
2880 2635 2898 2563 Dl
2475 2815 810 360 De
(/dev/tty03)2639 2831 w
10 R f
( device and the physical device is)6 1486(When the physical line drops, the connection between the session)9 2834 2 720 3607 t
( shown below, a new invocation of)6 1467(broken. As)1 483 2 720 3727 t
10 CW f
(getty)2707 3727 w
10 R f
(can attempt to reopen the line, without affecting)7 1996 1 3044 3727 t
(the old session device still being used.)6 1578 1 720 3847 t
8 R f
3184 4243 3184 4477 Dl
3859 4243 3184 4243 Dl
3858 4477 3858 4243 Dl
3183 4477 3858 4477 Dl
(user)3455 4315 w
(command)3364 4435 w
3521 4687 3521 4477 Dl
3521 4687 3503 4615 Dl
3521 4687 3539 4615 Dl
3184 4687 3184 4921 Dl
3859 4687 3184 4687 Dl
3858 4921 3858 4687 Dl
3183 4921 3858 4921 Dl
(user)3455 4760 w
(shell)3446 4880 w
3521 5131 3521 4921 Dl
3521 5132 3503 5060 Dl
3521 5132 3539 5060 Dl
3116 5312 810 360 De
8 CW f
(/dev/sess07)3257 5328 w
3116 5882 810 360 De
(/dev/tty03)3281 5898 w
1834 4687 1834 4921 Dl
2509 4687 1834 4687 Dl
2509 4921 2509 4687 Dl
1834 4921 2509 4921 Dl
(/etc/getty)1931 4820 w
3234 5754 2171 4921 Dl
3234 5755 3167 5725 Dl
3234 5754 3189 5696 Dl
3521 5544 3521 5492 Dl
3611 5544 3521 5544 Dl
3431 5544 3521 5544 Dl
10 R f
(The connection is also severed if the shell exits while any of its children are still running:)16 3696 1 720 6674 t
(- 4 -)2 182 1 2789 7728 t
cleartomark
showpage
restore
%%EndPage: 4 4
%%Page: 5 5
save
mark
5 pagesetup
8 R f
3184 1176 3184 1410 Dl
3859 1176 3184 1176 Dl
3858 1410 3858 1176 Dl
3183 1410 3858 1410 Dl
(user)3455 1248 w
(command)3364 1368 w
3521 1620 3521 1410 Dl
5 R f
( .)1 0( . .)2 70( . .)2 72( .)1 35( .)1 36( .)1 35( . .)2 72( . .)2 70( .)1 36( .)1 35( . .)2 72( . .)2 70( .)1 36(. .)1 48 14 3176 1856 t
(.)3850 1817 w
(.)3850 1778 w
(.)3850 1739 w
(.)3850 1700 w
(.)3850 1661 w
( .)1 0( .)1 -35( .)1 -36( . .)2 -70( . .)2 -72( .)1 -35( .)1 -36( . .)2 -70( . .)2 -72( .)1 -35( .)1 -36( .)1 -35( . .)2 -72( . .)2 -70(. .)1 13 15 3850 1622 t
(.)3176 1661 w
(.)3176 1700 w
(.)3176 1739 w
(.)3176 1778 w
(.)3176 1817 w
(.)3176 1856 w
8 R f
3521 1854 3521 1620 Dl
3521 2064 3521 1854 Dl
3521 2065 3503 1993 Dl
3521 2065 3539 1993 Dl
3116 2245 810 360 De
8 CW f
(/dev/sess07)3257 2261 w
3116 2815 810 360 De
(/dev/tty03)3281 2831 w
1834 1620 1834 1854 Dl
2509 1620 1834 1620 Dl
2509 1854 2509 1620 Dl
1834 1854 2509 1854 Dl
(/etc/getty)1931 1753 w
3234 2687 2171 1854 Dl
3234 2688 3167 2658 Dl
3234 2687 3189 2629 Dl
3521 2477 3521 2425 Dl
3611 2477 3521 2477 Dl
3431 2477 3521 2477 Dl
10 R f
( minor enhancement to the current system, there are actually)9 2555(Although the new scheme appears to be a)7 1765 2 720 3607 t
( new)1 204( A)1 143( one thing, we have added some new external events.)9 2246( For)1 211(several complicating factors.)2 1178 5 720 3727 t
10 CW f
(getty)4740 3727 w
10 R f
( link is severed; this may or may not be coincident with the demise)13 2855(process must be spawned when the)5 1465 2 720 3847 t
( session cleanup, notably clearing the)5 1572( Second,)1 394(of the session process.)3 944 3 720 3967 t
10 CW f
(/etc/utmp)3671 3967 w
10 R f
(entry, occurs when)2 788 1 4252 3967 t
(the)720 4087 w
10 CW f
(sesstty)901 4087 w
10 R f
( until all child processes)4 1106(device is closed, which in turn will not normally happen)9 2554 2 1380 4087 t
( are currently handled by)4 1045(terminate. Both)1 667 2 720 4207 t
10 CW f
(/etc/init)2469 4207 w
10 R f
( further complicate)2 781(; however, it seems unwise to)5 1242 2 3017 4207 t
10 CW f
(init)720 4327 w
10 R f
(further by adding new functionality to it.)6 1677 1 993 4327 t
( by divesting two of)4 840(We solve these problems)3 1028 2 720 4507 t
10 CW f
(init)2623 4507 w
10 R f
('s roles to some new programs, the)6 1455 1 2871 4507 t
10 I f
(session manager)1 679 1 4361 4507 t
10 R f
(and the)1 306 1 720 4627 t
10 I f
(line manager)1 544 1 1065 4627 t
10 R f
(.)1617 4627 w
10 CW f
(Init)1714 4627 w
10 R f
(will \256re up a single session manager, and one or more line managers, in)13 3047 1 1993 4627 t
( similar to the current)4 904( line manager is)3 665( The)1 223(accordance with the current system state.)5 1690 4 720 4747 t
10 CW f
(/etc/getty)4238 4747 w
10 R f
(. Its)1 194 1 4846 4747 t
( is to open new tty lines; additionally, it handles hardware environment setup and collects)14 3801(primary task)1 519 2 720 4867 t
( it does not invoke)4 795( that, however,)2 619( After)1 281(and validates the login id.)4 1082 4 720 4987 t
10 CW f
(login)3536 4987 w
10 R f
(; rather, it opens a stream to)6 1196 1 3844 4987 t
(the session manager and issues)4 1277 1 720 5107 t
10 CW f
(I_SENDFD)2032 5107 w
10 I f
(ioctl)2547 5107 w
10 R f
( to the session manager.)4 993(\(\) calls to pass the physical line)6 1314 2 2733 5107 t
( typical implementation would fork a child for each line or network)11 2847( A)1 144(It never invokes an actual shell.)5 1329 3 720 5227 t
(connection; the child would exit when the line had been handed to the session manager.)14 3615 1 720 5347 t
( ordinary tty lines,)3 769( might handle all)3 708( One)1 235(In general, there may be an arbitrary number of line managers.)10 2608 4 720 5527 t
( the line manager is)4 826( If)1 135( login requests as part of a ``listener'' process, etc.)9 2113(a second might handle remote)4 1246 4 720 5647 t
( action need be taken to re-enable the line after it has dropped.)12 2653(some sort of listener process, no special)6 1667 2 720 5767 t
( lines, where each port must)5 1165(The situation is somewhat more complex if we are dealing with ordinary tty)12 3155 2 720 5887 t
( explicit message must be sent to the line manager by the)11 2575( such cases, an)3 665( In)1 167(be opened separately.)2 913 4 720 6007 t
(session manager.)1 690 1 720 6127 t
( manager is the parent of all user shells, thereby relieving)10 2387(The session)1 478 2 720 6307 t
10 CW f
(/etc/init)3620 6307 w
10 R f
(of the responsibility.)2 845 1 4195 6307 t
(At initialization time, it opens the)5 1410 1 720 6427 t
10 I f
(control channel)1 643 1 2168 6427 t
10 R f
(of)2849 6427 w
10 CW f
(sesstty)2970 6427 w
10 R f
( the session manager receives a)5 1309(. When)1 333 2 3398 6427 t
( manager, it links it to a session device, creates the initial)11 2487(\256le descriptor from a line)4 1087 2 720 6547 t
10 CW f
(utmp)4338 6547 w
10 R f
(entry, and)1 418 1 4622 6547 t
(forks to a replacement for)4 1074 1 720 6667 t
10 CW f
(/bin/login)1830 6667 w
10 R f
(, known as)2 452 1 2438 6667 t
10 CW f
(/bin/loginenv)2926 6667 w
10 R f
( which is not)3 544( program \320)2 510(. This)1 272 3 3714 6667 t
( shell.)1 266(privileged \320 is responsible for setting up the user environment before passing control to the)14 4054 2 720 6787 t
( severed \(which)2 647(When the shell terminates, the link between the physical device and the session device is)14 3673 2 720 6907 t
(implies a)1 376 1 720 7027 t
10 I f
(close)1133 7027 w
10 R f
( manager is advised by the session)6 1454(\(\) of the physical device will take place\), and the line)10 2240 2 1346 7027 t
(manager to re-enable the line.)4 1220 1 720 7147 t
(The session manager also receives control messages from)7 2506 1 720 7327 t
10 CW f
(sesstty)3280 7327 w
10 R f
( drops.)1 302(telling of physical line)3 984 2 3754 7327 t
( situation.)1 410(Again, the connection to the session device is severed and the line manager appraised of the)15 3910 2 720 7447 t
(- 5 -)2 182 1 2789 7728 t
cleartomark
showpage
restore
%%EndPage: 5 5
%%Page: 6 6
save
mark
6 pagesetup
10 R f
(In neither case, though, is the)5 1228 1 720 960 t
10 CW f
(utmp)1984 960 w
10 R f
(entry cleared; that happens only when the session device is closed.)10 2779 1 2261 960 t
(Such status changes are passed to the session manager via the control channel.)12 3226 1 720 1080 t
10 CW f
(Sesstty)720 1260 w
10 R f
( \256rst section handles the)4 1086( The)1 243( two logical sections.)3 934(, although one driver, is divided into)6 1629 4 1148 1260 t
( is used to pass status change)6 1340( It)1 149( channel.)1 390(control channel; very little data is actually sent on this)9 2441 4 720 1380 t
( the session manager, and as the device for)8 1880(messages to)1 501 2 720 1500 t
10 CW f
(I_LINK)3148 1500 w
10 R f
(and)3555 1500 w
10 CW f
(I_UNLINK)3746 1500 w
10 R f
( second)1 324(calls. The)1 443 2 4273 1500 t
( passed)1 323( data and control messages are)5 1381( Most)1 297(section is the mostly-transparent user device handler.)6 2319 4 720 1620 t
( messages from the real device are diverted to the)9 2137( Hangup)1 392(through, whether upstream or downstream.)4 1791 3 720 1740 t
(control channel, though, as are close messages from the stream head.)10 2832 1 720 1860 t
9 B f
( Gory Details)2 525(2.3 The)1 323 2 720 2040 t
10 R f
( will)1 190( We)1 205( details.)1 320(Let us now re-examine the entire structure, this time paying attention to all of the small)15 3605 4 720 2220 t
( procedures, and then following the progress of a login)9 2302(do this by examining the boot-time initialization)6 2018 2 720 2340 t
( beginning to end, with occasional diversions to discuss what a component is doing while)14 3797(session from)1 523 2 720 2460 t
(awaiting an event.)2 745 1 720 2580 t
(At boot time, the session manager opens the session driver control channel and creates a)14 3706 1 720 2760 t
10 I f
(named stream)1 576 1 4464 2760 t
(pipe)720 2880 w
10 R f
( line manager creates a new stream pipe, opens)8 2019( Each)1 275(for communication with the line managers.)5 1810 3 936 2880 t
( session manager, and passes one end of the stream pipe to the session manager.)14 3404(the named pipe to the)4 916 2 720 3000 t
(Thus, each line manager has a unique channel to the session manager.)11 2879 1 720 3120 t
( when the line manager \320 we will assume for the moment some form of ``super-)15 3646(A session starts)2 674 2 720 3300 t
10 CW f
(getty)720 3420 w
10 R f
('' \320 detects that an)4 867 1 1028 3420 t
10 I f
(open)1940 3420 w
10 R f
( line manager will then)4 1001( The)1 233(\(\) attempt on some line has succeeded.)6 1664 3 2142 3420 t
10 I f
(fork)720 3540 w
10 R f
( The)1 231( session manager.)2 743(\(\) a per-line child process, to handle the negotiations with the user and the)13 3177 3 889 3540 t
(child process will collect the login id, much as)8 1969 1 720 3660 t
10 CW f
(getty)2728 3660 w
10 R f
( will then)2 406( It)1 133(does now.)1 419 3 3067 3660 t
10 I f
(push)4064 3660 w
10 CW f
(LD0)4291 3660 w
10 R f
(\(the standard)1 531 1 4509 3660 t
( discipline\), issue the appropriate)4 1359(tty line)1 289 2 720 3780 t
10 CW f
(TCSETA)2402 3780 w
10 R f
(call to con\256gure the line, and invoke an authentication)8 2244 1 2796 3780 t
(mechanism.)720 3900 w
8 R f
1867 4296 1867 4530 Dl
2542 4296 1867 4296 Dl
2542 4530 2542 4296 Dl
1867 4530 2542 4530 Dl
(line)2145 4369 w
(manager)2068 4489 w
5 R f
(.)2196 4532 w
(.)2196 4567 w
(.)2196 4601 w
(.)2196 4637 w
(.)2196 4672 w
(.)2196 4707 w
(.)2196 4742 w
8 R f
2204 4740 2186 4668 Dl
2205 4740 2223 4668 Dl
1867 4740 1867 4974 Dl
2542 4740 1867 4740 Dl
2542 4974 2542 4740 Dl
1867 4974 2542 4974 Dl
(line manager)1 418 1 1995 4813 t
(child)2125 4933 w
2204 5184 2204 4974 Dl
2204 5185 2186 5113 Dl
2205 5185 2223 5113 Dl
1867 5185 1867 5419 Dl
2542 5185 1867 5185 Dl
2542 5419 2542 5185 Dl
1867 5419 2542 5419 Dl
8 CW f
(LD0)2132 5318 w
2204 5629 2204 5419 Dl
2204 5629 2186 5557 Dl
2205 5629 2223 5557 Dl
1903 5863 1867 5863 Dl
1974 5863 1938 5863 Dl
2045 5863 2009 5863 Dl
2116 5863 2080 5863 Dl
2187 5863 2151 5863 Dl
2258 5863 2222 5863 Dl
2329 5863 2293 5863 Dl
2400 5863 2364 5863 Dl
2471 5863 2435 5863 Dl
2542 5863 2506 5863 Dl
2542 5827 2542 5863 Dl
2542 5761 2542 5797 Dl
2542 5695 2542 5731 Dl
2542 5629 2542 5665 Dl
2506 5629 2542 5629 Dl
2435 5629 2471 5629 Dl
2364 5629 2400 5629 Dl
2293 5629 2329 5629 Dl
2222 5629 2258 5629 Dl
2151 5629 2187 5629 Dl
2080 5629 2116 5629 Dl
2009 5629 2045 5629 Dl
1938 5629 1974 5629 Dl
1867 5629 1903 5629 Dl
1867 5665 1867 5629 Dl
1867 5731 1867 5695 Dl
1867 5797 1867 5761 Dl
1867 5863 1867 5827 Dl
8 R f
(network)2074 5702 w
(protocols)2056 5822 w
2204 6074 2204 5864 Dl
2204 6074 2186 6002 Dl
2205 6074 2223 6002 Dl
1800 6254 810 360 De
8 CW f
(/dev/tty03)1964 6270 w
3217 4296 3217 4530 Dl
3892 4296 3217 4296 Dl
3892 4530 3892 4296 Dl
3217 4530 3892 4530 Dl
8 R f
(Session)3433 4369 w
(Manager)3414 4489 w
3555 4530 3573 4602 Dl
3554 4530 3536 4602 Dl
3555 6074 3555 4530 Dl
3554 6074 3536 6002 Dl
3555 6074 3573 6002 Dl
3150 6254 810 360 De
8 CW f
(/dev/sessctl)3267 6270 w
2542 4412 2614 4394 Dl
2542 4413 2614 4431 Dl
3217 4413 2542 4413 Dl
3217 4413 3145 4431 Dl
3217 4412 3145 4394 Dl
2543 4857 2880 4413 Dl
2542 4857 2571 4789 Dl
2543 4856 2600 4810 Dl
10 R f
( session manager,)2 739(Following that, the line manager child creates a new stream pipe and passes it to the)15 3581 2 720 7046 t
( is used to pass login information from)7 1617( channel)1 346( This)1 247(thereby creating a unique channel for each session.)7 2110 4 720 7166 t
( to send it the \256le descriptor for the physical line via)11 2216(the line manager child to the session manager, and)8 2104 2 720 7286 t
10 CW f
(I_SENDFD)720 7406 w
10 R f
( session manager opens the clone device)6 1823(. The)1 273 2 1208 7406 t
10 CW f
(/dev/session)3364 7406 w
10 R f
(to create the control)3 897 1 4143 7406 t
(- 6 -)2 182 1 2789 7728 t
cleartomark
showpage
restore
%%EndPage: 6 6
%%Page: 7 7
save
mark
7 pagesetup
10 R f
(terminal for the new session.)4 1183 1 720 960 t
8 R f
1192 1356 1192 1590 Dl
1867 1356 1192 1356 Dl
1867 1590 1867 1356 Dl
1192 1590 1867 1590 Dl
(line)1470 1429 w
(manager)1393 1549 w
5 R f
(.)1521 1592 w
(.)1521 1627 w
(.)1521 1661 w
(.)1521 1697 w
(.)1521 1732 w
(.)1521 1767 w
(.)1521 1802 w
8 R f
1529 1800 1511 1728 Dl
1530 1800 1548 1728 Dl
1192 1800 1192 2034 Dl
1867 1800 1192 1800 Dl
1867 2034 1867 1800 Dl
1192 2034 1867 2034 Dl
(line manager)1 418 1 1320 1873 t
(child)1450 1993 w
1529 2244 1529 2034 Dl
1529 2245 1511 2173 Dl
1530 2245 1548 2173 Dl
1192 2245 1192 2479 Dl
1867 2245 1192 2245 Dl
1867 2479 1867 2245 Dl
1192 2479 1867 2479 Dl
8 CW f
(LD0)1457 2378 w
1529 2689 1529 2479 Dl
1529 2689 1511 2617 Dl
1530 2689 1548 2617 Dl
1228 2923 1192 2923 Dl
1299 2923 1263 2923 Dl
1370 2923 1334 2923 Dl
1441 2923 1405 2923 Dl
1512 2923 1476 2923 Dl
1583 2923 1547 2923 Dl
1654 2923 1618 2923 Dl
1725 2923 1689 2923 Dl
1796 2923 1760 2923 Dl
1867 2923 1831 2923 Dl
1867 2887 1867 2923 Dl
1867 2821 1867 2857 Dl
1867 2755 1867 2791 Dl
1867 2689 1867 2725 Dl
1831 2689 1867 2689 Dl
1760 2689 1796 2689 Dl
1689 2689 1725 2689 Dl
1618 2689 1654 2689 Dl
1547 2689 1583 2689 Dl
1476 2689 1512 2689 Dl
1405 2689 1441 2689 Dl
1334 2689 1370 2689 Dl
1263 2689 1299 2689 Dl
1192 2689 1228 2689 Dl
1192 2725 1192 2689 Dl
1192 2791 1192 2755 Dl
1192 2857 1192 2821 Dl
1192 2923 1192 2887 Dl
8 R f
(network)1399 2762 w
(protocols)1381 2882 w
1529 3134 1529 2924 Dl
1529 3134 1511 3062 Dl
1530 3134 1548 3062 Dl
1125 3314 810 360 De
8 CW f
(/dev/tty03)1289 3330 w
3892 1356 3892 1590 Dl
4567 1356 3892 1356 Dl
4567 1590 4567 1356 Dl
3892 1590 4567 1590 Dl
8 R f
(Session)4107 1429 w
(Manager)4088 1549 w
4230 1590 4248 1662 Dl
4229 1590 4211 1662 Dl
4229 3134 4229 1590 Dl
4229 3134 4211 3062 Dl
4230 3134 4248 3062 Dl
3825 3314 810 360 De
8 CW f
(/dev/sessctl)3941 3330 w
2475 3314 810 360 De
(/dev/session)2592 3330 w
3825 3314 3285 3314 Dl
3825 3314 3753 3332 Dl
3825 3314 3753 3296 Dl
4061 1590 2880 3134 Dl
4060 1590 4031 1658 Dl
4061 1590 4003 1636 Dl
1867 1472 1939 1454 Dl
1867 1473 1939 1491 Dl
3891 1473 1867 1473 Dl
3892 1473 3820 1491 Dl
3892 1472 3820 1454 Dl
3892 1590 3824 1619 Dl
3892 1589 3818 1583 Dl
1868 1917 3892 1590 Dl
1867 1917 1935 1888 Dl
1867 1918 1941 1924 Dl
10 R f
(At this point, the per-line process may exit.)7 1785 1 720 4106 t
8 R f
1192 4502 1192 4736 Dl
1867 4502 1192 4502 Dl
1867 4736 1867 4502 Dl
1192 4736 1867 4736 Dl
(line)1470 4575 w
(manager)1393 4695 w
1192 4946 1192 5180 Dl
1867 4946 1192 4946 Dl
1867 5180 1867 4946 Dl
1192 5180 1867 5180 Dl
8 CW f
(LD0)1457 5079 w
1529 5390 1529 5180 Dl
1529 5391 1511 5319 Dl
1530 5391 1548 5319 Dl
1228 5625 1192 5625 Dl
1299 5625 1263 5625 Dl
1370 5625 1334 5625 Dl
1441 5625 1405 5625 Dl
1512 5625 1476 5625 Dl
1583 5625 1547 5625 Dl
1654 5625 1618 5625 Dl
1725 5625 1689 5625 Dl
1796 5625 1760 5625 Dl
1867 5625 1831 5625 Dl
1867 5589 1867 5625 Dl
1867 5522 1867 5558 Dl
1867 5457 1867 5493 Dl
1867 5391 1867 5427 Dl
1831 5391 1867 5391 Dl
1760 5391 1796 5391 Dl
1689 5391 1725 5391 Dl
1618 5391 1654 5391 Dl
1547 5391 1583 5391 Dl
1476 5391 1512 5391 Dl
1405 5391 1441 5391 Dl
1334 5391 1370 5391 Dl
1263 5391 1299 5391 Dl
1192 5391 1228 5391 Dl
1192 5427 1192 5391 Dl
1192 5493 1192 5457 Dl
1192 5558 1192 5522 Dl
1192 5625 1192 5589 Dl
8 R f
(network)1399 5464 w
(protocols)1381 5584 w
1529 5835 1529 5625 Dl
1529 5835 1511 5763 Dl
1530 5835 1548 5763 Dl
1125 6015 810 360 De
8 CW f
(/dev/tty03)1289 6031 w
3892 4502 3892 4736 Dl
4567 4502 3892 4502 Dl
4567 4736 4567 4502 Dl
3892 4736 4567 4736 Dl
8 R f
(Session)4107 4575 w
(Manager)4088 4695 w
4230 4736 4248 4808 Dl
4229 4736 4211 4808 Dl
4229 5836 4229 4736 Dl
4229 5835 4211 5763 Dl
4230 5835 4248 5763 Dl
3825 6015 810 360 De
8 CW f
(/dev/sessctl)3941 6031 w
2475 6015 810 360 De
(/dev/session)2592 6031 w
3825 6015 3285 6015 Dl
3825 6015 3753 6033 Dl
3825 6015 3753 5997 Dl
1530 4946 3892 4736 Dl
1531 4946 1600 4922 Dl
1530 4947 1603 4958 Dl
2880 5835 4061 4736 Dl
2880 5834 2920 5773 Dl
2881 5836 2945 5800 Dl
1867 4618 1939 4600 Dl
1867 4619 1939 4637 Dl
3891 4619 1867 4619 Dl
3892 4619 3820 4637 Dl
3892 4618 3820 4600 Dl
10 R f
( primary difference is that any)5 1255( The)1 223( using a listener-based line manager.)5 1508(The scenario is similar if we are)6 1334 4 720 6807 t
( we shall see, the exact)5 969( As)1 180( must be pushed onto the stream before LD0.)8 1888(network-related line disciplines)2 1283 4 720 6927 t
( used must be carefully selected, as they will move out of reach of the user before the)17 3624(set of disciplines)2 696 2 720 7047 t
(login process is complete.)3 1062 1 720 7167 t
(- 7 -)2 182 1 2789 7728 t
cleartomark
showpage
restore
%%EndPage: 7 7
%%Page: 8 8
save
mark
8 pagesetup
10 R f
(Most of the time, the session manager is in a loop waiting for messages on the control channel.)17 4320 1 720 960 t
( a)1 85( this point,)2 460( At)1 175(Eventually, it will receive a validated login id and a physical device on this channel.)14 3600 4 720 1080 t
10 CW f
(utmp)720 1200 w
10 R f
( child process must shed any current control)7 1859( This)1 250( child process is created.)4 1034(entry is created and a)4 899 4 998 1200 t
( It)1 128( acquire a new control tty.)5 1087(tty \(i.e., the control tty of the line manager\) and open the session device to)14 3105 3 720 1320 t
(then performs a)2 676 1 720 1440 t
10 CW f
(TCGETA)1446 1440 w
10 R f
(to note the line environment, pops)5 1491 1 1856 1440 t
10 CW f
(LD0)3397 1440 w
10 R f
(, issues an)2 458 1 3585 1440 t
10 CW f
(I_LINK)4094 1440 w
10 R f
(to splice the)2 535 1 4505 1440 t
( device, and pushes)3 827(physical line to the session)4 1144 2 720 1560 t
10 CW f
(LD0)2733 1560 w
10 R f
( juggling of)2 501( This)1 253(onto the session device.)3 1000 3 2955 1560 t
10 CW f
(LD0)4751 1560 w
10 R f
(is)4973 1560 w
( below the splice point \320 say, a network protocol module \320 may not)13 2935(necessary because line disciplines)3 1385 2 720 1680 t
( many programs will want to remove)6 1536( But)1 214(be popped once the splice has taken place.)7 1767 3 720 1800 t
10 CW f
(LD0)4272 1800 w
10 R f
(on their own;)2 553 1 4487 1800 t
( wall is actually useful for some)6 1510( \(The)1 285( behind this brick wall.)4 1075(it is not reasonable to isolate it)6 1450 4 720 1920 t
( cryptographic module; for security reasons, it may)7 2139( line manager may wish to push a)7 1445(applications. The)1 736 3 720 2040 t
(be desirable to prevent the user from ever removing it.\))9 2278 1 720 2160 t
(Finally, the child process)3 1029 1 720 2340 t
10 I f
(exec)1782 2340 w
10 R f
(\(\)s the user's shell.)3 778 1 1966 2340 t
( close the physical device passed to it by the)9 1884(Once the fork has taken place, the session manager should)9 2436 2 720 2520 t
( must record the session device, the real device, the ``magic cookie'')11 2883( each session, it)3 669( For)1 211(line manager.)1 557 4 720 2640 t
(passed back by the)3 817 1 720 2760 t
10 CW f
(I_LINK)1584 2760 w
10 R f
( which will ultimately become the)5 1478(call, and the process id of the child,)7 1571 2 1991 2760 t
(user's shell.)1 485 1 720 2880 t
( dotted arrows indicate)3 963( The)1 230( the juggling has taken place, the con\256guration looks like this.)10 2652(After all of)2 475 4 720 3060 t
(information; the solid arrows indicate an open \256le descriptor or some other active data channel.)14 3919 1 720 3180 t
8 R f
2509 3887 2509 4121 Dl
3184 3887 2509 3887 Dl
3183 4121 3183 3887 Dl
2508 4121 3183 4121 Dl
(user)2780 3960 w
(shell)2771 4080 w
2846 4331 2846 4121 Dl
2846 4332 2828 4260 Dl
2846 4332 2864 4260 Dl
2509 4332 2509 4566 Dl
3184 4332 2509 4332 Dl
3183 4566 3183 4332 Dl
2508 4566 3183 4566 Dl
8 CW f
(LD0)2774 4464 w
2846 4776 2846 4566 Dl
2846 4776 2828 4704 Dl
2846 4776 2864 4704 Dl
2441 4956 810 360 De
(/dev/sess07)2582 4972 w
2846 5346 2846 5136 Dl
2846 5347 2828 5275 Dl
2846 5347 2864 5275 Dl
2545 5581 2509 5581 Dl
2616 5581 2580 5581 Dl
2686 5581 2650 5581 Dl
2758 5581 2722 5581 Dl
2828 5581 2792 5581 Dl
2899 5581 2863 5581 Dl
2971 5581 2935 5581 Dl
3041 5581 3005 5581 Dl
3113 5581 3077 5581 Dl
3183 5581 3147 5581 Dl
3183 5545 3183 5581 Dl
3183 5478 3183 5514 Dl
3183 5412 3183 5448 Dl
3183 5347 3183 5383 Dl
3147 5347 3183 5347 Dl
3077 5347 3113 5347 Dl
3005 5347 3041 5347 Dl
2935 5347 2971 5347 Dl
2863 5347 2899 5347 Dl
2792 5347 2828 5347 Dl
2722 5347 2758 5347 Dl
2650 5347 2686 5347 Dl
2580 5347 2616 5347 Dl
2509 5347 2545 5347 Dl
2509 5383 2509 5347 Dl
2509 5448 2509 5412 Dl
2509 5514 2509 5478 Dl
2509 5581 2509 5545 Dl
8 R f
(network)2716 5419 w
(protocols)2698 5539 w
2846 5791 2846 5581 Dl
2846 5791 2828 5719 Dl
2846 5791 2864 5719 Dl
2441 5971 810 360 De
8 CW f
(/dev/tty03)2606 5987 w
3859 3576 3859 3810 Dl
4534 3576 3859 3576 Dl
4534 3810 4534 3576 Dl
3859 3810 4534 3810 Dl
8 R f
(Session)4074 3648 w
(Manager)4055 3768 w
4196 4776 4196 3810 Dl
4196 4776 4178 4704 Dl
4196 4776 4214 4704 Dl
3791 4956 810 360 De
8 CW f
(/dev/sessctl)3908 4972 w
5 R f
(.)3851 3694 w
(.)3818 3709 w
(.)3786 3724 w
(.)3754 3739 w
(.)3722 3754 w
(.)3690 3768 w
(.)3658 3783 w
(.)3626 3799 w
(.)3593 3813 w
(.)3561 3828 w
(.)3529 3842 w
(.)3497 3858 w
(.)3465 3872 w
(.)3433 3887 w
(.)3401 3902 w
(.)3368 3917 w
(.)3336 3932 w
(.)3304 3946 w
(.)3272 3961 w
(.)3240 3976 w
(.)3208 3991 w
(.)3175 4006 w
8 R f
3184 4003 3241 3957 Dl
3185 4003 3257 3990 Dl
5 R f
(.)3851 3694 w
(.)3831 3725 w
(.)3811 3756 w
(.)3791 3786 w
(.)3772 3817 w
(.)3753 3848 w
(.)3732 3878 w
(.)3713 3909 w
(.)3694 3940 w
(.)3674 3971 w
(.)3654 4002 w
(.)3635 4033 w
(.)3615 4063 w
(.)3596 4094 w
(.)3575 4125 w
(.)3556 4155 w
(.)3537 4186 w
(.)3517 4217 w
(.)3497 4247 w
(.)3478 4278 w
(.)3458 4308 w
(.)3439 4339 w
(.)3419 4370 w
(.)3399 4400 w
(.)3380 4431 w
(.)3360 4462 w
(.)3340 4493 w
(.)3321 4524 w
(.)3301 4555 w
(.)3282 4585 w
(.)3262 4616 w
(.)3242 4647 w
(.)3223 4677 w
(.)3203 4708 w
(.)3183 4739 w
(.)3164 4769 w
(.)3144 4800 w
(.)3124 4831 w
8 R f
3133 4828 3156 4758 Dl
3132 4829 3186 4778 Dl
5 R f
(.)3851 3694 w
(.)3839 3729 w
(.)3827 3763 w
(.)3816 3797 w
(.)3804 3831 w
(.)3793 3866 w
(.)3781 3899 w
(.)3770 3933 w
(.)3758 3968 w
(.)3747 4002 w
(.)3735 4036 w
(.)3724 4070 w
(.)3712 4105 w
(.)3701 4138 w
(.)3689 4172 w
(.)3678 4207 w
(.)3666 4241 w
(.)3655 4275 w
(.)3643 4309 w
(.)3632 4344 w
(.)3620 4377 w
(.)3609 4411 w
(.)3597 4446 w
(.)3586 4480 w
(.)3574 4514 w
(.)3563 4548 w
(.)3551 4583 w
(.)3539 4616 w
(.)3528 4650 w
(.)3516 4685 w
(.)3505 4719 w
(.)3493 4753 w
(.)3482 4787 w
(.)3470 4822 w
(.)3459 4856 w
(.)3447 4889 w
(.)3436 4924 w
(.)3424 4958 w
(.)3413 4992 w
(.)3401 5026 w
(.)3390 5061 w
(.)3378 5095 w
(.)3367 5128 w
(.)3355 5163 w
(.)3344 5197 w
(.)3332 5231 w
(.)3321 5265 w
(.)3309 5300 w
(.)3298 5334 w
(.)3286 5367 w
(.)3275 5402 w
(.)3263 5436 w
(.)3251 5470 w
(.)3240 5504 w
(.)3228 5539 w
(.)3217 5573 w
(.)3205 5606 w
(.)3193 5641 w
(.)3182 5675 w
(.)3170 5709 w
(.)3159 5743 w
(.)3147 5778 w
(.)3136 5812 w
(.)3124 5846 w
8 R f
3134 5844 3139 5770 Dl
3132 5844 3172 5782 Dl
3791 4956 3251 4956 Dl
3791 4956 3719 4974 Dl
3791 4956 3719 4938 Dl
1159 3576 1159 3810 Dl
1834 3576 1159 3576 Dl
1834 3810 1834 3576 Dl
1159 3810 1834 3810 Dl
(line)1437 3648 w
(manager)1360 3768 w
1834 3692 1906 3674 Dl
1834 3693 1906 3711 Dl
3858 3692 1834 3692 Dl
3859 3693 3787 3711 Dl
3859 3692 3787 3674 Dl
10 R f
(As noted, the)2 558 1 720 6763 t
10 CW f
(sesstty)1317 6763 w
10 R f
(driver passes most data and control messages through without modi\256cation or)10 3264 1 1776 6763 t
( an)1 161( one event:)2 456( exception is made for)4 927(hindrance. An)1 608 4 720 6883 t
10 CW f
(M_HANGUP)2906 6883 w
10 R f
(indication coming from the real device.)5 1620 1 3420 6883 t
10 CW f
(M_HANGUP)720 7003 w
10 R f
( left to propagate upward,)4 1064( If)1 133( if we choose.)3 581(is an actual stream message, and may be diverted)8 2029 4 1233 7003 t
(it will cause)2 505 1 720 7123 t
10 CW f
(SIGHUP)1261 7123 w
10 R f
( though, this may not accomplish everything we)7 1991(to be generated; as we have seen,)6 1392 2 1657 7123 t
( the message is diverted, and a status message is sent instead to the session manager.)15 3511(want. Accordingly,)1 809 2 720 7243 t
(The session manager in turn issues)5 1450 1 720 7363 t
10 CW f
(I_UNLINK)2207 7363 w
10 R f
( the connection to the real device; if necessary,)8 1958(, to sever)2 387 2 2695 7363 t
(- 8 -)2 182 1 2789 7728 t
cleartomark
showpage
restore
%%EndPage: 8 8
%%Page: 9 9
save
mark
9 pagesetup
10 R f
( must issue a)3 592( the session manager)3 904( Finally,)1 392(it also noti\256es the line manager to re-enable the device.)9 2432 4 720 960 t
(command \(via the control channel\) to cause a real)8 2077 1 720 1080 t
10 CW f
(M_HANGUP)2833 1080 w
10 R f
( be sent to the session device.)6 1239(message to)1 452 2 3349 1080 t
( copy of the)3 555(\(We shall see later why we do not simply make a)10 2223 2 720 1200 t
10 CW f
(M_HANGUP)3550 1200 w
10 R f
(to send to the session)4 958 1 4082 1200 t
(manager, rather than diverting it.\))4 1379 1 720 1320 t
( one down, however, depends on three independent)7 2223( Tearing)1 393( is straight-forward.)2 840(Setting up a session)3 864 4 720 1500 t
( to as)2 253( of the session process \(which we will refer)8 1905(events: termination)1 824 3 720 1620 t
10 I f
(PEND\),)3748 1620 w
10 R f
(a close of the session)4 927 1 4113 1620 t
(device \()1 353 1 720 1740 t
10 I f
(SCLOSE)1073 1740 w
10 R f
(\), and a)2 366 1 1437 1740 t
10 CW f
(M_HANGUP)1863 1740 w
10 R f
( we)1 177( If)1 160( may occur in any order.)5 1150( These)1 331(of the real device.)3 819 5 2403 1740 t
(judiciously use)1 625 1 720 1860 t
10 I f
(sighold)1392 1860 w
10 R f
( block)1 268(\(\) to)1 191 2 1695 1860 t
10 CW f
(SIGCLD)2200 1860 w
10 R f
(, all of these events will appear to be synchronous to the)11 2472 1 2568 1860 t
(session manager, thus avoiding potential race conditions.)6 2329 1 720 1980 t
(The cleanup rules can be stated fairly simply.)7 1869 1 720 2160 t
( the connection between the)4 1230( the \256rst termination event comes in for any session, sever)10 2602(1. When)1 413 3 795 2340 t
(session device and the real device, and tell the line manager to re-enable the line.)14 3343 1 970 2460 t
( the \256rst event is)4 733(2. If)1 241 2 795 2640 t
10 CW f
(M_HANGUP)1812 2640 w
10 R f
( an)1 138(, send)1 251 2 2300 2640 t
10 CW f
(M_HANGUP)2733 2640 w
10 R f
(message up the session device to the user)7 1783 1 3257 2640 t
(processes.)970 2760 w
( both)1 211(3. When)1 413 2 795 2940 t
10 CW f
(PEND)1452 2940 w
10 R f
(and)1725 2940 w
10 CW f
(SCLOSE)1902 2940 w
10 R f
(have occurred, the session is over; clean up the)8 1940 1 2295 2940 t
10 CW f
(utmp)4268 2940 w
10 R f
(entry.)4541 2940 w
(4. Whenever)1 584 1 795 3120 t
10 CW f
(M_HANGUP)1413 3120 w
10 R f
( hangup signals are external to)5 1262( Hardware)1 459(arrives, send a re-enable message.)4 1392 3 1927 3120 t
( a re-)2 238(the machine, and hence asynchronous; depending on internal timing, one may arrive while)12 3832 2 970 3240 t
(enable is in transit, and hence its effect may be lost.)10 2143 1 970 3360 t
( \(b\))1 163(We must also deal with the problem of commands that \(a\) close all of their \256le descriptors, and)17 4157 2 720 3540 t
( session device to be closed, which in turn)8 1780( would cause the)3 707( This)1 249(persist after the shell itself has exited.)6 1584 4 720 3660 t
( the session entry in)4 918(would cause)1 526 2 720 3780 t
10 CW f
(/etc/utmp)2220 3780 w
10 R f
( processes would then become)4 1338( Such)1 289(to be deleted.)2 597 3 2816 3780 t
( deal with this by changing the implementation of)8 2076( We)1 207(invisible in some sense.)3 983 3 720 3900 t
10 B f
(/dev/tty)4022 3900 w
10 R f
(slightly. Rather)1 660 1 4380 3900 t
(than storing a pointer to the)5 1157 1 720 4020 t
10 CW f
(tty)1913 4020 w
10 R f
(structure in the ``)3 723 1 2129 4020 t
10 CW f
(u.)2852 4020 w
10 R f
( \256le table)2 396('' area, we instead store a pointer to the)8 1664 2 2980 4020 t
( its controlling)2 644( is, when a process acquires a session device as)9 2163( That)1 272(entry for the session device.)4 1241 4 720 4140 t
(terminal, the kernel would in effect perform a)7 1900 1 720 4260 t
10 I f
(dup)2656 4260 w
10 R f
(\(\) operation on the relevant \256le descriptor, storing the)8 2226 1 2814 4260 t
(result in)1 341 1 720 4380 t
10 CW f
(u.u_ttyd)1102 4380 w
10 R f
( in that session have)4 865( the session device could not close until all processes)9 2261(. Thus,)1 324 3 1590 4380 t
( close noti\256cation may be delayed even further, if other process outside the session are)14 3611(terminated. \(The)1 709 2 720 4500 t
( The)1 221(using the device.)2 690 2 720 4620 t
10 CW f
(write)1664 4620 w
10 R f
(command is one case in point.\))5 1283 1 1997 4620 t
( of the line manager)4 834( the child)2 388( If)1 132(There is one anomalous case of line re-enabling that must be dealt with.)12 2966 4 720 4800 t
( the login id successfully, it will never hand off the connection to the session manager.)15 3619(does not validate)2 701 2 720 4920 t
( ways around this)3 732( are a number of)4 689( There)1 299(Consequently, no ordinary re-enable message will ever be sent.)8 2600 4 720 5040 t
( managers look for special exit codes from their children, or having the)12 2944( the line)2 342( having)1 340(problem, such as)2 694 4 720 5160 t
(children always send re-enable requests to the parent via the session manager.)11 3197 1 720 5280 t
(Let us revisit Table 1 and examine the new division of functionality:)11 2827 1 720 5460 t
(- 9 -)2 182 1 2789 7728 t
cleartomark
showpage
restore
%%EndPage: 9 9
%%Page: 10 10
save
mark
10 pagesetup
10 B f
(TABLE 2.)1 448 1 1976 960 t
10 R f
(New Division of Responsibility)3 1294 1 2490 960 t
10 S f
(_ ______________________________________________________________________________)1 3923 1 918 1040 t
10 I f
( triggers)1 350( External)1 1490(Program Function)1 1303 3 968 1160 t
10 S f
(_ ______________________________________________________________________________)1 3923 1 918 1180 t
10 CW f
(/etc/init)968 1300 w
10 R f
( and invoke session)3 1071( Fork)1 -2205(Previous process died)2 887 3 3417 1300 t
(manager and line managers)3 1118 1 1910 1420 t
10 S f
(_ ______________________________________________________________________________)1 3923 1 918 1440 t
10 R f
( session manager)2 698( Contact)1 694(Line manager)1 559 3 968 1560 t
(Open set of lines)3 698 1 1910 1680 t
( open succeeds)2 614( Line)1 925(Fork per-line child)2 765 3 1910 1800 t
10 S f
(_ ______________________________________________________________________________)1 3923 1 918 1820 t
10 R f
( environment setup)2 782( Hardware)1 542(Line manager child)2 792 3 968 1940 t
(Collect and validate login id)4 1165 1 1910 2060 t
(Hand off line to session manager)5 1357 1 1910 2180 t
10 S f
(_ ______________________________________________________________________________)1 3923 1 918 2200 t
10 R f
( from line manager)3 786( Message)1 981( session device)2 615( Create)1 520(Session manager)1 682 5 968 2320 t
(Create)1910 2440 w
10 CW f
(utmp)2203 2440 w
10 R f
( from line manager child)4 1019(entry Message)1 1290 2 2476 2440 t
(Fork/exec)1910 2560 w
10 CW f
(loginenv)2342 2560 w
10 R f
( hangup or child process exit)5 1191( Line)1 919(Disconnect session)1 771 3 1910 2680 t
(Clean up)1 366 1 1910 2800 t
10 CW f
(utmp)2309 2800 w
10 R f
(Session ends)1 522 1 3417 2800 t
10 S f
(_ ______________________________________________________________________________)1 3923 1 918 2820 t
10 CW f
(/etc/loginenv)968 2940 w
10 R f
(Software environment setup)2 1142 1 1910 2940 t
(Exec user shell)2 620 1 1910 3060 t
10 S f
(_ ______________________________________________________________________________)1 3923 1 918 3080 t
10 CW f
(/bin/sh)968 3200 w
10 R f
(\(user session\))1 554 1 1910 3200 t
( logs off)2 349(exit User)1 1695 2 1910 3320 t
(receive)1910 3440 w
10 CW f
(SIGHUP)2230 3440 w
10 R f
(session manager message \(after)3 1374 1 3417 3440 t
(session disconnect\))1 782 1 3417 3560 t
10 S f
( \347)1 -3923(_ ______________________________________________________________________________)1 3923 2 918 3580 t
(\347)918 3540 w
(\347)918 3440 w
(\347)918 3340 w
(\347)918 3240 w
(\347)918 3140 w
(\347)918 3040 w
(\347)918 2940 w
(\347)918 2840 w
(\347)918 2740 w
(\347)918 2640 w
(\347)918 2540 w
(\347)918 2440 w
(\347)918 2340 w
(\347)918 2240 w
(\347)918 2140 w
(\347)918 2040 w
(\347)918 1940 w
(\347)918 1840 w
(\347)918 1740 w
(\347)918 1640 w
(\347)918 1540 w
(\347)918 1440 w
(\347)918 1340 w
(\347)918 1240 w
(\347)918 1140 w
(\347)4841 3580 w
(\347)4841 3540 w
(\347)4841 3440 w
(\347)4841 3340 w
(\347)4841 3240 w
(\347)4841 3140 w
(\347)4841 3040 w
(\347)4841 2940 w
(\347)4841 2840 w
(\347)4841 2740 w
(\347)4841 2640 w
(\347)4841 2540 w
(\347)4841 2440 w
(\347)4841 2340 w
(\347)4841 2240 w
(\347)4841 2140 w
(\347)4841 2040 w
(\347)4841 1940 w
(\347)4841 1840 w
(\347)4841 1740 w
(\347)4841 1640 w
(\347)4841 1540 w
(\347)4841 1440 w
(\347)4841 1340 w
(\347)4841 1240 w
(\347)4841 1140 w
9 B f
( GONGS, AND WHISTLES)3 1108(3. BELLS,)1 441 2 720 3820 t
10 R f
( makes it easy to add some new functionality)8 1886(In addition to \256xing some bugs, using the session manager)9 2434 2 720 4000 t
( feature is the ability to have a session survive the)10 2426( most interesting new)3 993( The)1 258(to the system.)2 643 4 720 4120 t
( of sending)2 478( Instead)1 363(disconnection of the physical terminal.)4 1619 3 720 4240 t
10 CW f
(M_HANGUP)3222 4240 w
10 R f
( session when the physical)4 1132(to a)1 164 2 3744 4240 t
( requests on the session device would eventually block due to)10 2588( Read)1 276(line drops, nothing would be done.)5 1456 3 720 4360 t
( a)1 86( Alternatively,)1 627( block because of \257ow control on the stream.)8 1930(lack of input data; write requests would)6 1677 4 720 4480 t
10 CW f
(STOP)720 4600 w
10 R f
( a user who disconnected)4 1079(signal could be sent to the session's process group instead; that way,)11 2956 2 1005 4600 t
( not have to worry about them eating the CPU alive)10 2159(because of stubborn malfunctioning processes would)5 2161 2 720 4720 t
(until they were killed manually.)4 1306 1 720 4840 t
(To resume a suspended session, a user would log in and issue a)12 2623 1 720 5020 t
10 CW f
(reconnect)3376 5020 w
10 R f
( command)1 428(command. This)1 663 2 3949 5020 t
( between the real device and the new session, and then)10 2305(would ask the session manager to sever the link)8 2015 2 720 5140 t
(splice the real device to the)5 1224 1 720 5260 t
10 CW f
(sesstty)1996 5260 w
10 R f
( session would probably be)4 1200( new)1 218( The)1 240(from the old session.)3 914 4 2468 5260 t
( would allow a user to switch back and)8 1617( This)1 244( suspended.)1 474(terminated, though as an option it, too, could be)8 1985 4 720 5380 t
(forth between multiple sessions, possibly even on different machines.)8 2844 1 720 5500 t
7 R f
(4)3564 5460 w
10 R f
( such session to)3 670( Permitting)1 496( long a disconnected session should be allowed to persist.)9 2433(It isn't clear how)3 721 4 720 5680 t
( undead)1 341(live inde\256nitely would tend to choke a system on the bodies of)11 2804 2 720 5800 t
7 R f
(5)3865 5760 w
10 R f
( a)1 97(processes. Presumably,)1 990 2 3953 5800 t
( to suspend a session for a)6 1115(timeout interval would be set by the system administrator; users who wished)11 3205 2 720 5920 t
(longer time could override the limit via an)7 1746 1 720 6040 t
10 I f
(ioctl)2499 6040 w
10 R f
(\(\) call.)1 268 1 2685 6040 t
( obvious)1 354( The)1 225( pile up, we may wish to discard it.)8 1495(Instead of having the output of a disconnected session)8 2246 4 720 6220 t
(model is a ``streams)3 879 1 720 6340 t
10 B f
(/dev/null)1647 6340 w
10 R f
( certainly easy)2 622( It's)1 214(''; unfortunately, that's not as simple as it sounds.)8 2183 3 2021 6340 t
( discards any data \257owing into it; however, there is no way for)12 2607(enough to implement a pseudo-driver that)5 1713 2 720 6460 t
( such an enhancement were made, the session)7 1879( If)1 132( EOF'' back to the stream head.)6 1320(a driver to pass a ``hard)5 989 4 720 6580 t
( number of 0-length)3 865( some large)2 504( Alternatively,)1 632(device could be spliced to a clone of the null stream.)10 2319 4 720 6700 t
8 S1 f
(__________________)720 6880 w
8 R f
( resemblance between this concept and the)6 1391(4. Any)1 264 2 720 7000 t
8 CW f
(sxt)2401 7000 w
8 R f
(driver is)1 268 1 2571 7000 t
8 I f
(not)2865 7000 w
8 R f
(coincidental; we discuss the similarities below.)5 1527 1 2993 7000 t
( can't call them zombies...)4 860(5. I)1 152 2 720 7120 t
10 R f
(- 10 -)2 232 1 2764 7728 t
cleartomark
showpage
restore
%%EndPage: 10 10
%%Page: 11 11
save
mark
11 pagesetup
10 R f
(records could be sent upstream.)4 1293 1 720 960 t
( a user may wish to acquire some)7 1545( Brie\257y,)1 392( resource allocation problem.)3 1257(Earlier, we alluded to the)4 1126 4 720 1140 t
( tape drive is a good example; the user may need)10 2066( A)1 142( command.)1 456(resource for a span longer than a single)7 1656 4 720 1260 t
(to create a)2 449 1 720 1380 t
10 CW f
(cpio)1214 1380 w
10 R f
( recreate it when the veri\256cation shows that the \256le is)10 2340(image on the tape, verify it,)5 1201 2 1499 1380 t
( the tape drive to that user may be handled)9 1820( a closed-shop environment, assignment of)5 1784( In)1 156(incorrect, etc.)1 560 4 720 1500 t
( also request that)3 716( from allocating the drive, this daemon would)7 1917( Apart)1 298(by a tape drive manager daemon.)5 1389 4 720 1620 t
( other)1 250( problem is when to release the drive for allocation to)10 2345( The)1 234(the operator mount the user's tape.)5 1491 4 720 1740 t
( when a session has)4 826( a time limit is one solution \(and probably part of any solution\), noting)13 2952(users. While)1 542 3 720 1860 t
( in)1 114( detecting logout is insuf\256cient; the process using the drive may be running)12 3153( Today,)1 350(ended is another.)2 703 4 720 1980 t
( however, persist until the last process is gone.)8 1923( Sessions,)1 436(the background.)1 651 3 720 2100 t
( useful to B2-level secure U)5 1307(Session-based ttys are also)3 1179 2 720 2280 t
8 R f
(NIX)3206 2280 w
10 R f
(systems)3411 2280 w
7 R f
([2])3728 2240 w
10 R f
( systems require the)3 910(. Such)1 321 2 3809 2280 t
(existence of a)2 572 1 720 2400 t
10 I f
(trusted path)1 493 1 1329 2400 t
10 R f
( connect that user to a)5 928(\320 a mechanism invoked by the user that will reliably)9 2253 2 1859 2400 t
( that way, the user is guaranteed that the)8 1717( trusted path must be used at login time;)8 1704( The)1 226(trusted program.)1 673 4 720 2520 t
10 CW f
(Password:)720 2640 w
10 R f
( a requirement for the)4 956( Obviously,)1 523( not coming from a Trojan horse program.)7 1847(prompt is)1 405 4 1309 2640 t
( killed or have their access rights)6 1404(trusted path is that all other processes talking to the terminal must be)12 2916 2 720 2760 t
( list of open \256les for)5 848( The)1 221( task.)1 219( in terms of implementation problems, this is a complex)9 2314(revoked. Sheerly)1 718 5 720 2880 t
( pageable ``)2 524(a process is in the process's)5 1236 2 720 3000 t
10 CW f
(u.)2480 3000 w
10 R f
('' area; thus, it is not easily accessible to the kernel at)11 2432 1 2608 3000 t
( an)1 132( carrier drops,)2 584( When)1 310( ttys inherently solve the problem.)5 1436( Session)1 378(interrupt time.)1 586 6 720 3120 t
10 CW f
(M_HANGUP)4184 3120 w
10 R f
(message)4702 3120 w
( will)1 205( receipt of the message, the session manager)7 1929( Upon)1 303(is generated.)1 527 4 720 3240 t
10 I f
(always)3733 3240 w
10 R f
(disconnect the physical)2 980 1 4060 3240 t
( device, and)2 497(device from the session)3 970 2 720 3360 t
10 I f
(always)2221 3360 w
10 R f
(ask the line manager \320 a trusted process \320 to re-enable the)11 2507 1 2533 3360 t
( the session manager is that the line may not be re-enabled until)12 2877( only change needed to)4 1028(line. The)1 415 3 720 3480 t
10 CW f
(M_HANGUP)720 3600 w
10 R f
(is received; presenting a new)4 1254 1 1249 3600 t
10 CW f
(login:)2552 3600 w
10 R f
(prompt upon session head exit violates the DoD)7 2079 1 2961 3600 t
(requirement that the user must initiate access to the trusted path.)10 2646 1 720 3720 t
( tty devices; rather, they can be linked to any underlying stream.)11 2785(Session heads need not be bound to)6 1535 2 720 3900 t
( example, RFS mount)3 936( For)1 218( the same umbrella.)3 845(This gives us the ability to bring other services under)9 2321 4 720 4020 t
(operations could be listed in)4 1167 1 720 4140 t
10 CW f
(/etc/utmp)1922 4140 w
10 R f
( would permit easy monitoring of start times, exit status,)9 2357(; that)1 213 2 2470 4140 t
( transfer operations, remote execution requests, etc. \320 could be listed)10 2866( network sessions \320 \256le)4 1019(etc. Other)1 435 3 720 4260 t
( of course;)2 451( care should be exercised in deciding what types of sessions should be listed,)13 3250( Some)1 300(as well.)1 319 4 720 4380 t
( to be worth the)4 751(things like directory queries or time server queries are likely to be too transient)13 3569 2 720 4500 t
(overhead.)720 4620 w
(One essential difference between the current)5 1864 1 720 4800 t
10 CW f
(/etc/init)2627 4800 w
10 R f
(and a line manager is that the latter knows)8 1830 1 3210 4800 t
( All)1 206( is in progress.)3 643(when an active session)3 975 3 720 4920 t
10 CW f
(init)2589 4920 w
10 R f
(can say is that something is running; it cannot tell)9 2166 1 2874 4920 t
( extremely important to programs that)5 1613( this knowledge is)3 779( But)1 221(whether or not the line is actually open.)7 1707 4 720 5040 t
( solutions are not particularly clean.)5 1566( Current)1 390( the line for outgoing calls.)5 1212(wish to use)2 506 4 720 5160 t
10 CW f
(Uucico)4479 5160 w
10 R f
(, for)1 193 1 4847 5160 t
(example, requires a special version of)5 1587 1 720 5280 t
10 CW f
(getty)2348 5280 w
10 R f
(known as)1 396 1 2689 5280 t
10 CW f
(uugetty)3126 5280 w
10 R f
( better solution)2 634( A)1 147(for shared lines.)2 672 3 3587 5280 t
( manager for a line \320 any available line \320 rather than relying on)13 2957(would be for it to ask the line)7 1363 2 720 5400 t
( would be handled by a)5 1039( in fact, such negotiations)4 1108( Ideally,)1 381(heuristics to determine what is happening.)5 1792 4 720 5520 t
(connection agent, rather than by each individual client program.)8 2620 1 720 5640 t
9 B f
( RECOVERY)1 545(4. ERROR)1 453 2 720 5880 t
10 R f
( the session)2 499( If)1 143( processes.)1 451(A serious disadvantage to the session manager is that is creates new critical)12 3227 4 720 6060 t
( It)1 131( in to the system.)4 729(manager crashes, or if a line manager gets confused, it would be impossible to log)14 3460 3 720 6180 t
(is thus necessary to plan for such occurrences.)7 1901 1 720 6300 t
( needs one essential)3 838( tty line manager)3 719( A)1 145(It is comparatively easy to recover from a line manager crash.)10 2618 4 720 6480 t
( lines are currently in use, and hence which other lines should be enabled)13 3124( which)1 319(piece of information:)2 877 3 720 6600 t
( As)1 178( the session manager.)3 881( accomplish this at line manager startup by having it ``log in'' to)12 2677( We)1 204(for login.)1 380 5 720 6720 t
( does care, the)3 618(part of this dialog, it indicates whether or not it cares about lines currently in use; if it)17 3702 2 720 6840 t
( in)1 120( assigned to that line manager are enabled if not currently)10 2455( Ports)1 280(session manager will send it a list.)6 1465 4 720 6960 t
(use.)720 7080 w
( rarely care which ports are in use; that is)9 1931( They)1 295(Network-based line managers are much simpler.)5 2094 3 720 7260 t
( their login sequence does not request noti\256cation.)7 2065( Thus,)1 291(generally the concern of the transport layer.)6 1790 3 720 7380 t
(- 11 -)2 232 1 2764 7728 t
cleartomark
showpage
restore
%%EndPage: 11 11
%%Page: 12 12
save
mark
12 pagesetup
10 R f
( suggests that)2 563( This)1 248( loss of state.)3 558(In either case, it is possible to kill and restart the line manager without)13 2951 4 720 960 t
( one would handle the)4 922( Typically,)1 476( each system.)2 555(for redundancy, at least two line managers should run on)9 2367 4 720 1080 t
( line managers would be used)5 1249( Additional)1 499(console only, while a second would handle all other tty lines.)10 2572 3 720 1200 t
(for each network type.)3 921 1 720 1320 t
( the session manager crashes, the)5 1474( When)1 327( is more dif\256cult.)3 782(Recovery from a session manager crash)5 1737 4 720 1500 t
10 CW f
(sessctl)720 1620 w
10 R f
( all of the session devices from the physical)8 1838(device is closed, thereby automatically unlinking)5 2024 2 1178 1620 t
( manager is)2 496( are disconnected, but their processes can remain suspended; when the session)11 3308(lines. Users)1 516 3 720 1740 t
( the sole means of access to)6 1175( if the session manager is)5 1072( Unfortunately,)1 656(restarted, reconnection is possible.)3 1417 4 720 1860 t
( a daemon)2 448( crashes can be handled by having)6 1471( Some)1 304(a system, it isn't possible to log in and restart it.)10 2097 4 720 1980 t
( manager, and restart it if necessary; obviously, though, there are many)11 3064(periodically query the session)3 1256 2 720 2100 t
( the best solution is to have a)7 1368( Perhaps)1 404( sort of automated detection.)4 1260(failure modes immune to this)4 1288 4 720 2220 t
(standing network server that will, on request, kill and restart the session manager.)12 3355 1 720 2340 t
7 R f
(6)4075 2300 w
9 B f
( DEVICES WITHOUT SESSION MANAGERS)4 1875(5. SESSION)1 508 2 720 2580 t
10 R f
( can eliminate the)3 791( We)1 224( simpli\256ed version of this mechanism can be used.)8 2242(In some environments, a)3 1063 4 720 2760 t
(session manager and the line managers, and simply change)8 2418 1 720 2880 t
10 CW f
(getty)3171 2880 w
10 R f
(to talk to the session driver.)5 1145 1 3504 2880 t
( a port selector that will connect a user to)9 1770(Assume that all access to the system is via a network, or via)12 2550 2 720 3060 t
( on the system)3 599( further that there are suf\256ciently many ports)7 1851( Assume)1 389(any free port that has DTR enabled.)6 1481 4 720 3180 t
( a serious problem, but that revoking access to the terminal is)11 2722(that a short-term loss of some is not)7 1598 2 720 3300 t
( that case, when)3 682(important. In)1 570 2 720 3420 t
10 CW f
(getty)2012 3420 w
10 R f
( line, it would open the clone driver)7 1524(answers a)1 405 2 2352 3420 t
10 CW f
(/dev/session)4320 3420 w
10 R f
( place on the session)4 913( further login proceedings would take)5 1610( All)1 208(and splice the physical line below it.)6 1589 4 720 3540 t
(device.)720 3660 w
( login shell exiting, and carrier dropping on the physical line.)10 2652( the)1 201(We now have two end conditions:)5 1467 3 720 3840 t
(When the former happens, a new)5 1368 1 720 3960 t
10 CW f
(getty)2123 3960 w
10 R f
( spawned by)2 517(will be)1 285 2 2458 3960 t
10 CW f
(init)3294 3960 w
10 R f
( there are no left-over processes,)5 1340(. If)1 158 2 3542 3960 t
( The)1 223( physical line to be unlinked.)5 1205(the session device will be closed, which in turn will cause the)11 2557 3 720 4080 t
10 CW f
(getty)4740 4080 w
10 R f
( there are left-over processes,)4 1230( If)1 139(can then proceed normally.)3 1131 3 720 4200 t
10 CW f
(getty)3260 4200 w
10 R f
( old session device)3 794(would open the)2 646 2 3600 4200 t
(and manually unlink the physical line; life could then proceed as before.)11 2972 1 720 4320 t
( the login shell does not exit, no new)8 1573( If)1 137( more problematic.)2 783(Carrier drops are)2 699 4 720 4500 t
10 CW f
(getty)3950 4500 w
10 R f
(is spawned; hence)2 752 1 4288 4500 t
(no process issues the)3 883 1 720 4620 t
10 CW f
(I_UNLINK)1644 4620 w
10 R f
( the)1 162(call. However,)1 633 2 2165 4620 t
10 CW f
(M_HANGUP)3000 4620 w
10 R f
(message is detectable by the session)5 1520 1 3520 4620 t
( the line \320 for assorted complex reasons, that cannot be done at interrupt time)14 3327( cannot unlink)2 598(driver. It)1 395 3 720 4740 t
( the physical)2 543( Additionally,)1 609(\320 but it can block output to the physical device from the session device.)13 3168 3 720 4860 t
( drops; thus, the line will not be available for reuse)10 2138(device driver can be modi\256ed to drop DTR if carrier)9 2182 2 720 4980 t
(until it is reopened by some future)6 1419 1 720 5100 t
10 CW f
(getty)2172 5100 w
10 R f
(.)2480 5100 w
( enemy could log in and then)6 1226( An)1 191( of service attacks.)3 775(This simpli\256ed version is very susceptible to denial)7 2128 4 720 5280 t
( provision must be made to detect too many)8 1925( Some)1 308(drop the line, thereby tying up a session device.)8 2087 3 720 5400 t
(session devices being assigned to one user.)6 1765 1 720 5520 t
( modems can be)3 685( Many)1 304( possible to use this version with a modem pool.)9 2045(Despite appearances, it may be)4 1286 4 720 5700 t
( if DTR is low; thus, a disabled line will be skipped by the phone)14 2966(con\256gured to busy out the line)5 1354 2 720 5820 t
(network.)720 5940 w
9 B f
( ON OTHER SYSTEM COMPONENTS)4 1595(6. IMPACT)1 493 2 720 6180 t
10 R f
( the entire)2 427( Obviously,)1 514( other system components.)3 1108(The session driver requires remarkably few changes to)7 2271 4 720 6360 t
( use streams instead of)4 948(implementation depends on the tty subsystem being converted to)8 2689 2 720 6480 t
10 CW f
(clist)4393 6480 w
10 R f
(s. Most)1 339 1 4701 6480 t
(of the changes are to)4 889 1 720 6600 t
10 CW f
(getty)1650 6600 w
10 R f
(and)1991 6600 w
10 CW f
(login)2176 6600 w
10 R f
( minimum, the version of)4 1082( a)1 85(. At)1 199 3 2484 6600 t
10 CW f
(login)3892 6600 w
10 R f
(invoked by)1 464 1 4234 6600 t
10 CW f
(getty)4740 6600 w
10 R f
( likely,)1 286( More)1 282( collecting the login name.)4 1095(must be changed to communicate with the session manager after)9 2657 4 720 6720 t
(we could remove the password-checking code from)6 2229 1 720 6840 t
10 CW f
(login)3002 6840 w
10 R f
(, and let)2 375 1 3310 6840 t
10 CW f
(getty)3738 6840 w
10 R f
(\320 a line manager \320)4 949 1 4091 6840 t
8 S1 f
(__________________)720 7020 w
8 R f
( better solution could be contrived if someone would bring back console bit switches and lights....)15 3201(6. A)1 184 2 720 7140 t
10 R f
(- 12 -)2 232 1 2764 7728 t
cleartomark
showpage
restore
%%EndPage: 12 12
%%Page: 13 13
save
mark
13 pagesetup
10 R f
( knowledge)1 477( is important to perform authentication before discarding)7 2357( It)1 132(invoke an authentication routine.)3 1354 4 720 960 t
(of the physical device.)3 922 1 720 1080 t
10 CW f
(Getty)720 1260 w
10 R f
( First,)1 278( of two ways.)3 571( can be done in either)5 906( That)1 251(also needs to be integrated with a line manager.)8 1979 5 1055 1260 t
(we could write a separate line manager program; it would fork and invoke per-line)13 3529 1 720 1380 t
10 CW f
(getty)4291 1380 w
10 R f
(processes,)4633 1380 w
(much as)1 340 1 720 1500 t
10 CW f
(init)1096 1500 w
10 R f
( we could write a ``super-)5 1082( Alternatively,)1 621(does now.)1 416 3 1372 1500 t
10 CW f
(getty)3491 1500 w
10 R f
('', a program that would have)5 1241 1 3799 1500 t
10 I f
(open)720 1620 w
10 R f
( would only)2 494(\(\) requests outstanding on multiple lines at once, and)8 2184 2 922 1620 t
10 I f
(fork)3633 1620 w
10 R f
(\(\) when the)2 470 1 3802 1620 t
10 I f
(open)4305 1620 w
10 R f
(\(\) succeeded.)1 533 1 4507 1620 t
( cost of greater complexity and)5 1339(This latter approach reduces clutter in the system process table, at the)11 2981 2 720 1740 t
( Super-)1 332(lesser robustness.)1 707 2 720 1860 t
10 CW f
(getty)1759 1860 w
10 R f
(is the only solution if we wish to implement two-way lines.)10 2455 1 2092 1860 t
(If)720 2040 w
10 CW f
(login)831 2040 w
10 R f
(loses its authentication code, and hence becomes unprivileged, the code in)10 3167 1 1176 2040 t
10 CW f
(sh)4389 2040 w
10 R f
(that)4555 2040 w
10 I f
(exec)4751 2040 w
10 R f
(\(\)s)4935 2040 w
10 CW f
(/bin/login)720 2160 w
10 R f
( be done is to disconnect from the current)8 1818( what must)2 481( Conceptually,)1 637(must be changed.)2 738 4 1366 2160 t
( is quite)2 383( It)1 152( to re-enable the line without dropping it \256rst.)8 2088(session, while asking the line manager)5 1697 4 720 2280 t
( thought needs to be)4 869( More)1 290(conceivable that some line managers will not be willing or able to do this.)13 3161 3 720 2400 t
(given to this question.)3 908 1 720 2520 t
( there are)2 390( Currently,)1 476( be converted to talk to the session manager.)8 1852(Existing listener processes will need to)5 1602 4 720 2700 t
( the Datakit)2 576(only two major ones for login sessions, the DKHOST listener for)10 3166 2 720 2820 t
10 S f
(\322)4462 2820 w
10 R f
(VCS and)1 419 1 4621 2820 t
10 CW f
(/usr/net/listen)720 2940 w
10 R f
(when used with STARLAN.)3 1162 1 1653 2940 t
(The)720 3120 w
10 B f
(/dev/tty)919 3120 w
10 R f
( In)1 161(change described earlier is actually independent of the other changes described here.)11 3593 2 1286 3120 t
( added complexity when handling)4 1406(fact, it could be done with the current system, though there would be)12 2914 2 720 3240 t
( those problems are not insurmountable.)5 1684( Still,)1 267( background process.)2 877(end conditions such as an orphaned)5 1492 4 720 3360 t
(Apart from changes to the)4 1110 1 720 3480 t
10 B f
(/dev/tty)1872 3480 w
10 R f
(driver itself, the)2 669 1 2236 3480 t
10 I f
(fork)2947 3480 w
10 R f
( would have to be changed to perform)7 1628(\(\) code)1 296 2 3116 3480 t
(the)720 3600 w
10 I f
(dup)875 3600 w
10 R f
(\(\) operation, and)2 678 1 1033 3600 t
10 I f
(exit)1744 3600 w
10 R f
(\(\) would have to perform an additional)6 1595 1 1896 3600 t
10 I f
(close)3524 3600 w
10 R f
(\(\).)3737 3600 w
( sessions, that)2 593( Under)1 327( the controlling tty.)3 827(The current accounting routine records the device number of)8 2573 4 720 3780 t
( the physical)2 539( If)1 141( head, which has no physical reality.)6 1555(value would be the device number of the session)8 2085 4 720 3900 t
( the other hand, it)4 738( On)1 189( be provided.)2 542(device number is desired there, some mechanism to announce it must)10 2851 4 720 4020 t
( and the)2 332(may not pay to change that; network connections have no true physical device number available,)14 3988 2 720 4140 t
(session device number serves to group together commands from a given session.)11 3311 1 720 4260 t
( to add some new \256elds to the)7 1254(It would be nice)3 670 2 720 4440 t
10 CW f
(utmp)2678 4440 w
10 R f
(structure, to record a link to the physical device or)9 2088 1 2952 4440 t
( If)1 145( may preclude this, however.)4 1237(source host; compatibility considerations)3 1707 3 720 4560 t
10 CW f
(utmp)3855 4560 w
10 R f
(cannot be changed, a)3 899 1 4141 4560 t
( few more type codes for)5 1059( A)1 143( containing this information must be set up.)7 1830(parallel \256le)1 464 4 720 4680 t
10 CW f
(utmp)4254 4680 w
10 R f
(are certainly)1 508 1 4532 4680 t
(needed to indicate disconnected sessions and the like.)7 2197 1 720 4800 t
( are a few programs,)4 924( There)1 316(Use of the session manager will exacerbate an existing incompatibility.)9 3080 3 720 4980 t
( the Korn shell, that use)5 1014(including some versions of)3 1122 2 720 5100 t
10 I f
(getppid)2894 5100 w
10 R f
(\(\) to determine if they are direct children of)8 1838 1 3202 5100 t
10 CW f
(init)720 5220 w
10 R f
( course, the same is true now for children of)9 1838( Of)1 172( this new scheme, almost nothing will be.)7 1721(. Under)1 341 4 968 5220 t
(listener processes.)1 734 1 720 5340 t
9 B f
( DIRECTIONS)1 600(7. FUTURE)1 498 2 720 5580 t
10 R f
( to functionality)2 663(As noted, the ability to bounce back and forth between different sessions is very similar)14 3657 2 720 5760 t
(provided by the)2 649 1 720 5880 t
10 CW f
(sxt)1405 5880 w
10 R f
( by rewriting)2 538(driver. Indeed,)1 628 2 1621 5880 t
10 CW f
(shl)2823 5880 w
10 R f
( new)1 201( The)1 223( the driver entirely.)3 795(we could eliminate)2 782 4 3039 5880 t
10 CW f
(shl)720 6000 w
10 R f
( created.)1 362(command would act as a line manager, and set up a new session for each shell layer)16 3729 2 949 6000 t
(There is some problem with implementing)5 1767 1 720 6120 t
10 CW f
(noloblk)2525 6120 w
10 R f
( disconnected session; one solution is to have)7 1897(in a)1 160 2 2983 6120 t
10 CW f
(shl)720 6240 w
10 R f
( A)1 141( heads, and let it perform the multiplexing at user level.)10 2324(splice a stream pipe to all of its session)8 1640 3 935 6240 t
(better idea might be to install real job control, and discard)10 2391 1 720 6360 t
10 CW f
(shl)3144 6360 w
10 R f
(entirely.)3357 6360 w
( could be used to replace the)6 1268(A similar technique)2 830 2 720 6540 t
10 CW f
(xt)2865 6540 w
10 R f
(driver;)3032 6540 w
10 CW f
(layers)3345 6540 w
10 R f
(could do the multiplexing and)4 1288 1 3752 6540 t
( itself, much as)3 653(handle the line protocol to the DMD)6 1556 2 720 6660 t
10 CW f
(mux)2970 6660 w
10 R f
(in 9th Edition and)3 768 1 3191 6660 t
10 CW f
(mpx)4000 6660 w
10 R f
(in 4.3)1 244 1 4221 6660 t
8 R f
(BSD)4465 6660 w
10 R f
(do. This)1 377 1 4663 6660 t
(would shrink and simplify the kernel, and allow easier modi\256cations to the protocol handler.)13 3803 1 720 6780 t
( the other)2 425( On)1 204( level.)1 268(There is certainly some ef\256ciency loss in having this multiplexing done at user)12 3423 4 720 6960 t
( always been the U)4 799(hand, it has)2 480 2 720 7080 t
8 R f
(NIX)1999 7080 w
10 R f
(system philosophy that the kernel should provide the basic primitives)9 2864 1 2176 7080 t
( is perhaps)2 455( This)1 250(and plumbing, while letting application programs provide the richness and complexity.)10 3615 3 720 7200 t
(best-illustrated by the duplication of code represented by having both)9 2906 1 720 7320 t
10 CW f
(xt)3666 7320 w
10 R f
(and)3826 7320 w
10 CW f
(sxt)4010 7320 w
10 R f
(present in the same)3 810 1 4230 7320 t
(system.)720 7440 w
(- 13 -)2 232 1 2764 7728 t
cleartomark
showpage
restore
%%EndPage: 13 13
%%Page: 14 14
save
mark
14 pagesetup
10 R f
( mechanisms provide several handles to resolve the problem.)8 2512(If ef\256ciency is a major concern, the streams)7 1808 2 720 960 t
(Perhaps the nicest solution for)4 1246 1 720 1080 t
10 CW f
(layers)2000 1080 w
10 R f
(is to adopt)2 435 1 2394 1080 t
10 CW f
(mux)2863 1080 w
10 R f
( tty line discipline into)4 933( move the)2 412( to)1 145('s approach:)1 499 4 3051 1080 t
( only complete lines are passed to user level, thereby avoiding the expense of several)14 3516( Thus,)1 291(the terminal.)1 513 3 720 1200 t
( a ``buffer'' line discipline could delay)6 1636( Alternatively,)1 625(packets and context switches per character typed.)6 2059 3 720 1320 t
( complete packet was received, again reducing the context-)8 2573(characters sent from the terminal until a)6 1747 2 720 1440 t
( to turn itself off if a raw-mode)7 1477( such a line discipline would need)6 1564( \(Obviously,)1 568(switch overhead.)1 711 4 720 1560 t
(application such as)2 776 1 720 1680 t
10 CW f
(vi)1529 1680 w
10 R f
(were running.\))1 595 1 1682 1680 t
( would \(or at least, could\))5 1131( such layer)2 472( each)1 260(Letting each layer be a session has a curious implication:)9 2457 4 720 1860 t
(have a)1 266 1 720 1980 t
10 CW f
(utmp)1020 1980 w
10 R f
( the one hand, it provides a clearer picture of who is)11 2161( On)1 188( is both good and bad.)5 923(entry. This)1 474 4 1294 1980 t
(doing what, and eliminates such oddities as the)7 1980 1 720 2100 t
10 CW f
(relogin)2739 2100 w
10 R f
( the other hand, if each layer)6 1228(command. On)1 614 2 3198 2100 t
(appears to be a true login session, commands that scan)9 2360 1 720 2220 t
10 CW f
(utmp)3125 2220 w
10 R f
( It)1 138(need to be modi\256ed to realize this.)6 1493 2 3409 2220 t
(isn't pleasant to receive six separate copies of a)8 1975 1 720 2340 t
10 CW f
(wall)2730 2340 w
10 R f
( turns out that)3 583( \(It)1 162(message, for example.)2 912 3 3005 2340 t
10 CW f
(wall)4697 2340 w
10 R f
(is)4973 2340 w
( such as)2 340( that are split between a DMD and the host,)9 1853( Programs)1 454(a particularly nasty case.)3 1025 4 720 2460 t
10 CW f
(jim)4429 2460 w
10 R f
(and)4646 2460 w
10 CW f
(cip)4827 2460 w
10 R f
(,)5015 2460 w
( the current scheme on)4 947( Under)1 318( if they receive data that isn't part of their protocol.)10 2153(can get very confused)3 902 4 720 2580 t
( is suf\256ciently incautious as to invoke such a program in the)11 2599(System V, that is only a problem if one)8 1721 2 720 2700 t
( speci\256c problem by modifying)4 1295( can bypass this)3 657( One)1 233(designated login window.)2 1048 4 720 2820 t
10 CW f
(wall)3988 2820 w
10 R f
(to ignore lines that)3 777 1 4263 2820 t
( to like having)3 599( balance, we tend)3 719( On)1 189(are in raw mode; this does not solve the general problem, however.\))11 2813 4 720 2940 t
(each layer appear in)3 823 1 720 3060 t
10 CW f
(utmp)1576 3060 w
10 R f
(, but it is certainly a debatable point.)7 1513 1 1824 3060 t
9 B f
( QUIRKS)1 385(8. IMPLEMENTATION)1 988 2 720 3300 t
10 R f
(The)720 3480 w
10 I f
(Careful Reader)1 643 1 924 3480 t
10 R f
( features \320 stream pipes, named)5 1433(will have noticed that this design uses several)7 1991 2 1616 3480 t
( 3.)1 108( Release)1 351( V)1 105( not appear to be part of System)7 1385(stream pipes, and a stream tty line discipline \320 that do)10 2371 5 720 3600 t
(This perception is somewhat correct in practice, and entirely correct in principle.)11 3311 1 720 3720 t
(The stream tty line discipline is a prototype adapted by others from the STARLAN support.)14 3778 1 720 3900 t
( opening the clone device)4 1080( By)1 190( a strange fashion.)3 771(Stream pipes are currently supported in)5 1642 4 720 4080 t
10 CW f
(/dev/spx)4443 4080 w
10 R f
(, a)1 109 1 4931 4080 t
( create a full stream pipe,)5 1068( To)1 181(process receives half of a stream pipe.)6 1592 3 720 4200 t
10 CW f
(/dev/spx)3598 4200 w
10 R f
(must be opened again,)3 926 1 4114 4200 t
( spliced together via the)4 1022(and the two halves)3 794 2 720 4320 t
10 CW f
(I_FDINSERT)2578 4320 w
10 I f
(ioctl)3220 4320 w
10 R f
( the distributed system, only)4 1199( In)1 158(\(\) call.)1 277 3 3406 4320 t
10 CW f
(root)720 4440 w
10 R f
(may open)1 412 1 1006 4440 t
10 CW f
(/dev/spx)1464 4440 w
10 R f
(. The)1 259 1 1952 4440 t
10 CW f
(/dev/spx)2257 4440 w
10 R f
( be a public interface, and)5 1130(driver is not considered to)4 1127 2 2783 4440 t
( does work today.)3 734( It)1 127(may not be present in this form in future releases of System V.)12 2601 3 720 4560 t
( An)1 196( one creates a stream pipe.)5 1132( First,)1 283(Creating named stream pipes is even more bizarre.)7 2128 4 720 4740 t
10 I f
(fstat)4500 4740 w
10 R f
(\(\) call is)2 359 1 4681 4740 t
( \(Recall)1 364( end of the stream pipe.)5 1027(used to determine the major and minor device numbers used for one)11 2929 3 720 4860 t
( A)1 143( as far as the kernel is concerned.\))7 1447(that these are actual devices)4 1161 3 720 4980 t
10 I f
(mknod)3509 4980 w
10 R f
(\(\) call is then used to create a)7 1257 1 3783 4980 t
(new, named)1 509 1 720 5100 t
10 CW f
(i\261node)1281 5100 w
10 R f
( processes may open this \256lename and)6 1687( Other)1 312(corresponding to that pipe end.)4 1348 3 1693 5100 t
(receive a \256le descriptor equivalent to the original pipe end.)9 2423 1 720 5220 t
( data written by them)4 909( is,)1 131( That)1 255(All processes that open a named stream pipe receive the same pipe end.)12 3025 4 720 5400 t
( unique)1 328( Creating)1 433(may be intermixed, and no identifying information is transmitted to the far end.)12 3559 3 720 5520 t
(connections from the line managers to the session manager is a key problem.)12 3166 1 720 5640 t
( is, each line manager,)4 940( That)1 253(We accomplish this by using the named pipe solely to pass \256le descriptors.)12 3127 3 720 5820 t
( a new stream pipe and passes one end of it to the session manager via the named pipe.)18 3607(at startup, creates)2 713 2 720 5940 t
( facility similar to 4.2)4 948( A)1 151(All further communication takes place on this new pipe.)8 2412 3 720 6060 t
8 R f
(BSD)4231 6060 w
10 R f
('s)4388 6060 w
10 I f
(U)4506 6060 w
8 I f
(NIX)4578 6060 w
10 I f
(-domain)4707 6060 w
(sockets)720 6180 w
10 R f
(would simplify matters.)2 969 1 1041 6180 t
( per-line child)2 594(When a session is starting up, each line manager creates yet another stream pipe for the)15 3726 2 720 6360 t
( separate connection is created)4 1266( This)1 249(process to pass to the session manager via the line manager's pipe.)11 2805 3 720 6480 t
( there is the aforementioned problem of having multiple simultaneous)9 3257( First,)1 319(for two reasons.)2 744 3 720 6600 t
( when)1 264( Second,)1 400(conversations on a single pipe.)4 1321 3 720 6720 t
10 CW f
(I_SENDFD)2753 6720 w
10 R f
( \256le)1 175(is used to pass \256le descriptors, these)6 1584 2 3281 6720 t
( are not)2 363( They)1 295( queue.)1 320(descriptors are sent immediately to the head of the receiving process's read)11 3342 4 720 6840 t
( session manager is)3 828( The)1 231( one.)1 212(associated with any data message, nor are they sent synchronously with)10 3049 4 720 6960 t
( 4.2)1 196( physical line goes with which session.)6 1630(thus incapable of telling which)4 1280 3 720 7080 t
8 R f
(BSD)3826 7080 w
10 R f
('s mechanism for passing)3 1057 1 3983 7080 t
(access rights to a \256le along with some text would alleviate this problem.)12 2980 1 720 7200 t
(- 14 -)2 232 1 2764 7728 t
cleartomark
showpage
restore
%%EndPage: 14 14
%%Page: 15 15
save
mark
15 pagesetup
9 B f
( PROBLEMS)1 535(9. UNSOLVED)1 628 2 720 960 t
10 R f
( it assumes that a shell)5 962( is,)1 129( That)1 253(The current design is very heavily oriented towards login-type sessions.)9 2976 4 720 1140 t
( this is certainly true for login sessions, it is not)10 2062( Although)1 453( of any connection.)3 816(is the desired end-point)3 989 4 720 1260 t
( remote execution request would need very different)7 2149( example, a)2 473( For)1 205(true for some other types of session.)6 1493 4 720 1380 t
( The)1 223( FTAM session would not even use a shell.)8 1804( An)1 190( an interactive request.)3 933(parameters to that shell than)4 1170 5 720 1500 t
( or extended so that the line manager \(or)8 1773(current session manager protocol will have to be redesigned)8 2547 2 720 1620 t
(rather, the program acting as a line manager in this context\) can retain ownership of the session device.)17 4320 1 720 1740 t
(Some possible new designs would make the session manager disappear entirely as a separate program.)14 4207 1 720 1860 t
( of)1 122( effect of a disconnection)4 1060( The)1 226(The issue of subsessions, for layers in particular, needs more thought.)10 2912 4 720 2040 t
( sessions can only be created by)6 1335( Since)1 291(the physical line must be propagated to all subsessions.)8 2295 3 720 2160 t
10 CW f
(root)4676 2160 w
10 R f
(, it)1 116 1 4924 2160 t
( hand, privileged programs are)4 1278(may be suf\256cient to inform the primary session of hangups; on the other)12 3042 2 720 2280 t
( we are using sessions for resource management, we need a way to)12 2818( If)1 138(not, in general, immune to bugs.)5 1364 3 720 2400 t
( session, rather than any subsession; it is certainly reasonable to use a tape)13 3144(bind the resource to the real)5 1176 2 720 2520 t
(drive in a window other than the one it was allocated from.)11 2445 1 720 2640 t
( of the communications channel between the session)7 2185(The biggest wart in the current design is the nature)9 2135 2 720 2820 t
( scheme requires that a large number of \256le descriptors be)10 2471( current)1 324( The)1 230(manager and the line manager.)4 1295 4 720 2940 t
(kept open by the session manager; if each invocation of)9 2302 1 720 3060 t
10 CW f
(layers)3056 3060 w
10 R f
(is in effect a line manager, the session)7 1589 1 3451 3060 t
(manager could exceed the system limit.)5 1621 1 720 3180 t
9 B f
(10. SUMMARY)1 653 1 720 3420 t
10 R f
(The session manager is a single concept that solves several problems:)10 2859 1 720 3600 t
( introduces a strong concept of a session into the U)10 2116(1. It)1 236 2 795 3780 t
8 R f
(NIX)3147 3780 w
10 R f
(system.)3322 3780 w
( session is isolated from all other sessions on the same physical line.)12 2825(2. Each)1 374 2 795 3960 t
( handling of modem control signals can be made reliable, despite ill-behaved user processes.)13 3800(3. The)1 330 2 795 4140 t
( connections and windows can be treated as sessions, if desired.)10 2625(4. Non-login)1 586 2 795 4320 t
9 B f
(11. ACKNOWLEDGEMENTS)1 1233 1 720 4560 t
10 R f
( Paul)1 214( He,)1 210( an early draft of this document.)6 1344(I'd like to thank Steve Albert for reading and commenting on)10 2552 4 720 4740 t
( Mintz, and Ed Whelan gave me several opportunities to explain the entire concept,)13 3564(Lustgarten, Nancy)1 756 2 720 4860 t
( essential parts of it.)4 962(thereby helping me clarify the designs; they also helped me focus on the)12 3358 2 720 4980 t
(Additionally, Dennis Ritchie had a number of useful suggestions.)8 2679 1 720 5100 t
10 B f
(GLOSSARY)2604 5700 w
10 I f
(clone driver)1 508 1 720 5940 t
10 R f
( provides a means to assign a unique minor device to each process)12 2933(A clone driver)2 622 2 1485 5940 t
( a clone device is opened, an idle minor device is selected, and)12 2596( When)1 304(using the driver.)2 670 3 1470 6060 t
(the)1470 6180 w
10 CW f
(i\261node)1644 6180 w
10 R f
( minor device rather than the clone)6 1559(used is modi\256ed to point to this)6 1425 2 2056 6180 t
(device)1470 6300 w
10 CW f
(i\261node)1763 6300 w
10 R f
(.)2131 6300 w
10 I f
(I)720 6480 w
10 S f
(_)753 6480 w
10 I f
(LINK)803 6480 w
10 R f
(An)1470 6480 w
10 CW f
(ioctl)1629 6480 w
10 R f
( a multiplexor driver and a)5 1127(\(\) command used to set up the linkage between)8 1976 2 1937 6480 t
(stream.)1470 6600 w
10 I f
(I)720 6780 w
10 S f
(_)753 6780 w
10 I f
(SENDFD)803 6780 w
10 R f
(An)1470 6780 w
10 CW f
(ioctl)1625 6780 w
10 R f
(\(\) command used to send an open \256le descriptor across a stream pipe.)12 2871 1 1933 6780 t
10 I f
(I)720 6960 w
10 S f
(_)753 6960 w
10 I f
(UNLINK)803 6960 w
10 R f
(An)1470 6960 w
10 CW f
(ioctl)1637 6960 w
10 R f
(\(\) command used to tear down the linkage between a multiplexor driver)11 3095 1 1945 6960 t
(and a stream.)2 545 1 1470 7080 t
10 I f
(listener)720 7260 w
10 R f
(A process that receives and dispatches connection requests arriving via a network.)11 3369 1 1470 7260 t
(- 15 -)2 232 1 2764 7728 t
cleartomark
showpage
restore
%%EndPage: 15 15
%%Page: 16 16
save
mark
16 pagesetup
10 I f
(multiplexor driver)1 747 1 720 960 t
10 R f
(A multiplexor driver is a pseudo-device driver that permits any open stream to be)13 3474 1 1566 960 t
( be used to layer a protocol \320 say, IP \320 on top of a physical)15 2561( can)1 172( It)1 128(linked beneath it.)2 709 4 1470 1080 t
( be implemented as a multiplexor driver, while the Ethernet)9 2578( IP could)2 403(device. Thus,)1 589 3 1470 1200 t
(interface would be a stream to be linked beneath it.)9 2112 1 1470 1320 t
10 I f
(named stream pipe)2 824 1 720 1500 t
10 R f
( with a name in the \256le system that can be opened by other)13 2773(A stream pipe)2 624 2 1643 1500 t
( to a)2 188(processes. Akin)1 673 2 1470 1620 t
10 CW f
(FIFO)2364 1620 w
10 R f
(, but full-duplex.)2 688 1 2612 1620 t
10 I f
(session manager)1 677 1 720 1800 t
10 R f
(See pp. 1-16.)2 543 1 1470 1800 t
10 I f
(stream pipe)1 491 1 720 1980 t
10 R f
( it is)2 219( Thus,)1 306( it is implemented via streams.)5 1337(Similar to an ordinary pipe, except that)6 1694 4 1484 1980 t
( transmit \256le descriptors via)4 1192( stream pipe may be used to)6 1235(full-duplex. A)1 619 3 1470 2100 t
10 CW f
(I_SENDFD)4560 2100 w
10 R f
(and)1470 2220 w
10 CW f
(I_RECVFD)1648 2220 w
10 R f
( feature is)2 413( is possible to push modules onto a stream pipe, but that)11 2338(. It)1 153 3 2136 2220 t
(not used by the session manager.)5 1355 1 1470 2340 t
10 I f
(U)720 2520 w
8 I f
(NIX)792 2520 w
10 I f
(-domain socket)1 643 1 921 2520 t
10 R f
( communication on 4.2)3 1033(A mechanism for intra-machine, inter-process)4 1981 2 1663 2520 t
8 R f
(BSD)4677 2520 w
10 R f
(and)4896 2520 w
(4.3)1470 2640 w
8 R f
(BSD)1595 2640 w
10 R f
( data and access rights)4 956( Both)1 269( in this domain look like \256le names.)7 1553(. Addresses)1 510 4 1752 2640 t
(\320 \256le descriptors \320 may be passed across U)8 1883 1 1470 2760 t
8 R f
(NIX)3353 2760 w
10 R f
(-domain connections.)1 868 1 3495 2760 t
10 I f
(REFERENCES)2574 3360 w
10 R f
( Stream Input-Output System''.)3 1305( ``A)1 208( D.M.)1 248(1. Ritchie,)1 422 4 770 3600 t
10 I f
(AT&T Bell Laboratories Technical Journal)4 1792 1 3024 3600 t
10 R f
(, vol.)1 216 1 4824 3600 t
(63, no. 8, part 2 \(October 1984\), pp. 1897-1910.)8 1989 1 878 3720 t
( Computer Security Center.)3 1156(2. DoD)1 302 2 770 3900 t
10 I f
(DoD Trusted Computer System Evaluation Criteria)5 2164 1 2305 3900 t
10 R f
(, 1983, CSC-)2 563 1 4477 3900 t
(STD-001-83.)878 4020 w
(- 16 -)2 232 1 2764 7728 t
cleartomark
showpage
restore
%%EndPage: 16 16
%%Page: 17 17
save
mark
17 pagesetup
10 R f
(done with aps)2 571 1 720 960 t
(- 17 -)2 232 1 2764 7728 t
cleartomark
showpage
restore
%%EndPage: 17 17
%%Trailer
done
%%Pages: 17