home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 75 6e 69 78 0a 46 72 |.sources|.unix.Fr|
|00000020| 6f 6d 3a 20 62 72 6e 73 | 74 6e 64 40 6e 79 75 2e |om: brns|tnd@nyu.|
|00000030| 65 64 75 20 28 44 61 6e | 20 42 65 72 6e 73 74 65 |edu (Dan| Bernste|
|00000040| 69 6e 29 0a 53 75 62 6a | 65 63 74 3a 20 76 32 35 |in).Subj|ect: v25|
|00000050| 69 31 33 32 3a 20 47 65 | 6e 65 72 61 6c 69 7a 65 |i132: Ge|neralize|
|00000060| 64 20 69 6e 74 65 72 66 | 61 63 65 20 74 6f 20 70 |d interf|ace to p|
|00000070| 73 65 75 64 6f 2d 74 74 | 79 20 64 65 76 69 63 65 |seudo-tt|y device|
|00000080| 73 2c 20 50 61 72 74 30 | 36 2f 30 39 0a 53 65 6e |s, Part0|6/09.Sen|
|00000090| 64 65 72 3a 20 75 6e 69 | 78 2d 73 6f 75 72 63 65 |der: uni|x-source|
|000000a0| 73 2d 6d 6f 64 65 72 61 | 74 6f 72 40 70 61 2e 64 |s-modera|tor@pa.d|
|000000b0| 65 63 2e 63 6f 6d 0a 41 | 70 70 72 6f 76 65 64 3a |ec.com.A|pproved:|
|000000c0| 20 76 69 78 69 65 40 70 | 61 2e 64 65 63 2e 63 6f | vixie@p|a.dec.co|
|000000d0| 6d 0a 0a 53 75 62 6d 69 | 74 74 65 64 2d 42 79 3a |m..Submi|tted-By:|
|000000e0| 20 62 72 6e 73 74 6e 64 | 40 6e 79 75 2e 65 64 75 | brnstnd|@nyu.edu|
|000000f0| 20 28 44 61 6e 20 42 65 | 72 6e 73 74 65 69 6e 29 | (Dan Be|rnstein)|
|00000100| 0a 50 6f 73 74 69 6e 67 | 2d 4e 75 6d 62 65 72 3a |.Posting|-Number:|
|00000110| 20 56 6f 6c 75 6d 65 20 | 32 35 2c 20 49 73 73 75 | Volume |25, Issu|
|00000120| 65 20 31 33 32 0a 41 72 | 63 68 69 76 65 2d 4e 61 |e 132.Ar|chive-Na|
|00000130| 6d 65 3a 20 70 74 79 34 | 2f 70 61 72 74 30 36 0a |me: pty4|/part06.|
|00000140| 0a 23 21 20 2f 62 69 6e | 2f 73 68 0a 23 20 54 68 |.#! /bin|/sh.# Th|
|00000150| 69 73 20 69 73 20 61 20 | 73 68 65 6c 6c 20 61 72 |is is a |shell ar|
|00000160| 63 68 69 76 65 2e 20 20 | 52 65 6d 6f 76 65 20 61 |chive. |Remove a|
|00000170| 6e 79 74 68 69 6e 67 20 | 62 65 66 6f 72 65 20 74 |nything |before t|
|00000180| 68 69 73 20 6c 69 6e 65 | 2c 20 74 68 65 6e 20 75 |his line|, then u|
|00000190| 6e 70 61 63 6b 0a 23 20 | 69 74 20 62 79 20 73 61 |npack.# |it by sa|
|000001a0| 76 69 6e 67 20 69 74 20 | 69 6e 74 6f 20 61 20 66 |ving it |into a f|
|000001b0| 69 6c 65 20 61 6e 64 20 | 74 79 70 69 6e 67 20 22 |ile and |typing "|
|000001c0| 73 68 20 66 69 6c 65 22 | 2e 20 20 54 6f 20 6f 76 |sh file"|. To ov|
|000001d0| 65 72 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |erwrite |existing|
|000001e0| 0a 23 20 66 69 6c 65 73 | 2c 20 74 79 70 65 20 22 |.# files|, type "|
|000001f0| 73 68 20 66 69 6c 65 20 | 2d 63 22 2e 20 20 59 6f |sh file |-c". Yo|
|00000200| 75 20 63 61 6e 20 61 6c | 73 6f 20 66 65 65 64 20 |u can al|so feed |
|00000210| 74 68 69 73 20 61 73 20 | 73 74 61 6e 64 61 72 64 |this as |standard|
|00000220| 20 69 6e 70 75 74 20 76 | 69 61 0a 23 20 75 6e 73 | input v|ia.# uns|
|00000230| 68 61 72 2c 20 6f 72 20 | 62 79 20 74 79 70 69 6e |har, or |by typin|
|00000240| 67 20 22 73 68 20 3c 66 | 69 6c 65 22 2c 20 65 2e |g "sh <f|ile", e.|
|00000250| 67 2e 2e 20 20 49 66 20 | 74 68 69 73 20 61 72 63 |g.. If |this arc|
|00000260| 68 69 76 65 20 69 73 20 | 63 6f 6d 70 6c 65 74 65 |hive is |complete|
|00000270| 2c 20 79 6f 75 0a 23 20 | 77 69 6c 6c 20 73 65 65 |, you.# |will see|
|00000280| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 6d | the fol|lowing m|
|00000290| 65 73 73 61 67 65 20 61 | 74 20 74 68 65 20 65 6e |essage a|t the en|
|000002a0| 64 3a 0a 23 09 09 22 45 | 6e 64 20 6f 66 20 61 72 |d:.#.."E|nd of ar|
|000002b0| 63 68 69 76 65 20 36 20 | 28 6f 66 20 39 29 2e 22 |chive 6 |(of 9)."|
|000002c0| 0a 23 20 43 6f 6e 74 65 | 6e 74 73 3a 20 20 43 41 |.# Conte|nts: CA|
|000002d0| 4c 4c 53 20 43 54 54 59 | 53 2e 64 72 61 66 74 31 |LLS CTTY|S.draft1|
|000002e0| 20 4d 61 6b 65 66 69 6c | 65 20 70 74 79 2d 6f 70 | Makefil|e pty-op|
|000002f0| 74 73 2e 31 20 70 74 79 | 74 74 79 2e 63 20 73 69 |ts.1 pty|tty.c si|
|00000300| 67 73 63 68 65 64 2e 33 | 0a 23 20 57 72 61 70 70 |gsched.3|.# Wrapp|
|00000310| 65 64 20 62 79 20 76 69 | 78 69 65 40 63 6f 67 6e |ed by vi|xie@cogn|
|00000320| 69 74 69 6f 6e 2e 70 61 | 2e 64 65 63 2e 63 6f 6d |ition.pa|.dec.com|
|00000330| 20 6f 6e 20 57 65 64 20 | 46 65 62 20 31 39 20 31 | on Wed |Feb 19 1|
|00000340| 33 3a 33 35 3a 30 35 20 | 31 39 39 32 0a 50 41 54 |3:35:05 |1992.PAT|
|00000350| 48 3d 2f 62 69 6e 3a 2f | 75 73 72 2f 62 69 6e 3a |H=/bin:/|usr/bin:|
|00000360| 2f 75 73 72 2f 75 63 62 | 20 3b 20 65 78 70 6f 72 |/usr/ucb| ; expor|
|00000370| 74 20 50 41 54 48 0a 69 | 66 20 74 65 73 74 20 2d |t PATH.i|f test -|
|00000380| 66 20 27 43 41 4c 4c 53 | 27 20 2d 61 20 22 24 7b |f 'CALLS|' -a "${|
|00000390| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|000003a0| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|000003b0| 20 57 69 6c 6c 20 6e 6f | 74 20 63 6c 6f 62 62 65 | Will no|t clobbe|
|000003c0| 72 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |r existi|ng file |
|000003d0| 5c 22 27 43 41 4c 4c 53 | 27 5c 22 0a 65 6c 73 65 |\"'CALLS|'\".else|
|000003e0| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 45 78 74 72 |.echo sh|ar: Extr|
|000003f0| 61 63 74 69 6e 67 20 5c | 22 27 43 41 4c 4c 53 27 |acting \|"'CALLS'|
|00000400| 5c 22 20 5c 28 39 34 37 | 37 20 63 68 61 72 61 63 |\" \(947|7 charac|
|00000410| 74 65 72 73 5c 29 0a 73 | 65 64 20 22 73 2f 5e 58 |ters\).s|ed "s/^X|
|00000420| 2f 2f 22 20 3e 27 43 41 | 4c 4c 53 27 20 3c 3c 27 |//" >'CA|LLS' <<'|
|00000430| 45 4e 44 5f 4f 46 5f 46 | 49 4c 45 27 0a 70 74 79 |END_OF_F|ILE'.pty|
|00000440| 20 75 73 65 73 20 61 20 | 62 75 6e 63 68 20 6f 66 | uses a |bunch of|
|00000450| 20 73 79 73 63 61 6c 6c | 73 20 28 34 32 20 61 74 | syscall|s (42 at|
|00000460| 20 6c 61 73 74 20 63 6f | 75 6e 74 29 20 61 6e 64 | last co|unt) and|
|00000470| 20 6c 69 62 72 61 72 79 | 20 72 6f 75 74 69 6e 65 | library| routine|
|00000480| 73 2e 0a 43 61 6c 6c 73 | 20 6d 61 72 6b 65 64 20 |s..Calls| marked |
|00000490| 77 69 74 68 20 2a 20 61 | 72 65 20 42 53 44 2d 6f |with * a|re BSD-o|
|000004a0| 6e 6c 79 20 6f 72 20 6f | 74 68 65 72 77 69 73 65 |nly or o|therwise|
|000004b0| 20 6e 6f 74 20 61 76 61 | 69 6c 61 62 6c 65 20 6f | not ava|ilable o|
|000004c0| 6e 20 61 6c 6c 20 55 4e | 49 58 0a 73 79 73 74 65 |n all UN|IX.syste|
|000004d0| 6d 73 2e 20 43 61 6c 6c | 73 20 6d 61 72 6b 65 64 |ms. Call|s marked|
|000004e0| 20 77 69 74 68 20 2b 20 | 61 72 65 20 77 69 64 65 | with + |are wide|
|000004f0| 6c 79 20 61 76 61 69 6c | 61 62 6c 65 20 62 75 74 |ly avail|able but|
|00000500| 20 68 61 76 65 20 64 69 | 66 66 65 72 65 6e 74 0a | have di|fferent.|
|00000510| 62 65 68 61 76 69 6f 72 | 20 6f 6e 20 64 69 66 66 |behavior| on diff|
|00000520| 65 72 65 6e 74 20 73 79 | 73 74 65 6d 73 2d 2d 2d |erent sy|stems---|
|00000530| 62 65 68 61 76 69 6f 72 | 20 64 69 66 66 65 72 65 |behavior| differe|
|00000540| 6e 74 20 65 6e 6f 75 67 | 68 20 74 68 61 74 20 70 |nt enoug|h that p|
|00000550| 74 79 20 6d 69 67 68 74 | 0a 6e 6f 74 20 77 6f 72 |ty might|.not wor|
|00000560| 6b 2e 0a 58 0a 58 5f 65 | 78 69 74 3a 20 75 73 65 |k..X.X_e|xit: use|
|00000570| 64 20 69 6e 20 70 74 79 | 65 72 72 2e 63 20 66 6f |d in pty|err.c fo|
|00000580| 72 20 61 6c 6d 6f 73 74 | 20 61 6c 6c 20 65 78 69 |r almost| all exi|
|00000590| 74 73 2e 20 4e 6f 74 65 | 20 74 68 61 74 20 70 74 |ts. Note| that pt|
|000005a0| 79 20 64 6f 65 73 20 6e | 6f 74 20 75 73 65 0a 58 |y does n|ot use.X|
|000005b0| 09 73 74 64 69 6f 20 69 | 6e 20 61 6e 79 20 77 61 |.stdio i|n any wa|
|000005c0| 79 2e 0a 58 2a 61 63 63 | 65 70 74 3a 20 75 73 65 |y..X*acc|ept: use|
|000005d0| 64 20 69 6e 20 70 74 79 | 63 6f 6d 6d 2e 63 60 63 |d in pty|comm.c`c|
|000005e0| 6f 6d 6d 5f 61 63 63 65 | 70 74 2c 20 74 6f 20 61 |omm_acce|pt, to a|
|000005f0| 63 63 65 70 74 20 61 20 | 63 6f 6e 6e 65 63 74 69 |ccept a |connecti|
|00000600| 6f 6e 20 66 6f 72 20 74 | 68 65 0a 58 09 6d 61 73 |on for t|he.X.mas|
|00000610| 74 65 72 20 6f 6e 20 61 | 20 64 65 73 63 72 69 70 |ter on a| descrip|
|00000620| 74 6f 72 20 63 72 65 61 | 74 65 64 20 62 79 20 63 |tor crea|ted by c|
|00000630| 6f 6d 6d 5f 72 65 61 64 | 0a 61 63 63 65 73 73 3a |omm_read|.access:|
|00000640| 20 75 73 65 64 20 77 69 | 74 68 20 46 5f 4f 4b 20 | used wi|th F_OK |
|00000650| 69 6e 20 70 74 79 67 65 | 74 2e 63 20 74 6f 20 63 |in ptyge|t.c to c|
|00000660| 68 65 63 6b 20 69 66 20 | 61 20 70 74 79 20 62 61 |heck if |a pty ba|
|00000670| 6e 6b 20 28 65 2e 67 2e | 2c 20 74 74 79 71 2a 29 |nk (e.g.|, ttyq*)|
|00000680| 0a 58 09 65 78 69 73 74 | 73 0a 58 2a 62 69 6e 64 |.X.exist|s.X*bind|
|00000690| 3a 20 75 73 65 64 20 69 | 6e 20 70 74 79 63 6f 6d |: used i|n ptycom|
|000006a0| 6d 2e 63 60 63 6f 6d 6d | 5f 72 65 61 64 20 74 6f |m.c`comm|_read to|
|000006b0| 20 63 72 65 61 74 65 20 | 74 68 65 20 6d 61 73 74 | create |the mast|
|000006c0| 65 72 27 73 20 63 6f 6d | 6d 20 73 6f 63 6b 65 74 |er's com|m socket|
|000006d0| 0a 58 2a 62 7a 65 72 6f | 3a 20 75 73 65 64 20 69 |.X*bzero|: used i|
|000006e0| 6e 73 69 64 65 20 74 68 | 65 20 73 79 73 74 65 6d |nside th|e system|
|000006f0| 27 73 20 46 44 5f 5a 45 | 52 4f 20 6d 61 63 72 6f |'s FD_ZE|RO macro|
|00000700| 20 62 65 66 6f 72 65 20 | 73 65 6c 65 63 74 0a 63 | before |select.c|
|00000710| 68 64 69 72 3a 20 75 73 | 65 64 20 6f 6e 63 65 20 |hdir: us|ed once |
|00000720| 69 6e 20 74 68 65 20 6d | 61 73 74 65 72 20 61 6e |in the m|aster an|
|00000730| 64 20 6f 6e 63 65 20 69 | 6e 20 74 68 65 20 73 69 |d once i|n the si|
|00000740| 67 6c 65 72 2c 20 62 6f | 74 68 20 74 69 6d 65 73 |gler, bo|th times|
|00000750| 20 69 6e 0a 58 09 70 74 | 79 6d 61 69 6e 2e 63 2c | in.X.pt|ymain.c,|
|00000760| 20 74 6f 20 73 77 69 74 | 63 68 20 70 65 72 6d 61 | to swit|ch perma|
|00000770| 6e 65 6e 74 6c 79 20 74 | 6f 20 50 54 59 44 49 52 |nently t|o PTYDIR|
|00000780| 2e 0a 63 6c 6f 73 65 3a | 20 75 73 65 64 20 74 68 |..close:| used th|
|00000790| 72 6f 75 67 68 6f 75 74 | 20 74 68 65 20 70 72 6f |roughout| the pro|
|000007a0| 67 72 61 6d 20 74 6f 20 | 67 65 74 20 72 69 64 20 |gram to |get rid |
|000007b0| 6f 66 20 61 20 66 69 6c | 65 20 64 65 73 63 72 69 |of a fil|e descri|
|000007c0| 70 74 6f 72 2e 0a 58 09 | 4e 6f 74 65 20 74 68 61 |ptor..X.|Note tha|
|000007d0| 74 20 74 68 65 20 72 65 | 74 75 72 6e 20 76 61 6c |t the re|turn val|
|000007e0| 75 65 20 66 72 6f 6d 20 | 63 6c 6f 73 65 20 69 73 |ue from |close is|
|000007f0| 20 6e 6f 74 20 63 68 65 | 63 6b 65 64 2d 2d 2d 74 | not che|cked---t|
|00000800| 68 65 72 65 27 73 0a 58 | 09 61 62 73 6f 6c 75 74 |here's.X|.absolut|
|00000810| 65 6c 79 20 6e 6f 20 77 | 61 79 20 70 74 79 20 63 |ely no w|ay pty c|
|00000820| 6f 75 6c 64 20 64 6f 20 | 61 6e 79 74 68 69 6e 67 |ould do |anything|
|00000830| 20 61 62 6f 75 74 20 74 | 68 65 20 64 65 73 63 72 | about t|he descr|
|00000840| 69 70 74 6f 72 20 69 6e | 0a 58 09 63 61 73 65 20 |iptor in|.X.case |
|00000850| 6f 66 20 61 6e 20 65 72 | 72 6f 72 2c 20 61 6e 64 |of an er|ror, and|
|00000860| 20 69 74 27 73 20 66 61 | 72 20 6d 6f 72 65 20 69 | it's fa|r more i|
|00000870| 6d 70 6f 72 74 61 6e 74 | 20 74 68 61 74 20 74 68 |mportant| that th|
|00000880| 65 0a 58 09 64 65 73 63 | 72 69 70 74 6f 72 20 62 |e.X.desc|riptor b|
|00000890| 65 20 66 72 65 65 64 20 | 75 70 20 74 68 61 6e 20 |e freed |up than |
|000008a0| 74 68 61 74 20 4e 46 53 | 27 73 20 70 65 72 76 65 |that NFS|'s perve|
|000008b0| 72 74 65 64 20 69 64 65 | 61 20 6f 66 20 55 4e 49 |rted ide|a of UNI|
|000008c0| 58 0a 58 09 49 2f 4f 20 | 62 65 20 64 65 61 6c 74 |X.X.I/O |be dealt|
|000008d0| 20 77 69 74 68 2e 0a 58 | 2a 63 6f 6e 6e 65 63 74 | with..X|*connect|
|000008e0| 3a 20 75 73 65 64 20 69 | 6e 20 70 74 79 63 6f 6d |: used i|n ptycom|
|000008f0| 6d 2e 63 60 63 6f 6d 6d | 5f 77 72 69 74 65 20 74 |m.c`comm|_write t|
|00000900| 6f 20 63 6f 6e 6e 65 63 | 74 20 74 6f 20 61 20 72 |o connec|t to a r|
|00000910| 75 6e 6e 69 6e 67 20 6d | 61 73 74 65 72 0a 64 75 |unning m|aster.du|
|00000920| 70 3a 20 75 73 65 64 20 | 28 31 29 20 69 6e 20 70 |p: used |(1) in p|
|00000930| 74 79 74 74 79 2e 63 20 | 74 6f 20 74 72 79 20 74 |tytty.c |to try t|
|00000940| 6f 20 66 69 6e 64 20 74 | 68 65 20 63 6f 6e 74 72 |o find t|he contr|
|00000950| 6f 6c 6c 69 6e 67 20 74 | 74 79 20 64 65 73 63 72 |olling t|ty descr|
|00000960| 69 70 74 6f 72 3b 0a 58 | 09 28 32 29 20 69 6e 20 |iptor;.X|.(2) in |
|00000970| 70 74 79 73 6c 61 76 65 | 2e 63 20 74 6f 20 6d 6f |ptyslave|.c to mo|
|00000980| 76 65 20 74 68 65 20 2f | 64 65 76 2f 74 74 79 78 |ve the /|dev/ttyx|
|00000990| 78 20 64 65 73 63 72 69 | 70 74 6f 72 20 74 6f 20 |x descri|ptor to |
|000009a0| 30 2f 31 2f 32 3b 0a 58 | 09 28 33 29 20 69 6e 20 |0/1/2;.X|.(3) in |
|000009b0| 70 74 79 73 65 63 75 72 | 65 2e 63 20 74 6f 20 73 |ptysecur|e.c to s|
|000009c0| 65 74 20 75 70 20 64 65 | 73 63 72 69 70 74 6f 72 |et up de|scriptor|
|000009d0| 73 20 66 6f 72 20 2f 62 | 69 6e 2f 70 73 0a 58 2a |s for /b|in/ps.X*|
|000009e0| 64 75 70 32 3a 20 75 73 | 65 64 20 69 6e 20 70 74 |dup2: us|ed in pt|
|000009f0| 79 6d 69 73 63 2e 63 20 | 74 6f 20 6d 6f 76 65 20 |ymisc.c |to move |
|00000a00| 61 20 2f 64 65 76 2f 6e | 75 6c 6c 20 64 65 73 63 |a /dev/n|ull desc|
|00000a10| 72 69 70 74 6f 72 20 61 | 72 6f 75 6e 64 0a 65 78 |riptor a|round.ex|
|00000a20| 65 63 76 65 3a 20 75 73 | 65 64 20 69 6e 20 70 74 |ecve: us|ed in pt|
|00000a30| 79 73 65 63 75 72 65 2e | 63 20 74 6f 20 69 6e 76 |ysecure.|c to inv|
|00000a40| 6f 6b 65 20 2f 62 69 6e | 2f 70 73 0a 65 78 65 63 |oke /bin|/ps.exec|
|00000a50| 76 70 3a 20 75 73 65 64 | 20 69 6e 20 70 74 79 73 |vp: used| in ptys|
|00000a60| 6c 61 76 65 2e 63 20 74 | 6f 20 69 6e 76 6f 6b 65 |lave.c t|o invoke|
|00000a70| 20 74 68 65 20 75 73 65 | 72 27 73 20 70 72 6f 67 | the use|r's prog|
|00000a80| 72 61 6d 2c 20 61 66 74 | 65 72 20 73 65 74 72 65 |ram, aft|er setre|
|00000a90| 75 69 64 0a 58 2a 66 63 | 68 6d 6f 64 3a 20 75 73 |uid.X*fc|hmod: us|
|00000aa0| 65 64 20 69 6e 20 70 74 | 79 73 65 63 75 72 65 2e |ed in pt|ysecure.|
|00000ab0| 63 20 75 70 6f 6e 20 61 | 20 73 6c 61 76 65 20 74 |c upon a| slave t|
|00000ac0| 74 79 20 64 65 73 63 72 | 69 70 74 6f 72 0a 58 2b |ty descr|iptor.X+|
|00000ad0| 66 63 6e 74 6c 3a 20 75 | 73 65 64 20 77 69 74 68 |fcntl: u|sed with|
|00000ae0| 20 46 5f 47 45 54 46 4c | 20 69 6e 20 70 74 79 6d | F_GETFL| in ptym|
|00000af0| 69 73 63 2e 63 20 28 61 | 6e 64 20 73 69 67 73 63 |isc.c (a|nd sigsc|
|00000b00| 68 65 64 2e 63 29 20 74 | 6f 20 73 65 65 20 69 66 |hed.c) t|o see if|
|00000b10| 20 61 0a 58 09 64 65 73 | 63 72 69 70 74 6f 72 20 | a.X.des|criptor |
|00000b20| 69 73 20 6f 70 65 6e 0a | 66 6c 6f 63 6b 3a 20 75 |is open.|flock: u|
|00000b30| 73 65 64 20 69 6e 20 70 | 74 79 6d 69 73 63 2e 63 |sed in p|tymisc.c|
|00000b40| 20 66 6f 72 20 67 65 6e | 65 72 69 63 20 6c 6f 63 | for gen|eric loc|
|00000b50| 6b 69 6e 67 20 72 6f 75 | 74 69 6e 65 20 28 75 73 |king rou|tine (us|
|00000b60| 65 64 20 6f 6e 20 6c 6f | 67 20 66 69 6c 65 73 29 |ed on lo|g files)|
|00000b70| 0a 66 6f 72 6b 3a 20 75 | 73 65 64 20 69 6e 20 70 |.fork: u|sed in p|
|00000b80| 74 79 6d 61 69 6e 2e 63 | 20 28 74 77 69 63 65 29 |tymain.c| (twice)|
|00000b90| 20 74 6f 20 63 72 65 61 | 74 65 20 6d 61 73 74 65 | to crea|te maste|
|00000ba0| 72 20 61 6e 64 20 73 6c | 61 76 65 20 70 72 6f 63 |r and sl|ave proc|
|00000bb0| 65 73 73 65 73 3b 0a 58 | 09 75 73 65 64 20 69 6e |esses;.X|.used in|
|00000bc0| 20 70 74 79 73 65 63 75 | 72 65 2e 63 20 74 6f 20 | ptysecu|re.c to |
|00000bd0| 69 6e 76 6f 6b 65 20 2f | 62 69 6e 2f 70 73 20 66 |invoke /|bin/ps f|
|00000be0| 6f 72 20 73 65 63 75 72 | 69 74 79 20 63 68 65 63 |or secur|ity chec|
|00000bf0| 6b 0a 66 72 65 65 3a 20 | 75 73 65 64 20 69 6e 20 |k.free: |used in |
|00000c00| 72 61 6c 6c 6f 63 2e 63 | 60 72 66 72 65 65 0a 58 |ralloc.c|`rfree.X|
|00000c10| 2a 66 73 74 61 74 3a 20 | 75 73 65 64 20 69 6e 20 |*fstat: |used in |
|00000c20| 70 74 79 73 65 63 75 72 | 65 2e 63 20 75 70 6f 6e |ptysecur|e.c upon|
|00000c30| 20 61 20 73 6c 61 76 65 | 20 74 74 79 20 64 65 73 | a slave| tty des|
|00000c40| 63 72 69 70 74 6f 72 0a | 58 2a 67 65 74 64 74 61 |criptor.|X*getdta|
|00000c50| 62 6c 65 73 69 7a 65 3a | 20 75 73 65 64 20 69 6e |blesize:| used in|
|00000c60| 20 73 6c 61 76 65 20 75 | 6e 64 65 72 20 2d 45 20 | slave u|nder -E |
|00000c70| 74 6f 20 63 6c 6f 73 65 | 20 61 6c 6c 20 6f 70 65 |to close| all ope|
|00000c80| 6e 20 64 65 73 63 72 69 | 70 74 6f 72 73 3b 0a 58 |n descri|ptors;.X|
|00000c90| 09 75 73 65 64 20 69 6e | 20 70 74 79 6d 61 73 74 |.used in| ptymast|
|00000ca0| 65 72 2e 63 60 63 6c 6f | 73 65 61 6c 6c 62 75 74 |er.c`clo|seallbut|
|00000cb0| 20 28 77 68 69 63 68 20 | 69 73 20 61 20 72 6f 79 | (which |is a roy|
|00000cc0| 61 6c 20 6b 6c 75 64 67 | 65 29 0a 58 2a 67 65 74 |al kludg|e).X*get|
|00000cd0| 70 67 72 70 3a 20 75 73 | 65 64 20 69 6e 20 70 74 |pgrp: us|ed in pt|
|00000ce0| 79 74 74 79 2e 63 60 66 | 6f 72 63 65 5f 66 67 20 |ytty.c`f|orce_fg |
|00000cf0| 74 6f 20 70 6c 75 67 20 | 69 6e 74 6f 20 54 49 4f |to plug |into TIO|
|00000d00| 43 53 50 47 52 50 3b 20 | 75 73 65 64 20 69 6e 0a |CSPGRP; |used in.|
|00000d10| 58 09 70 74 79 6d 61 73 | 74 65 72 2e 63 60 63 6f |X.ptymas|ter.c`co|
|00000d20| 6e 74 63 68 69 6c 64 20 | 69 6e 20 70 72 65 70 61 |ntchild |in prepa|
|00000d30| 72 61 74 69 6f 6e 20 66 | 6f 72 20 6b 69 6c 6c 70 |ration f|or killp|
|00000d40| 67 0a 67 65 74 70 69 64 | 3a 20 75 73 65 64 20 28 |g.getpid|: used (|
|00000d50| 31 29 20 69 6e 20 74 68 | 65 20 6d 61 73 74 65 72 |1) in th|e master|
|00000d60| 20 74 6f 20 66 69 6c 6c | 20 69 6e 20 61 20 73 65 | to fill| in a se|
|00000d70| 73 73 6c 6f 67 20 73 74 | 72 75 63 74 75 72 65 3b |sslog st|ructure;|
|00000d80| 20 28 32 29 20 69 6e 0a | 58 09 70 74 79 74 74 79 | (2) in.|X.ptytty|
|00000d90| 2e 63 60 66 6f 72 63 65 | 5f 66 67 20 74 6f 20 70 |.c`force|_fg to p|
|00000da0| 6c 75 67 20 69 6e 74 6f | 20 67 65 74 70 67 72 70 |lug into| getpgrp|
|00000db0| 3b 20 28 33 29 20 69 6e | 20 74 68 65 20 73 69 67 |; (3) in| the sig|
|00000dc0| 6e 61 6c 6c 65 72 20 74 | 6f 0a 58 09 73 65 6e 64 |naller t|o.X.send|
|00000dd0| 20 61 20 57 49 4e 43 48 | 20 74 6f 20 69 74 73 65 | a WINCH| to itse|
|00000de0| 6c 66 20 61 66 74 65 72 | 20 72 65 63 6f 6e 6e 65 |lf after| reconne|
|00000df0| 63 74 3b 20 28 34 29 20 | 69 6e 20 74 68 65 20 73 |ct; (4) |in the s|
|00000e00| 6c 61 76 65 20 74 6f 20 | 73 65 74 0a 58 09 69 74 |lave to |set.X.it|
|00000e10| 73 20 70 67 72 70 20 62 | 65 66 6f 72 65 20 65 78 |s pgrp b|efore ex|
|00000e20| 65 63 3b 20 28 35 29 20 | 69 6e 20 74 68 65 20 73 |ec; (5) |in the s|
|00000e30| 6c 61 76 65 20 74 6f 20 | 70 61 73 73 20 74 6f 20 |lave to |pass to |
|00000e40| 74 63 74 70 67 72 70 3b | 20 28 36 29 0a 58 09 74 |tctpgrp;| (6).X.t|
|00000e50| 6f 20 73 65 74 20 75 70 | 20 6e 75 6d 62 65 72 73 |o set up| numbers|
|00000e60| 20 66 6f 72 20 72 61 6e | 64 6f 6d 20 74 74 79 20 | for ran|dom tty |
|00000e70| 73 65 61 72 63 68 69 6e | 67 3b 20 28 37 29 20 69 |searchin|g; (7) i|
|00000e80| 6e 20 74 68 65 20 6d 61 | 73 74 65 72 2c 0a 58 09 |n the ma|ster,.X.|
|00000e90| 77 68 65 6e 20 66 64 63 | 74 72 6c 72 20 61 73 6b |when fdc|trlr ask|
|00000ea0| 73 20 66 6f 72 20 69 74 | 73 20 70 69 64 3b 20 28 |s for it|s pid; (|
|00000eb0| 38 29 20 69 6e 20 73 69 | 67 64 66 6c 2e 63 20 74 |8) in si|gdfl.c t|
|00000ec0| 6f 20 73 65 6e 64 20 61 | 20 73 69 67 6e 61 6c 0a |o send a| signal.|
|00000ed0| 58 09 74 6f 20 69 74 73 | 65 6c 66 3b 20 28 39 29 |X.to its|elf; (9)|
|00000ee0| 20 69 6e 20 70 74 79 73 | 65 63 75 72 65 2e 63 20 | in ptys|ecure.c |
|00000ef0| 66 6f 72 20 76 61 72 69 | 6f 75 73 20 70 75 72 70 |for vari|ous purp|
|00000f00| 6f 73 65 73 2e 0a 58 2a | 67 65 74 70 77 6e 61 6d |oses..X*|getpwnam|
|00000f10| 3a 20 75 73 65 64 20 6f | 6e 6c 79 20 69 6e 20 75 |: used o|nly in u|
|00000f20| 73 65 72 6e 61 6d 65 2e | 63 0a 58 2a 67 65 74 70 |sername.|c.X*getp|
|00000f30| 77 75 69 64 3a 20 75 73 | 65 64 20 6f 6e 6c 79 20 |wuid: us|ed only |
|00000f40| 69 6e 20 75 73 65 72 6e | 61 6d 65 2e 63 0a 58 2a |in usern|ame.c.X*|
|00000f50| 67 65 74 65 75 69 64 3a | 20 75 73 65 64 20 69 6e |geteuid:| used in|
|00000f60| 20 70 74 79 73 65 63 75 | 72 65 2e 63 20 61 73 20 | ptysecu|re.c as |
|00000f70| 61 20 73 65 63 75 72 65 | 20 70 73 65 75 64 6f 2d |a secure| pseudo-|
|00000f80| 74 74 79 20 6f 77 6e 65 | 72 0a 67 65 74 75 69 64 |tty owne|r.getuid|
|00000f90| 3a 20 75 73 65 64 20 6f | 6e 63 65 20 69 6e 20 70 |: used o|nce in p|
|00000fa0| 74 79 74 74 79 2e 63 20 | 74 6f 20 69 6e 69 74 69 |tytty.c |to initi|
|00000fb0| 61 6c 69 7a 65 20 61 20 | 75 69 64 20 76 61 72 69 |alize a |uid vari|
|00000fc0| 61 62 6c 65 0a 58 2b 69 | 6f 63 74 6c 3a 20 75 73 |able.X+i|octl: us|
|00000fd0| 65 64 20 69 6e 20 70 74 | 79 74 74 79 2e 63 60 69 |ed in pt|ytty.c`i|
|00000fe0| 6f 63 20 74 6f 20 63 6f | 6e 74 72 6f 6c 20 61 20 |oc to co|ntrol a |
|00000ff0| 74 74 79 20 64 65 73 63 | 72 69 70 74 6f 72 3b 20 |tty desc|riptor; |
|00001000| 61 62 6f 75 74 20 74 77 | 6f 0a 58 09 64 6f 7a 65 |about tw|o.X.doze|
|00001010| 6e 20 42 53 44 2d 73 70 | 65 63 69 66 69 63 20 69 |n BSD-sp|ecific i|
|00001020| 6f 63 74 6c 73 20 61 72 | 65 20 75 73 65 64 20 69 |octls ar|e used i|
|00001030| 6e 20 70 74 79 74 74 79 | 2e 63 0a 58 2b 6b 69 6c |n ptytty|.c.X+kil|
|00001040| 6c 3a 20 75 73 65 64 20 | 28 31 29 20 69 6e 20 74 |l: used |(1) in t|
|00001050| 68 65 20 6d 61 73 74 65 | 72 20 74 6f 20 74 65 6c |he maste|r to tel|
|00001060| 6c 20 74 68 65 20 63 68 | 69 6c 64 20 74 6f 20 63 |l the ch|ild to c|
|00001070| 6f 6e 74 69 6e 75 65 20 | 61 66 74 65 72 20 74 68 |ontinue |after th|
|00001080| 65 0a 58 09 73 69 67 6c | 65 72 20 73 61 79 73 20 |e.X.sigl|er says |
|00001090| 73 6f 3b 20 28 32 29 20 | 69 6e 20 74 68 65 20 73 |so; (2) |in the s|
|000010a0| 69 67 6c 65 72 20 74 6f | 20 74 65 6c 6c 20 69 74 |igler to| tell it|
|000010b0| 73 65 6c 66 20 74 6f 20 | 57 49 4e 43 48 20 61 66 |self to |WINCH af|
|000010c0| 74 65 72 0a 58 09 61 20 | 72 65 63 6f 6e 6e 65 63 |ter.X.a |reconnec|
|000010d0| 74 3b 20 28 33 29 20 69 | 6e 20 73 69 67 64 66 6c |t; (3) i|n sigdfl|
|000010e0| 2e 63 20 74 6f 20 73 65 | 6e 64 20 61 20 73 69 67 |.c to se|nd a sig|
|000010f0| 6e 61 6c 20 74 6f 20 69 | 74 73 65 6c 66 2e 0a 58 |nal to i|tself..X|
|00001100| 2a 6b 69 6c 6c 70 67 3a | 20 75 73 65 64 20 69 6e |*killpg:| used in|
|00001110| 20 70 74 79 6d 61 73 74 | 65 72 2e 63 60 63 6f 6e | ptymast|er.c`con|
|00001120| 74 63 68 69 6c 64 20 74 | 6f 20 63 6f 6e 74 69 6e |tchild t|o contin|
|00001130| 75 65 20 74 68 65 20 63 | 68 69 6c 64 27 73 20 70 |ue the c|hild's p|
|00001140| 72 6f 63 65 73 73 0a 58 | 09 67 72 6f 75 70 20 69 |rocess.X|.group i|
|00001150| 66 20 61 20 73 74 72 61 | 69 67 68 74 20 6b 69 6c |f a stra|ight kil|
|00001160| 6c 28 29 20 66 61 69 6c | 65 64 0a 58 2a 6c 69 73 |l() fail|ed.X*lis|
|00001170| 74 65 6e 3a 20 75 73 65 | 64 20 69 6e 20 70 74 79 |ten: use|d in pty|
|00001180| 63 6f 6d 6d 2e 63 20 74 | 6f 20 70 72 65 70 61 72 |comm.c t|o prepar|
|00001190| 65 20 74 68 65 20 6d 61 | 73 74 65 72 27 73 20 63 |e the ma|ster's c|
|000011a0| 6f 6d 6d 20 73 6f 63 6b | 65 74 20 66 6f 72 0a 58 |omm sock|et for.X|
|000011b0| 09 63 6f 6e 6e 65 63 74 | 69 6f 6e 73 0a 6c 73 65 |.connect|ions.lse|
|000011c0| 65 6b 3a 20 75 73 65 64 | 20 69 6e 20 70 74 79 6c |ek: used| in ptyl|
|000011d0| 6f 67 73 2e 63 2c 20 73 | 65 73 73 63 6f 6e 6e 6c |ogs.c, s|essconnl|
|000011e0| 6f 67 2e 63 2c 20 61 6e | 64 20 73 65 73 73 6c 6f |og.c, an|d sesslo|
|000011f0| 67 2e 63 20 74 6f 20 70 | 6c 61 63 65 20 61 20 72 |g.c to p|lace a r|
|00001200| 65 63 6f 72 64 0a 58 09 | 61 74 20 61 20 70 61 72 |ecord.X.|at a par|
|00001210| 74 69 63 75 6c 61 72 20 | 73 70 6f 74 20 69 6e 20 |ticular |spot in |
|00001220| 61 20 6c 6f 67 20 66 69 | 6c 65 0a 6d 61 6c 6c 6f |a log fi|le.mallo|
|00001230| 63 3a 20 75 73 65 64 20 | 69 6e 20 72 61 6c 6c 6f |c: used |in rallo|
|00001240| 63 2e 63 60 72 61 6c 6c | 6f 63 0a 58 2b 6f 70 65 |c.c`rall|oc.X+ope|
|00001250| 6e 3a 20 75 73 65 64 20 | 28 31 29 20 69 6e 20 70 |n: used |(1) in p|
|00001260| 74 79 67 65 74 2e 63 20 | 77 69 74 68 20 4f 5f 52 |tyget.c |with O_R|
|00001270| 44 57 52 20 74 6f 20 6f | 70 65 6e 20 74 68 65 20 |DWR to o|pen the |
|00001280| 6d 61 73 74 65 72 20 61 | 6e 64 20 73 6c 61 76 65 |master a|nd slave|
|00001290| 0a 58 09 73 69 64 65 73 | 20 6f 66 20 61 20 74 74 |.X.sides| of a tt|
|000012a0| 79 3b 20 28 32 29 20 69 | 6e 20 70 74 79 6c 6f 67 |y; (2) i|n ptylog|
|000012b0| 73 2e 63 20 77 69 74 68 | 20 4f 5f 52 44 57 52 2c |s.c with| O_RDWR,|
|000012c0| 20 4f 5f 52 44 57 52 20 | 7c 20 4f 5f 41 50 50 45 | O_RDWR || O_APPE|
|000012d0| 4e 44 2c 0a 58 09 61 6e | 64 20 4f 5f 57 52 4f 4e |ND,.X.an|d O_WRON|
|000012e0| 4c 59 20 7c 20 4f 5f 41 | 50 50 45 4e 44 20 74 6f |LY | O_A|PPEND to|
|000012f0| 20 6f 70 65 6e 20 55 54 | 4d 50 5f 46 49 4c 45 20 | open UT|MP_FILE |
|00001300| 61 6e 64 20 57 54 4d 50 | 5f 46 49 4c 45 3b 20 28 |and WTMP|_FILE; (|
|00001310| 33 29 20 69 6e 0a 58 09 | 70 74 79 6d 69 73 63 2e |3) in.X.|ptymisc.|
|00001320| 63 60 66 6f 72 63 65 6f | 70 65 6e 20 75 70 6f 6e |c`forceo|pen upon|
|00001330| 20 2f 64 65 76 2f 6e 75 | 6c 6c 20 61 6e 64 20 2f | /dev/nu|ll and /|
|00001340| 2c 20 74 6f 20 61 74 74 | 65 6d 70 74 20 74 6f 20 |, to att|empt to |
|00001350| 6d 61 6b 65 0a 58 09 73 | 75 72 65 20 61 20 64 65 |make.X.s|ure a de|
|00001360| 73 63 72 69 70 74 6f 72 | 20 69 73 20 69 6e 20 75 |scriptor| is in u|
|00001370| 73 65 3b 20 28 34 29 20 | 69 6e 20 70 74 79 73 6c |se; (4) |in ptysl|
|00001380| 61 76 65 2e 63 20 28 74 | 77 69 63 65 29 20 74 6f |ave.c (t|wice) to|
|00001390| 20 6f 70 65 6e 0a 58 09 | 2f 64 65 76 2f 74 74 79 | open.X.|/dev/tty|
|000013a0| 20 77 69 74 68 20 4f 5f | 52 44 57 52 3b 20 28 35 | with O_|RDWR; (5|
|000013b0| 29 20 69 6e 20 70 74 79 | 74 74 79 2e 63 60 74 74 |) in pty|tty.c`tt|
|000013c0| 79 5f 67 65 74 63 74 72 | 6c 20 74 6f 20 6f 70 65 |y_getctr|l to ope|
|000013d0| 6e 0a 58 09 2f 64 65 76 | 2f 74 74 79 3b 20 28 36 |n.X./dev|/tty; (6|
|000013e0| 29 20 69 6e 20 73 65 73 | 73 63 6f 6e 6e 6c 6f 67 |) in ses|sconnlog|
|000013f0| 2e 63 20 61 6e 64 20 73 | 65 73 73 6c 6f 67 2e 63 |.c and s|esslog.c|
|00001400| 2c 20 77 69 74 68 20 4f | 5f 57 52 4f 4e 4c 59 20 |, with O|_WRONLY |
|00001410| 7c 0a 58 09 4f 5f 43 52 | 45 41 54 20 61 6e 64 20 ||.X.O_CR|EAT and |
|00001420| 4f 5f 57 52 4f 4e 4c 59 | 20 7c 20 4f 5f 41 50 50 |O_WRONLY| | O_APP|
|00001430| 45 4e 44 20 7c 20 4f 5f | 43 52 45 41 54 20 28 62 |END | O_|CREAT (b|
|00001440| 6f 74 68 20 6d 6f 64 65 | 20 30 36 34 34 29 2c 20 |oth mode| 0644), |
|00001450| 74 6f 0a 58 09 6f 70 65 | 6e 20 74 68 65 20 73 65 |to.X.ope|n the se|
|00001460| 73 73 6e 6f 77 2c 20 73 | 65 73 73 6c 6f 67 2c 20 |ssnow, s|esslog, |
|00001470| 73 63 6e 6f 77 2c 20 61 | 6e 64 20 73 63 6c 6f 67 |scnow, a|nd sclog|
|00001480| 20 73 79 73 74 65 6d 20 | 66 69 6c 65 73 20 66 6f | system |files fo|
|00001490| 72 0a 58 09 75 70 64 61 | 74 65 3b 20 28 37 29 20 |r.X.upda|te; (7) |
|000014a0| 69 6e 20 70 74 79 73 65 | 63 75 72 65 2e 63 20 66 |in ptyse|cure.c f|
|000014b0| 6f 72 20 76 61 72 69 6f | 75 73 20 70 75 72 70 6f |or vario|us purpo|
|000014c0| 73 65 73 2e 0a 70 69 70 | 65 3a 20 75 73 65 64 20 |ses..pip|e: used |
|000014d0| 28 31 29 20 69 6e 20 70 | 74 79 6d 61 69 6e 2e 63 |(1) in p|tymain.c|
|000014e0| 20 74 6f 20 63 72 65 61 | 74 65 20 70 69 70 65 73 | to crea|te pipes|
|000014f0| 20 66 72 6f 6d 20 74 68 | 65 20 6d 61 73 74 65 72 | from th|e master|
|00001500| 20 74 6f 20 74 68 65 0a | 58 09 73 69 67 6c 65 72 | to the.|X.sigler|
|00001510| 20 61 6e 64 20 73 6c 61 | 76 65 2c 20 73 6f 20 74 | and sla|ve, so t|
|00001520| 68 61 74 20 74 68 65 72 | 65 27 73 20 6e 6f 20 72 |hat ther|e's no r|
|00001530| 61 63 65 20 62 65 74 77 | 65 65 6e 20 74 68 65 20 |ace betw|een the |
|00001540| 6d 61 73 74 65 72 0a 58 | 09 73 65 74 74 69 6e 67 |master.X|.setting|
|00001550| 20 75 70 20 66 69 6c 65 | 73 20 61 6e 64 20 74 68 | up file|s and th|
|00001560| 65 20 73 69 67 6c 65 72 | 20 61 6e 64 20 73 6c 61 |e sigler| and sla|
|00001570| 76 65 20 73 74 61 72 74 | 69 6e 67 3b 20 28 32 29 |ve start|ing; (2)|
|00001580| 20 69 6e 0a 58 09 70 74 | 79 73 69 67 6c 65 72 2e | in.X.pt|ysigler.|
|00001590| 63 20 74 6f 20 63 72 65 | 61 74 65 20 74 68 65 20 |c to cre|ate the |
|000015a0| 6d 61 73 74 65 72 2d 3e | 73 69 67 6c 65 72 20 61 |master->|sigler a|
|000015b0| 6e 64 20 73 69 67 6c 65 | 72 2d 3e 6d 61 73 74 65 |nd sigle|r->maste|
|000015c0| 72 0a 58 09 70 69 70 65 | 73 20 6a 75 73 74 20 62 |r.X.pipe|s just b|
|000015d0| 65 66 6f 72 65 20 72 65 | 63 6f 6e 6e 65 63 74 3b |efore re|connect;|
|000015e0| 20 28 33 29 20 69 6e 20 | 70 74 79 73 65 63 75 72 | (3) in |ptysecur|
|000015f0| 65 2e 63 20 74 6f 20 63 | 72 65 61 74 65 20 61 6e |e.c to c|reate an|
|00001600| 0a 58 09 6f 75 74 70 75 | 74 20 70 69 70 65 20 66 |.X.outpu|t pipe f|
|00001610| 6f 72 20 2f 62 69 6e 2f | 70 73 2e 0a 72 65 61 64 |or /bin/|ps..read|
|00001620| 0a 58 2a 72 65 63 76 6d | 73 67 3a 20 75 73 65 64 |.X*recvm|sg: used|
|00001630| 20 69 6e 20 70 74 79 63 | 6f 6d 6d 2e 63 20 74 6f | in ptyc|omm.c to|
|00001640| 20 72 65 63 65 69 76 65 | 20 61 20 64 65 73 63 72 | receive| a descr|
|00001650| 69 70 74 6f 72 20 66 72 | 6f 6d 20 61 20 55 4e 49 |iptor fr|om a UNI|
|00001660| 58 2d 64 6f 6d 61 69 6e | 0a 58 09 73 6f 63 6b 65 |X-domain|.X.socke|
|00001670| 74 2e 20 4e 6f 74 65 20 | 74 68 61 74 20 72 65 63 |t. Note |that rec|
|00001680| 76 6d 73 67 28 29 20 69 | 73 20 62 75 67 67 79 20 |vmsg() i|s buggy |
|00001690| 69 6e 20 6d 6f 73 74 20 | 42 53 44 20 76 61 72 69 |in most |BSD vari|
|000016a0| 61 6e 74 73 2e 0a 58 2a | 73 65 6c 65 63 74 3a 20 |ants..X*|select: |
|000016b0| 75 73 65 64 20 28 31 29 | 20 69 6e 20 70 74 79 6d |used (1)| in ptym|
|000016c0| 69 73 63 2e 63 20 74 6f | 20 70 61 75 73 65 20 62 |isc.c to| pause b|
|000016d0| 72 69 65 66 6c 79 3b 20 | 28 32 29 20 69 6e 20 73 |riefly; |(2) in s|
|000016e0| 69 67 73 63 68 65 64 2e | 63 20 74 6f 0a 58 09 63 |igsched.|c to.X.c|
|000016f0| 68 65 63 6b 20 66 6f 72 | 20 75 73 61 62 6c 65 20 |heck for| usable |
|00001700| 64 65 73 63 72 69 70 74 | 6f 72 73 2e 0a 58 2a 73 |descript|ors..X*s|
|00001710| 65 6e 64 6d 73 67 3a 20 | 75 73 65 64 20 69 6e 20 |endmsg: |used in |
|00001720| 70 74 79 63 6f 6d 6d 2e | 63 20 74 6f 20 73 65 6e |ptycomm.|c to sen|
|00001730| 64 20 61 20 64 65 73 63 | 72 69 70 74 6f 72 20 64 |d a desc|riptor d|
|00001740| 6f 77 6e 20 61 20 55 4e | 49 58 2d 64 6f 6d 61 69 |own a UN|IX-domai|
|00001750| 6e 0a 58 09 73 6f 63 6b | 65 74 2e 20 4e 6f 74 65 |n.X.sock|et. Note|
|00001760| 20 74 68 61 74 20 73 65 | 6e 64 6d 73 67 28 29 20 | that se|ndmsg() |
|00001770| 69 73 20 62 75 67 67 79 | 20 69 6e 20 73 6f 6d 65 |is buggy| in some|
|00001780| 20 42 53 44 20 76 61 72 | 69 61 6e 74 73 2e 0a 58 | BSD var|iants..X|
|00001790| 2a 73 65 74 70 67 72 70 | 3a 20 75 73 65 64 20 69 |*setpgrp|: used i|
|000017a0| 6e 20 70 74 79 73 6c 61 | 76 65 2e 63 20 74 6f 20 |n ptysla|ve.c to |
|000017b0| 73 65 74 20 75 70 20 70 | 67 72 70 20 6f 66 20 73 |set up p|grp of s|
|000017c0| 6c 61 76 65 0a 58 2a 73 | 65 74 72 65 75 69 64 3a |lave.X*s|etreuid:|
|000017d0| 20 75 73 65 64 20 69 6e | 20 70 74 79 73 6c 61 76 | used in| ptyslav|
|000017e0| 65 2e 63 20 74 6f 20 6d | 61 6b 65 20 73 75 72 65 |e.c to m|ake sure|
|000017f0| 20 74 68 61 74 20 73 6c | 61 76 65 20 72 75 6e 73 | that sl|ave runs|
|00001800| 20 61 73 20 72 65 61 6c | 20 75 69 64 3b 0a 58 09 | as real| uid;.X.|
|00001810| 75 73 65 64 20 69 6e 20 | 70 74 79 73 65 63 75 72 |used in |ptysecur|
|00001820| 65 2e 63 20 74 6f 20 6d | 61 6b 65 20 73 75 72 65 |e.c to m|ake sure|
|00001830| 20 74 68 61 74 20 2f 62 | 69 6e 2f 70 73 20 72 75 | that /b|in/ps ru|
|00001840| 6e 73 20 61 73 20 72 65 | 61 6c 20 75 69 64 3b 0a |ns as re|al uid;.|
|00001850| 58 09 75 73 65 64 20 69 | 6e 20 70 74 79 6d 61 69 |X.used i|n ptymai|
|00001860| 6e 2e 63 20 74 6f 20 6d | 61 6b 65 20 73 75 72 65 |n.c to m|ake sure|
|00001870| 20 74 68 61 74 20 6d 61 | 73 74 65 72 20 69 73 20 | that ma|ster is |
|00001880| 73 61 66 65 20 66 72 6f | 6d 20 75 73 65 72 0a 58 |safe fro|m user.X|
|00001890| 2a 73 69 67 62 6c 6f 63 | 6b 3a 20 75 73 65 64 20 |*sigbloc|k: used |
|000018a0| 69 6e 20 73 69 67 64 66 | 6c 2e 63 20 61 6e 64 20 |in sigdf|l.c and |
|000018b0| 73 69 67 73 63 68 65 64 | 2e 63 20 66 6f 72 20 76 |sigsched|.c for v|
|000018c0| 61 72 69 6f 75 73 20 70 | 75 72 70 6f 73 65 73 0a |arious p|urposes.|
|000018d0| 58 2b 73 69 67 6e 61 6c | 3a 20 75 73 65 64 20 69 |X+signal|: used i|
|000018e0| 6e 20 76 61 72 69 6f 75 | 73 20 73 70 6f 74 73 20 |n variou|s spots |
|000018f0| 74 6f 20 73 65 74 20 68 | 61 6e 64 6c 65 72 73 20 |to set h|andlers |
|00001900| 74 6f 20 53 49 47 5f 7b | 49 47 4e 2c 44 46 4c 7d |to SIG_{|IGN,DFL}|
|00001910| 0a 58 2a 73 69 67 73 65 | 74 6d 61 73 6b 3a 20 75 |.X*sigse|tmask: u|
|00001920| 73 65 64 20 69 6e 20 73 | 69 67 64 66 6c 2e 63 20 |sed in s|igdfl.c |
|00001930| 61 6e 64 20 73 69 67 73 | 63 68 65 64 2e 63 20 66 |and sigs|ched.c f|
|00001940| 6f 72 20 76 61 72 69 6f | 75 73 20 70 75 72 70 6f |or vario|us purpo|
|00001950| 73 65 73 0a 58 2a 73 69 | 67 76 65 63 3a 20 75 73 |ses.X*si|gvec: us|
|00001960| 65 64 20 69 6e 20 73 69 | 67 64 66 6c 2e 63 20 61 |ed in si|gdfl.c a|
|00001970| 6e 64 20 73 69 67 73 63 | 68 65 64 2e 63 20 74 6f |nd sigsc|hed.c to|
|00001980| 20 69 6e 73 74 61 6c 6c | 20 73 69 67 6e 61 6c 20 | install| signal |
|00001990| 68 61 6e 64 6c 65 72 73 | 0a 58 2a 73 6f 63 6b 65 |handlers|.X*socke|
|000019a0| 74 3a 20 75 73 65 64 20 | 69 6e 20 70 74 79 63 6f |t: used |in ptyco|
|000019b0| 6d 6d 2e 63 60 63 6f 6d | 6d 5f 7b 72 65 61 64 2c |mm.c`com|m_{read,|
|000019c0| 77 72 69 74 65 7d 20 74 | 6f 20 73 65 74 20 75 70 |write} t|o set up|
|000019d0| 20 63 6f 6d 6d 20 73 6f | 63 6b 65 74 0a 73 74 72 | comm so|cket.str|
|000019e0| 63 70 79 3a 20 75 73 65 | 64 20 69 6e 20 65 6e 76 |cpy: use|d in env|
|000019f0| 2e 63 20 66 6f 72 20 76 | 61 72 69 6f 75 73 20 70 |.c for v|arious p|
|00001a00| 75 72 70 6f 73 65 73 0a | 73 74 72 6c 65 6e 3a 20 |urposes.|strlen: |
|00001a10| 75 73 65 64 20 74 68 72 | 6f 75 67 68 6f 75 74 20 |used thr|oughout |
|00001a20| 74 68 65 20 63 6f 64 65 | 20 66 6f 72 20 76 61 72 |the code| for var|
|00001a30| 69 6f 75 73 20 70 75 72 | 70 6f 73 65 73 0a 73 74 |ious pur|poses.st|
|00001a40| 72 6e 63 6d 70 3a 20 75 | 73 65 64 20 69 6e 20 65 |rncmp: u|sed in e|
|00001a50| 6e 76 2e 63 20 61 6e 64 | 20 70 74 79 6c 6f 67 73 |nv.c and| ptylogs|
|00001a60| 2e 63 0a 73 74 72 6e 63 | 70 79 3a 20 75 73 65 64 |.c.strnc|py: used|
|00001a70| 20 69 6e 20 70 74 79 6c | 6f 67 73 2e 63 2c 20 73 | in ptyl|ogs.c, s|
|00001a80| 65 73 73 63 6f 6e 6e 6c | 6f 67 2e 63 2c 20 73 65 |essconnl|og.c, se|
|00001a90| 73 73 6c 6f 67 2e 63 0a | 74 69 6d 65 3a 20 75 73 |sslog.c.|time: us|
|00001aa0| 65 64 20 69 6e 20 70 74 | 79 6d 69 73 63 2e 63 60 |ed in pt|ymisc.c`|
|00001ab0| 6e 6f 77 0a 75 6e 6c 69 | 6e 6b 3a 20 75 73 65 64 |now.unli|nk: used|
|00001ac0| 20 6f 6e 6c 79 20 69 6e | 20 70 74 79 63 6f 6d 6d | only in| ptycomm|
|00001ad0| 2e 63 2c 20 75 70 6f 6e | 20 61 20 72 65 73 74 72 |.c, upon| a restr|
|00001ae0| 69 63 74 65 64 20 70 61 | 74 68 6e 61 6d 65 2c 20 |icted pa|thname, |
|00001af0| 74 6f 20 72 65 6d 6f 76 | 65 0a 58 09 61 6e 20 6f |to remov|e.X.an o|
|00001b00| 62 73 6f 6c 65 74 65 20 | 63 6f 6d 6d 75 6e 69 63 |bsolete |communic|
|00001b10| 61 74 69 6f 6e 73 20 73 | 6f 63 6b 65 74 2e 0a 58 |ations s|ocket..X|
|00001b20| 2a 77 61 69 74 33 3a 20 | 75 73 65 64 20 69 6e 20 |*wait3: |used in |
|00001b30| 62 6f 74 68 20 6d 61 73 | 74 65 72 20 61 6e 64 20 |both mas|ter and |
|00001b40| 73 69 67 6c 65 72 20 74 | 6f 20 77 61 69 74 20 66 |sigler t|o wait f|
|00001b50| 6f 72 20 63 68 69 6c 64 | 72 65 6e 20 28 69 6e 20 |or child|ren (in |
|00001b60| 74 68 65 0a 58 09 6c 61 | 74 74 65 72 20 63 61 73 |the.X.la|tter cas|
|00001b70| 65 2c 20 73 69 6d 70 6c | 79 20 74 6f 20 67 65 74 |e, simpl|y to get|
|00001b80| 20 72 69 64 20 6f 66 20 | 7a 6f 6d 62 69 65 73 29 | rid of |zombies)|
|00001b90| 2c 20 77 69 74 68 20 4e | 4f 48 41 4e 47 20 61 6e |, with N|OHANG an|
|00001ba0| 64 0a 58 09 55 4e 54 52 | 41 43 45 44 2e 0a 77 72 |d.X.UNTR|ACED..wr|
|00001bb0| 69 74 65 0a 58 0a 4e 6f | 74 65 20 74 68 61 74 20 |ite.X.No|te that |
|00001bc0| 70 74 79 20 61 6c 73 6f | 20 64 65 70 65 6e 64 73 |pty also| depends|
|00001bd0| 20 6f 6e 20 65 6e 76 69 | 72 6f 6e 20 61 6e 64 20 | on envi|ron and |
|00001be0| 65 72 72 6e 6f 2e 0a 58 | 0a 54 68 65 20 42 53 44 |errno..X|.The BSD|
|00001bf0| 2d 73 70 65 63 69 66 69 | 63 20 63 61 6c 6c 73 20 |-specifi|c calls |
|00001c00| 63 61 6e 20 62 65 20 64 | 69 76 69 64 65 64 20 69 |can be d|ivided i|
|00001c10| 6e 74 6f 20 73 65 76 65 | 72 61 6c 20 67 72 6f 75 |nto seve|ral grou|
|00001c20| 70 73 3a 0a 58 0a 41 20 | 28 70 74 79 20 61 6c 6c |ps:.X.A |(pty all|
|00001c30| 6f 63 61 74 69 6f 6e 29 | 2e 20 4c 6f 74 73 20 6f |ocation)|. Lots o|
|00001c40| 66 20 76 65 6e 64 6f 72 | 73 20 68 61 76 65 20 61 |f vendor|s have a|
|00001c50| 64 64 65 64 20 70 73 65 | 75 64 6f 2d 74 74 79 73 |dded pse|udo-ttys|
|00001c60| 2e 20 49 6e 20 74 68 65 | 20 42 53 44 0a 77 6f 72 |. In the| BSD.wor|
|00001c70| 6c 64 2c 20 65 76 65 72 | 79 6f 6e 65 20 73 69 6d |ld, ever|yone sim|
|00001c80| 70 6c 79 20 63 6f 70 69 | 65 64 20 77 68 61 74 20 |ply copi|ed what |
|00001c90| 42 65 72 6b 65 6c 65 79 | 20 64 69 64 2e 20 55 6e |Berkeley| did. Un|
|00001ca0| 66 6f 72 74 75 6e 61 74 | 65 6c 79 2c 20 53 79 73 |fortunat|ely, Sys|
|00001cb0| 74 65 6d 20 56 0a 69 73 | 20 67 72 61 63 65 64 20 |tem V.is| graced |
|00001cc0| 77 69 74 68 20 61 74 20 | 6c 65 61 73 74 20 6e 69 |with at |least ni|
|00001cd0| 6e 65 20 70 73 65 75 64 | 6f 2d 74 74 79 20 61 6c |ne pseud|o-tty al|
|00001ce0| 6c 6f 63 61 74 69 6f 6e | 20 6d 65 63 68 61 6e 69 |location| mechani|
|00001cf0| 73 6d 73 3b 20 74 68 65 | 72 65 20 61 72 65 0a 70 |sms; the|re are.p|
|00001d00| 72 6f 62 61 62 6c 79 20 | 6d 61 6e 79 20 6d 6f 72 |robably |many mor|
|00001d10| 65 20 77 68 69 63 68 20 | 49 20 68 61 76 65 6e 27 |e which |I haven'|
|00001d20| 74 20 73 65 65 6e 2e 20 | 70 74 79 67 65 74 2e 63 |t seen. |ptyget.c|
|00001d30| 20 61 6e 64 20 70 74 79 | 73 65 63 75 72 65 2e 63 | and pty|secure.c|
|00001d40| 20 68 61 76 65 0a 74 6f | 20 62 65 20 63 6f 6d 70 | have.to| be comp|
|00001d50| 6c 65 74 65 6c 79 20 72 | 65 77 72 69 74 74 65 6e |letely r|ewritten|
|00001d60| 20 66 6f 72 20 65 61 63 | 68 20 6e 65 77 20 61 6c | for eac|h new al|
|00001d70| 6c 6f 63 61 74 69 6f 6e | 20 64 65 73 69 67 6e 2e |location| design.|
|00001d80| 20 4f 6e 20 74 68 65 20 | 6f 74 68 65 72 0a 68 61 | On the |other.ha|
|00001d90| 6e 64 2c 20 74 68 65 72 | 65 20 6d 75 73 74 20 62 |nd, ther|e must b|
|00001da0| 65 20 63 6f 64 65 20 77 | 68 69 63 68 20 75 73 65 |e code w|hich use|
|00001db0| 73 20 74 68 65 20 70 74 | 79 73 20 6f 6e 20 74 68 |s the pt|ys on th|
|00001dc0| 61 74 20 73 79 73 74 65 | 6d 2c 20 73 6f 20 74 68 |at syste|m, so th|
|00001dd0| 69 73 20 69 73 0a 63 65 | 72 74 61 69 6e 6c 79 20 |is is.ce|rtainly |
|00001de0| 61 20 64 6f 61 62 6c 65 | 20 6a 6f 62 2e 0a 58 0a |a doable| job..X.|
|00001df0| 42 20 28 73 65 6c 65 63 | 74 29 2e 20 73 65 6c 65 |B (selec|t). sele|
|00001e00| 63 74 20 28 61 6e 64 20 | 74 68 65 20 61 73 73 6f |ct (and |the asso|
|00001e10| 63 69 61 74 65 64 20 46 | 44 5f 5a 45 52 4f 20 5b |ciated F|D_ZERO [|
|00001e20| 75 73 69 6e 67 20 62 7a | 65 72 6f 5d 2c 20 46 44 |using bz|ero], FD|
|00001e30| 5f 49 53 53 45 54 2c 0a | 61 6e 64 20 46 44 5f 53 |_ISSET,.|and FD_S|
|00001e40| 45 54 20 6d 61 63 72 6f | 73 29 20 69 73 20 74 68 |ET macro|s) is th|
|00001e50| 65 20 66 6f 75 6e 64 61 | 74 69 6f 6e 20 6f 66 20 |e founda|tion of |
|00001e60| 74 68 65 20 73 69 67 73 | 63 68 65 64 20 6c 69 62 |the sigs|ched lib|
|00001e70| 72 61 72 79 2c 20 77 68 | 69 63 68 0a 6c 69 74 65 |rary, wh|ich.lite|
|00001e80| 72 61 6c 6c 79 20 72 75 | 6e 73 20 65 76 65 72 79 |rally ru|ns every|
|00001e90| 74 68 69 6e 67 2e 20 73 | 65 6c 65 63 74 20 61 6c |thing. s|elect al|
|00001ea0| 73 6f 20 75 73 65 73 20 | 74 68 65 20 6c 61 72 67 |so uses |the larg|
|00001eb0| 65 73 74 20 70 61 72 74 | 20 6f 66 20 70 74 79 27 |est part| of pty'|
|00001ec0| 73 0a 72 75 6e 20 74 69 | 6d 65 2e 20 49 74 20 77 |s.run ti|me. It w|
|00001ed0| 6f 75 6c 64 20 62 65 20 | 69 6e 63 72 65 64 69 62 |ould be |incredib|
|00001ee0| 6c 79 20 64 69 66 66 69 | 63 75 6c 74 20 74 6f 20 |ly diffi|cult to |
|00001ef0| 73 69 6d 75 6c 61 74 65 | 20 73 65 6c 65 63 74 28 |simulate| select(|
|00001f00| 29 20 77 69 74 68 20 61 | 0a 6c 65 73 73 20 70 6f |) with a|.less po|
|00001f10| 77 65 72 66 75 6c 20 6d | 65 63 68 61 6e 69 73 6d |werful m|echanism|
|00001f20| 2c 20 73 75 63 68 20 61 | 73 20 70 6f 6c 6c 28 29 |, such a|s poll()|
|00001f30| 2e 20 49 20 77 6f 75 6c | 64 20 68 61 76 65 20 74 |. I woul|d have t|
|00001f40| 6f 20 62 65 20 65 78 63 | 65 65 64 69 6e 67 6c 79 |o be exc|eedingly|
|00001f50| 0a 62 6f 72 65 64 20 62 | 65 66 6f 72 65 20 61 74 |.bored b|efore at|
|00001f60| 74 65 6d 70 74 69 6e 67 | 20 74 6f 20 70 6f 72 74 |tempting| to port|
|00001f70| 20 70 74 79 20 74 6f 20 | 61 20 73 79 73 74 65 6d | pty to |a system|
|00001f80| 20 77 69 74 68 6f 75 74 | 20 73 65 6c 65 63 74 28 | without| select(|
|00001f90| 29 2e 0a 58 0a 43 20 28 | 63 6f 6d 6d 75 6e 69 63 |)..X.C (|communic|
|00001fa0| 61 74 69 6f 6e 2c 20 69 | 6e 63 6c 75 64 69 6e 67 |ation, i|ncluding|
|00001fb0| 20 66 64 20 70 61 73 73 | 69 6e 67 29 2e 20 61 63 | fd pass|ing). ac|
|00001fc0| 63 65 70 74 2c 20 62 69 | 6e 64 2c 20 63 6f 6e 6e |cept, bi|nd, conn|
|00001fd0| 65 63 74 2c 20 6c 69 73 | 74 65 6e 2c 0a 72 65 63 |ect, lis|ten,.rec|
|00001fe0| 76 6d 73 67 2c 20 73 65 | 6e 64 6d 73 67 2c 20 61 |vmsg, se|ndmsg, a|
|00001ff0| 6e 64 20 73 6f 63 6b 65 | 74 20 61 72 65 20 69 73 |nd socke|t are is|
|00002000| 6f 6c 61 74 65 64 20 69 | 6e 73 69 64 65 20 70 74 |olated i|nside pt|
|00002010| 79 63 6f 6d 6d 2e 63 2e | 20 59 6f 75 20 63 61 6e |ycomm.c.| You can|
|00002020| 20 72 69 70 0a 6f 75 74 | 20 74 68 65 20 65 6e 74 | rip.out| the ent|
|00002030| 69 72 65 20 70 74 79 63 | 6f 6d 6d 2e 63 20 6d 65 |ire ptyc|omm.c me|
|00002040| 63 68 61 6e 69 73 6d 20 | 61 6e 64 20 72 65 70 6c |chanism |and repl|
|00002050| 61 63 65 20 69 74 20 77 | 69 74 68 20 61 6e 79 74 |ace it w|ith anyt|
|00002060| 68 69 6e 67 20 77 68 69 | 63 68 0a 58 28 31 29 20 |hing whi|ch.X(1) |
|00002070| 61 6c 6c 6f 77 73 20 63 | 6c 69 65 6e 74 2d 73 65 |allows c|lient-se|
|00002080| 72 76 65 72 20 63 6f 6e | 6e 65 63 74 69 6f 6e 73 |rver con|nections|
|00002090| 20 77 69 74 68 20 73 6f | 6d 65 20 73 65 63 75 72 | with so|me secur|
|000020a0| 69 74 79 3b 20 28 32 29 | 20 6c 65 74 73 0a 72 65 |ity; (2)| lets.re|
|000020b0| 61 64 28 29 2c 20 77 72 | 69 74 65 28 29 2c 20 61 |ad(), wr|ite(), a|
|000020c0| 6e 64 20 73 65 6c 65 63 | 74 28 29 20 77 6f 72 6b |nd selec|t() work|
|000020d0| 3b 20 28 33 29 20 70 72 | 6f 76 69 64 65 73 20 66 |; (3) pr|ovides f|
|000020e0| 69 6c 65 20 64 65 73 63 | 72 69 70 74 6f 72 0a 70 |ile desc|riptor.p|
|000020f0| 61 73 73 69 6e 67 3b 20 | 28 34 29 20 61 6c 6c 6f |assing; |(4) allo|
|00002100| 77 73 20 61 20 74 77 6f | 2d 77 61 79 20 63 6f 6e |ws a two|-way con|
|00002110| 6e 65 63 74 69 6f 6e 20 | 6f 6e 20 61 20 73 69 6e |nection |on a sin|
|00002120| 67 6c 65 20 64 65 73 63 | 72 69 70 74 6f 72 2e 20 |gle desc|riptor. |
|00002130| 4d 6f 73 74 0a 73 74 72 | 65 61 6d 73 20 66 61 63 |Most.str|eams fac|
|00002140| 69 6c 69 74 69 65 73 20 | 63 61 6e 20 68 61 6e 64 |ilities |can hand|
|00002150| 6c 65 20 28 33 29 2e 20 | 4e 6f 74 65 20 74 68 61 |le (3). |Note tha|
|00002160| 74 20 69 66 20 74 68 65 | 20 66 69 6c 65 20 64 65 |t if the| file de|
|00002170| 73 63 72 69 70 74 6f 72 | 0a 70 61 73 73 69 6e 67 |scriptor|.passing|
|00002180| 20 6d 65 63 68 61 6e 69 | 73 6d 20 69 73 6e 27 74 | mechani|sm isn't|
|00002190| 20 61 73 20 62 75 67 67 | 79 20 61 73 20 42 53 44 | as bugg|y as BSD|
|000021a0| 27 73 2c 20 79 6f 75 20 | 63 61 6e 20 67 65 74 20 |'s, you |can get |
|000021b0| 72 69 64 20 6f 66 0a 70 | 74 79 6d 69 73 63 2e 63 |rid of.p|tymisc.c|
|000021c0| 60 67 61 61 72 67 68 2e | 0a 58 0a 44 20 28 6a 6f |`gaargh.|.X.D (jo|
|000021d0| 62 20 63 6f 6e 74 72 6f | 6c 29 2e 20 67 65 74 70 |b contro|l). getp|
|000021e0| 67 72 70 28 29 2c 20 73 | 65 74 70 67 72 70 28 29 |grp(), s|etpgrp()|
|000021f0| 2c 20 74 68 65 20 54 49 | 4f 43 53 50 47 52 50 20 |, the TI|OCSPGRP |
|00002200| 61 6e 64 20 54 49 4f 43 | 47 50 47 52 50 0a 69 6f |and TIOC|GPGRP.io|
|00002210| 63 74 6c 73 2c 20 76 61 | 72 69 6f 75 73 20 73 69 |ctls, va|rious si|
|00002220| 67 6e 61 6c 73 2c 20 6b | 69 6c 6c 28 2c 53 49 47 |gnals, k|ill(,SIG|
|00002230| 43 4f 4e 54 29 2c 20 6b | 69 6c 6c 70 67 2c 20 61 |CONT), k|illpg, a|
|00002240| 6e 64 20 77 61 69 74 33 | 20 61 72 65 20 61 6c 6c |nd wait3| are all|
|00002250| 20 70 61 72 74 0a 6f 66 | 20 74 68 65 20 42 53 44 | part.of| the BSD|
|00002260| 20 6a 6f 62 20 63 6f 6e | 74 72 6f 6c 20 73 79 73 | job con|trol sys|
|00002270| 74 65 6d 2e 20 70 74 79 | 20 70 75 74 73 20 71 75 |tem. pty| puts qu|
|00002280| 69 74 65 20 61 20 62 69 | 74 20 6f 66 20 65 66 66 |ite a bi|t of eff|
|00002290| 6f 72 74 20 69 6e 74 6f | 0a 68 61 6e 64 6c 69 6e |ort into|.handlin|
|000022a0| 67 20 6a 6f 62 20 63 6f | 6e 74 72 6f 6c 2c 20 62 |g job co|ntrol, b|
|000022b0| 75 74 20 6e 6f 74 20 6e | 65 61 72 6c 79 20 61 73 |ut not n|early as|
|000022c0| 20 6d 75 63 68 20 61 73 | 20 74 68 65 20 70 72 65 | much as| the pre|
|000022d0| 76 69 6f 75 73 20 76 65 | 72 73 69 6f 6e 2e 20 49 |vious ve|rsion. I|
|000022e0| 0a 72 65 61 6c 6c 79 20 | 63 61 6e 27 74 20 67 75 |.really |can't gu|
|000022f0| 65 73 73 20 77 68 61 74 | 20 77 69 6c 6c 20 67 6f |ess what| will go|
|00002300| 20 77 72 6f 6e 67 20 69 | 66 20 79 6f 75 20 73 69 | wrong i|f you si|
|00002310| 6d 70 6c 79 20 72 69 70 | 20 6f 75 74 20 61 6c 6c |mply rip| out all|
|00002320| 20 74 68 65 20 6a 6f 62 | 0a 63 6f 6e 74 72 6f 6c | the job|.control|
|00002330| 20 63 6f 64 65 20 61 6e | 64 20 72 65 70 6c 61 63 | code an|d replac|
|00002340| 65 20 77 61 69 74 33 28 | 29 20 77 69 74 68 20 61 |e wait3(|) with a|
|00002350| 6e 20 61 70 70 72 6f 70 | 72 69 61 74 65 20 77 61 |n approp|riate wa|
|00002360| 69 74 28 29 2e 0a 58 0a | 58 45 20 28 74 74 79 20 |it()..X.|XE (tty |
|00002370| 68 61 6e 64 6c 69 6e 67 | 29 2e 20 53 49 47 57 49 |handling|). SIGWI|
|00002380| 4e 43 48 20 61 6e 64 20 | 73 6f 6d 65 20 74 77 6f |NCH and |some two|
|00002390| 20 64 6f 7a 65 6e 20 74 | 74 79 20 69 6f 63 74 6c | dozen t|ty ioctl|
|000023a0| 73 20 61 6c 6c 20 64 65 | 70 65 6e 64 20 6f 6e 0a |s all de|pend on.|
|000023b0| 74 68 65 20 42 53 44 20 | 74 74 79 20 73 79 73 74 |the BSD |tty syst|
|000023c0| 65 6d 2e 20 53 49 47 57 | 49 4e 43 48 20 69 73 20 |em. SIGW|INCH is |
|000023d0| 65 61 73 79 20 74 6f 20 | 74 61 6b 65 20 63 61 72 |easy to |take car|
|000023e0| 65 20 6f 66 2d 2d 2d 69 | 74 27 73 20 61 6c 72 65 |e of---i|t's alre|
|000023f0| 61 64 79 0a 58 23 69 66 | 64 65 66 27 65 64 20 66 |ady.X#if|def'ed f|
|00002400| 6f 72 20 54 54 59 5f 57 | 49 4e 44 4f 57 53 2e 20 |or TTY_W|INDOWS. |
|00002410| 28 70 74 79 20 77 6f 72 | 6b 73 20 75 6e 64 65 72 |(pty wor|ks under|
|00002420| 20 42 53 44 20 34 2e 32 | 2c 20 77 68 69 63 68 20 | BSD 4.2|, which |
|00002430| 64 6f 65 73 6e 27 74 20 | 68 61 76 65 0a 53 49 47 |doesn't |have.SIG|
|00002440| 57 49 4e 43 48 2e 29 20 | 54 68 65 20 6f 74 68 65 |WINCH.) |The othe|
|00002450| 72 20 74 74 79 20 69 6f | 63 74 6c 73 20 61 72 65 |r tty io|ctls are|
|00002460| 20 69 73 6f 6c 61 74 65 | 64 20 69 6e 73 69 64 65 | isolate|d inside|
|00002470| 20 70 74 79 74 74 79 2e | 63 2c 20 77 68 69 63 68 | ptytty.|c, which|
|00002480| 20 49 0a 77 69 6c 6c 20 | 70 72 6f 62 61 62 6c 79 | I.will |probably|
|00002490| 20 72 65 77 72 69 74 65 | 20 66 6f 72 20 50 4f 53 | rewrite| for POS|
|000024a0| 49 58 20 69 66 20 61 6e | 64 20 77 68 65 6e 20 73 |IX if an|d when s|
|000024b0| 6f 6d 65 62 6f 64 79 20 | 61 73 6b 73 20 6d 65 20 |omebody |asks me |
|000024c0| 74 6f 2e 0a 4a 61 6e 75 | 61 72 79 20 31 39 39 32 |to..Janu|ary 1992|
|000024d0| 20 75 70 64 61 74 65 3a | 20 4f 6b 61 79 2c 20 49 | update:| Okay, I|
|000024e0| 27 76 65 20 6e 6f 77 20 | 69 6d 70 6c 65 6d 65 6e |'ve now |implemen|
|000024f0| 74 65 64 20 54 54 59 5f | 54 45 52 4d 49 4f 2e 20 |ted TTY_|TERMIO. |
|00002500| 50 4f 53 49 58 2c 20 66 | 6f 72 0a 73 6f 6d 65 20 |POSIX, f|or.some |
|00002510| 61 62 73 6f 6c 75 74 65 | 6c 79 20 69 64 69 6f 74 |absolute|ly idiot|
|00002520| 69 63 20 72 65 61 73 6f | 6e 2c 20 64 6f 65 73 6e |ic reaso|n, doesn|
|00002530| 27 74 20 73 74 69 63 6b | 20 74 6f 20 74 68 65 20 |'t stick| to the |
|00002540| 74 72 61 64 69 74 69 6f | 6e 61 6c 20 68 65 61 64 |traditio|nal head|
|00002550| 65 72 0a 66 69 6c 65 73 | 2c 20 62 75 74 20 54 54 |er.files|, but TT|
|00002560| 59 5f 54 45 52 4d 49 4f | 20 73 68 6f 75 6c 64 20 |Y_TERMIO| should |
|00002570| 62 65 20 67 6f 6f 64 20 | 65 6e 6f 75 67 68 20 66 |be good |enough f|
|00002580| 6f 72 20 73 79 73 74 65 | 6d 73 20 77 69 74 68 20 |or syste|ms with |
|00002590| 53 79 73 74 65 6d 20 56 | 0a 74 74 79 20 68 61 6e |System V|.tty han|
|000025a0| 64 6c 69 6e 67 2e 0a 58 | 0a 58 46 20 28 73 69 67 |dling..X|.XF (sig|
|000025b0| 6e 61 6c 20 6d 61 6e 61 | 67 65 6d 65 6e 74 29 2e |nal mana|gement).|
|000025c0| 20 73 69 67 62 6c 6f 63 | 6b 2c 20 73 69 67 73 65 | sigbloc|k, sigse|
|000025d0| 74 6d 61 73 6b 2c 20 73 | 69 67 76 65 63 2c 20 61 |tmask, s|igvec, a|
|000025e0| 6e 64 20 67 6f 6f 64 20 | 6f 6c 64 20 73 69 67 6e |nd good |old sign|
|000025f0| 61 6c 0a 61 72 65 20 61 | 6c 6c 20 75 73 65 64 20 |al.are a|ll used |
|00002600| 74 68 72 6f 75 67 68 6f | 75 74 20 74 68 65 20 70 |througho|ut the p|
|00002610| 74 79 20 63 6f 64 65 2e | 20 50 4f 53 49 58 20 63 |ty code.| POSIX c|
|00002620| 61 6e 20 68 61 6e 64 6c | 65 20 61 6c 6c 20 6f 66 |an handl|e all of|
|00002630| 20 74 68 65 6d 2c 20 61 | 6e 64 0a 49 20 77 69 6c | them, a|nd.I wil|
|00002640| 6c 20 64 6f 20 74 68 69 | 73 20 70 6f 72 74 20 73 |l do thi|s port s|
|00002650| 6f 6f 6e 2e 20 53 79 73 | 74 65 6d 20 56 20 63 61 |oon. Sys|tem V ca|
|00002660| 6e 6e 6f 74 2d 2d 2d 69 | 74 27 73 20 76 65 72 79 |nnot---i|t's very|
|00002670| 20 69 6d 70 6f 72 74 61 | 6e 74 20 74 68 61 74 20 | importa|nt that |
|00002680| 70 74 79 0a 68 61 76 65 | 20 72 65 6c 69 61 62 6c |pty.have| reliabl|
|00002690| 65 20 73 69 67 6e 61 6c | 20 68 61 6e 64 6c 69 6e |e signal| handlin|
|000026a0| 67 2e 0a 58 0a 47 20 28 | 65 61 73 79 20 73 74 75 |g..X.G (|easy stu|
|000026b0| 66 66 29 2e 20 64 75 70 | 32 2c 20 66 63 6e 74 6c |ff). dup|2, fcntl|
|000026c0| 28 2c 46 5f 47 45 54 46 | 4c 2c 30 29 2c 20 67 65 |(,F_GETF|L,0), ge|
|000026d0| 74 64 74 61 62 6c 65 73 | 69 7a 65 2c 20 67 65 74 |tdtables|ize, get|
|000026e0| 70 77 6e 61 6d 2c 0a 67 | 65 74 70 77 75 69 64 2c |pwnam,.g|etpwuid,|
|000026f0| 20 66 63 68 6d 6f 64 2c | 20 66 73 74 61 74 2c 20 | fchmod,| fstat, |
|00002700| 61 6e 64 20 73 65 74 72 | 65 75 69 64 20 61 72 65 |and setr|euid are|
|00002710| 20 61 6c 6c 20 72 65 61 | 73 6f 6e 61 62 6c 79 20 | all rea|sonably |
|00002720| 65 61 73 79 20 74 6f 20 | 68 61 6e 64 6c 65 2e 0a |easy to |handle..|
|00002730| 64 75 70 32 28 29 20 63 | 61 6e 20 62 65 20 77 72 |dup2() c|an be wr|
|00002740| 69 74 74 65 6e 20 69 6e | 20 74 65 72 6d 73 20 6f |itten in| terms o|
|00002750| 66 20 46 5f 44 55 50 46 | 44 20 66 6f 72 20 53 79 |f F_DUPF|D for Sy|
|00002760| 73 74 65 6d 20 56 3b 20 | 69 6e 20 66 61 63 74 2c |stem V; |in fact,|
|00002770| 20 70 74 79 0a 6f 6e 6c | 79 20 75 73 65 73 20 69 | pty.onl|y uses i|
|00002780| 74 20 69 6e 20 61 20 73 | 69 74 75 61 74 69 6f 6e |t in a s|ituation|
|00002790| 20 77 68 65 72 65 20 69 | 74 20 73 68 6f 75 6c 64 | where i|t should|
|000027a0| 20 62 65 20 61 20 6e 6f | 2d 6f 70 21 20 28 53 65 | be a no|-op! (Se|
|000027b0| 65 0a 70 74 79 6d 69 73 | 63 60 66 6f 72 63 65 6f |e.ptymis|c`forceo|
|000027c0| 70 65 6e 20 61 6e 64 20 | 74 68 65 20 63 61 6c 6c |pen and |the call|
|000027d0| 73 20 74 6f 20 66 6f 72 | 63 65 6f 70 65 6e 20 69 |s to for|ceopen i|
|000027e0| 6e 20 70 74 79 6d 61 69 | 6e 2e 63 2e 29 20 46 5f |n ptymai|n.c.) F_|
|000027f0| 47 45 54 46 4c 20 69 73 | 2c 0a 49 20 62 65 6c 69 |GETFL is|,.I beli|
|00002800| 65 76 65 2c 20 61 76 61 | 69 6c 61 62 6c 65 20 6f |eve, ava|ilable o|
|00002810| 6e 20 61 6c 6c 20 6d 6f | 64 65 72 6e 20 55 4e 49 |n all mo|dern UNI|
|00002820| 58 2d 6c 69 6b 65 20 73 | 79 73 74 65 6d 73 2e 20 |X-like s|ystems. |
|00002830| 67 65 74 64 74 61 62 6c | 65 73 69 7a 65 20 63 61 |getdtabl|esize ca|
|00002840| 6e 0a 62 65 20 72 65 70 | 6c 61 63 65 64 20 62 79 |n.be rep|laced by|
|00002850| 20 4e 4f 46 49 4c 45 2e | 20 73 65 74 72 65 75 69 | NOFILE.| setreui|
|00002860| 64 28 75 69 64 2c 75 69 | 64 29 20 69 73 20 65 73 |d(uid,ui|d) is es|
|00002870| 73 65 6e 74 69 61 6c 6c | 79 20 65 71 75 69 76 61 |sentiall|y equiva|
|00002880| 6c 65 6e 74 20 74 6f 0a | 73 65 74 75 69 64 28 75 |lent to.|setuid(u|
|00002890| 69 64 29 2e 20 67 65 74 | 70 77 6e 61 6d 28 29 20 |id). get|pwnam() |
|000028a0| 61 6e 64 20 67 65 74 70 | 77 75 69 64 28 29 20 61 |and getp|wuid() a|
|000028b0| 70 70 65 61 72 20 6f 6e | 20 6d 6f 73 74 20 73 79 |ppear on| most sy|
|000028c0| 73 74 65 6d 73 2c 20 61 | 6e 64 20 77 68 65 6e 0a |stems, a|nd when.|
|000028d0| 74 68 65 79 20 64 6f 6e | 27 74 20 61 70 70 65 61 |they don|'t appea|
|000028e0| 72 2c 20 74 68 65 79 27 | 72 65 20 65 61 73 79 20 |r, they'|re easy |
|000028f0| 65 6e 6f 75 67 68 20 74 | 6f 20 77 72 69 74 65 20 |enough t|o write |
|00002900| 28 6a 75 73 74 20 73 63 | 61 6e 20 2f 65 74 63 2f |(just sc|an /etc/|
|00002910| 70 61 73 73 77 64 29 2e | 0a 66 63 68 6d 6f 64 20 |passwd).|.fchmod |
|00002920| 61 6e 64 20 66 73 74 61 | 74 20 63 61 6e 20 62 65 |and fsta|t can be|
|00002930| 20 72 65 70 6c 61 63 65 | 64 20 62 79 20 63 68 6d | replace|d by chm|
|00002940| 6f 64 20 61 6e 64 20 73 | 74 61 74 2d 2d 2d 74 68 |od and s|tat---th|
|00002950| 65 79 27 72 65 20 6f 6e | 6c 79 20 75 73 65 64 0a |ey're on|ly used.|
|00002960| 69 6e 20 73 69 74 75 61 | 74 69 6f 6e 73 20 77 68 |in situa|tions wh|
|00002970| 65 72 65 20 74 68 65 20 | 70 61 74 68 6e 61 6d 65 |ere the |pathname|
|00002980| 20 69 73 20 6b 6e 6f 77 | 6e 20 28 76 69 7a 2e 2c | is know|n (viz.,|
|00002990| 20 61 20 73 6c 61 76 65 | 20 74 74 79 29 2e 0a 45 | a slave| tty)..E|
|000029a0| 4e 44 5f 4f 46 5f 46 49 | 4c 45 0a 69 66 20 74 65 |ND_OF_FI|LE.if te|
|000029b0| 73 74 20 39 34 37 37 20 | 2d 6e 65 20 60 77 63 20 |st 9477 |-ne `wc |
|000029c0| 2d 63 20 3c 27 43 41 4c | 4c 53 27 60 3b 20 74 68 |-c <'CAL|LS'`; th|
|000029d0| 65 6e 0a 20 20 20 20 65 | 63 68 6f 20 73 68 61 72 |en. e|cho shar|
|000029e0| 3a 20 5c 22 27 43 41 4c | 4c 53 27 5c 22 20 75 6e |: \"'CAL|LS'\" un|
|000029f0| 70 61 63 6b 65 64 20 77 | 69 74 68 20 77 72 6f 6e |packed w|ith wron|
|00002a00| 67 20 73 69 7a 65 21 0a | 66 69 0a 23 20 65 6e 64 |g size!.|fi.# end|
|00002a10| 20 6f 66 20 27 43 41 4c | 4c 53 27 0a 66 69 0a 69 | of 'CAL|LS'.fi.i|
|00002a20| 66 20 74 65 73 74 20 2d | 66 20 27 43 54 54 59 53 |f test -|f 'CTTYS|
|00002a30| 2e 64 72 61 66 74 31 27 | 20 2d 61 20 22 24 7b 31 |.draft1'| -a "${1|
|00002a40| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|00002a50| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|00002a60| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|00002a70| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|00002a80| 22 27 43 54 54 59 53 2e | 64 72 61 66 74 31 27 5c |"'CTTYS.|draft1'\|
|00002a90| 22 0a 65 6c 73 65 0a 65 | 63 68 6f 20 73 68 61 72 |".else.e|cho shar|
|00002aa0| 3a 20 45 78 74 72 61 63 | 74 69 6e 67 20 5c 22 27 |: Extrac|ting \"'|
|00002ab0| 43 54 54 59 53 2e 64 72 | 61 66 74 31 27 5c 22 20 |CTTYS.dr|aft1'\" |
|00002ac0| 5c 28 39 34 33 30 20 63 | 68 61 72 61 63 74 65 72 |\(9430 c|haracter|
|00002ad0| 73 5c 29 0a 73 65 64 20 | 22 73 2f 5e 58 2f 2f 22 |s\).sed |"s/^X//"|
|00002ae0| 20 3e 27 43 54 54 59 53 | 2e 64 72 61 66 74 31 27 | >'CTTYS|.draft1'|
|00002af0| 20 3c 3c 27 45 4e 44 5f | 4f 46 5f 46 49 4c 45 27 | <<'END_|OF_FILE'|
|00002b00| 0a 43 6f 6e 74 72 6f 6c | 6c 69 6e 67 20 54 74 79 |.Control|ling Tty|
|00002b10| 73 3a 20 41 20 55 4e 49 | 58 20 48 6f 72 72 6f 72 |s: A UNI|X Horror|
|00002b20| 20 53 74 6f 72 79 0a 44 | 61 6e 69 65 6c 20 4a 2e | Story.D|aniel J.|
|00002b30| 20 42 65 72 6e 73 74 65 | 69 6e 0a 64 72 61 66 74 | Bernste|in.draft|
|00002b40| 20 31 0a 58 31 30 2f 36 | 2f 39 31 0a 58 0a 58 0a | 1.X10/6|/91.X.X.|
|00002b50| 58 31 2e 20 49 6e 74 72 | 6f 64 75 63 74 69 6f 6e |X1. Intr|oduction|
|00002b60| 0a 58 0a 58 09 20 60 60 | 4e 6f 72 6d 61 6c 20 66 |.X.X. ``|Normal f|
|00002b70| 69 6c 65 20 61 63 63 65 | 73 73 20 70 65 72 6d 69 |ile acce|ss permi|
|00002b80| 73 73 69 6f 6e 73 20 68 | 61 6e 64 6c 65 20 73 65 |ssions h|andle se|
|00002b90| 63 75 72 69 74 79 2e 27 | 27 0a 58 09 09 09 2d 2d |curity.'|'.X...--|
|00002ba0| 2d 50 4f 53 49 58 2e 31 | 2d 31 39 38 38 20 72 61 |-POSIX.1|-1988 ra|
|00002bb0| 74 69 6f 6e 61 6c 65 2c | 20 42 2e 37 2e 31 2e 31 |tionale,| B.7.1.1|
|00002bc0| 2e 34 0a 58 0a 57 68 65 | 6e 20 61 20 75 73 65 72 |.4.X.Whe|n a user|
|00002bd0| 20 6c 6f 67 73 20 69 6e | 74 6f 20 61 20 55 4e 49 | logs in|to a UNI|
|00002be0| 58 20 73 79 73 74 65 6d | 2c 20 68 65 20 69 73 20 |X system|, he is |
|00002bf0| 61 73 73 69 67 6e 65 64 | 20 61 20 5f 74 74 79 5f |assigned| a _tty_|
|00002c00| 20 77 68 69 63 68 20 65 | 63 68 6f 65 73 0a 61 6e | which e|choes.an|
|00002c10| 64 20 70 72 6f 63 65 73 | 73 65 73 20 68 69 73 20 |d proces|ses his |
|00002c20| 63 68 61 72 61 63 74 65 | 72 73 2c 20 6c 65 74 73 |characte|rs, lets|
|00002c30| 20 68 69 6d 20 65 64 69 | 74 20 63 6f 6d 6d 61 6e | him edi|t comman|
|00002c40| 64 20 6c 69 6e 65 73 2c | 20 68 61 6e 64 6c 65 73 |d lines,| handles|
|00002c50| 20 66 6c 6f 77 0a 63 6f | 6e 74 72 6f 6c 20 6f 6e | flow.co|ntrol on|
|00002c60| 20 6f 75 74 70 75 74 2c | 20 61 6e 64 20 73 6f 20 | output,| and so |
|00002c70| 6f 6e 2e 20 54 68 65 20 | 75 73 65 72 27 73 20 73 |on. The |user's s|
|00002c80| 68 65 6c 6c 20 72 65 61 | 64 73 20 61 6e 64 20 77 |hell rea|ds and w|
|00002c90| 72 69 74 65 73 20 66 72 | 6f 6d 20 74 68 65 0a 74 |rites fr|om the.t|
|00002ca0| 74 79 2e 20 4d 65 73 73 | 61 67 65 73 20 73 65 6e |ty. Mess|ages sen|
|00002cb0| 74 20 62 79 20 74 68 65 | 20 60 60 77 72 69 74 65 |t by the| ``write|
|00002cc0| 27 27 20 61 6e 64 20 60 | 60 74 61 6c 6b 27 27 20 |'' and `|`talk'' |
|00002cd0| 75 73 65 72 20 63 6f 6d | 6d 75 6e 69 63 61 74 69 |user com|municati|
|00002ce0| 6f 6e 0a 63 6f 6d 6d 61 | 6e 64 73 20 61 72 65 20 |on.comma|nds are |
|00002cf0| 61 6c 73 6f 20 73 65 6e | 74 20 74 68 72 6f 75 67 |also sen|t throug|
|00002d00| 68 20 74 68 65 20 74 74 | 79 2e 20 49 6e 20 66 61 |h the tt|y. In fa|
|00002d10| 63 74 2c 20 74 74 79 73 | 20 28 61 6c 73 6f 20 63 |ct, ttys| (also c|
|00002d20| 61 6c 6c 65 64 0a 58 5f | 74 65 72 6d 69 6e 61 6c |alled.X_|terminal|
|00002d30| 73 5f 2c 20 5f 74 65 6c | 65 74 79 70 65 73 5f 2c |s_, _tel|etypes_,|
|00002d40| 20 61 6e 64 20 5f 74 79 | 70 65 77 72 69 74 65 72 | and _ty|pewriter|
|00002d50| 73 5f 29 20 61 72 65 20 | 74 68 65 20 66 6f 63 61 |s_) are |the foca|
|00002d60| 6c 20 70 6f 69 6e 74 20 | 6f 66 0a 61 6c 6d 6f 73 |l point |of.almos|
|00002d70| 74 20 61 6c 6c 20 69 6e | 74 65 72 61 63 74 69 6f |t all in|teractio|
|00002d80| 6e 20 62 65 74 77 65 65 | 6e 20 61 20 75 73 65 72 |n betwee|n a user|
|00002d90| 20 61 6e 64 20 74 68 65 | 20 73 79 73 74 65 6d 2e | and the| system.|
|00002da0| 0a 58 0a 54 74 79 73 20 | 63 6f 6d 65 20 69 6e 20 |.X.Ttys |come in |
|00002db0| 74 77 6f 20 66 6c 61 76 | 6f 72 73 3a 20 68 61 72 |two flav|ors: har|
|00002dc0| 64 77 69 72 65 64 20 74 | 74 79 73 20 61 6e 64 20 |dwired t|tys and |
|00002dd0| 70 73 65 75 64 6f 2d 74 | 74 79 73 2e 20 48 61 72 |pseudo-t|tys. Har|
|00002de0| 64 77 69 72 65 64 20 74 | 74 79 73 0a 61 72 65 20 |dwired t|tys.are |
|00002df0| 63 6f 6e 6e 65 63 74 65 | 64 20 64 69 72 65 63 74 |connecte|d direct|
|00002e00| 6c 79 20 74 6f 20 61 20 | 70 68 79 73 69 63 61 6c |ly to a |physical|
|00002e10| 20 64 65 76 69 63 65 2c | 20 73 75 63 68 20 61 73 | device,| such as|
|00002e20| 20 61 20 6d 6f 64 65 6d | 2e 0a 50 73 65 75 64 6f | a modem|..Pseudo|
|00002e30| 2d 74 74 79 73 20 6d 61 | 79 20 62 65 20 64 79 6e |-ttys ma|y be dyn|
|00002e40| 61 6d 69 63 61 6c 6c 79 | 20 63 6f 6e 6e 65 63 74 |amically| connect|
|00002e50| 65 64 20 74 6f 20 61 6e | 79 20 70 72 6f 63 65 73 |ed to an|y proces|
|00002e60| 73 2e 20 46 6f 72 20 69 | 6e 73 74 61 6e 63 65 2c |s. For i|nstance,|
|00002e70| 0a 74 68 65 20 74 65 6c | 6e 65 74 64 20 70 72 6f |.the tel|netd pro|
|00002e80| 67 72 61 6d 20 6c 69 6e | 6b 73 20 61 20 70 73 65 |gram lin|ks a pse|
|00002e90| 75 64 6f 2d 74 74 79 20 | 77 69 74 68 20 65 61 63 |udo-tty |with eac|
|00002ea0| 68 20 6e 65 74 77 6f 72 | 6b 20 63 6f 6e 6e 65 63 |h networ|k connec|
|00002eb0| 74 69 6f 6e 2e 0a 58 0a | 55 6e 6c 69 6b 65 20 70 |tion..X.|Unlike p|
|00002ec0| 69 70 65 73 2c 20 74 74 | 79 73 20 68 61 76 65 20 |ipes, tt|ys have |
|00002ed0| 74 72 61 64 69 74 69 6f | 6e 61 6c 6c 79 20 62 65 |traditio|nally be|
|00002ee0| 65 6e 20 61 73 73 69 67 | 6e 65 64 20 61 20 6e 61 |en assig|ned a na|
|00002ef0| 6d 65 20 69 6e 20 74 68 | 65 0a 66 69 6c 65 73 79 |me in th|e.filesy|
|00002f00| 73 74 65 6d 3a 20 2f 64 | 65 76 2f 63 6f 6e 73 6f |stem: /d|ev/conso|
|00002f10| 6c 65 2c 20 66 6f 72 20 | 69 6e 73 74 61 6e 63 65 |le, for |instance|
|00002f20| 2c 20 69 73 20 61 20 68 | 61 72 64 77 69 72 65 64 |, is a h|ardwired|
|00002f30| 20 74 74 79 2c 20 61 6e | 64 0a 58 2f 64 65 76 2f | tty, an|d.X/dev/|
|00002f40| 74 74 79 70 37 20 69 73 | 20 61 20 70 73 65 75 64 |ttyp7 is| a pseud|
|00002f50| 6f 2d 74 74 79 2e 20 54 | 68 65 20 70 72 69 6d 61 |o-tty. T|he prima|
|00002f60| 72 79 20 72 65 61 73 6f | 6e 20 66 6f 72 20 74 68 |ry reaso|n for th|
|00002f70| 65 73 65 20 66 69 6c 65 | 73 20 69 73 20 74 6f 0a |ese file|s is to.|
|00002f80| 73 75 70 70 6f 72 74 20 | 75 73 65 72 2d 74 6f 2d |support |user-to-|
|00002f90| 75 73 65 72 20 63 6f 6d | 6d 75 6e 69 63 61 74 69 |user com|municati|
|00002fa0| 6f 6e 2e 20 54 68 65 20 | 73 79 73 74 65 6d 20 74 |on. The |system t|
|00002fb0| 79 70 69 63 61 6c 6c 79 | 20 61 73 73 69 67 6e 73 |ypically| assigns|
|00002fc0| 0a 6f 77 6e 65 72 73 68 | 69 70 20 6f 66 20 74 74 |.ownersh|ip of tt|
|00002fd0| 79 20 66 69 6c 65 73 20 | 74 6f 20 74 68 65 20 63 |y files |to the c|
|00002fe0| 75 72 72 65 6e 74 20 75 | 73 65 72 2e 20 54 68 61 |urrent u|ser. Tha|
|00002ff0| 74 20 77 61 79 20 74 68 | 65 20 75 73 65 72 20 63 |t way th|e user c|
|00003000| 61 6e 20 63 68 61 6e 67 | 65 0a 68 69 73 20 74 74 |an chang|e.his tt|
|00003010| 79 20 6d 6f 64 65 73 20 | 74 6f 20 63 6f 6e 74 72 |y modes |to contr|
|00003020| 6f 6c 20 77 68 65 74 68 | 65 72 20 60 60 77 72 69 |ol wheth|er ``wri|
|00003030| 74 65 27 27 20 61 6e 64 | 20 60 60 74 61 6c 6b 27 |te'' and| ``talk'|
|00003040| 27 20 6d 65 73 73 61 67 | 65 73 20 61 72 65 0a 61 |' messag|es are.a|
|00003050| 6c 6c 6f 77 65 64 2e 0a | 58 0a 4f 63 63 61 73 69 |llowed..|X.Occasi|
|00003060| 6f 6e 61 6c 6c 79 20 61 | 20 70 72 6f 67 72 61 6d |onally a| program|
|00003070| 20 28 6f 72 20 6d 6f 72 | 65 20 6f 66 74 65 6e 20 | (or mor|e often |
|00003080| 61 20 73 63 72 69 70 74 | 29 20 77 61 6e 74 73 20 |a script|) wants |
|00003090| 74 6f 20 73 65 6e 64 20 | 6d 65 73 73 61 67 65 73 |to send |messages|
|000030a0| 0a 74 6f 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |.to the |current |
|000030b0| 74 74 79 2c 20 6e 6f 20 | 6d 61 74 74 65 72 20 77 |tty, no |matter w|
|000030c0| 68 61 74 20 72 65 64 69 | 72 65 63 74 69 6f 6e 20 |hat redi|rection |
|000030d0| 68 61 73 20 62 65 65 6e | 20 70 75 74 20 6f 6e 20 |has been| put on |
|000030e0| 73 74 64 6f 75 74 0a 61 | 6e 64 20 73 74 64 65 72 |stdout.a|nd stder|
|000030f0| 72 2e 20 28 54 68 65 20 | 61 75 74 68 6f 72 20 64 |r. (The |author d|
|00003100| 65 66 65 72 73 20 6a 75 | 64 67 6d 65 6e 74 20 6f |efers ju|dgment o|
|00003110| 6e 20 77 68 65 74 68 65 | 72 20 74 68 69 73 20 69 |n whethe|r this i|
|00003120| 73 20 61 20 73 65 6e 73 | 69 62 6c 65 0a 74 68 69 |s a sens|ible.thi|
|00003130| 6e 67 20 66 6f 72 20 70 | 72 6f 67 72 61 6d 73 20 |ng for p|rograms |
|00003140| 74 6f 20 64 6f 2e 29 20 | 4d 6f 72 65 20 6f 66 74 |to do.) |More oft|
|00003150| 65 6e 2c 20 61 20 75 73 | 65 72 20 77 61 6e 74 73 |en, a us|er wants|
|00003160| 20 74 6f 20 6b 6e 6f 77 | 20 77 68 61 74 20 74 68 | to know| what th|
|00003170| 65 0a 63 75 72 72 65 6e | 74 20 74 74 79 20 69 73 |e.curren|t tty is|
|00003180| 2c 20 74 6f 20 6b 65 65 | 70 20 74 72 61 63 6b 20 |, to kee|p track |
|00003190| 6f 66 20 77 68 61 74 20 | 68 65 27 73 20 64 6f 69 |of what |he's doi|
|000031a0| 6e 67 2e 20 4f 6e 65 20 | 6f 62 76 69 6f 75 73 20 |ng. One |obvious |
|000031b0| 73 6f 6c 75 74 69 6f 6e | 0a 74 6f 20 62 6f 74 68 |solution|.to both|
|000031c0| 20 70 72 6f 62 6c 65 6d | 73 20 69 73 20 74 6f 20 | problem|s is to |
|000031d0| 6b 65 65 70 20 74 68 65 | 20 63 75 72 72 65 6e 74 |keep the| current|
|000031e0| 20 74 74 79 20 69 6e 20 | 61 6e 20 65 6e 76 69 72 | tty in |an envir|
|000031f0| 6f 6e 6d 65 6e 74 20 76 | 61 72 69 61 62 6c 65 2c |onment v|ariable,|
|00003200| 0a 6c 69 6b 65 20 54 54 | 59 3d 2f 64 65 76 2f 74 |.like TT|Y=/dev/t|
|00003210| 74 79 70 37 2e 20 54 68 | 65 6e 20 61 20 60 60 74 |typ7. Th|en a ``t|
|00003220| 74 79 27 27 20 70 72 6f | 67 72 61 6d 20 63 61 6e |ty'' pro|gram can|
|00003230| 20 73 69 6d 70 6c 79 20 | 65 63 68 6f 20 24 54 54 | simply |echo $TT|
|00003240| 59 2c 20 61 6e 64 0a 70 | 72 6f 67 72 61 6d 73 20 |Y, and.p|rograms |
|00003250| 77 68 69 63 68 20 77 61 | 6e 74 20 74 6f 20 74 61 |which wa|nt to ta|
|00003260| 6c 6b 20 74 6f 20 74 68 | 65 20 75 73 65 72 20 63 |lk to th|e user c|
|00003270| 61 6e 20 6f 70 65 6e 20 | 24 54 54 59 2e 0a 58 0a |an open |$TTY..X.|
|00003280| 55 6e 66 6f 72 74 75 6e | 61 74 65 6c 79 2c 20 55 |Unfortun|ately, U|
|00003290| 4e 49 58 20 6e 65 76 65 | 72 20 61 63 71 75 69 72 |NIX neve|r acquir|
|000032a0| 65 64 20 73 75 63 68 20 | 61 20 73 69 6d 70 6c 65 |ed such |a simple|
|000032b0| 20 75 73 65 72 2d 6d 6f | 64 65 20 73 6f 6c 75 74 | user-mo|de solut|
|000032c0| 69 6f 6e 2e 0a 49 6e 73 | 74 65 61 64 20 65 61 63 |ion..Ins|tead eac|
|000032d0| 68 20 70 72 6f 63 65 73 | 73 20 77 61 73 20 61 73 |h proces|s was as|
|000032e0| 73 69 67 6e 65 64 20 61 | 20 60 60 63 6f 6e 74 72 |signed a| ``contr|
|000032f0| 6f 6c 6c 69 6e 67 20 74 | 74 79 27 27 2c 20 73 6f |olling t|ty'', so|
|00003300| 6d 65 74 68 69 6e 67 20 | 77 68 69 63 68 0a 74 68 |mething |which.th|
|00003310| 65 20 6b 65 72 6e 65 6c | 20 6b 65 70 74 20 74 72 |e kernel| kept tr|
|00003320| 61 63 6b 20 6f 66 20 61 | 6e 64 20 74 72 65 61 74 |ack of a|nd treat|
|00003330| 65 64 20 73 70 65 63 69 | 61 6c 6c 79 2e 20 54 68 |ed speci|ally. Th|
|00003340| 61 74 20 69 73 20 77 68 | 65 72 65 20 74 68 65 20 |at is wh|ere the |
|00003350| 68 6f 72 72 6f 72 0a 73 | 74 6f 72 79 20 62 65 67 |horror.s|tory beg|
|00003360| 69 6e 73 2e 0a 58 0a 58 | 0a 58 32 2e 20 43 6f 6e |ins..X.X|.X2. Con|
|00003370| 74 72 6f 6c 6c 69 6e 67 | 20 74 74 79 73 0a 58 0a |trolling| ttys.X.|
|00003380| 50 72 6f 63 65 73 73 65 | 73 20 73 74 61 72 74 20 |Processe|s start |
|00003390| 77 69 74 68 6f 75 74 20 | 61 20 63 6f 6e 74 72 6f |without |a contro|
|000033a0| 6c 6c 69 6e 67 20 74 65 | 72 6d 69 6e 61 6c 2e 20 |lling te|rminal. |
|000033b0| 57 68 65 6e 20 61 20 70 | 72 6f 63 65 73 73 20 77 |When a p|rocess w|
|000033c0| 69 74 68 6f 75 74 20 61 | 0a 63 6f 6e 74 72 6f 6c |ithout a|.control|
|000033d0| 6c 69 6e 67 20 74 74 79 | 20 28 61 6c 73 6f 20 63 |ling tty| (also c|
|000033e0| 61 6c 6c 65 64 20 60 60 | 63 74 74 79 27 27 29 20 |alled ``|ctty'') |
|000033f0| 6f 70 65 6e 73 20 61 20 | 74 74 79 2c 20 69 74 20 |opens a |tty, it |
|00003400| 69 73 20 61 73 73 69 67 | 6e 65 64 20 74 68 61 74 |is assig|ned that|
|00003410| 0a 63 74 74 79 2c 20 61 | 6e 64 20 74 68 65 20 63 |.ctty, a|nd the c|
|00003420| 74 74 79 20 69 73 20 70 | 72 65 73 65 72 76 65 64 |tty is p|reserved|
|00003430| 20 74 68 72 6f 75 67 68 | 20 66 6f 72 6b 28 29 20 | through| fork() |
|00003440| 61 6e 64 20 65 78 65 63 | 28 29 2e 20 44 69 66 66 |and exec|(). Diff|
|00003450| 65 72 65 6e 74 0a 55 4e | 49 58 20 73 79 73 74 65 |erent.UN|IX syste|
|00003460| 6d 73 20 68 61 76 65 20 | 76 61 72 69 6f 75 73 20 |ms have |various |
|00003470| 6d 65 74 68 6f 64 73 20 | 6f 66 20 72 65 6d 6f 76 |methods |of remov|
|00003480| 69 6e 67 20 74 68 65 20 | 61 73 73 6f 63 69 61 74 |ing the |associat|
|00003490| 69 6f 6e 20 62 65 74 77 | 65 65 6e 20 61 0a 70 72 |ion betw|een a.pr|
|000034a0| 6f 63 65 73 73 20 61 6e | 64 20 69 74 73 20 63 6f |ocess an|d its co|
|000034b0| 6e 74 72 6f 6c 6c 69 6e | 67 20 74 74 79 2e 20 57 |ntrollin|g tty. W|
|000034c0| 65 20 77 69 6c 6c 20 72 | 65 74 75 72 6e 20 74 6f |e will r|eturn to|
|000034d0| 20 74 68 69 73 20 73 75 | 62 6a 65 63 74 20 62 65 | this su|bject be|
|000034e0| 6c 6f 77 2e 0a 58 0a 41 | 20 73 70 65 63 69 61 6c |low..X.A| special|
|000034f0| 20 66 69 6c 65 2c 20 2f | 64 65 76 2f 74 74 79 2c | file, /|dev/tty,|
|00003500| 20 69 73 20 61 63 63 65 | 73 73 69 62 6c 65 20 74 | is acce|ssible t|
|00003510| 6f 20 61 6c 6c 20 70 72 | 6f 63 65 73 73 65 73 20 |o all pr|ocesses |
|00003520| 61 74 20 61 6c 6c 20 74 | 69 6d 65 73 2e 0a 57 68 |at all t|imes..Wh|
|00003530| 65 6e 20 61 20 70 72 6f | 63 65 73 73 20 6f 70 65 |en a pro|cess ope|
|00003540| 6e 73 20 2f 64 65 76 2f | 74 74 79 2c 20 69 74 20 |ns /dev/|tty, it |
|00003550| 67 65 74 73 20 61 20 76 | 61 6c 69 64 20 64 65 73 |gets a v|alid des|
|00003560| 63 72 69 70 74 6f 72 20 | 74 6f 20 69 74 73 20 63 |criptor |to its c|
|00003570| 74 74 79 2c 0a 6f 72 20 | 45 4e 4f 44 45 56 20 69 |tty,.or |ENODEV i|
|00003580| 66 20 69 74 20 64 6f 65 | 73 20 6e 6f 74 20 68 61 |f it doe|s not ha|
|00003590| 76 65 20 61 20 63 74 74 | 79 2e 20 54 68 65 20 70 |ve a ctt|y. The p|
|000035a0| 72 6f 74 65 63 74 69 6f | 6e 20 6f 6e 20 74 68 65 |rotectio|n on the|
|000035b0| 20 61 63 74 75 61 6c 20 | 74 74 79 0a 66 69 6c 65 | actual |tty.file|
|000035c0| 20 69 73 20 69 72 72 65 | 6c 65 76 61 6e 74 20 74 | is irre|levant t|
|000035d0| 6f 20 2f 64 65 76 2f 74 | 74 79 2e 0a 58 0a 55 6e |o /dev/t|ty..X.Un|
|000035e0| 64 65 72 20 42 53 44 20 | 34 2e 32 2c 20 74 68 65 |der BSD |4.2, the|
|000035f0| 20 63 6f 6e 74 72 6f 6c | 6c 69 6e 67 20 74 74 79 | control|ling tty|
|00003600| 20 68 61 73 20 61 6c 6d | 6f 73 74 20 6e 6f 20 65 | has alm|ost no e|
|00003610| 66 66 65 63 74 73 20 6f | 6e 20 6a 6f 62 20 63 6f |ffects o|n job co|
|00003620| 6e 74 72 6f 6c 2e 0a 42 | 53 44 20 34 2e 33 20 61 |ntrol..B|SD 4.3 a|
|00003630| 64 64 65 64 20 73 6f 6d | 65 20 72 75 6c 65 73 20 |dded som|e rules |
|00003640| 69 6e 20 74 68 65 20 6e | 61 6d 65 20 6f 66 20 6a |in the n|ame of j|
|00003650| 6f 62 20 63 6f 6e 74 72 | 6f 6c 20 73 65 63 75 72 |ob contr|ol secur|
|00003660| 69 74 79 2e 20 50 4f 53 | 49 58 20 77 65 6e 74 0a |ity. POS|IX went.|
|00003670| 6d 75 63 68 20 66 61 72 | 74 68 65 72 2c 20 61 6e |much far|ther, an|
|00003680| 64 20 66 6f 72 6d 61 6c | 69 7a 65 64 20 63 6f 6e |d formal|ized con|
|00003690| 74 72 6f 6c 6c 69 6e 67 | 20 74 74 79 73 20 69 6e |trolling| ttys in|
|000036a0| 74 6f 20 60 60 73 65 73 | 73 69 6f 6e 73 2e 27 27 |to ``ses|sions.''|
|000036b0| 20 45 61 63 68 0a 70 72 | 6f 63 65 73 73 20 69 73 | Each.pr|ocess is|
|000036c0| 20 61 73 73 6f 63 69 61 | 74 65 64 20 77 69 74 68 | associa|ted with|
|000036d0| 20 61 20 73 65 73 73 69 | 6f 6e 2c 20 61 6e 64 20 | a sessi|on, and |
|000036e0| 76 61 72 69 6f 75 73 20 | 61 64 2d 68 6f 63 20 73 |various |ad-hoc s|
|000036f0| 65 73 73 69 6f 6e 20 72 | 75 6c 65 73 0a 61 72 65 |ession r|ules.are|
|00003700| 20 74 68 72 6f 77 6e 20 | 69 6e 20 74 6f 20 63 6f | thrown |in to co|
|00003710| 6d 70 6c 69 63 61 74 65 | 20 6a 6f 62 20 63 6f 6e |mplicate| job con|
|00003720| 74 72 6f 6c 20 61 6e 64 | 20 73 69 67 6e 61 6c 20 |trol and| signal |
|00003730| 70 72 6f 63 65 73 73 69 | 6e 67 20 69 6e 0a 67 65 |processi|ng in.ge|
|00003740| 6e 65 72 61 6c 2e 20 28 | 46 6f 72 20 69 6e 73 74 |neral. (|For inst|
|00003750| 61 6e 63 65 2c 20 61 20 | 70 72 6f 63 65 73 73 20 |ance, a |process |
|00003760| 63 61 6e 20 6f 6e 6c 79 | 20 73 74 6f 70 20 69 66 |can only| stop if|
|00003770| 20 69 74 73 20 70 61 72 | 65 6e 74 20 69 73 20 69 | its par|ent is i|
|00003780| 6e 20 74 68 65 0a 58 2a | 73 61 6d 65 2a 20 73 65 |n the.X*|same* se|
|00003790| 73 73 69 6f 6e 20 62 75 | 74 20 61 20 2a 64 69 66 |ssion bu|t a *dif|
|000037a0| 66 65 72 65 6e 74 2a 20 | 70 72 6f 63 65 73 73 20 |ferent* |process |
|000037b0| 67 72 6f 75 70 2e 29 20 | 54 68 65 20 70 72 6f 62 |group.) |The prob|
|000037c0| 6c 65 6d 20 6f 66 0a 73 | 75 70 70 6f 72 74 69 6e |lem of.s|upportin|
|000037d0| 67 20 6a 6f 62 20 63 6f | 6e 74 72 6f 6c 20 77 69 |g job co|ntrol wi|
|000037e0| 74 68 6f 75 74 20 6c 6f | 73 69 6e 67 20 73 65 63 |thout lo|sing sec|
|000037f0| 75 72 69 74 79 20 62 65 | 63 61 6d 65 20 61 6e 20 |urity be|came an |
|00003800| 65 78 63 75 73 65 20 66 | 6f 72 0a 63 6f 6e 74 72 |excuse f|or.contr|
|00003810| 6f 6c 6c 69 6e 67 20 74 | 65 72 6d 69 6e 61 6c 73 |olling t|erminals|
|00003820| 20 61 6e 64 20 73 65 73 | 73 69 6f 6e 73 2e 0a 58 | and ses|sions..X|
|00003830| 0a 41 74 20 74 68 69 73 | 20 70 6f 69 6e 74 20 77 |.At this| point w|
|00003840| 65 20 63 61 6e 20 69 64 | 65 6e 74 69 66 79 20 73 |e can id|entify s|
|00003850| 69 78 20 73 65 70 61 72 | 61 74 65 20 66 6f 72 6d |ix separ|ate form|
|00003860| 73 20 6f 66 20 61 63 63 | 65 73 73 20 74 6f 20 61 |s of acc|ess to a|
|00003870| 20 74 74 79 0a 64 65 76 | 69 63 65 2c 20 73 61 79 | tty.dev|ice, say|
|00003880| 20 2f 64 65 76 2f 74 74 | 79 70 37 2c 20 62 79 20 | /dev/tt|yp7, by |
|00003890| 61 20 70 72 6f 63 65 73 | 73 3a 0a 58 0a 58 20 20 |a proces|s:.X.X |
|000038a0| 20 4f 20 28 6f 77 6e 65 | 72 73 68 69 70 29 20 61 | O (owne|rship) a|
|000038b0| 63 63 65 73 73 3a 20 75 | 69 64 20 6f 77 6e 73 20 |ccess: u|id owns |
|000038c0| 2f 64 65 76 2f 74 74 79 | 70 37 0a 58 20 20 20 50 |/dev/tty|p7.X P|
|000038d0| 20 28 70 72 6f 74 65 63 | 74 69 6f 6e 29 20 61 63 | (protec|tion) ac|
|000038e0| 63 65 73 73 3a 20 75 69 | 64 20 68 61 73 20 70 65 |cess: ui|d has pe|
|000038f0| 72 6d 69 73 69 6f 6e 20 | 74 6f 20 6f 70 65 6e 20 |rmision |to open |
|00003900| 2f 64 65 76 2f 74 74 79 | 70 37 0a 58 20 20 20 43 |/dev/tty|p7.X C|
|00003910| 20 28 63 74 74 79 29 20 | 61 63 63 65 73 73 3a 20 | (ctty) |access: |
|00003920| 63 75 72 72 65 6e 74 20 | 63 74 74 79 20 69 73 20 |current |ctty is |
|00003930| 2f 64 65 76 2f 74 74 79 | 70 37 0a 58 20 20 20 54 |/dev/tty|p7.X T|
|00003940| 20 28 2f 64 65 76 2f 74 | 74 79 29 20 61 63 63 65 | (/dev/t|ty) acce|
|00003950| 73 73 3a 20 66 69 6c 65 | 20 64 65 73 63 72 69 70 |ss: file| descrip|
|00003960| 74 6f 72 20 74 6f 20 2f | 64 65 76 2f 74 74 79 2c |tor to /|dev/tty,|
|00003970| 20 70 6f 69 6e 74 69 6e | 67 20 74 6f 20 2f 64 65 | pointin|g to /de|
|00003980| 76 2f 74 74 79 70 37 0a | 58 20 20 20 53 20 28 73 |v/ttyp7.|X S (s|
|00003990| 6c 61 76 65 29 20 61 63 | 63 65 73 73 3a 20 66 69 |lave) ac|cess: fi|
|000039a0| 6c 65 20 64 65 73 63 72 | 69 70 74 6f 72 20 74 6f |le descr|iptor to|
|000039b0| 20 2f 64 65 76 2f 74 74 | 79 70 37 20 69 74 73 65 | /dev/tt|yp7 itse|
|000039c0| 6c 66 0a 58 20 20 20 4d | 20 28 6d 61 73 74 65 72 |lf.X M| (master|
|000039d0| 29 20 61 63 63 65 73 73 | 3a 20 66 69 6c 65 20 64 |) access|: file d|
|000039e0| 65 73 63 72 69 70 74 6f | 72 20 74 6f 20 2f 64 65 |escripto|r to /de|
|000039f0| 76 2f 70 74 79 70 37 20 | 28 70 73 65 75 64 6f 2d |v/ptyp7 |(pseudo-|
|00003a00| 74 74 79 73 20 6f 6e 6c | 79 29 0a 58 0a 58 28 54 |ttys onl|y).X.X(T|
|00003a10| 68 65 20 6e 61 6d 65 73 | 20 60 60 6d 61 73 74 65 |he names| ``maste|
|00003a20| 72 27 27 20 61 6e 64 20 | 60 60 73 6c 61 76 65 27 |r'' and |``slave'|
|00003a30| 27 20 61 72 65 20 70 73 | 65 75 64 6f 2d 74 74 79 |' are ps|eudo-tty|
|00003a40| 20 74 65 72 6d 69 6e 6f | 6c 6f 67 79 2e 29 0a 54 | termino|logy.).T|
|00003a50| 68 65 20 73 79 73 74 65 | 6d 20 6c 65 74 73 20 61 |he syste|m lets a|
|00003a60| 20 70 72 6f 63 65 73 73 | 20 61 63 71 75 69 72 65 | process| acquire|
|00003a70| 20 61 63 63 65 73 73 20 | 69 6e 20 73 65 76 65 72 | access |in sever|
|00003a80| 61 6c 20 77 61 79 73 3a | 20 41 20 70 72 6f 63 65 |al ways:| A proce|
|00003a90| 73 73 20 77 69 74 68 0a | 4f 20 61 63 63 65 73 73 |ss with.|O access|
|00003aa0| 20 63 61 6e 20 67 61 69 | 6e 20 50 20 61 63 63 65 | can gai|n P acce|
|00003ab0| 73 73 2e 20 41 20 70 72 | 6f 63 65 73 73 20 77 69 |ss. A pr|ocess wi|
|00003ac0| 74 68 20 50 20 61 63 63 | 65 73 73 20 63 61 6e 20 |th P acc|ess can |
|00003ad0| 67 61 69 6e 20 53 20 61 | 63 63 65 73 73 2e 20 41 |gain S a|ccess. A|
|00003ae0| 0a 70 72 6f 63 65 73 73 | 20 77 69 74 68 20 43 20 |.process| with C |
|00003af0| 61 63 63 65 73 73 20 63 | 61 6e 20 67 61 69 6e 20 |access c|an gain |
|00003b00| 54 20 61 63 63 65 73 73 | 2e 20 41 20 70 72 6f 63 |T access|. A proc|
|00003b10| 65 73 73 20 77 69 74 68 | 20 4d 20 6f 72 20 53 20 |ess with| M or S |
|00003b20| 61 63 63 65 73 73 0a 63 | 61 6e 20 67 61 69 6e 20 |access.c|an gain |
|00003b30| 43 20 61 63 63 65 73 73 | 2e 20 41 20 70 72 6f 63 |C access|. A proc|
|00003b40| 65 73 73 20 63 61 6e 20 | 67 61 69 6e 20 4d 20 61 |ess can |gain M a|
|00003b50| 63 63 65 73 73 20 28 62 | 79 20 6f 70 65 6e 69 6e |ccess (b|y openin|
|00003b60| 67 20 2f 64 65 76 2f 70 | 74 79 70 37 29 0a 69 66 |g /dev/p|typ7).if|
|00003b70| 20 6e 6f 20 6f 74 68 65 | 72 20 70 72 6f 63 65 73 | no othe|r proces|
|00003b80| 73 20 68 61 73 20 4d 20 | 61 63 63 65 73 73 2e 0a |s has M |access..|
|00003b90| 58 0a 55 6e 64 65 72 20 | 42 53 44 2c 20 74 6f 20 |X.Under |BSD, to |
|00003ba0| 73 68 65 64 20 43 20 61 | 63 63 65 73 73 2c 20 61 |shed C a|ccess, a|
|00003bb0| 20 70 72 6f 63 65 73 73 | 20 6d 75 73 74 20 67 61 | process| must ga|
|00003bc0| 69 6e 20 54 20 61 63 63 | 65 73 73 20 28 69 2e 65 |in T acc|ess (i.e|
|00003bd0| 2e 2c 20 6f 70 65 6e 0a | 58 2f 64 65 76 2f 74 74 |., open.|X/dev/tt|
|00003be0| 79 29 20 61 6e 64 20 70 | 65 72 66 6f 72 6d 20 74 |y) and p|erform t|
|00003bf0| 68 65 20 54 49 4f 43 4e | 4f 54 54 59 20 69 6f 63 |he TIOCN|OTTY ioc|
|00003c00| 74 6c 2e 20 55 6e 66 6f | 72 74 75 6e 61 74 65 6c |tl. Unfo|rtunatel|
|00003c10| 79 2c 20 69 66 20 61 6e | 79 20 70 72 6f 63 65 73 |y, if an|y proces|
|00003c20| 73 0a 61 70 70 6c 69 65 | 73 20 74 68 65 20 54 49 |s.applie|s the TI|
|00003c30| 4f 43 45 58 43 4c 20 69 | 6f 63 74 6c 20 74 6f 20 |OCEXCL i|octl to |
|00003c40| 74 68 65 20 74 74 79 2c | 20 6e 6f 20 70 72 6f 63 |the tty,| no proc|
|00003c50| 65 73 73 20 77 69 6c 6c | 20 62 65 20 61 62 6c 65 |ess will| be able|
|00003c60| 20 74 6f 20 6f 70 65 6e | 0a 58 2f 64 65 76 2f 74 | to open|.X/dev/t|
|00003c70| 74 79 20 69 74 73 65 6c | 66 20 75 6e 74 69 6c 20 |ty itsel|f until |
|00003c80| 73 6f 6d 65 20 70 72 6f | 63 65 73 73 20 64 6f 65 |some pro|cess doe|
|00003c90| 73 20 54 49 4f 43 4e 58 | 43 4c 2e 20 41 20 70 72 |s TIOCNX|CL. A pr|
|00003ca0| 6f 67 72 61 6d 20 73 74 | 75 63 6b 20 75 6e 64 65 |ogram st|uck unde|
|00003cb0| 72 0a 61 20 74 74 79 20 | 77 69 74 68 20 54 49 4f |r.a tty |with TIO|
|00003cc0| 43 45 58 43 4c 20 73 65 | 74 20 68 61 73 20 2a 61 |CEXCL se|t has *a|
|00003cd0| 62 73 6f 6c 75 74 65 6c | 79 20 6e 6f 20 72 65 6c |bsolutel|y no rel|
|00003ce0| 69 61 62 6c 65 20 77 61 | 79 2a 20 74 6f 20 64 69 |iable wa|y* to di|
|00003cf0| 73 73 6f 63 69 61 74 65 | 0a 69 74 73 65 6c 66 20 |ssociate|.itself |
|00003d00| 66 72 6f 6d 20 74 68 61 | 74 20 74 74 79 2e 20 28 |from tha|t tty. (|
|00003d10| 50 65 72 68 61 70 73 20 | 74 68 69 73 20 69 73 20 |Perhaps |this is |
|00003d20| 6e 6f 74 20 61 20 73 75 | 72 70 72 69 73 65 20 67 |not a su|rprise g|
|00003d30| 69 76 65 6e 20 74 68 61 | 74 20 74 68 65 72 65 0a |iven tha|t there.|
|00003d40| 69 73 20 61 6c 73 6f 20 | 61 62 73 6f 6c 75 74 65 |is also |absolute|
|00003d50| 6c 79 20 6e 6f 20 72 65 | 6c 69 61 62 6c 65 20 77 |ly no re|liable w|
|00003d60| 61 79 20 66 6f 72 20 61 | 20 70 72 6f 63 65 73 73 |ay for a| process|
|00003d70| 20 74 6f 20 66 69 67 75 | 72 65 20 6f 75 74 20 77 | to figu|re out w|
|00003d80| 68 61 74 20 74 74 79 0a | 69 74 20 69 73 20 61 73 |hat tty.|it is as|
|00003d90| 73 6f 63 69 61 74 65 64 | 20 77 69 74 68 20 69 6e |sociated| with in|
|00003da0| 20 74 68 65 20 66 69 72 | 73 74 20 70 6c 61 63 65 | the fir|st place|
|00003db0| 2e 29 0a 58 0a 41 6e 64 | 20 74 68 65 20 54 49 4f |.).X.And| the TIO|
|00003dc0| 43 45 58 43 4c 20 70 72 | 6f 62 6c 65 6d 20 70 61 |CEXCL pr|oblem pa|
|00003dd0| 6c 65 73 20 62 65 73 69 | 64 65 20 74 68 65 20 6e |les besi|de the n|
|00003de0| 75 6d 62 65 72 20 6f 66 | 20 74 77 69 73 74 73 20 |umber of| twists |
|00003df0| 61 6e 64 20 74 75 72 6e | 73 0a 69 6e 74 72 6f 64 |and turn|s.introd|
|00003e00| 75 63 65 64 20 62 79 20 | 50 4f 53 49 58 2e 20 4f |uced by |POSIX. O|
|00003e10| 62 76 69 6f 75 73 6c 79 | 20 74 68 69 73 20 69 73 |bviously| this is|
|00003e20| 20 6e 6f 74 20 61 20 73 | 69 6d 70 6c 65 20 73 79 | not a s|imple sy|
|00003e30| 73 74 65 6d 20 74 6f 20 | 69 6d 70 6c 65 6d 65 6e |stem to |implemen|
|00003e40| 74 2c 0a 75 73 65 2c 20 | 75 6e 64 65 72 73 74 61 |t,.use, |understa|
|00003e50| 6e 64 2c 20 6f 72 20 6d | 61 6b 65 20 73 65 63 75 |nd, or m|ake secu|
|00003e60| 72 65 2e 0a 58 0a 58 0a | 58 33 2e 20 53 65 63 75 |re..X.X.|X3. Secu|
|00003e70| 72 69 74 79 0a 58 0a 53 | 74 65 76 65 20 42 65 6c |rity.X.S|teve Bel|
|00003e80| 6c 6f 76 69 6e 20 70 6f | 69 6e 74 65 64 20 6f 75 |lovin po|inted ou|
|00003e90| 74 20 79 65 61 72 73 20 | 61 67 6f 20 28 5b 5d 29 |t years |ago ([])|
|00003ea0| 2c 20 61 73 20 64 69 64 | 20 74 68 69 73 20 61 75 |, as did| this au|
|00003eb0| 74 68 6f 72 20 28 5b 5d | 29 2c 20 74 68 61 74 0a |thor ([]|), that.|
|00003ec0| 61 6e 20 61 74 74 61 63 | 6b 65 72 20 63 6f 75 6c |an attac|ker coul|
|00003ed0| 64 20 61 62 75 73 65 20 | 63 6f 6e 74 72 6f 6c 6c |d abuse |controll|
|00003ee0| 69 6e 67 20 74 74 79 73 | 20 74 6f 20 74 61 6b 65 |ing ttys| to take|
|00003ef0| 20 61 6c 6d 6f 73 74 20 | 63 6f 6d 70 6c 65 74 65 | almost |complete|
|00003f00| 20 63 6f 6e 74 72 6f 6c | 0a 6f 66 20 74 68 65 20 | control|.of the |
|00003f10| 73 79 73 74 65 6d 2e 20 | 50 75 74 20 73 69 6d 70 |system. |Put simp|
|00003f20| 6c 79 2c 20 69 74 20 69 | 73 20 76 65 72 79 20 64 |ly, it i|s very d|
|00003f30| 69 66 66 69 63 75 6c 74 | 20 74 6f 20 64 65 74 65 |ifficult| to dete|
|00003f40| 63 74 2c 20 6c 65 74 20 | 61 6c 6f 6e 65 0a 72 65 |ct, let |alone.re|
|00003f50| 76 6f 6b 65 2c 20 77 68 | 65 74 68 65 72 20 61 6e |voke, wh|ether an|
|00003f60| 6f 74 68 65 72 20 75 73 | 65 72 20 68 61 73 20 53 |other us|er has S|
|00003f70| 2c 20 54 2c 20 6f 72 20 | 43 20 61 63 63 65 73 73 |, T, or |C access|
|00003f80| 20 74 6f 20 61 20 74 74 | 79 2e 0a 58 0a 42 53 44 | to a tt|y..X.BSD|
|00003f90| 20 34 2e 32 20 61 6e 64 | 20 69 74 73 20 64 65 73 | 4.2 and| its des|
|00003fa0| 63 65 6e 64 61 6e 74 73 | 20 68 61 76 65 20 61 20 |cendants| have a |
|00003fb0| 76 68 61 6e 67 75 70 28 | 29 20 73 79 73 74 65 6d |vhangup(|) system|
|00003fc0| 20 63 61 6c 6c 20 6d 65 | 61 6e 74 20 74 6f 20 72 | call me|ant to r|
|00003fd0| 65 76 6f 6b 65 0a 61 63 | 63 65 73 73 20 74 6f 20 |evoke.ac|cess to |
|00003fe0| 61 20 74 74 79 2e 20 55 | 6e 66 6f 72 74 75 6e 61 |a tty. U|nfortuna|
|00003ff0| 74 65 6c 79 2c 20 69 74 | 20 64 6f 65 73 6e 27 74 |tely, it| doesn't|
|00004000| 20 77 6f 72 6b 20 6f 6e | 20 6d 6f 73 74 20 73 79 | work on| most sy|
|00004010| 73 74 65 6d 73 2c 20 61 | 6e 64 0a 6f 6e 6c 79 20 |stems, a|nd.only |
|00004020| 72 65 76 6f 6b 65 73 20 | 53 20 61 63 63 65 73 73 |revokes |S access|
|00004030| 20 6f 6e 20 74 68 65 20 | 72 65 73 74 2e 20 28 54 | on the |rest. (T|
|00004040| 68 69 73 20 61 75 74 68 | 6f 72 20 63 6f 6e 73 69 |his auth|or consi|
|00004050| 64 65 72 73 20 76 68 61 | 6e 67 75 70 28 29 20 61 |ders vha|ngup() a|
|00004060| 0a 6a 6f 6b 65 20 69 6e | 20 76 65 72 79 20 70 6f |.joke in| very po|
|00004070| 6f 72 20 74 61 73 74 65 | 2e 29 0a 58 0a 53 65 76 |or taste|.).X.Sev|
|00004080| 65 72 61 6c 20 76 65 6e | 64 6f 72 73 20 68 61 76 |eral ven|dors hav|
|00004090| 65 20 61 74 74 65 6d 70 | 74 65 64 20 74 6f 20 66 |e attemp|ted to f|
|000040a0| 69 78 20 74 68 69 73 20 | 70 72 6f 62 6c 65 6d 2e |ix this |problem.|
|000040b0| 20 54 68 65 20 43 6f 6e | 76 65 78 20 55 4e 49 58 | The Con|vex UNIX|
|000040c0| 20 38 2e 30 0a 64 6f 63 | 75 6d 65 6e 74 61 74 69 | 8.0.doc|umentati|
|000040d0| 6f 6e 2c 20 66 6f 72 20 | 69 6e 73 74 61 6e 63 65 |on, for |instance|
|000040e0| 2c 20 73 61 79 73 20 74 | 68 61 74 20 74 68 65 20 |, says t|hat the |
|000040f0| 68 6f 6c 65 73 20 61 72 | 65 20 67 6f 6e 65 2e 20 |holes ar|e gone. |
|00004100| 54 68 65 79 27 72 65 20 | 6e 6f 74 2e 0a 43 6f 6e |They're |not..Con|
|00004110| 76 65 78 20 69 6e 73 69 | 73 74 65 64 20 74 68 61 |vex insi|sted tha|
|00004120| 74 20 69 74 73 20 73 79 | 73 74 65 6d 20 77 61 73 |t its sy|stem was|
|00004130| 20 73 65 63 75 72 65 20 | 75 6e 74 69 6c 20 74 68 | secure |until th|
|00004140| 65 20 61 75 74 68 6f 72 | 20 73 65 6e 74 0a 65 78 |e author| sent.ex|
|00004150| 70 6c 69 63 69 74 20 63 | 6f 64 65 20 73 68 6f 77 |plicit c|ode show|
|00004160| 69 6e 67 20 68 6f 77 20 | 74 6f 20 62 72 65 61 6b |ing how |to break|
|00004170| 20 74 74 79 20 73 65 63 | 75 72 69 74 79 2e 0a 58 | tty sec|urity..X|
|00004180| 0a 53 69 6d 69 6c 61 72 | 6c 79 2c 20 61 66 74 65 |.Similar|ly, afte|
|00004190| 72 20 61 20 73 65 72 69 | 65 73 20 6f 66 20 49 6e |r a seri|es of In|
|000041a0| 74 65 72 6e 65 74 20 62 | 72 65 61 6b 69 6e 73 20 |ternet b|reakins |
|000041b0| 75 73 69 6e 67 20 74 74 | 79 20 73 65 63 75 72 69 |using tt|y securi|
|000041c0| 74 79 20 68 6f 6c 65 73 | 2c 0a 53 75 6e 20 64 69 |ty holes|,.Sun di|
|000041d0| 73 74 72 69 62 75 74 65 | 64 20 61 20 70 61 74 63 |stribute|d a patc|
|000041e0| 68 20 74 6f 20 74 68 65 | 69 72 20 53 75 6e 4f 53 |h to the|ir SunOS|
|000041f0| 20 34 2e 31 20 74 65 6c | 6e 65 74 64 20 61 6e 64 | 4.1 tel|netd and|
|00004200| 20 72 6c 6f 67 69 6e 64 | 0a 73 75 70 70 6f 73 65 | rlogind|.suppose|
|00004210| 64 6c 79 20 66 69 78 69 | 6e 67 20 74 68 65 20 70 |dly fixi|ng the p|
|00004220| 72 6f 62 6c 65 6d 73 20 | 28 5b 5d 29 2e 20 28 49 |roblems |([]). (I|
|00004230| 74 20 69 73 20 77 6f 72 | 74 68 20 6e 6f 74 69 6e |t is wor|th notin|
|00004240| 67 20 74 68 61 74 0a 65 | 73 73 65 6e 74 69 61 6c |g that.e|ssential|
|00004250| 6c 79 20 74 68 65 20 73 | 61 6d 65 20 66 69 78 20 |ly the s|ame fix |
|00004260| 61 70 70 65 61 72 65 64 | 20 69 6e 20 76 65 72 73 |appeared| in vers|
|00004270| 69 6f 6e 20 33 2e 30 20 | 6f 66 20 74 68 65 20 61 |ion 3.0 |of the a|
|00004280| 75 74 68 6f 72 27 73 20 | 70 74 79 0a 70 61 63 6b |uthor's |pty.pack|
|00004290| 61 67 65 20 5b 5d 20 73 | 65 76 65 72 61 6c 20 6d |age [] s|everal m|
|000042a0| 6f 6e 74 68 73 20 62 65 | 66 6f 72 65 2e 29 20 41 |onths be|fore.) A|
|000042b0| 6c 74 68 6f 75 67 68 20 | 74 68 65 20 70 61 74 63 |lthough |the patc|
|000042c0| 68 20 77 61 73 20 65 6e | 6f 75 67 68 20 74 6f 0a |h was en|ough to.|
|000042d0| 74 65 6d 70 6f 72 61 72 | 69 6c 79 20 73 74 6f 70 |temporar|ily stop|
|000042e0| 20 74 68 65 20 61 74 74 | 61 63 6b 73 2c 20 69 74 | the att|acks, it|
|000042f0| 20 64 69 64 20 6e 6f 74 | 20 63 6c 6f 73 65 20 43 | did not| close C|
|00004300| 20 61 63 63 65 73 73 2c | 20 61 6e 64 20 68 65 6e | access,| and hen|
|00004310| 63 65 20 77 61 73 0a 6e | 6f 74 20 65 6e 6f 75 67 |ce was.n|ot enoug|
|00004320| 68 2e 0a 58 0a 56 65 72 | 73 69 6f 6e 20 34 2e 30 |h..X.Ver|sion 4.0|
|00004330| 20 6f 66 20 74 68 65 20 | 61 75 74 68 6f 72 27 73 | of the |author's|
|00004340| 20 70 74 79 20 70 61 63 | 6b 61 67 65 20 28 5b 5d | pty pac|kage ([]|
|00004350| 29 20 69 6e 63 6c 75 64 | 65 73 20 73 65 63 75 72 |) includ|es secur|
|00004360| 69 74 79 20 74 65 73 74 | 73 0a 77 68 69 63 68 20 |ity test|s.which |
|00004370| 64 65 74 65 63 74 20 61 | 6c 6c 20 70 6f 73 73 69 |detect a|ll possi|
|00004380| 62 6c 65 20 66 6f 72 6d | 73 20 6f 66 20 74 74 79 |ble form|s of tty|
|00004390| 20 61 63 63 65 73 73 2c | 20 61 6e 64 20 77 68 69 | access,| and whi|
|000043a0| 63 68 20 77 6f 72 6b 20 | 6f 6e 20 61 6e 79 20 42 |ch work |on any B|
|000043b0| 53 44 0a 73 79 73 74 65 | 6d 2e 20 49 74 20 69 73 |SD.syste|m. It is|
|000043c0| 20 6f 62 73 63 65 6e 65 | 20 74 68 61 74 20 73 75 | obscene| that su|
|000043d0| 63 68 20 6d 65 61 73 75 | 72 65 73 20 68 61 76 65 |ch measu|res have|
|000043e0| 20 70 72 6f 76 65 6e 20 | 6e 65 63 65 73 73 61 72 | proven |necessar|
|000043f0| 79 2e 20 49 6e 20 74 68 | 65 0a 6d 65 61 6e 74 69 |y. In th|e.meanti|
|00004400| 6d 65 2c 20 63 72 61 63 | 6b 65 72 73 20 66 72 6f |me, crac|kers fro|
|00004410| 6d 20 74 68 65 20 4e 65 | 74 68 65 72 6c 61 6e 64 |m the Ne|therland|
|00004420| 73 20 61 6e 64 20 65 6c | 73 65 77 68 65 72 65 20 |s and el|sewhere |
|00004430| 68 61 76 65 20 62 72 6f | 6b 65 6e 20 69 6e 74 6f |have bro|ken into|
|00004440| 0a 6c 69 74 65 72 61 6c | 6c 79 20 74 68 6f 75 73 |.literal|ly thous|
|00004450| 61 6e 64 73 20 6f 66 20 | 49 6e 74 65 72 6e 65 74 |ands of |Internet|
|00004460| 20 61 63 63 6f 75 6e 74 | 73 2c 20 74 61 6b 69 6e | account|s, takin|
|00004470| 67 20 61 64 76 61 6e 74 | 61 67 65 20 6f 66 20 74 |g advant|age of t|
|00004480| 74 79 0a 73 65 63 75 72 | 69 74 79 20 68 6f 6c 65 |ty.secur|ity hole|
|00004490| 73 20 61 74 20 77 69 6c | 6c 2e 0a 58 0a 58 0a 58 |s at wil|l..X.X.X|
|000044a0| 34 2e 20 53 69 6d 70 6c | 69 66 69 63 61 74 69 6f |4. Simpl|ificatio|
|000044b0| 6e 73 0a 58 0a 55 6e 64 | 65 72 20 53 75 6e 4f 53 |ns.X.Und|er SunOS|
|000044c0| 20 34 2e 31 2c 20 42 53 | 44 20 34 2e 34 2c 20 61 | 4.1, BS|D 4.4, a|
|000044d0| 6e 64 20 61 20 66 65 77 | 20 6f 74 68 65 72 20 73 |nd a few| other s|
|000044e0| 79 73 74 65 6d 73 2c 20 | 54 20 61 63 63 65 73 73 |ystems, |T access|
|000044f0| 20 68 61 73 20 62 65 65 | 6e 0a 72 65 6d 6f 76 65 | has bee|n.remove|
|00004500| 64 2e 20 41 20 70 72 6f | 63 65 73 73 20 77 68 69 |d. A pro|cess whi|
|00004510| 63 68 20 6f 70 65 6e 73 | 20 2f 64 65 76 2f 74 74 |ch opens| /dev/tt|
|00004520| 79 20 77 69 6c 6c 20 67 | 65 74 20 61 20 66 75 6c |y will g|et a ful|
|00004530| 6c 2d 66 6c 65 64 67 65 | 64 0a 64 65 73 63 72 69 |l-fledge|d.descri|
|00004540| 70 74 6f 72 20 74 6f 20 | 2f 64 65 76 2f 74 74 79 |ptor to |/dev/tty|
|00004550| 70 37 3b 20 74 68 65 72 | 65 20 69 73 20 6e 6f 20 |p7; ther|e is no |
|00004560| 6c 6f 6e 67 65 72 20 61 | 6e 79 20 64 69 73 74 69 |longer a|ny disti|
|00004570| 6e 63 74 69 6f 6e 20 62 | 65 74 77 65 65 6e 0a 58 |nction b|etween.X|
|00004580| 2f 64 65 76 2f 74 74 79 | 20 61 6e 64 20 74 68 65 |/dev/tty| and the|
|00004590| 20 72 65 61 6c 20 74 74 | 79 20 66 69 6c 65 20 69 | real tt|y file i|
|000045a0| 74 20 72 65 66 65 72 73 | 20 74 6f 2c 20 65 78 63 |t refers| to, exc|
|000045b0| 65 70 74 20 74 68 61 74 | 20 2f 64 65 76 2f 74 74 |ept that| /dev/tt|
|000045c0| 79 20 69 73 0a 61 6c 77 | 61 79 73 20 63 6f 6d 70 |y is.alw|ays comp|
|000045d0| 6c 65 74 65 6c 79 20 75 | 6e 70 72 6f 74 65 63 74 |letely u|nprotect|
|000045e0| 65 64 2e 0a 58 0a 41 6e | 79 20 65 78 63 75 73 65 |ed..X.An|y excuse|
|000045f0| 20 66 6f 72 20 63 6f 6e | 74 72 6f 6c 6c 69 6e 67 | for con|trolling|
|00004600| 20 74 65 72 6d 69 6e 61 | 6c 73 20 6f 72 20 50 4f | termina|ls or PO|
|00004610| 53 49 58 20 73 65 73 73 | 69 6f 6e 73 20 6f 6e 20 |SIX sess|ions on |
|00004620| 74 68 65 20 62 61 73 69 | 73 20 6f 66 0a 6a 6f 62 |the basi|s of.job|
|00004630| 20 63 6f 6e 74 72 6f 6c | 20 73 65 63 75 72 69 74 | control| securit|
|00004640| 79 20 69 73 20 63 6f 6d | 70 6c 65 74 65 6c 79 20 |y is com|pletely |
|00004650| 69 6e 76 61 6c 69 64 2e | 20 41 73 20 70 6f 69 6e |invalid.| As poin|
|00004660| 74 65 64 20 6f 75 74 20 | 62 79 20 74 68 65 20 61 |ted out |by the a|
|00004670| 75 74 68 6f 72 0a 69 6e | 20 5b 5d 2c 20 74 68 65 |uthor.in| [], the|
|00004680| 20 6a 6f 62 20 63 6f 6e | 74 72 6f 6c 20 73 79 73 | job con|trol sys|
|00004690| 74 65 6d 20 63 61 6e 20 | 62 65 20 6d 61 64 65 20 |tem can |be made |
|000046a0| 6d 75 63 68 20 73 69 6d | 70 6c 65 72 2c 20 65 61 |much sim|pler, ea|
|000046b0| 73 69 65 72 20 74 6f 20 | 75 73 65 2c 0a 61 6e 64 |sier to |use,.and|
|000046c0| 20 73 69 6d 75 6c 74 61 | 6e 65 6f 75 73 6c 79 20 | simulta|neously |
|000046d0| 63 6f 6d 70 6c 65 74 65 | 6c 79 20 73 65 63 75 72 |complete|ly secur|
|000046e0| 65 2c 20 77 69 74 68 20 | 61 62 73 6f 6c 75 74 65 |e, with |absolute|
|000046f0| 6c 79 20 6e 6f 20 68 65 | 6c 70 20 66 72 6f 6d 20 |ly no he|lp from |
|00004700| 63 74 74 79 73 0a 6f 72 | 20 50 4f 53 49 58 20 73 |cttys.or| POSIX s|
|00004710| 65 73 73 69 6f 6e 73 2e | 20 41 73 20 73 75 67 67 |essions.| As sugg|
|00004720| 65 73 74 65 64 20 61 62 | 6f 76 65 2c 20 74 68 65 |ested ab|ove, the|
|00004730| 20 63 6f 6e 74 72 6f 6c | 6c 69 6e 67 20 74 74 79 | control|ling tty|
|00004740| 20 63 61 6e 20 62 65 20 | 70 61 73 73 65 64 0a 69 | can be |passed.i|
|00004750| 6e 20 74 68 65 20 54 54 | 59 20 65 6e 76 69 72 6f |n the TT|Y enviro|
|00004760| 6e 6d 65 6e 74 20 76 61 | 72 69 61 62 6c 65 2e 20 |nment va|riable. |
|00004770| 43 20 28 61 6e 64 20 54 | 29 20 61 63 63 65 73 73 |C (and T|) access|
|00004780| 2c 20 61 73 20 77 65 6c | 6c 20 61 73 20 50 4f 53 |, as wel|l as POS|
|00004790| 49 58 0a 73 65 73 73 69 | 6f 6e 73 2c 20 63 61 6e |IX.sessi|ons, can|
|000047a0| 20 73 69 6d 70 6c 79 20 | 64 69 73 61 70 70 65 61 | simply |disappea|
|000047b0| 72 2e 0a 58 0a 58 28 41 | 70 70 61 72 65 6e 74 6c |r..X.X(A|pparentl|
|000047c0| 79 20 74 68 65 20 64 69 | 73 61 70 70 65 61 72 61 |y the di|sappeara|
|000047d0| 6e 63 65 20 6f 66 20 63 | 74 74 79 73 20 61 6e 64 |nce of c|ttys and|
|000047e0| 20 50 4f 53 49 58 20 73 | 65 73 73 69 6f 6e 73 20 | POSIX s|essions |
|000047f0| 77 6f 75 6c 64 20 72 65 | 6d 6f 76 65 0a 61 62 73 |would re|move.abs|
|00004800| 6f 6c 75 74 65 6c 79 20 | 6e 6f 20 66 75 6e 63 74 |olutely |no funct|
|00004810| 69 6f 6e 61 6c 69 74 79 | 2c 20 66 72 6f 6d 20 65 |ionality|, from e|
|00004820| 69 74 68 65 72 20 74 68 | 65 20 75 73 65 72 27 73 |ither th|e user's|
|00004830| 20 6f 72 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 | or the |applicat|
|00004840| 69 6f 6e 27 73 0a 70 6f | 69 6e 74 20 6f 66 20 76 |ion's.po|int of v|
|00004850| 69 65 77 3b 20 61 6e 64 | 20 6f 66 20 63 6f 75 72 |iew; and| of cour|
|00004860| 73 65 20 69 74 20 77 6f | 75 6c 64 20 6d 61 6b 65 |se it wo|uld make|
|00004870| 20 61 20 6d 75 63 68 20 | 63 6c 65 61 6e 65 72 20 | a much |cleaner |
|00004880| 73 79 73 74 65 6d 20 61 | 6e 64 0a 73 74 61 6e 64 |system a|nd.stand|
|00004890| 61 72 64 20 69 66 20 69 | 74 20 77 65 72 65 20 6f |ard if i|t were o|
|000048a0| 66 66 69 63 69 61 6c 6c | 79 20 61 64 6f 70 74 65 |fficiall|y adopte|
|000048b0| 64 2e 20 54 68 65 20 61 | 75 74 68 6f 72 20 77 6f |d. The a|uthor wo|
|000048c0| 75 6c 64 20 67 72 65 61 | 74 6c 79 20 6c 6f 76 65 |uld grea|tly love|
|000048d0| 20 74 6f 0a 68 65 61 72 | 20 66 72 6f 6d 20 61 6e | to.hear| from an|
|000048e0| 79 20 70 72 6f 70 6f 6e | 65 6e 74 73 20 6f 66 20 |y propon|ents of |
|000048f0| 50 4f 53 49 58 20 73 65 | 73 73 69 6f 6e 73 20 77 |POSIX se|ssions w|
|00004900| 68 6f 20 63 61 6e 20 65 | 78 70 6c 61 69 6e 20 77 |ho can e|xplain w|
|00004910| 68 61 74 20 66 65 61 74 | 75 72 65 73 0a 74 68 65 |hat feat|ures.the|
|00004920| 79 20 70 72 6f 76 69 64 | 65 2c 20 65 73 70 65 63 |y provid|e, espec|
|00004930| 69 61 6c 6c 79 20 69 6e | 20 6c 69 67 68 74 20 6f |ially in| light o|
|00004940| 66 20 68 69 73 20 6e 65 | 77 2c 20 73 69 6d 70 6c |f his ne|w, simpl|
|00004950| 65 2c 20 73 65 63 75 72 | 65 20 6a 6f 62 20 63 6f |e, secur|e job co|
|00004960| 6e 74 72 6f 6c 0a 73 79 | 73 74 65 6d 2c 20 77 68 |ntrol.sy|stem, wh|
|00004970| 65 6e 20 69 6e 20 66 61 | 63 74 20 76 65 6e 64 6f |en in fa|ct vendo|
|00004980| 72 73 2c 20 70 72 6f 67 | 72 61 6d 6d 65 72 73 2c |rs, prog|rammers,|
|00004990| 20 61 6e 64 20 75 73 65 | 72 73 20 77 6f 75 6c 64 | and use|rs would|
|000049a0| 6e 27 74 20 63 61 72 65 | 20 69 66 0a 73 65 74 73 |n't care| if.sets|
|000049b0| 69 64 28 29 20 62 65 63 | 61 6d 65 20 61 20 6e 6f |id() bec|ame a no|
|000049c0| 2d 6f 70 2e 29 0a 58 0a | 58 46 6f 72 20 62 61 63 |-op.).X.|XFor bac|
|000049d0| 6b 77 61 72 64 73 20 63 | 6f 6d 70 61 74 69 62 69 |kwards c|ompatibi|
|000049e0| 6c 69 74 79 20 69 74 20 | 77 6f 75 6c 64 20 62 65 |lity it |would be|
|000049f0| 20 75 73 65 66 75 6c 20 | 74 6f 20 6b 65 65 70 20 | useful |to keep |
|00004a00| 61 20 2f 64 65 76 2f 74 | 74 79 20 64 65 76 69 63 |a /dev/t|ty devic|
|00004a10| 65 0a 73 6f 20 74 68 61 | 74 20 70 72 6f 67 72 61 |e.so tha|t progra|
|00004a20| 6d 73 20 64 6f 20 6e 6f | 74 20 68 61 76 65 20 74 |ms do no|t have t|
|00004a30| 6f 20 62 65 20 63 68 61 | 6e 67 65 64 20 74 6f 20 |o be cha|nged to |
|00004a40| 75 73 65 20 24 54 54 59 | 2e 20 41 70 70 6c 69 63 |use $TTY|. Applic|
|00004a50| 61 74 69 6f 6e 73 0a 72 | 75 6e 6e 69 6e 67 20 75 |ations.r|unning u|
|00004a60| 6e 64 65 72 20 74 68 65 | 20 61 75 74 68 6f 72 27 |nder the| author'|
|00004a70| 73 20 70 74 79 20 70 72 | 6f 67 72 61 6d 20 63 61 |s pty pr|ogram ca|
|00004a80| 6e 20 6e 6f 72 6d 61 6c | 6c 79 20 61 63 63 65 73 |n normal|ly acces|
|00004a90| 73 20 74 68 65 20 74 74 | 79 0a 74 68 72 6f 75 67 |s the tt|y.throug|
|00004aa0| 68 20 64 65 73 63 72 69 | 70 74 6f 72 20 33 2c 20 |h descri|ptor 3, |
|00004ab0| 73 6f 20 61 6e 20 65 61 | 73 79 20 73 6f 6c 75 74 |so an ea|sy solut|
|00004ac0| 69 6f 6e 20 68 65 72 65 | 20 69 73 20 74 6f 20 6c |ion here| is to l|
|00004ad0| 65 74 20 2f 64 65 76 2f | 74 74 79 20 62 65 20 61 |et /dev/|tty be a|
|00004ae0| 0a 73 69 6d 70 6c 65 20 | 64 72 69 76 65 72 20 77 |.simple |driver w|
|00004af0| 68 69 63 68 20 64 75 70 | 28 29 73 20 66 64 20 33 |hich dup|()s fd 3|
|00004b00| 2e 0a 58 0a 54 68 65 20 | 6f 6e 6c 79 20 6f 74 68 |..X.The |only oth|
|00004b10| 65 72 20 75 73 65 66 75 | 6c 20 66 75 6e 63 74 69 |er usefu|l functi|
|00004b20| 6f 6e 20 6f 66 20 61 20 | 63 6f 6e 74 72 6f 6c 6c |on of a |controll|
|00004b30| 69 6e 67 20 74 65 72 6d | 69 6e 61 6c 2d 2d 2d 76 |ing term|inal---v|
|00004b40| 69 7a 2e 2c 20 74 6f 20 | 68 65 6c 70 0a 74 68 65 |iz., to |help.the|
|00004b50| 20 75 73 65 72 20 63 61 | 74 65 67 6f 72 69 7a 65 | user ca|tegorize|
|00004b60| 20 70 72 6f 63 65 73 73 | 65 73 2d 2d 2d 69 73 20 | process|es---is |
|00004b70| 65 61 73 69 6c 79 20 74 | 61 6b 65 6e 20 63 61 72 |easily t|aken car|
|00004b80| 65 20 6f 66 20 61 74 20 | 75 73 65 72 20 6c 65 76 |e of at |user lev|
|00004b90| 65 6c 2e 0a 70 73 20 63 | 61 6e 20 75 73 65 20 24 |el..ps c|an use $|
|00004ba0| 54 54 59 20 66 6f 72 20 | 69 74 73 20 6f 75 74 70 |TTY for |its outp|
|00004bb0| 75 74 2e 20 41 63 63 6f | 75 6e 74 69 6e 67 20 63 |ut. Acco|unting c|
|00004bc0| 6f 75 6c 64 20 62 65 20 | 62 79 20 70 69 64 20 28 |ould be |by pid (|
|00004bd0| 61 73 20 69 74 20 73 68 | 6f 75 6c 64 0a 62 65 29 |as it sh|ould.be)|
|00004be0| 20 69 6e 73 74 65 61 64 | 20 6f 66 20 62 79 20 74 | instead| of by t|
|00004bf0| 68 65 20 6d 61 72 67 69 | 6e 61 6c 6c 79 20 75 73 |he margi|nally us|
|00004c00| 65 66 75 6c 20 61 63 5f | 74 74 79 2e 0a 58 0a 57 |eful ac_|tty..X.W|
|00004c10| 65 27 72 65 20 73 74 69 | 6c 6c 20 6c 65 66 74 20 |e're sti|ll left |
|00004c20| 77 69 74 68 20 4f 20 61 | 6e 64 20 50 20 61 63 63 |with O a|nd P acc|
|00004c30| 65 73 73 2d 2d 2d 74 74 | 79 73 20 61 72 65 20 73 |ess---tt|ys are s|
|00004c40| 74 69 6c 6c 20 69 6e 20 | 74 68 65 20 66 69 6c 65 |till in |the file|
|00004c50| 73 79 73 74 65 6d 2e 0a | 47 69 76 65 6e 20 66 64 |system..|Given fd|
|00004c60| 20 33 20 73 75 70 70 6f | 72 74 2c 20 70 72 6f 67 | 3 suppo|rt, prog|
|00004c70| 72 61 6d 73 20 77 68 69 | 63 68 20 77 61 6e 74 20 |rams whi|ch want |
|00004c80| 74 6f 20 74 61 6c 6b 20 | 74 6f 20 74 68 65 20 75 |to talk |to the u|
|00004c90| 73 65 72 20 64 6f 6e 27 | 74 20 6e 65 65 64 0a 74 |ser don'|t need.t|
|00004ca0| 6f 20 6f 70 65 6e 28 29 | 20 74 74 79 73 2e 20 54 |o open()| ttys. T|
|00004cb0| 68 65 20 6f 74 68 65 72 | 20 75 73 65 20 6f 66 20 |he other| use of |
|00004cc0| 74 74 79 73 20 69 6e 20 | 74 68 65 20 66 69 6c 65 |ttys in |the file|
|00004cd0| 73 79 73 74 65 6d 20 69 | 73 20 75 73 65 72 2d 74 |system i|s user-t|
|00004ce0| 6f 2d 75 73 65 72 0a 63 | 6f 6d 6d 75 6e 69 63 61 |o-user.c|ommunica|
|00004cf0| 74 69 6f 6e 2c 20 62 75 | 74 20 74 68 65 72 65 20 |tion, bu|t there |
|00004d00| 61 72 65 20 73 65 76 65 | 72 61 6c 20 72 65 70 6c |are seve|ral repl|
|00004d10| 61 63 65 6d 65 6e 74 20 | 63 6f 6d 6d 75 6e 69 63 |acement |communic|
|00004d20| 61 74 69 6f 6e 20 73 79 | 73 74 65 6d 73 0a 77 68 |ation sy|stems.wh|
|00004d30| 69 63 68 20 64 65 70 65 | 6e 64 20 6f 6e 20 75 73 |ich depe|nd on us|
|00004d40| 65 72 73 20 72 75 6e 6e | 69 6e 67 20 74 68 65 69 |ers runn|ing thei|
|00004d50| 72 20 6f 77 6e 20 64 61 | 65 6d 6f 6e 73 20 72 61 |r own da|emons ra|
|00004d60| 74 68 65 72 20 74 68 61 | 6e 20 68 61 76 69 6e 67 |ther tha|n having|
|00004d70| 20 61 0a 77 72 69 74 61 | 62 6c 65 20 74 74 79 20 | a.writa|ble tty |
|00004d80| 66 69 6c 65 2e 20 53 6f | 20 74 74 79 20 66 69 6c |file. So| tty fil|
|00004d90| 65 73 20 63 61 6e 20 64 | 69 73 61 70 70 65 61 72 |es can d|isappear|
|00004da0| 2e 20 52 61 74 68 65 72 | 20 74 68 61 6e 20 6f 70 |. Rather| than op|
|00004db0| 65 6e 69 6e 67 20 74 74 | 79 0a 66 69 6c 65 73 2c |ening tt|y.files,|
|00004dc0| 20 70 72 6f 67 72 61 6d | 73 20 63 61 6e 20 63 72 | program|s can cr|
|00004dd0| 65 61 74 65 20 74 74 79 | 73 20 77 69 74 68 20 61 |eate tty|s with a|
|00004de0| 20 6e 65 77 20 73 79 73 | 74 65 6d 20 63 61 6c 6c | new sys|tem call|
|00004df0| 2e 20 54 68 65 6e 20 74 | 74 79 73 20 77 69 6c 6c |. Then t|tys will|
|00004e00| 0a 62 65 20 6d 75 63 68 | 20 6d 6f 72 65 20 6c 69 |.be much| more li|
|00004e10| 6b 65 20 70 69 70 65 73 | 2c 20 77 68 69 63 68 20 |ke pipes|, which |
|00004e20| 6d 61 79 20 62 65 20 61 | 63 63 65 73 73 65 64 20 |may be a|ccessed |
|00004e30| 6f 6e 6c 79 20 74 68 72 | 6f 75 67 68 20 61 20 70 |only thr|ough a p|
|00004e40| 61 69 72 20 6f 66 0a 64 | 65 73 63 72 69 70 74 6f |air of.d|escripto|
|00004e50| 72 73 2e 0a 58 0a 49 66 | 20 74 68 65 73 65 20 73 |rs..X.If| these s|
|00004e60| 69 6d 70 6c 69 66 69 63 | 61 74 69 6f 6e 73 20 68 |implific|ations h|
|00004e70| 61 64 20 62 65 65 6e 20 | 6d 61 64 65 20 77 68 65 |ad been |made whe|
|00004e80| 6e 20 55 4e 49 58 20 77 | 61 73 20 79 6f 75 6e 67 |n UNIX w|as young|
|00004e90| 2c 20 62 65 66 6f 72 65 | 20 69 74 0a 77 61 73 20 |, before| it.was |
|00004ea0| 75 73 65 64 20 62 79 20 | 6d 69 6c 6c 69 6f 6e 73 |used by |millions|
|00004eb0| 20 6f 66 20 70 65 6f 70 | 6c 65 2c 20 74 68 65 6e | of peop|le, then|
|00004ec0| 20 6d 61 79 62 65 20 74 | 68 65 20 63 6f 6e 74 72 | maybe t|he contr|
|00004ed0| 6f 6c 6c 69 6e 67 20 74 | 65 72 6d 69 6e 61 6c 0a |olling t|erminal.|
|00004ee0| 68 6f 72 72 6f 72 20 73 | 74 6f 72 79 20 77 6f 75 |horror s|tory wou|
|00004ef0| 6c 64 20 6e 6f 74 20 68 | 61 76 65 20 6c 61 73 74 |ld not h|ave last|
|00004f00| 65 64 20 73 6f 20 6c 6f | 6e 67 20 6f 72 20 63 61 |ed so lo|ng or ca|
|00004f10| 75 73 65 64 20 73 6f 20 | 6d 75 63 68 20 64 61 6d |used so |much dam|
|00004f20| 61 67 65 2e 0a 58 46 6f | 72 74 75 6e 61 74 65 6c |age..XFo|rtunatel|
|00004f30| 79 2c 20 74 68 65 20 73 | 74 6f 72 79 20 77 69 6c |y, the s|tory wil|
|00004f40| 6c 20 65 6e 64 20 73 6f | 6f 6e 2c 20 61 73 20 69 |l end so|on, as i|
|00004f50| 6e 20 4f 63 74 6f 62 65 | 72 20 31 39 39 32 20 74 |n Octobe|r 1992 t|
|00004f60| 68 65 20 61 75 74 68 6f | 72 20 77 69 6c 6c 0a 64 |he autho|r will.d|
|00004f70| 69 73 74 72 69 62 75 74 | 65 20 63 6f 64 65 20 77 |istribut|e code w|
|00004f80| 68 69 63 68 20 61 6e 79 | 6f 6e 65 20 63 61 6e 20 |hich any|one can |
|00004f90| 75 73 65 20 74 6f 20 65 | 78 70 6c 6f 69 74 20 74 |use to e|xploit t|
|00004fa0| 68 65 73 65 20 68 6f 6c | 65 73 2e 20 41 6e 79 20 |hese hol|es. Any |
|00004fb0| 76 65 6e 64 6f 72 0a 77 | 68 69 63 68 20 77 61 6e |vendor.w|hich wan|
|00004fc0| 74 73 20 74 6f 20 73 74 | 61 79 20 69 6e 20 62 75 |ts to st|ay in bu|
|00004fd0| 73 69 6e 65 73 73 20 77 | 69 6c 6c 20 66 69 78 20 |siness w|ill fix |
|00004fe0| 69 74 73 20 73 79 73 74 | 65 6d 73 20 6c 6f 6e 67 |its syst|ems long|
|00004ff0| 20 62 65 66 6f 72 65 20 | 74 68 65 6e 2e 0a 58 0a | before |then..X.|
|00005000| 58 0a 52 65 66 65 72 65 | 6e 63 65 73 0a 58 0a 58 |X.Refere|nces.X.X|
|00005010| 58 58 58 0a 45 4e 44 5f | 4f 46 5f 46 49 4c 45 0a |XXX.END_|OF_FILE.|
|00005020| 69 66 20 74 65 73 74 20 | 39 34 33 30 20 2d 6e 65 |if test |9430 -ne|
|00005030| 20 60 77 63 20 2d 63 20 | 3c 27 43 54 54 59 53 2e | `wc -c |<'CTTYS.|
|00005040| 64 72 61 66 74 31 27 60 | 3b 20 74 68 65 6e 0a 20 |draft1'`|; then. |
|00005050| 20 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 5c 22 | echo |shar: \"|
|00005060| 27 43 54 54 59 53 2e 64 | 72 61 66 74 31 27 5c 22 |'CTTYS.d|raft1'\"|
|00005070| 20 75 6e 70 61 63 6b 65 | 64 20 77 69 74 68 20 77 | unpacke|d with w|
|00005080| 72 6f 6e 67 20 73 69 7a | 65 21 0a 66 69 0a 23 20 |rong siz|e!.fi.# |
|00005090| 65 6e 64 20 6f 66 20 27 | 43 54 54 59 53 2e 64 72 |end of '|CTTYS.dr|
|000050a0| 61 66 74 31 27 0a 66 69 | 0a 69 66 20 74 65 73 74 |aft1'.fi|.if test|
|000050b0| 20 2d 66 20 27 4d 61 6b | 65 66 69 6c 65 27 20 2d | -f 'Mak|efile' -|
|000050c0| 61 20 22 24 7b 31 7d 22 | 20 21 3d 20 22 2d 63 22 |a "${1}"| != "-c"|
|000050d0| 20 3b 20 74 68 65 6e 20 | 0a 20 20 65 63 68 6f 20 | ; then |. echo |
|000050e0| 73 68 61 72 3a 20 57 69 | 6c 6c 20 6e 6f 74 20 63 |shar: Wi|ll not c|
|000050f0| 6c 6f 62 62 65 72 20 65 | 78 69 73 74 69 6e 67 20 |lobber e|xisting |
|00005100| 66 69 6c 65 20 5c 22 27 | 4d 61 6b 65 66 69 6c 65 |file \"'|Makefile|
|00005110| 27 5c 22 0a 65 6c 73 65 | 0a 65 63 68 6f 20 73 68 |'\".else|.echo sh|
|00005120| 61 72 3a 20 45 78 74 72 | 61 63 74 69 6e 67 20 5c |ar: Extr|acting \|
|00005130| 22 27 4d 61 6b 65 66 69 | 6c 65 27 5c 22 20 5c 28 |"'Makefi|le'\" \(|
|00005140| 31 30 36 32 36 20 63 68 | 61 72 61 63 74 65 72 73 |10626 ch|aracters|
|00005150| 5c 29 0a 73 65 64 20 22 | 73 2f 5e 58 2f 2f 22 20 |\).sed "|s/^X//" |
|00005160| 3e 27 4d 61 6b 65 66 69 | 6c 65 27 20 3c 3c 27 45 |>'Makefi|le' <<'E|
|00005170| 4e 44 5f 4f 46 5f 46 49 | 4c 45 27 0a 43 43 3d 63 |ND_OF_FI|LE'.CC=c|
|00005180| 63 20 2d 73 0a 4f 50 54 | 4d 5a 3d 2d 4f 0a 58 23 |c -s.OPT|MZ=-O.X#|
|00005190| 20 4f 50 54 4d 5a 20 69 | 73 20 75 73 65 64 20 62 | OPTMZ i|s used b|
|000051a0| 65 6c 6f 77 20 66 6f 72 | 20 74 69 6d 65 2d 63 72 |elow for| time-cr|
|000051b0| 69 74 69 63 61 6c 20 6d | 6f 64 75 6c 65 73 0a 43 |itical m|odules.C|
|000051c0| 50 50 3d 63 63 20 2d 45 | 0a 58 23 20 61 6c 74 65 |PP=cc -E|.X# alte|
|000051d0| 72 6e 61 74 69 76 65 3a | 20 43 50 50 3d 2f 6c 69 |rnative:| CPP=/li|
|000051e0| 62 2f 63 70 70 20 3c 0a | 50 54 59 4c 49 42 53 3d |b/cpp <.|PTYLIBS=|
|000051f0| 0a 58 0a 61 6c 6c 3a 20 | 70 74 79 20 63 6c 6f 6e |.X.all: |pty clon|
|00005200| 65 73 20 73 65 73 73 73 | 74 75 66 66 20 74 74 79 |es sesss|tuff tty|
|00005210| 6d 69 73 63 20 6d 69 73 | 63 0a 58 0a 74 61 72 67 |misc mis|c.X.targ|
|00005220| 65 74 2d 6c 69 73 74 3a | 0a 58 09 40 65 63 68 6f |et-list:|.X.@echo|
|00005230| 20 27 74 61 72 67 65 74 | 2d 6c 69 73 74 20 61 6c | 'target|-list al|
|00005240| 6c 20 63 6c 6f 6e 65 73 | 20 73 65 73 73 73 74 75 |l clones| sessstu|
|00005250| 66 66 20 74 74 79 6d 69 | 73 63 20 6d 69 73 63 20 |ff ttymi|sc misc |
|00005260| 49 4e 53 54 41 4c 4c 20 | 43 48 45 43 4b 43 4f 4e |INSTALL |CHECKCON|
|00005270| 46 20 73 68 61 72 20 63 | 6c 65 61 6e 20 6c 69 6e |F shar c|lean lin|
|00005280| 74 27 0a 58 0a 63 6c 6f | 6e 65 73 3a 20 62 69 66 |t'.X.clo|nes: bif|
|00005290| 66 20 6d 65 73 67 20 77 | 61 6c 6c 20 77 72 69 74 |f mesg w|all writ|
|000052a0| 65 20 6c 6f 63 6b 20 73 | 63 72 69 70 74 20 75 73 |e lock s|cript us|
|000052b0| 65 72 73 20 74 74 79 20 | 77 68 6f 20 77 68 6f 61 |ers tty |who whoa|
|000052c0| 6d 69 0a 58 0a 73 65 73 | 73 73 74 75 66 66 3a 20 |mi.X.ses|sstuff: |
|000052d0| 73 65 73 73 20 73 65 73 | 73 6c 69 73 74 20 73 65 |sess ses|slist se|
|000052e0| 73 73 6e 61 6d 65 20 73 | 65 73 73 6d 65 6e 75 20 |ssname s|essmenu |
|000052f0| 64 69 73 63 6f 6e 6e 65 | 63 74 20 72 65 63 6f 6e |disconne|ct recon|
|00005300| 6e 65 63 74 20 73 65 73 | 73 77 68 6f 20 73 65 73 |nect ses|swho ses|
|00005310| 73 77 68 65 72 65 20 73 | 65 73 73 6b 69 6c 6c 0a |swhere s|esskill.|
|00005320| 58 0a 74 74 79 6d 69 73 | 63 3a 20 74 69 6f 63 73 |X.ttymis|c: tiocs|
|00005330| 74 69 20 63 6f 6e 64 6f | 6d 20 74 74 79 70 72 6f |ti condo|m ttypro|
|00005340| 74 65 63 74 20 75 74 6d | 70 69 6e 69 74 20 74 74 |tect utm|pinit tt|
|00005350| 79 64 65 74 61 63 68 20 | 63 68 65 63 6b 70 74 79 |ydetach |checkpty|
|00005360| 73 20 65 78 63 6c 6f 6e | 20 65 78 63 6c 6f 66 66 |s exclon| excloff|
|00005370| 20 77 74 6d 70 72 6f 74 | 61 74 65 20 73 65 73 73 | wtmprot|ate sess|
|00005380| 72 6f 74 61 74 65 20 73 | 63 6c 6f 67 72 6f 74 61 |rotate s|clogrota|
|00005390| 74 65 20 73 65 73 73 6e | 6f 77 69 6e 69 74 20 73 |te sessn|owinit s|
|000053a0| 63 6e 6f 77 69 6e 69 74 | 0a 58 0a 6d 69 73 63 3a |cnowinit|.X.misc:|
|000053b0| 20 74 73 63 72 69 70 74 | 20 73 63 72 69 70 74 2e | tscript| script.|
|000053c0| 74 69 64 79 20 77 61 69 | 74 66 6f 72 20 61 72 67 |tidy wai|tfor arg|
|000053d0| 76 30 20 63 74 72 6c 76 | 20 6e 6f 62 75 66 20 74 |v0 ctrlv| nobuf t|
|000053e0| 70 6c 61 79 20 74 72 65 | 63 6f 72 64 0a 58 0a 49 |play tre|cord.X.I|
|000053f0| 4e 53 54 41 4c 4c 3a 20 | 49 4e 53 54 41 4c 4c 2e |NSTALL: |INSTALL.|
|00005400| 63 0a 58 09 24 28 43 43 | 29 20 2d 6f 20 49 4e 53 |c.X.$(CC|) -o INS|
|00005410| 54 41 4c 4c 20 49 4e 53 | 54 41 4c 4c 2e 63 0a 58 |TALL INS|TALL.c.X|
|00005420| 0a 43 48 45 43 4b 43 4f | 4e 46 3a 20 43 48 45 43 |.CHECKCO|NF: CHEC|
|00005430| 4b 43 4f 4e 46 2e 63 0a | 58 09 24 28 43 43 29 20 |KCONF.c.|X.$(CC) |
|00005440| 2d 6f 20 43 48 45 43 4b | 43 4f 4e 46 20 43 48 45 |-o CHECK|CONF CHE|
|00005450| 43 4b 43 4f 4e 46 2e 63 | 0a 58 0a 73 65 73 73 6e |CKCONF.c|.X.sessn|
|00005460| 6f 77 69 6e 69 74 3a 20 | 73 65 73 73 6e 6f 77 69 |owinit: |sessnowi|
|00005470| 6e 69 74 2e 73 68 0a 58 | 09 24 28 43 50 50 29 20 |nit.sh.X|.$(CPP) |
|00005480| 73 65 73 73 6e 6f 77 69 | 6e 69 74 2e 73 68 20 7c |sessnowi|nit.sh ||
|00005490| 20 74 61 69 6c 20 2d 32 | 20 7c 20 74 72 20 2d 64 | tail -2| | tr -d|
|000054a0| 20 27 22 27 20 7c 20 73 | 65 64 20 27 73 2f 5e 58 | '"' | s|ed 's/^X|
|000054b0| 2f 23 2f 27 20 3e 20 73 | 65 73 73 6e 6f 77 69 6e |/#/' > s|essnowin|
|000054c0| 69 74 0a 58 09 63 68 6d | 6f 64 20 37 30 30 20 73 |it.X.chm|od 700 s|
|000054d0| 65 73 73 6e 6f 77 69 6e | 69 74 0a 58 0a 73 63 6e |essnowin|it.X.scn|
|000054e0| 6f 77 69 6e 69 74 3a 20 | 73 63 6e 6f 77 69 6e 69 |owinit: |scnowini|
|000054f0| 74 2e 73 68 0a 58 09 24 | 28 43 50 50 29 20 73 63 |t.sh.X.$|(CPP) sc|
|00005500| 6e 6f 77 69 6e 69 74 2e | 73 68 20 7c 20 74 61 69 |nowinit.|sh | tai|
|00005510| 6c 20 2d 32 20 7c 20 74 | 72 20 2d 64 20 27 22 27 |l -2 | t|r -d '"'|
|00005520| 20 7c 20 73 65 64 20 27 | 73 2f 5e 58 2f 23 2f 27 | | sed '|s/^X/#/'|
|00005530| 20 3e 20 73 63 6e 6f 77 | 69 6e 69 74 0a 58 09 63 | > scnow|init.X.c|
|00005540| 68 6d 6f 64 20 37 30 30 | 20 73 63 6e 6f 77 69 6e |hmod 700| scnowin|
|00005550| 69 74 0a 58 0a 73 65 73 | 73 72 6f 74 61 74 65 3a |it.X.ses|srotate:|
|00005560| 20 73 65 73 73 72 6f 74 | 61 74 65 2e 73 68 0a 58 | sessrot|ate.sh.X|
|00005570| 09 24 28 43 50 50 29 20 | 73 65 73 73 72 6f 74 61 |.$(CPP) |sessrota|
|00005580| 74 65 2e 73 68 20 7c 20 | 74 61 69 6c 20 2d 31 32 |te.sh | |tail -12|
|00005590| 20 7c 20 74 72 20 2d 64 | 20 27 22 27 20 7c 20 73 | | tr -d| '"' | s|
|000055a0| 65 64 20 27 73 2f 5e 58 | 2f 23 2f 27 20 3e 20 73 |ed 's/^X|/#/' > s|
|000055b0| 65 73 73 72 6f 74 61 74 | 65 0a 58 09 63 68 6d 6f |essrotat|e.X.chmo|
|000055c0| 64 20 37 30 30 20 73 65 | 73 73 72 6f 74 61 74 65 |d 700 se|ssrotate|
|000055d0| 0a 58 0a 73 63 6c 6f 67 | 72 6f 74 61 74 65 3a 20 |.X.sclog|rotate: |
|000055e0| 73 63 6c 6f 67 72 6f 74 | 61 74 65 2e 73 68 0a 58 |sclogrot|ate.sh.X|
|000055f0| 09 24 28 43 50 50 29 20 | 73 63 6c 6f 67 72 6f 74 |.$(CPP) |sclogrot|
|00005600| 61 74 65 2e 73 68 20 7c | 20 74 61 69 6c 20 2d 31 |ate.sh || tail -1|
|00005610| 32 20 7c 20 74 72 20 2d | 64 20 27 22 27 20 7c 20 |2 | tr -|d '"' | |
|00005620| 73 65 64 20 27 73 2f 5e | 58 2f 23 2f 27 20 3e 20 |sed 's/^|X/#/' > |
|00005630| 73 63 6c 6f 67 72 6f 74 | 61 74 65 0a 58 09 63 68 |sclogrot|ate.X.ch|
|00005640| 6d 6f 64 20 37 30 30 20 | 73 63 6c 6f 67 72 6f 74 |mod 700 |sclogrot|
|00005650| 61 74 65 0a 58 0a 77 74 | 6d 70 72 6f 74 61 74 65 |ate.X.wt|mprotate|
|00005660| 3a 20 77 74 6d 70 72 6f | 74 61 74 65 2e 73 68 0a |: wtmpro|tate.sh.|
|00005670| 58 09 24 28 43 50 50 29 | 20 77 74 6d 70 72 6f 74 |X.$(CPP)| wtmprot|
|00005680| 61 74 65 2e 73 68 20 7c | 20 74 61 69 6c 20 2d 31 |ate.sh || tail -1|
|00005690| 32 20 7c 20 74 72 20 2d | 64 20 27 22 27 20 7c 20 |2 | tr -|d '"' | |
|000056a0| 73 65 64 20 27 73 2f 5e | 58 2f 23 2f 27 20 3e 20 |sed 's/^|X/#/' > |
|000056b0| 77 74 6d 70 72 6f 74 61 | 74 65 0a 58 09 63 68 6d |wtmprota|te.X.chm|
|000056c0| 6f 64 20 37 30 30 20 77 | 74 6d 70 72 6f 74 61 74 |od 700 w|tmprotat|
|000056d0| 65 0a 58 0a 6e 6f 62 75 | 66 3a 20 6e 6f 62 75 66 |e.X.nobu|f: nobuf|
|000056e0| 2e 73 68 0a 58 09 63 70 | 20 6e 6f 62 75 66 2e 73 |.sh.X.cp| nobuf.s|
|000056f0| 68 20 6e 6f 62 75 66 0a | 58 09 63 68 6d 6f 64 20 |h nobuf.|X.chmod |
|00005700| 37 30 30 20 6e 6f 62 75 | 66 0a 58 0a 73 63 72 69 |700 nobu|f.X.scri|
|00005710| 70 74 2e 74 69 64 79 3a | 20 73 63 72 69 70 74 2e |pt.tidy:| script.|
|00005720| 74 69 64 79 2e 73 68 0a | 58 09 74 72 20 27 38 33 |tidy.sh.|X.tr '83|
|00005730| 27 20 27 5c 30 31 30 5c | 30 31 35 27 20 3c 20 73 |' '\010\|015' < s|
|00005740| 63 72 69 70 74 2e 74 69 | 64 79 2e 73 68 20 3e 20 |cript.ti|dy.sh > |
|00005750| 73 63 72 69 70 74 2e 74 | 69 64 79 0a 58 09 63 68 |script.t|idy.X.ch|
|00005760| 6d 6f 64 20 37 30 30 20 | 73 63 72 69 70 74 2e 74 |mod 700 |script.t|
|00005770| 69 64 79 0a 58 0a 73 65 | 73 73 3a 20 73 65 73 73 |idy.X.se|ss: sess|
|00005780| 2e 73 68 0a 58 09 63 70 | 20 73 65 73 73 2e 73 68 |.sh.X.cp| sess.sh|
|00005790| 20 73 65 73 73 0a 58 09 | 63 68 6d 6f 64 20 37 30 | sess.X.|chmod 70|
|000057a0| 30 20 73 65 73 73 0a 58 | 0a 74 73 63 72 69 70 74 |0 sess.X|.tscript|
|000057b0| 3a 20 74 73 63 72 69 70 | 74 2e 73 68 0a 58 09 63 |: tscrip|t.sh.X.c|
|000057c0| 70 20 74 73 63 72 69 70 | 74 2e 73 68 20 74 73 63 |p tscrip|t.sh tsc|
|000057d0| 72 69 70 74 0a 58 09 63 | 68 6d 6f 64 20 37 30 30 |ript.X.c|hmod 700|
|000057e0| 20 74 73 63 72 69 70 74 | 0a 58 0a 73 63 72 69 70 | tscript|.X.scrip|
|000057f0| 74 3a 20 73 63 72 69 70 | 74 2e 73 68 0a 58 09 63 |t: scrip|t.sh.X.c|
|00005800| 70 20 73 63 72 69 70 74 | 2e 73 68 20 73 63 72 69 |p script|.sh scri|
|00005810| 70 74 0a 58 09 63 68 6d | 6f 64 20 37 30 30 20 73 |pt.X.chm|od 700 s|
|00005820| 63 72 69 70 74 0a 58 0a | 74 74 79 70 72 6f 74 65 |cript.X.|ttyprote|
|00005830| 63 74 3a 20 74 74 79 70 | 72 6f 74 65 63 74 2e 73 |ct: ttyp|rotect.s|
|00005840| 68 0a 58 09 63 70 20 74 | 74 79 70 72 6f 74 65 63 |h.X.cp t|typrotec|
|00005850| 74 2e 73 68 20 74 74 79 | 70 72 6f 74 65 63 74 0a |t.sh tty|protect.|
|00005860| 58 09 63 68 6d 6f 64 20 | 37 30 30 20 74 74 79 70 |X.chmod |700 ttyp|
|00005870| 72 6f 74 65 63 74 0a 58 | 0a 63 6f 6e 64 6f 6d 3a |rotect.X|.condom:|
|00005880| 20 74 74 79 70 72 6f 74 | 65 63 74 2e 73 68 0a 58 | ttyprot|ect.sh.X|
|00005890| 09 63 70 20 74 74 79 70 | 72 6f 74 65 63 74 2e 73 |.cp ttyp|rotect.s|
|000058a0| 68 20 63 6f 6e 64 6f 6d | 0a 58 09 63 68 6d 6f 64 |h condom|.X.chmod|
|000058b0| 20 37 30 30 20 63 6f 6e | 64 6f 6d 0a 58 0a 73 65 | 700 con|dom.X.se|
|000058c0| 73 73 6b 69 6c 6c 3a 20 | 73 65 73 73 6b 69 6c 6c |sskill: |sesskill|
|000058d0| 2e 6f 20 70 74 79 63 6f | 6d 6d 2e 6f 20 67 65 74 |.o ptyco|mm.o get|
|000058e0| 6f 70 74 2e 6f 20 65 6e | 76 2e 6f 20 72 61 6c 6c |opt.o en|v.o rall|
|000058f0| 6f 63 2e 6f 20 70 74 79 | 6d 69 73 63 2e 6f 20 66 |oc.o pty|misc.o f|
|00005900| 6d 74 2e 6f 20 73 63 61 | 6e 2e 6f 0a 58 09 24 28 |mt.o sca|n.o.X.$(|
|00005910| 43 43 29 20 2d 6f 20 73 | 65 73 73 6b 69 6c 6c 20 |CC) -o s|esskill |
|00005920| 73 65 73 73 6b 69 6c 6c | 2e 6f 20 70 74 79 63 6f |sesskill|.o ptyco|
|00005930| 6d 6d 2e 6f 20 67 65 74 | 6f 70 74 2e 6f 20 65 6e |mm.o get|opt.o en|
|00005940| 76 2e 6f 20 72 61 6c 6c | 6f 63 2e 6f 20 70 74 79 |v.o rall|oc.o pty|
|00005950| 6d 69 73 63 2e 6f 20 66 | 6d 74 2e 6f 20 73 63 61 |misc.o f|mt.o sca|
|00005960| 6e 2e 6f 0a 58 0a 74 70 | 6c 61 79 3a 20 74 70 6c |n.o.X.tp|lay: tpl|
|00005970| 61 79 2e 6f 20 73 69 67 | 73 63 68 65 64 2e 6f 20 |ay.o sig|sched.o |
|00005980| 74 69 6d 65 72 2e 6f 20 | 72 61 6c 6c 6f 63 2e 6f |timer.o |ralloc.o|
|00005990| 0a 58 09 24 28 43 43 29 | 20 2d 6f 20 74 70 6c 61 |.X.$(CC)| -o tpla|
|000059a0| 79 20 74 70 6c 61 79 2e | 6f 20 73 69 67 73 63 68 |y tplay.|o sigsch|
|000059b0| 65 64 2e 6f 20 74 69 6d | 65 72 2e 6f 20 72 61 6c |ed.o tim|er.o ral|
|000059c0| 6c 6f 63 2e 6f 0a 58 0a | 74 72 65 63 6f 72 64 3a |loc.o.X.|trecord:|
|000059d0| 20 74 72 65 63 6f 72 64 | 2e 6f 20 73 69 67 73 63 | trecord|.o sigsc|
|000059e0| 68 65 64 2e 6f 20 74 69 | 6d 65 72 2e 6f 20 72 61 |hed.o ti|mer.o ra|
|000059f0| 6c 6c 6f 63 2e 6f 0a 58 | 09 24 28 43 43 29 20 2d |lloc.o.X|.$(CC) -|
|00005a00| 6f 20 74 72 65 63 6f 72 | 64 20 74 72 65 63 6f 72 |o trecor|d trecor|
|00005a10| 64 2e 6f 20 73 69 67 73 | 63 68 65 64 2e 6f 20 74 |d.o sigs|ched.o t|
|00005a20| 69 6d 65 72 2e 6f 20 72 | 61 6c 6c 6f 63 2e 6f 0a |imer.o r|alloc.o.|
|00005a30| 58 0a 63 74 72 6c 76 3a | 20 63 74 72 6c 76 2e 6f |X.ctrlv:| ctrlv.o|
|00005a40| 20 70 74 79 6d 69 73 63 | 2e 6f 20 73 63 61 6e 2e | ptymisc|.o scan.|
|00005a50| 6f 0a 58 09 24 28 43 43 | 29 20 2d 6f 20 63 74 72 |o.X.$(CC|) -o ctr|
|00005a60| 6c 76 20 63 74 72 6c 76 | 2e 6f 20 70 74 79 6d 69 |lv ctrlv|.o ptymi|
|00005a70| 73 63 2e 6f 20 73 63 61 | 6e 2e 6f 0a 58 0a 63 68 |sc.o sca|n.o.X.ch|
|00005a80| 65 63 6b 70 74 79 73 3a | 20 63 68 65 63 6b 70 74 |eckptys:| checkpt|
|00005a90| 79 73 2e 6f 0a 58 09 24 | 28 43 43 29 20 2d 6f 20 |ys.o.X.$|(CC) -o |
|00005aa0| 63 68 65 63 6b 70 74 79 | 73 20 63 68 65 63 6b 70 |checkpty|s checkp|
|00005ab0| 74 79 73 2e 6f 0a 58 0a | 74 74 79 64 65 74 61 63 |tys.o.X.|ttydetac|
|00005ac0| 68 3a 20 74 74 79 64 65 | 74 61 63 68 2e 6f 20 65 |h: ttyde|tach.o e|
|00005ad0| 6e 76 2e 6f 20 72 61 6c | 6c 6f 63 2e 6f 0a 58 09 |nv.o ral|loc.o.X.|
|00005ae0| 24 28 43 43 29 20 2d 6f | 20 74 74 79 64 65 74 61 |$(CC) -o| ttydeta|
|00005af0| 63 68 20 74 74 79 64 65 | 74 61 63 68 2e 6f 20 65 |ch ttyde|tach.o e|
|00005b00| 6e 76 2e 6f 20 72 61 6c | 6c 6f 63 2e 6f 0a 58 0a |nv.o ral|loc.o.X.|
|00005b10| 65 78 63 6c 6f 66 66 3a | 20 65 78 63 6c 6f 66 66 |excloff:| excloff|
|00005b20| 2e 6f 0a 58 09 24 28 43 | 43 29 20 2d 6f 20 65 78 |.o.X.$(C|C) -o ex|
|00005b30| 63 6c 6f 66 66 20 65 78 | 63 6c 6f 66 66 2e 6f 0a |cloff ex|cloff.o.|
|00005b40| 58 0a 65 78 63 6c 6f 6e | 3a 20 65 78 63 6c 6f 6e |X.exclon|: exclon|
|00005b50| 2e 6f 0a 58 09 24 28 43 | 43 29 20 2d 6f 20 65 78 |.o.X.$(C|C) -o ex|
|00005b60| 63 6c 6f 6e 20 65 78 63 | 6c 6f 6e 2e 6f 0a 58 0a |clon exc|lon.o.X.|
|00005b70| 61 72 67 76 30 3a 20 61 | 72 67 76 30 2e 6f 0a 58 |argv0: a|rgv0.o.X|
|00005b80| 09 24 28 43 43 29 20 2d | 6f 20 61 72 67 76 30 20 |.$(CC) -|o argv0 |
|00005b90| 61 72 67 76 30 2e 6f 0a | 58 0a 77 61 69 74 66 6f |argv0.o.|X.waitfo|
|00005ba0| 72 3a 20 77 61 69 74 66 | 6f 72 2e 6f 0a 58 09 24 |r: waitf|or.o.X.$|
|00005bb0| 28 43 43 29 20 2d 6f 20 | 77 61 69 74 66 6f 72 20 |(CC) -o |waitfor |
|00005bc0| 77 61 69 74 66 6f 72 2e | 6f 0a 58 0a 74 74 79 3a |waitfor.|o.X.tty:|
|00005bd0| 20 74 74 79 2e 6f 20 67 | 65 74 6f 70 74 2e 6f 0a | tty.o g|etopt.o.|
|00005be0| 58 09 24 28 43 43 29 20 | 2d 6f 20 74 74 79 20 74 |X.$(CC) |-o tty t|
|00005bf0| 74 79 2e 6f 20 67 65 74 | 6f 70 74 2e 6f 0a 58 0a |ty.o get|opt.o.X.|
|00005c00| 75 74 6d 70 69 6e 69 74 | 3a 20 75 74 6d 70 69 6e |utmpinit|: utmpin|
|00005c10| 69 74 2e 6f 20 70 74 79 | 6d 69 73 63 2e 6f 20 73 |it.o pty|misc.o s|
|00005c20| 63 61 6e 2e 6f 0a 58 09 | 24 28 43 43 29 20 2d 6f |can.o.X.|$(CC) -o|
|00005c30| 20 75 74 6d 70 69 6e 69 | 74 20 75 74 6d 70 69 6e | utmpini|t utmpin|
|00005c40| 69 74 2e 6f 20 70 74 79 | 6d 69 73 63 2e 6f 20 73 |it.o pty|misc.o s|
|00005c50| 63 61 6e 2e 6f 0a 58 0a | 77 68 6f 3a 20 77 68 6f |can.o.X.|who: who|
|00005c60| 2e 6f 20 67 65 74 6f 70 | 74 2e 6f 20 66 6d 74 2e |.o getop|t.o fmt.|
|00005c70| 6f 0a 58 09 24 28 43 43 | 29 20 2d 6f 20 77 68 6f |o.X.$(CC|) -o who|
|00005c80| 20 77 68 6f 2e 6f 20 67 | 65 74 6f 70 74 2e 6f 20 | who.o g|etopt.o |
|00005c90| 66 6d 74 2e 6f 0a 58 0a | 77 68 6f 61 6d 69 3a 20 |fmt.o.X.|whoami: |
|00005ca0| 77 68 6f 61 6d 69 2e 6f | 20 75 73 65 72 6e 61 6d |whoami.o| usernam|
|00005cb0| 65 2e 6f 20 66 6d 74 2e | 6f 20 73 63 61 6e 2e 6f |e.o fmt.|o scan.o|
|00005cc0| 0a 58 09 24 28 43 43 29 | 20 2d 6f 20 77 68 6f 61 |.X.$(CC)| -o whoa|
|00005cd0| 6d 69 20 77 68 6f 61 6d | 69 2e 6f 20 75 73 65 72 |mi whoam|i.o user|
|00005ce0| 6e 61 6d 65 2e 6f 20 66 | 6d 74 2e 6f 20 73 63 61 |name.o f|mt.o sca|
|00005cf0| 6e 2e 6f 0a 58 0a 75 73 | 65 72 73 3a 20 75 73 65 |n.o.X.us|ers: use|
|00005d00| 72 73 2e 6f 20 72 61 64 | 69 78 73 6f 72 74 2e 6f |rs.o rad|ixsort.o|
|00005d10| 20 72 61 6c 6c 6f 63 2e | 6f 0a 58 09 24 28 43 43 | ralloc.|o.X.$(CC|
|00005d20| 29 20 2d 6f 20 75 73 65 | 72 73 20 75 73 65 72 73 |) -o use|rs users|
|00005d30| 2e 6f 20 72 61 64 69 78 | 73 6f 72 74 2e 6f 20 72 |.o radix|sort.o r|
|00005d40| 61 6c 6c 6f 63 2e 6f 0a | 58 0a 6c 6f 63 6b 3a 20 |alloc.o.|X.lock: |
|00005d50| 6c 6f 63 6b 2e 6f 0a 58 | 09 24 28 43 43 29 20 2d |lock.o.X|.$(CC) -|
|00005d60| 6f 20 6c 6f 63 6b 20 6c | 6f 63 6b 2e 6f 20 2d 6c |o lock l|ock.o -l|
|00005d70| 63 75 72 73 65 73 0a 58 | 0a 73 65 73 73 77 68 65 |curses.X|.sesswhe|
|00005d80| 72 65 3a 20 73 65 73 73 | 77 68 65 72 65 2e 6f 20 |re: sess|where.o |
|00005d90| 73 65 73 73 63 6f 6e 6e | 6c 6f 67 2e 6f 20 67 65 |sessconn|log.o ge|
|00005da0| 74 6f 70 74 2e 6f 20 66 | 6d 74 2e 6f 20 70 74 79 |topt.o f|mt.o pty|
|00005db0| 6d 69 73 63 2e 6f 20 73 | 63 61 6e 2e 6f 0a 58 09 |misc.o s|can.o.X.|
|00005dc0| 24 28 43 43 29 20 2d 6f | 20 73 65 73 73 77 68 65 |$(CC) -o| sesswhe|
|00005dd0| 72 65 20 73 65 73 73 77 | 68 65 72 65 2e 6f 20 73 |re sessw|here.o s|
|00005de0| 65 73 73 63 6f 6e 6e 6c | 6f 67 2e 6f 20 67 65 74 |essconnl|og.o get|
|00005df0| 6f 70 74 2e 6f 20 66 6d | 74 2e 6f 20 70 74 79 6d |opt.o fm|t.o ptym|
|00005e00| 69 73 63 2e 6f 20 73 63 | 61 6e 2e 6f 0a 58 0a 73 |isc.o sc|an.o.X.s|
|00005e10| 65 73 73 77 68 6f 3a 20 | 73 65 73 73 77 68 6f 2e |esswho: |sesswho.|
|00005e20| 6f 20 73 65 73 73 6c 6f | 67 2e 6f 20 67 65 74 6f |o sesslo|g.o geto|
|00005e30| 70 74 2e 6f 20 70 74 79 | 6d 69 73 63 2e 6f 20 73 |pt.o pty|misc.o s|
|00005e40| 63 61 6e 2e 6f 0a 58 09 | 24 28 43 43 29 20 2d 6f |can.o.X.|$(CC) -o|
|00005e50| 20 73 65 73 73 77 68 6f | 20 73 65 73 73 77 68 6f | sesswho| sesswho|
|00005e60| 2e 6f 20 73 65 73 73 6c | 6f 67 2e 6f 20 67 65 74 |.o sessl|og.o get|
|00005e70| 6f 70 74 2e 6f 20 70 74 | 79 6d 69 73 63 2e 6f 20 |opt.o pt|ymisc.o |
|00005e80| 73 63 61 6e 2e 6f 0a 58 | 0a 73 65 73 73 6c 69 73 |scan.o.X|.sesslis|
|00005e90| 74 3a 20 73 65 73 73 6c | 69 73 74 2e 6f 20 70 74 |t: sessl|ist.o pt|
|00005ea0| 79 63 6f 6d 6d 2e 6f 20 | 66 6d 74 2e 6f 20 67 65 |ycomm.o |fmt.o ge|
|00005eb0| 74 6f 70 74 2e 6f 20 70 | 74 79 6d 69 73 63 2e 6f |topt.o p|tymisc.o|
|00005ec0| 20 73 63 61 6e 2e 6f 0a | 58 09 24 28 43 43 29 20 | scan.o.|X.$(CC) |
|00005ed0| 2d 6f 20 73 65 73 73 6c | 69 73 74 20 73 65 73 73 |-o sessl|ist sess|
|00005ee0| 6c 69 73 74 2e 6f 20 70 | 74 79 63 6f 6d 6d 2e 6f |list.o p|tycomm.o|
|00005ef0| 20 66 6d 74 2e 6f 20 67 | 65 74 6f 70 74 2e 6f 20 | fmt.o g|etopt.o |
|00005f00| 70 74 79 6d 69 73 63 2e | 6f 20 73 63 61 6e 2e 6f |ptymisc.|o scan.o|
|00005f10| 0a 58 0a 64 69 73 63 6f | 6e 6e 65 63 74 3a 20 64 |.X.disco|nnect: d|
|00005f20| 69 73 63 6f 6e 6e 65 63 | 74 2e 6f 20 70 74 79 63 |isconnec|t.o ptyc|
|00005f30| 6f 6d 6d 2e 6f 20 67 65 | 74 6f 70 74 2e 6f 20 65 |omm.o ge|topt.o e|
|00005f40| 6e 76 2e 6f 20 72 61 6c | 6c 6f 63 2e 6f 20 70 74 |nv.o ral|loc.o pt|
|00005f50| 79 6d 69 73 63 2e 6f 20 | 66 6d 74 2e 6f 20 73 63 |ymisc.o |fmt.o sc|
|00005f60| 61 6e 2e 6f 0a 58 09 24 | 28 43 43 29 20 2d 6f 20 |an.o.X.$|(CC) -o |
|00005f70| 64 69 73 63 6f 6e 6e 65 | 63 74 20 64 69 73 63 6f |disconne|ct disco|
|00005f80| 6e 6e 65 63 74 2e 6f 20 | 70 74 79 63 6f 6d 6d 2e |nnect.o |ptycomm.|
|00005f90| 6f 20 67 65 74 6f 70 74 | 2e 6f 20 65 6e 76 2e 6f |o getopt|.o env.o|
|00005fa0| 20 72 61 6c 6c 6f 63 2e | 6f 20 70 74 79 6d 69 73 | ralloc.|o ptymis|
|00005fb0| 63 2e 6f 20 66 6d 74 2e | 6f 20 73 63 61 6e 2e 6f |c.o fmt.|o scan.o|
|00005fc0| 0a 58 0a 72 65 63 6f 6e | 6e 65 63 74 3a 20 72 65 |.X.recon|nect: re|
|00005fd0| 63 6f 6e 6e 65 63 74 2e | 6f 20 70 74 79 63 6f 6d |connect.|o ptycom|
|00005fe0| 6d 2e 6f 20 67 65 74 6f | 70 74 2e 6f 20 65 6e 76 |m.o geto|pt.o env|
|00005ff0| 2e 6f 20 72 61 6c 6c 6f | 63 2e 6f 20 70 74 79 6d |.o rallo|c.o ptym|
|00006000| 69 73 63 2e 6f 20 66 6d | 74 2e 6f 20 73 63 61 6e |isc.o fm|t.o scan|
|00006010| 2e 6f 0a 58 09 24 28 43 | 43 29 20 2d 6f 20 72 65 |.o.X.$(C|C) -o re|
|00006020| 63 6f 6e 6e 65 63 74 20 | 72 65 63 6f 6e 6e 65 63 |connect |reconnec|
|00006030| 74 2e 6f 20 70 74 79 63 | 6f 6d 6d 2e 6f 20 67 65 |t.o ptyc|omm.o ge|
|00006040| 74 6f 70 74 2e 6f 20 65 | 6e 76 2e 6f 20 72 61 6c |topt.o e|nv.o ral|
|00006050| 6c 6f 63 2e 6f 20 70 74 | 79 6d 69 73 63 2e 6f 20 |loc.o pt|ymisc.o |
|00006060| 66 6d 74 2e 6f 20 73 63 | 61 6e 2e 6f 0a 58 0a 73 |fmt.o sc|an.o.X.s|
|00006070| 65 73 73 6d 65 6e 75 3a | 20 73 65 73 73 6d 65 6e |essmenu:| sessmen|
|00006080| 75 2e 6f 0a 58 09 24 28 | 43 43 29 20 2d 6f 20 73 |u.o.X.$(|CC) -o s|
|00006090| 65 73 73 6d 65 6e 75 20 | 73 65 73 73 6d 65 6e 75 |essmenu |sessmenu|
|000060a0| 2e 6f 0a 58 0a 73 65 73 | 73 6e 61 6d 65 3a 20 73 |.o.X.ses|sname: s|
|000060b0| 65 73 73 6e 61 6d 65 2e | 6f 20 70 74 79 63 6f 6d |essname.|o ptycom|
|000060c0| 6d 2e 6f 20 67 65 74 6f | 70 74 2e 6f 20 65 6e 76 |m.o geto|pt.o env|
|000060d0| 2e 6f 20 72 61 6c 6c 6f | 63 2e 6f 20 70 74 79 6d |.o rallo|c.o ptym|
|000060e0| 69 73 63 2e 6f 20 66 6d | 74 2e 6f 20 73 63 61 6e |isc.o fm|t.o scan|
|000060f0| 2e 6f 0a 58 09 24 28 43 | 43 29 20 2d 6f 20 73 65 |.o.X.$(C|C) -o se|
|00006100| 73 73 6e 61 6d 65 20 73 | 65 73 73 6e 61 6d 65 2e |ssname s|essname.|
|00006110| 6f 20 70 74 79 63 6f 6d | 6d 2e 6f 20 67 65 74 6f |o ptycom|m.o geto|
|00006120| 70 74 2e 6f 20 65 6e 76 | 2e 6f 20 72 61 6c 6c 6f |pt.o env|.o rallo|
|00006130| 63 2e 6f 20 70 74 79 6d | 69 73 63 2e 6f 20 66 6d |c.o ptym|isc.o fm|
|00006140| 74 2e 6f 20 73 63 61 6e | 2e 6f 0a 58 0a 62 69 66 |t.o scan|.o.X.bif|
|00006150| 66 3a 20 62 69 66 66 2e | 6f 0a 58 09 24 28 43 43 |f: biff.|o.X.$(CC|
|00006160| 29 20 2d 6f 20 62 69 66 | 66 20 62 69 66 66 2e 6f |) -o bif|f biff.o|
|00006170| 0a 58 0a 6d 65 73 67 3a | 20 6d 65 73 67 2e 6f 0a |.X.mesg:| mesg.o.|
|00006180| 58 09 24 28 43 43 29 20 | 2d 6f 20 6d 65 73 67 20 |X.$(CC) |-o mesg |
|00006190| 6d 65 73 67 2e 6f 0a 58 | 0a 74 69 6f 63 73 74 69 |mesg.o.X|.tiocsti|
|000061a0| 3a 20 74 69 6f 63 73 74 | 69 2e 6f 0a 58 09 24 28 |: tiocst|i.o.X.$(|
|000061b0| 43 43 29 20 2d 6f 20 74 | 69 6f 63 73 74 69 20 74 |CC) -o t|iocsti t|
|000061c0| 69 6f 63 73 74 69 2e 6f | 0a 58 0a 77 72 69 74 65 |iocsti.o|.X.write|
|000061d0| 3a 20 77 72 69 74 65 2e | 6f 20 66 6d 74 2e 6f 0a |: write.|o fmt.o.|
|000061e0| 58 09 24 28 43 43 29 20 | 2d 6f 20 77 72 69 74 65 |X.$(CC) |-o write|
|000061f0| 20 77 72 69 74 65 2e 6f | 20 66 6d 74 2e 6f 0a 58 | write.o| fmt.o.X|
|00006200| 0a 77 61 6c 6c 3a 20 77 | 61 6c 6c 2e 6f 20 66 6d |.wall: w|all.o fm|
|00006210| 74 2e 6f 0a 58 09 24 28 | 43 43 29 20 2d 6f 20 77 |t.o.X.$(|CC) -o w|
|00006220| 61 6c 6c 20 77 61 6c 6c | 2e 6f 20 66 6d 74 2e 6f |all wall|.o fmt.o|
|00006230| 0a 58 0a 70 74 79 3a 20 | 65 6e 76 2e 6f 20 66 6d |.X.pty: |env.o fm|
|00006240| 74 2e 6f 20 67 65 74 6f | 70 74 71 75 69 65 74 2e |t.o geto|ptquiet.|
|00006250| 6f 20 70 74 79 63 6f 6d | 6d 2e 6f 20 70 74 79 65 |o ptycom|m.o ptye|
|00006260| 72 72 2e 6f 20 70 74 79 | 67 65 74 2e 6f 20 70 74 |rr.o pty|get.o pt|
|00006270| 79 6c 6f 67 73 2e 6f 20 | 70 74 79 6d 61 69 6e 2e |ylogs.o |ptymain.|
|00006280| 6f 20 70 74 79 6d 61 73 | 74 65 72 2e 6f 20 70 74 |o ptymas|ter.o pt|
|00006290| 79 6d 69 73 63 2e 6f 20 | 70 74 79 73 65 63 75 72 |ymisc.o |ptysecur|
|000062a0| 65 2e 6f 20 70 74 79 73 | 69 67 6c 65 72 2e 6f 20 |e.o ptys|igler.o |
|000062b0| 70 74 79 73 6c 61 76 65 | 2e 6f 20 70 74 79 74 65 |ptyslave|.o ptyte|
|000062c0| 78 74 73 2e 6f 20 70 74 | 79 74 74 79 2e 6f 20 72 |xts.o pt|ytty.o r|
|000062d0| 61 6c 6c 6f 63 2e 6f 20 | 73 63 61 6e 2e 6f 20 73 |alloc.o |scan.o s|
|000062e0| 65 73 73 63 6f 6e 6e 6c | 6f 67 2e 6f 20 73 65 73 |essconnl|og.o ses|
|000062f0| 73 6c 6f 67 2e 6f 20 73 | 69 67 64 66 6c 2e 6f 20 |slog.o s|igdfl.o |
|00006300| 73 69 67 73 63 68 65 64 | 2e 6f 20 75 73 65 72 6e |sigsched|.o usern|
|00006310| 61 6d 65 2e 6f 0a 58 09 | 24 28 43 43 29 20 2d 6f |ame.o.X.|$(CC) -o|
|00006320| 20 70 74 79 20 65 6e 76 | 2e 6f 20 66 6d 74 2e 6f | pty env|.o fmt.o|
|00006330| 20 67 65 74 6f 70 74 71 | 75 69 65 74 2e 6f 20 70 | getoptq|uiet.o p|
|00006340| 74 79 63 6f 6d 6d 2e 6f | 20 70 74 79 65 72 72 2e |tycomm.o| ptyerr.|
|00006350| 6f 20 70 74 79 67 65 74 | 2e 6f 20 70 74 79 6c 6f |o ptyget|.o ptylo|
|00006360| 67 73 2e 6f 20 70 74 79 | 6d 61 69 6e 2e 6f 20 70 |gs.o pty|main.o p|
|00006370| 74 79 6d 61 73 74 65 72 | 2e 6f 20 70 74 79 6d 69 |tymaster|.o ptymi|
|00006380| 73 63 2e 6f 20 70 74 79 | 73 65 63 75 72 65 2e 6f |sc.o pty|secure.o|
|00006390| 20 70 74 79 73 69 67 6c | 65 72 2e 6f 20 70 74 79 | ptysigl|er.o pty|
|000063a0| 73 6c 61 76 65 2e 6f 20 | 70 74 79 74 65 78 74 73 |slave.o |ptytexts|
|000063b0| 2e 6f 20 70 74 79 74 74 | 79 2e 6f 20 72 61 6c 6c |.o ptytt|y.o rall|
|000063c0| 6f 63 2e 6f 20 73 63 61 | 6e 2e 6f 20 73 65 73 73 |oc.o sca|n.o sess|
|000063d0| 63 6f 6e 6e 6c 6f 67 2e | 6f 20 73 65 73 73 6c 6f |connlog.|o sesslo|
|000063e0| 67 2e 6f 20 73 69 67 64 | 66 6c 2e 6f 20 73 69 67 |g.o sigd|fl.o sig|
|000063f0| 73 63 68 65 64 2e 6f 20 | 75 73 65 72 6e 61 6d 65 |sched.o |username|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.