home *** CD-ROM | disk | FTP | other *** search
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: 13
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 75 75 | 6e 65 74 21 68 75 73 63 |Path: uu|net!husc|
|00000010| 36 21 63 63 61 21 6d 69 | 72 72 6f 72 21 61 64 65 |6!cca!mi|rror!ade|
|00000020| 6c 69 65 21 6e 65 63 6e | 74 63 21 6e 63 6f 61 73 |lie!necn|tc!ncoas|
|00000030| 74 21 61 6c 6c 62 65 72 | 79 0a 46 72 6f 6d 3a 20 |t!allber|y.From: |
|00000040| 63 72 64 73 40 74 2e 55 | 55 43 50 20 28 57 68 6f |crds@t.U|UCP (Who|
|00000050| 20 41 6d 20 49 29 0a 4e | 65 77 73 67 72 6f 75 70 | Am I).N|ewsgroup|
|00000060| 73 3a 20 63 6f 6d 70 2e | 73 6f 75 72 63 65 73 2e |s: comp.|sources.|
|00000070| 6d 69 73 63 0a 53 75 62 | 6a 65 63 74 3a 20 70 72 |misc.Sub|ject: pr|
|00000080| 65 6c 6f 67 2e 63 2c 20 | 61 20 67 65 74 74 79 20 |elog.c, |a getty |
|00000090| 6c 69 6b 65 20 66 72 6f | 6e 74 20 65 6e 64 20 66 |like fro|nt end f|
|000000a0| 6f 72 20 55 4e 4f 53 2c | 20 6d 6f 73 74 6c 79 20 |or UNOS,| mostly |
|000000b0| 55 4e 49 58 20 63 6f 6d | 70 61 74 61 62 6c 65 0a |UNIX com|patable.|
|000000c0| 4b 65 79 77 6f 72 64 73 | 3a 20 67 65 74 74 79 20 |Keywords|: getty |
|000000d0| 6c 6f 67 69 6e 20 73 6f | 75 72 63 65 20 43 68 61 |login so|urce Cha|
|000000e0| 72 6c 65 73 20 52 69 76 | 65 72 20 43 20 70 72 6f |rles Riv|er C pro|
|000000f0| 67 72 61 6d 0a 4d 65 73 | 73 61 67 65 2d 49 44 3a |gram.Mes|sage-ID:|
|00000100| 20 3c 34 38 37 36 40 6e | 63 6f 61 73 74 2e 55 55 | <4876@n|coast.UU|
|00000110| 43 50 3e 0a 44 61 74 65 | 3a 20 31 35 20 4f 63 74 |CP>.Date|: 15 Oct|
|00000120| 20 38 37 20 30 32 3a 32 | 35 3a 32 38 20 47 4d 54 | 87 02:2|5:28 GMT|
|00000130| 0a 53 65 6e 64 65 72 3a | 20 61 6c 6c 62 65 72 79 |.Sender:| allbery|
|00000140| 40 6e 63 6f 61 73 74 2e | 55 55 43 50 0a 4f 72 67 |@ncoast.|UUCP.Org|
|00000150| 61 6e 69 7a 61 74 69 6f | 6e 3a 20 43 6c 65 76 65 |anizatio|n: Cleve|
|00000160| 6c 61 6e 64 20 50 75 62 | 6c 69 63 20 41 63 63 65 |land Pub|lic Acce|
|00000170| 73 73 20 55 4e 2a 58 2c | 20 43 6c 65 76 65 6c 61 |ss UN*X,| Clevela|
|00000180| 6e 64 2c 20 4f 68 0a 4c | 69 6e 65 73 3a 20 33 39 |nd, Oh.L|ines: 39|
|00000190| 35 0a 41 70 70 72 6f 76 | 65 64 3a 20 61 6c 6c 62 |5.Approv|ed: allb|
|000001a0| 65 72 79 40 6e 63 6f 61 | 73 74 2e 55 55 43 50 0a |ery@ncoa|st.UUCP.|
|000001b0| 58 2d 41 72 63 68 69 76 | 65 3a 20 63 6f 6d 70 2e |X-Archiv|e: comp.|
|000001c0| 73 6f 75 72 63 65 73 2e | 6d 69 73 63 2f 38 37 31 |sources.|misc/871|
|000001d0| 30 2f 31 33 0a 0a 23 21 | 2f 62 69 6e 2f 73 68 0a |0/13..#!|/bin/sh.|
|000001e0| 23 20 54 68 69 73 20 69 | 73 20 61 20 73 68 65 6c |# This i|s a shel|
|000001f0| 6c 20 61 72 63 68 69 76 | 65 2c 20 6d 65 61 6e 69 |l archiv|e, meani|
|00000200| 6e 67 3a 0a 23 20 31 2e | 20 52 65 6d 6f 76 65 20 |ng:.# 1.| Remove |
|00000210| 65 76 65 72 79 74 68 69 | 6e 67 20 61 62 6f 76 65 |everythi|ng above|
|00000220| 20 74 68 65 20 23 21 2f | 62 69 6e 2f 73 68 20 6c | the #!/|bin/sh l|
|00000230| 69 6e 65 2e 0a 23 20 32 | 2e 20 53 61 76 65 20 74 |ine..# 2|. Save t|
|00000240| 68 65 20 72 65 73 75 6c | 74 69 6e 67 20 74 65 78 |he resul|ting tex|
|00000250| 74 20 69 6e 20 61 20 66 | 69 6c 65 2e 0a 23 20 33 |t in a f|ile..# 3|
|00000260| 2e 20 45 78 65 63 75 74 | 65 20 74 68 65 20 66 69 |. Execut|e the fi|
|00000270| 6c 65 20 77 69 74 68 20 | 2f 62 69 6e 2f 73 68 20 |le with |/bin/sh |
|00000280| 28 6e 6f 74 20 63 73 68 | 29 20 74 6f 20 63 72 65 |(not csh|) to cre|
|00000290| 61 74 65 20 74 68 65 20 | 66 69 6c 65 73 3a 0a 23 |ate the |files:.#|
|000002a0| 09 70 72 65 6c 6f 67 2e | 63 0a 23 20 54 68 69 73 |.prelog.|c.# This|
|000002b0| 20 61 72 63 68 69 76 65 | 20 63 72 65 61 74 65 64 | archive| created|
|000002c0| 3a 20 53 75 6e 20 4f 63 | 74 20 31 31 20 30 36 3a |: Sun Oc|t 11 06:|
|000002d0| 31 32 3a 31 31 20 31 39 | 38 37 0a 65 78 70 6f 72 |12:11 19|87.expor|
|000002e0| 74 20 50 41 54 48 3b 20 | 50 41 54 48 3d 2f 62 69 |t PATH; |PATH=/bi|
|000002f0| 6e 3a 24 50 41 54 48 0a | 69 66 20 74 65 73 74 20 |n:$PATH.|if test |
|00000300| 2d 66 20 27 70 72 65 6c | 6f 67 2e 63 27 0a 74 68 |-f 'prel|og.c'.th|
|00000310| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 6f |en..echo| shar: o|
|00000320| 76 65 72 2d 77 72 69 74 | 69 6e 67 20 65 78 69 73 |ver-writ|ing exis|
|00000330| 74 69 6e 67 20 66 69 6c | 65 20 22 27 70 72 65 6c |ting fil|e "'prel|
|00000340| 6f 67 2e 63 27 22 0a 66 | 69 0a 63 61 74 20 3c 3c |og.c'".f|i.cat <<|
|00000350| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 70 72 | \SHAR_E|OF > 'pr|
|00000360| 65 6c 6f 67 2e 63 27 0a | 2f 2a 0a 20 2a 20 09 70 |elog.c'.|/*. * .p|
|00000370| 72 65 6c 6f 67 2e 63 09 | 56 65 72 73 69 6f 6e 20 |relog.c.|Version |
|00000380| 31 2e 30 09 47 6c 65 6e | 6e 20 41 2e 20 45 6d 65 |1.0.Glen|n A. Eme|
|00000390| 6c 6b 6f 09 09 31 30 2f | 31 30 2f 38 37 0a 20 2a |lko..10/|10/87. *|
|000003a0| 0a 20 2a 09 46 69 72 73 | 74 20 6f 66 20 61 6c 6c |. *.Firs|t of all|
|000003b0| 2c 20 49 20 64 6f 20 68 | 65 72 65 62 79 20 64 65 |, I do h|ereby de|
|000003c0| 63 6c 61 72 65 20 74 68 | 69 73 20 63 6f 64 65 20 |clare th|is code |
|000003d0| 61 73 20 61 20 63 6f 6d | 70 6c 65 74 65 6c 79 20 |as a com|pletely |
|000003e0| 6f 72 69 67 69 6e 61 6c | 0a 20 2a 09 70 72 6f 67 |original|. *.prog|
|000003f0| 72 61 6d 2c 20 69 6e 73 | 70 69 72 65 64 20 62 79 |ram, ins|pired by|
|00000400| 20 6d 61 6e 79 20 62 75 | 74 20 77 72 69 74 74 65 | many bu|t writte|
|00000410| 6e 20 62 79 20 6f 6e 65 | 20 28 6d 65 29 2e 20 20 |n by one| (me). |
|00000420| 49 20 68 65 72 65 62 79 | 20 67 72 61 6e 74 0a 20 |I hereby| grant. |
|00000430| 2a 09 61 6e 79 6f 6e 65 | 20 70 65 72 6d 69 73 73 |*.anyone| permiss|
|00000440| 69 6f 6e 20 74 6f 20 75 | 73 65 20 74 68 69 73 20 |ion to u|se this |
|00000450| 63 6f 64 65 20 61 73 20 | 70 75 62 6c 69 63 20 64 |code as |public d|
|00000460| 6f 6d 61 69 6e 2c 20 66 | 6f 72 20 74 68 65 20 73 |omain, f|or the s|
|00000470| 6f 6c 65 0a 20 2a 09 70 | 75 72 70 6f 73 65 20 6f |ole. *.p|urpose o|
|00000480| 66 20 75 6e 64 65 72 73 | 74 61 6e 64 69 6e 67 2c |f unders|tanding,|
|00000490| 20 6c 65 61 72 6e 69 6e | 67 2c 20 6f 72 20 73 69 | learnin|g, or si|
|000004a0| 6d 70 6c 79 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |mply imp|lementat|
|000004b0| 69 6f 6e 20 6f 66 20 61 | 6e 79 0a 20 2a 09 6f 72 |ion of a|ny. *.or|
|000004c0| 20 61 6c 6c 20 6f 66 20 | 74 68 65 20 63 6f 6e 63 | all of |the conc|
|000004d0| 65 70 74 73 20 68 65 72 | 65 69 6e 2e 20 20 49 20 |epts her|ein. I |
|000004e0| 68 65 72 65 62 79 20 72 | 65 73 74 72 69 63 74 20 |hereby r|estrict |
|000004f0| 74 68 65 20 75 73 61 67 | 65 20 6f 66 20 74 68 69 |the usag|e of thi|
|00000500| 73 0a 20 2a 09 63 6f 64 | 65 20 74 6f 20 4e 4f 4e |s. *.cod|e to NON|
|00000510| 2d 50 52 4f 46 49 54 20 | 70 75 72 70 6f 73 65 73 |-PROFIT |purposes|
|00000520| 3b 20 6e 6f 20 70 6f 72 | 74 69 6f 6e 73 20 6f 66 |; no por|tions of|
|00000530| 20 74 68 69 73 20 63 6f | 64 65 20 73 68 6f 75 6c | this co|de shoul|
|00000540| 64 20 62 65 20 75 73 65 | 64 0a 20 2a 09 62 79 20 |d be use|d. *.by |
|00000550| 61 6e 79 6f 6e 65 20 69 | 6e 20 61 6e 79 20 77 61 |anyone i|n any wa|
|00000560| 79 2c 20 73 68 61 70 65 | 2c 20 6f 72 20 66 6f 72 |y, shape|, or for|
|00000570| 6d 2c 20 69 6e 20 6f 72 | 64 65 72 20 74 6f 20 70 |m, in or|der to p|
|00000580| 72 6f 6d 6f 74 65 20 67 | 61 69 6e 20 74 6f 0a 20 |romote g|ain to. |
|00000590| 2a 09 65 69 74 68 65 72 | 20 73 65 6c 66 20 6f 72 |*.either| self or|
|000005a0| 20 6f 74 68 65 72 73 20 | 28 65 78 63 65 70 74 20 | others |(except |
|000005b0| 6d 65 2c 20 62 75 74 20 | 49 27 6c 6c 20 6e 65 76 |me, but |I'll nev|
|000005c0| 65 72 20 64 6f 20 74 68 | 61 74 29 2e 20 20 54 68 |er do th|at). Th|
|000005d0| 69 73 0a 20 2a 09 72 65 | 73 74 72 69 63 74 69 6f |is. *.re|strictio|
|000005e0| 6e 20 61 6c 73 6f 20 73 | 74 69 70 75 6c 61 74 65 |n also s|tipulate|
|000005f0| 73 20 74 68 61 74 20 61 | 6e 79 20 6f 66 20 74 68 |s that a|ny of th|
|00000600| 65 20 61 62 6f 76 65 20 | 77 6f 72 64 73 2c 20 61 |e above |words, a|
|00000610| 73 20 77 65 6c 6c 0a 20 | 2a 09 74 68 65 73 65 2c |s well. |*.these,|
|00000620| 20 73 68 61 6c 6c 20 62 | 65 20 70 72 6f 6c 69 66 | shall b|e prolif|
|00000630| 65 72 61 74 65 64 20 77 | 69 74 68 20 74 68 69 73 |erated w|ith this|
|00000640| 20 63 6f 64 65 20 75 6e | 74 69 6c 20 64 6f 6f 6d | code un|til doom|
|00000650| 73 64 61 79 20 28 6f 72 | 20 61 66 74 65 72 29 2e |sday (or| after).|
|00000660| 0a 20 2a 0a 20 2a 09 54 | 68 61 6e 6b 20 79 6f 75 |. *. *.T|hank you|
|00000670| 2e 0a 20 2a 0a 20 2a 09 | 54 68 69 73 20 70 72 6f |.. *. *.|This pro|
|00000680| 67 72 61 6d 20 77 61 73 | 20 77 72 69 74 74 65 6e |gram was| written|
|00000690| 20 61 6e 64 20 64 65 76 | 65 6c 6f 70 65 64 20 6f | and dev|eloped o|
|000006a0| 6e 20 61 20 43 68 61 72 | 6c 65 73 20 52 69 76 65 |n a Char|les Rive|
|000006b0| 72 20 44 61 74 61 20 53 | 79 73 74 65 6d 73 0a 20 |r Data S|ystems. |
|000006c0| 2a 09 55 6e 69 76 65 72 | 73 65 20 36 38 2f 33 35 |*.Univer|se 68/35|
|000006d0| 20 72 75 6e 6e 69 6e 67 | 20 55 4e 4f 53 20 35 2e | running| UNOS 5.|
|000006e0| 31 2e 20 20 54 68 65 20 | 70 75 72 70 6f 73 65 20 |1. The |purpose |
|000006f0| 77 61 73 20 74 6f 20 70 | 72 6f 76 69 64 65 20 61 |was to p|rovide a|
|00000700| 20 6c 6f 67 69 6e 0a 20 | 2a 09 70 72 65 70 72 6f | login. |*.prepro|
|00000710| 63 65 73 73 6f 72 20 73 | 69 6d 69 6c 61 72 20 74 |cessor s|imilar t|
|00000720| 6f 20 67 65 74 74 79 2c | 20 77 68 69 63 68 20 77 |o getty,| which w|
|00000730| 6f 75 6c 64 20 61 75 74 | 6f 6d 61 74 69 63 61 6c |ould aut|omatical|
|00000740| 6c 79 20 64 65 74 65 63 | 74 20 62 61 75 64 0a 20 |ly detec|t baud. |
|00000750| 2a 09 72 61 74 65 2c 20 | 73 65 74 20 74 68 65 20 |*.rate, |set the |
|00000760| 65 6e 74 72 79 20 69 6e | 20 74 68 65 20 2f 65 74 |entry in| the /et|
|00000770| 63 2f 74 74 79 73 20 66 | 69 6c 65 20 66 6f 72 20 |c/ttys f|ile for |
|00000780| 74 68 65 20 70 72 6f 70 | 65 72 20 62 61 75 64 20 |the prop|er baud |
|00000790| 73 65 74 74 69 6e 67 2c | 0a 20 2a 09 61 6e 64 20 |setting,|. *.and |
|000007a0| 74 68 65 6e 20 65 78 65 | 63 75 74 65 20 74 68 65 |then exe|cute the|
|000007b0| 20 6f 72 69 67 69 6e 61 | 6c 20 6c 6f 67 69 6e 20 | origina|l login |
|000007c0| 70 72 6f 63 65 73 73 6f | 72 20 74 6f 20 6c 6f 67 |processo|r to log|
|000007d0| 20 69 6e 20 61 20 75 73 | 65 72 2e 20 20 4e 6f 0a | in a us|er. No.|
|000007e0| 20 2a 09 61 74 74 65 6d | 70 74 20 68 61 73 20 62 | *.attem|pt has b|
|000007f0| 65 65 6e 20 6d 61 64 65 | 20 61 74 20 74 68 69 73 |een made| at this|
|00000800| 20 70 6f 69 6e 74 20 74 | 6f 20 74 65 73 74 20 74 | point t|o test t|
|00000810| 68 69 73 20 63 6f 64 65 | 20 77 69 74 68 20 73 69 |his code| with si|
|00000820| 67 6e 61 6c 73 2c 0a 20 | 2a 09 62 75 74 20 69 74 |gnals,. |*.but it|
|00000830| 20 69 73 20 6d 79 20 62 | 65 6c 69 65 66 20 74 68 | is my b|elief th|
|00000840| 61 74 20 69 74 20 73 68 | 6f 75 6c 64 20 77 6f 72 |at it sh|ould wor|
|00000850| 6b 20 70 72 6f 70 65 72 | 6c 79 2e 0a 20 2a 0a 20 |k proper|ly.. *. |
|00000860| 2a 0a 20 2a 09 54 68 65 | 20 66 69 6c 65 20 2f 65 |*. *.The| file /e|
|00000870| 74 63 2f 74 74 79 73 20 | 6d 75 73 74 20 62 65 20 |tc/ttys |must be |
|00000880| 6d 61 69 6e 74 61 69 6e | 65 64 20 70 72 6f 70 65 |maintain|ed prope|
|00000890| 72 6c 79 20 66 6f 72 20 | 74 68 65 20 6f 72 69 67 |rly for |the orig|
|000008a0| 69 6e 61 6c 20 55 4e 4f | 53 0a 20 2a 09 6c 6f 67 |inal UNO|S. *.log|
|000008b0| 69 6e 20 70 72 6f 63 65 | 64 75 72 65 20 74 6f 20 |in proce|dure to |
|000008c0| 73 65 74 20 74 68 65 20 | 62 61 75 64 20 72 61 74 |set the |baud rat|
|000008d0| 65 20 64 75 72 69 6e 67 | 20 74 68 65 20 6c 6f 67 |e during| the log|
|000008e0| 69 6e 20 70 72 6f 63 65 | 64 65 75 72 65 2e 20 20 |in proce|deure. |
|000008f0| 49 0a 20 2a 09 68 61 76 | 65 20 61 64 64 65 64 20 |I. *.hav|e added |
|00000900| 61 20 66 69 65 6c 64 20 | 69 6e 20 2f 65 74 63 2f |a field |in /etc/|
|00000910| 74 74 79 73 20 77 68 69 | 63 68 20 77 69 6c 6c 20 |ttys whi|ch will |
|00000920| 64 65 74 65 72 6d 69 6e | 65 20 77 68 69 63 68 20 |determin|e which |
|00000930| 62 61 75 64 20 74 61 62 | 6c 65 0a 20 2a 09 69 73 |baud tab|le. *.is|
|00000940| 20 75 73 65 64 20 66 6f | 72 20 72 6f 74 61 72 79 | used fo|r rotary|
|00000950| 20 62 61 75 64 20 73 65 | 6c 65 63 74 69 6f 6e 2e | baud se|lection.|
|00000960| 20 20 42 61 75 64 20 73 | 65 6c 65 63 74 69 6f 6e | Baud s|election|
|00000970| 20 69 73 20 61 63 63 6f | 6d 70 6c 69 73 68 65 64 | is acco|mplished|
|00000980| 20 62 79 0a 20 2a 09 73 | 65 6e 73 69 6e 67 20 66 | by. *.s|ensing f|
|00000990| 6f 72 20 74 77 6f 20 63 | 61 72 72 69 61 67 65 20 |or two c|arriage |
|000009a0| 72 65 74 75 72 6e 73 2c | 20 61 6e 64 20 69 66 20 |returns,| and if |
|000009b0| 74 68 65 79 20 61 72 65 | 20 6e 6f 74 20 66 6f 75 |they are| not fou|
|000009c0| 6e 64 20 61 64 6a 61 63 | 65 6e 74 0a 20 2a 09 74 |nd adjac|ent. *.t|
|000009d0| 6f 20 65 61 63 68 20 6f | 74 68 65 72 2c 20 77 61 |o each o|ther, wa|
|000009e0| 69 74 69 6e 67 20 66 6f | 72 20 6e 6f 20 64 61 74 |iting fo|r no dat|
|000009f0| 61 2c 20 61 6e 64 20 74 | 68 65 6e 20 72 6f 74 6f |a, and t|hen roto|
|00000a00| 72 69 6e 67 20 74 6f 20 | 74 68 65 20 6e 65 78 74 |ring to |the next|
|00000a10| 20 62 61 75 64 0a 20 2a | 09 73 65 6c 65 63 74 69 | baud. *|.selecti|
|00000a20| 6f 6e 2c 20 61 6e 64 20 | 72 65 70 65 61 74 69 6e |on, and |repeatin|
|00000a30| 67 2e 20 20 44 75 72 69 | 6e 67 20 74 68 69 73 20 |g. Duri|ng this |
|00000a40| 74 69 6d 65 2c 20 65 69 | 74 68 65 72 20 6e 6f 74 |time, ei|ther not|
|00000a50| 68 69 6e 67 2c 20 6f 72 | 20 61 0a 20 2a 09 6d 65 |hing, or| a. *.me|
|00000a60| 73 73 61 67 65 20 28 73 | 65 65 20 72 6f 74 6f 72 |ssage (s|ee rotor|
|00000a70| 6d 73 67 29 20 6d 61 79 | 20 62 65 20 73 65 6e 74 |msg) may| be sent|
|00000a80| 20 74 6f 20 74 68 65 20 | 74 65 72 6d 69 6e 61 6c | to the |terminal|
|00000a90| 20 61 73 20 65 61 63 68 | 20 72 61 74 65 20 69 73 | as each| rate is|
|00000aa0| 0a 20 2a 09 72 6f 74 6f | 72 65 64 20 74 68 72 6f |. *.roto|red thro|
|00000ab0| 75 67 68 2e 0a 20 2a 0a | 20 2a 09 53 75 70 70 6f |ugh.. *.| *.Suppo|
|00000ac0| 72 74 20 69 6e 20 74 68 | 65 20 63 6f 64 65 20 65 |rt in th|e code e|
|00000ad0| 78 69 73 74 73 20 74 6f | 20 73 74 61 72 74 20 75 |xists to| start u|
|00000ae0| 70 20 61 6e 64 20 64 72 | 69 76 65 20 61 20 22 41 |p and dr|ive a "A|
|00000af0| 54 78 78 22 20 63 6f 6d | 70 61 74 61 62 6c 65 0a |Txx" com|patable.|
|00000b00| 20 2a 09 6d 6f 64 65 6d | 2c 20 61 6e 64 20 69 74 | *.modem|, and it|
|00000b10| 20 6d 61 79 20 62 65 20 | 64 65 73 69 72 61 62 6c | may be |desirabl|
|00000b20| 65 20 74 6f 20 74 61 6b | 65 20 61 64 76 61 6e 74 |e to tak|e advant|
|00000b30| 61 67 65 20 6f 66 20 74 | 68 65 20 63 61 72 72 69 |age of t|he carri|
|00000b40| 65 72 0a 20 2a 09 6d 65 | 73 73 61 67 65 20 74 6f |er. *.me|ssage to|
|00000b50| 20 64 65 74 65 72 6d 69 | 6e 65 20 62 61 75 64 20 | determi|ne baud |
|00000b60| 73 65 6c 65 63 74 69 6f | 6e 20 64 69 72 65 63 74 |selectio|n direct|
|00000b70| 6c 79 2c 20 72 61 74 68 | 65 72 20 74 68 61 6e 20 |ly, rath|er than |
|00000b80| 72 6f 74 6f 72 69 6e 67 | 2e 0a 20 2a 0a 20 2a 09 |rotoring|.. *. *.|
|00000b90| 54 68 65 20 2f 65 74 63 | 2f 74 74 79 73 20 66 69 |The /etc|/ttys fi|
|00000ba0| 6c 65 20 68 61 73 20 73 | 69 6e 67 6c 65 20 6c 69 |le has s|ingle li|
|00000bb0| 6e 65 20 69 74 65 6d 73 | 20 66 6f 72 20 65 61 63 |ne items| for eac|
|00000bc0| 68 20 74 74 79 20 64 65 | 76 69 63 65 2c 20 77 69 |h tty de|vice, wi|
|00000bd0| 74 68 0a 20 2a 09 74 68 | 65 20 69 6e 66 6f 72 6d |th. *.th|e inform|
|00000be0| 61 74 69 6f 6e 20 66 69 | 65 6c 64 73 20 64 65 6c |ation fi|elds del|
|00000bf0| 69 6d 69 74 65 64 20 62 | 79 20 63 6f 6c 6f 6e 73 |imited b|y colons|
|00000c00| 2e 20 20 49 20 64 69 64 | 20 6e 6f 74 20 70 75 74 |. I did| not put|
|00000c10| 20 69 6e 20 74 68 65 0a | 20 2a 09 6e 65 63 65 73 | in the.| *.neces|
|00000c20| 73 61 72 79 20 73 75 70 | 70 6f 72 74 20 66 6f 72 |sary sup|port for|
|00000c30| 20 63 6f 6e 74 69 6e 75 | 61 74 69 6f 6e 20 6c 69 | continu|ation li|
|00000c40| 6e 65 73 3b 20 69 74 20 | 63 61 6e 20 62 65 20 73 |nes; it |can be s|
|00000c50| 61 66 65 6c 79 20 6c 65 | 66 74 20 61 73 0a 20 2a |afely le|ft as. *|
|00000c60| 09 61 6e 20 65 78 65 72 | 63 69 73 65 20 74 6f 20 |.an exer|cise to |
|00000c70| 74 68 65 20 67 75 72 75 | 20 5b 73 6d 69 6c 65 5d |the guru| [smile]|
|00000c80| 2e 20 20 54 68 65 20 66 | 6f 72 6d 61 74 20 6f 66 |. The f|ormat of|
|00000c90| 20 74 68 65 20 2f 65 74 | 63 2f 74 74 79 73 20 66 | the /et|c/ttys f|
|00000ca0| 69 6c 65 0a 20 2a 09 69 | 73 20 61 73 20 66 6f 6c |ile. *.i|s as fol|
|00000cb0| 6c 6f 77 73 3a 0a 20 2a | 0a 20 2a 09 73 74 61 74 |lows:. *|. *.stat|
|00000cc0| 65 3a 6c 69 6e 65 6e 6f | 3a 64 65 76 70 61 74 68 |e:lineno|:devpath|
|00000cd0| 3a 64 65 76 69 64 3a 74 | 65 72 6d 69 6e 61 6c 3a |:devid:t|erminal:|
|00000ce0| 74 74 79 6d 6f 64 65 73 | 3a 63 6f 6d 6d 65 6e 74 |ttymodes|:comment|
|00000cf0| 73 3a 65 78 74 72 61 0a | 20 2a 0a 20 2a 09 77 68 |s:extra.| *. *.wh|
|00000d00| 65 72 65 20 5b 69 6e 20 | 62 72 61 63 6b 65 74 73 |ere [in |brackets|
|00000d10| 20 69 73 20 74 68 65 20 | 6d 61 78 69 6d 75 6d 20 | is the |maximum |
|00000d20| 66 69 65 6c 64 20 77 69 | 74 68 20 61 6c 6c 6f 77 |field wi|th allow|
|00000d30| 65 64 20 62 79 20 70 72 | 65 6c 6f 67 5d 3a 0a 20 |ed by pr|elog]:. |
|00000d40| 2a 0a 20 2a 09 09 73 74 | 61 74 65 20 5b 31 32 5d |*. *..st|ate [12]|
|00000d50| 20 2d 2d 20 65 69 74 68 | 65 72 20 22 6f 6e 22 20 | -- eith|er "on" |
|00000d60| 6f 72 20 73 6f 6d 65 74 | 68 69 6e 67 20 65 6c 73 |or somet|hing els|
|00000d70| 65 3b 20 6f 6e 20 69 6e | 64 69 63 61 74 69 6e 67 |e; on in|dicating|
|00000d80| 20 61 6e 0a 20 2a 09 09 | 09 61 63 74 69 76 65 20 | an. *..|.active |
|00000d90| 6c 6f 67 69 6e 20 70 6f | 72 74 2c 20 61 6e 64 20 |login po|rt, and |
|00000da0| 61 6e 79 74 68 69 6e 67 | 20 65 6c 73 65 20 69 6e |anything| else in|
|00000db0| 64 69 63 61 74 69 6e 67 | 20 61 6e 0a 20 2a 09 09 |dicating| an. *..|
|00000dc0| 09 69 2f 6f 20 70 6f 72 | 74 20 66 6f 72 20 6f 74 |.i/o por|t for ot|
|00000dd0| 68 65 72 20 75 73 61 67 | 65 2e 0a 20 2a 0a 20 2a |her usag|e.. *. *|
|00000de0| 09 09 6c 69 6e 65 6e 6f | 20 5b 34 5d 20 2d 2d 20 |..lineno| [4] -- |
|00000df0| 6c 6f 67 69 63 61 6c 20 | 74 74 79 20 6e 75 6d 62 |logical |tty numb|
|00000e00| 65 72 2c 20 6f 6e 20 74 | 68 65 20 43 52 44 53 2c |er, on t|he CRDS,|
|00000e10| 20 69 74 20 63 6f 72 72 | 65 73 70 6f 6e 64 73 0a | it corr|esponds.|
|00000e20| 20 2a 09 09 09 74 6f 20 | 6c 61 73 74 20 6e 75 6d | *...to |last num|
|00000e30| 62 65 72 20 69 6e 20 74 | 68 65 20 64 65 76 69 63 |ber in t|he devic|
|00000e40| 65 20 70 61 74 68 2c 20 | 77 68 69 63 68 68 61 73 |e path, |whichhas|
|00000e50| 20 61 20 72 61 6e 67 65 | 0a 20 2a 09 09 09 66 72 | a range|. *...fr|
|00000e60| 6f 6d 20 30 20 74 6f 20 | 31 31 2e 0a 20 2a 0a 20 |om 0 to |11.. *. |
|00000e70| 2a 09 09 64 70 61 74 68 | 20 5b 31 32 5d 20 2d 2d |*..dpath| [12] --|
|00000e80| 20 74 68 65 20 66 75 6c | 6c 20 70 61 74 68 20 6f | the ful|l path o|
|00000e90| 66 20 74 68 65 20 74 74 | 79 20 64 65 76 69 63 65 |f the tt|y device|
|00000ea0| 2e 20 20 53 6f 6d 65 74 | 68 69 6e 67 20 6c 69 6b |. Somet|hing lik|
|00000eb0| 65 0a 20 2a 09 09 09 22 | 2f 64 65 76 2f 74 74 79 |e. *..."|/dev/tty|
|00000ec0| 34 22 20 69 73 20 76 61 | 6c 69 64 2e 0a 20 2a 0a |4" is va|lid.. *.|
|00000ed0| 20 2a 09 09 64 65 76 6e | 75 6d 20 5b 36 5d 20 2d | *..devn|um [6] -|
|00000ee0| 2d 20 54 68 65 20 73 79 | 73 74 65 6d 20 6d 61 6a |- The sy|stem maj|
|00000ef0| 6f 72 20 61 6e 64 20 6d | 69 6e 6f 72 20 64 65 76 |or and m|inor dev|
|00000f00| 69 63 65 20 6e 75 6d 62 | 65 72 2e 20 20 4f 6e 0a |ice numb|er. On.|
|00000f10| 20 2a 09 09 09 74 68 65 | 20 43 52 44 53 2c 20 74 | *...the| CRDS, t|
|00000f20| 68 69 73 20 69 73 20 31 | 2f 6e 6e 2c 20 77 68 65 |his is 1|/nn, whe|
|00000f30| 72 65 20 6e 6e 20 69 73 | 20 74 68 65 20 74 74 79 |re nn is| the tty|
|00000f40| 20 6e 75 6d 62 65 72 2e | 0a 20 2a 0a 20 2a 09 09 | number.|. *. *..|
|00000f50| 74 74 79 69 64 20 5b 31 | 32 5d 20 2d 2d 20 74 68 |ttyid [1|2] -- th|
|00000f60| 69 73 20 69 73 20 74 68 | 65 20 74 65 72 6d 69 6e |is is th|e termin|
|00000f70| 61 6c 20 69 64 20 61 73 | 73 75 6d 65 64 20 74 6f |al id as|sumed to|
|00000f80| 20 62 65 20 63 6f 6e 6e | 65 63 74 65 64 0a 20 2a | be conn|ected. *|
|00000f90| 09 09 09 74 6f 20 74 68 | 65 20 6c 69 6e 65 3b 20 |...to th|e line; |
|00000fa0| 69 74 20 69 73 20 6c 6f | 6f 6b 65 64 20 75 70 20 |it is lo|oked up |
|00000fb0| 69 6e 20 74 68 65 20 74 | 65 72 6d 63 61 70 20 65 |in the t|ermcap e|
|00000fc0| 6e 74 72 69 65 73 0a 20 | 2a 09 09 09 74 6f 20 73 |ntries. |*...to s|
|00000fd0| 65 74 20 74 65 72 6d 69 | 6e 61 6c 20 70 61 72 61 |et termi|nal para|
|00000fe0| 6d 65 74 65 72 73 2e 20 | 20 53 6f 6d 65 74 68 69 |meters. | Somethi|
|00000ff0| 6e 67 20 6c 69 6b 65 20 | 22 76 74 31 30 30 22 0a |ng like |"vt100".|
|00001000| 20 2a 09 09 09 69 73 20 | 76 61 6c 69 64 2e 0a 20 | *...is |valid.. |
|00001010| 2a 0a 20 2a 09 09 74 62 | 61 75 64 20 5b 32 30 5d |*. *..tb|aud [20]|
|00001020| 20 2d 2d 20 74 68 69 73 | 20 69 73 20 74 68 65 20 | -- this| is the |
|00001030| 65 6e 74 72 79 20 72 65 | 61 64 20 74 6f 20 73 65 |entry re|ad to se|
|00001040| 74 20 74 65 72 6d 69 6e | 61 6c 20 6d 6f 64 65 73 |t termin|al modes|
|00001050| 20 6f 6e 0a 20 2a 09 09 | 09 74 68 65 20 74 74 79 | on. *..|.the tty|
|00001060| 20 64 65 76 69 63 65 2e | 20 20 54 68 69 73 20 65 | device.| This e|
|00001070| 6e 74 72 79 20 69 73 20 | 70 61 73 73 65 64 20 62 |ntry is |passed b|
|00001080| 79 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 0a 20 |y the or|iginal. |
|00001090| 2a 09 09 09 6c 6f 67 69 | 6e 20 70 72 6f 67 72 61 |*...logi|n progra|
|000010a0| 6d 20 74 6f 20 61 6e 20 | 69 6e 74 65 72 6e 61 6c |m to an |internal|
|000010b0| 20 55 4e 4f 53 20 73 70 | 65 63 69 66 69 63 20 73 | UNOS sp|ecific s|
|000010c0| 79 73 74 65 6d 20 63 61 | 6c 6c 0a 20 2a 09 09 09 |ystem ca|ll. *...|
|000010d0| 63 61 6c 6c 65 64 20 5f | 74 74 79 6d 6f 64 65 73 |called _|ttymodes|
|000010e0| 2e 20 20 54 68 65 20 73 | 74 61 6e 64 61 72 64 20 |. The s|tandard |
|000010f0| 2f 65 74 63 2f 74 74 79 | 73 20 66 69 6c 65 20 6f |/etc/tty|s file o|
|00001100| 6e 6c 79 0a 20 2a 09 09 | 09 73 65 74 73 20 74 68 |nly. *..|.sets th|
|00001110| 65 20 62 61 75 64 20 72 | 61 74 65 20 62 79 20 74 |e baud r|ate by t|
|00001120| 68 69 73 20 66 69 65 6c | 64 2c 20 61 6e 64 20 74 |his fiel|d, and t|
|00001130| 68 69 73 20 69 73 20 77 | 68 65 72 65 0a 20 2a 09 |his is w|here. *.|
|00001140| 09 09 70 72 65 6c 6f 67 | 20 70 75 74 73 20 69 74 |..prelog| puts it|
|00001150| 73 20 73 70 65 65 64 20 | 73 65 74 74 69 6e 67 20 |s speed |setting |
|00001160| 61 66 74 65 72 20 69 74 | 20 68 61 73 20 64 65 74 |after it| has det|
|00001170| 65 63 74 65 64 0a 20 2a | 09 09 09 74 68 65 20 73 |ected. *|...the s|
|00001180| 70 65 65 64 2e 20 20 41 | 20 73 74 61 6e 64 61 72 |peed. A| standar|
|00001190| 64 20 55 4e 4f 53 20 65 | 6e 74 72 79 20 69 6e 20 |d UNOS e|ntry in |
|000011a0| 74 68 69 73 20 66 69 65 | 6c 64 20 69 73 0a 20 2a |this fie|ld is. *|
|000011b0| 09 09 09 73 6f 6d 65 74 | 68 69 6e 67 20 6c 69 6b |...somet|hing lik|
|000011c0| 65 20 22 73 70 65 65 64 | 3d 39 36 30 30 22 2e 0a |e "speed|=9600"..|
|000011d0| 20 2a 09 09 09 4e 4f 54 | 45 3a 20 54 48 49 53 20 | *...NOT|E: THIS |
|000011e0| 46 49 45 4c 44 20 49 53 | 20 4d 4f 44 49 46 49 45 |FIELD IS| MODIFIE|
|000011f0| 44 20 42 59 20 70 72 65 | 6c 6f 67 2e 0a 20 2a 0a |D BY pre|log.. *.|
|00001200| 20 2a 09 09 74 73 65 74 | 62 20 5b 33 30 5d 20 2d | *..tset|b [30] -|
|00001210| 2d 20 74 68 69 73 20 66 | 69 65 6c 64 20 77 61 73 |- this f|ield was|
|00001220| 20 74 68 65 20 63 6f 6d | 6d 65 6e 74 20 66 69 65 | the com|ment fie|
|00001230| 6c 64 20 61 73 73 6f 63 | 69 61 74 65 64 20 77 69 |ld assoc|iated wi|
|00001240| 74 68 0a 20 2a 09 09 09 | 74 68 65 20 74 74 79 20 |th. *...|the tty |
|00001250| 64 65 76 69 63 65 2e 20 | 20 49 20 63 6f 6d 6d 61 |device. | I comma|
|00001260| 6e 64 65 65 72 65 64 20 | 74 68 69 73 20 66 69 65 |ndeered |this fie|
|00001270| 6c 64 2c 20 61 6e 64 20 | 68 61 76 65 0a 20 2a 09 |ld, and |have. *.|
|00001280| 09 09 67 69 76 65 6e 20 | 69 74 20 6e 65 77 20 6d |..given |it new m|
|00001290| 65 61 6e 69 6e 67 3b 20 | 74 68 65 20 46 49 52 53 |eaning; |the FIRS|
|000012a0| 54 20 63 68 61 72 61 63 | 74 65 72 20 6f 66 20 74 |T charac|ter of t|
|000012b0| 68 69 73 0a 20 2a 09 09 | 09 66 69 65 6c 64 20 73 |his. *..|.field s|
|000012c0| 68 61 6c 6c 20 62 65 20 | 61 20 27 30 27 20 74 68 |hall be |a '0' th|
|000012d0| 72 75 20 27 39 27 2c 20 | 69 64 65 6e 74 69 66 79 |ru '9', |identify|
|000012e0| 69 6e 67 20 77 68 69 63 | 68 20 74 61 62 6c 65 0a |ing whic|h table.|
|000012f0| 20 2a 09 09 09 70 72 65 | 6c 6f 67 20 73 68 61 6c | *...pre|log shal|
|00001300| 6c 20 75 73 65 20 74 6f | 20 73 65 6c 65 63 74 20 |l use to| select |
|00001310| 69 74 73 20 62 61 75 64 | 20 72 61 74 65 73 20 62 |its baud| rates b|
|00001320| 79 2c 20 61 73 20 77 65 | 6c 6c 0a 20 2a 09 09 09 |y, as we|ll. *...|
|00001330| 61 73 20 63 6f 6e 74 72 | 6f 6c 20 61 20 6d 6f 64 |as contr|ol a mod|
|00001340| 65 6d 20 62 79 2e 20 20 | 54 68 65 20 44 45 46 41 |em by. |The DEFA|
|00001350| 55 4c 54 20 73 65 74 74 | 69 6e 67 20 69 73 20 30 |ULT sett|ing is 0|
|00001360| 20 6f 72 0a 20 2a 09 09 | 09 61 20 6e 6f 6e 2d 6e | or. *..|.a non-n|
|00001370| 75 6d 65 72 69 63 20 63 | 68 61 72 61 63 74 65 72 |umeric c|haracter|
|00001380| 2c 20 77 68 69 63 68 20 | 61 72 65 20 74 72 65 61 |, which |are trea|
|00001390| 74 65 64 20 74 68 65 20 | 73 61 6d 65 2e 0a 20 2a |ted the |same.. *|
|000013a0| 09 09 09 49 6e 20 74 68 | 69 73 20 64 65 66 61 75 |...In th|is defau|
|000013b0| 6c 74 20 6d 6f 64 65 2c | 20 74 68 65 20 62 61 75 |lt mode,| the bau|
|000013c0| 64 20 72 61 74 65 20 77 | 69 6c 6c 20 4e 4f 54 20 |d rate w|ill NOT |
|000013d0| 62 65 20 61 75 74 6f 0a | 20 2a 09 09 09 73 65 6c |be auto.| *...sel|
|000013e0| 65 63 74 65 64 2c 20 69 | 6e 73 74 65 61 64 2c 20 |ected, i|nstead, |
|000013f0| 74 68 65 20 74 74 79 6d | 6f 64 65 73 20 66 69 65 |the ttym|odes fie|
|00001400| 6c 64 20 77 69 6c 6c 20 | 62 65 20 75 73 65 64 0a |ld will |be used.|
|00001410| 20 2a 09 09 09 61 73 20 | 69 73 2c 20 77 69 74 68 | *...as |is, with|
|00001420| 6f 75 74 20 63 68 61 6e | 67 69 6e 67 20 69 74 2e |out chan|ging it.|
|00001430| 20 20 53 65 65 20 74 68 | 65 20 74 61 62 6c 65 73 | See th|e tables|
|00001440| 20 66 6f 72 20 74 68 65 | 0a 20 2a 09 09 09 6f 74 | for the|. *...ot|
|00001450| 68 65 72 20 70 6f 73 73 | 69 62 6c 65 20 76 61 6c |her poss|ible val|
|00001460| 75 65 73 2e 20 20 54 68 | 65 20 52 45 53 54 20 6f |ues. Th|e REST o|
|00001470| 66 20 74 68 69 73 20 66 | 69 65 6c 64 20 6d 61 79 |f this f|ield may|
|00001480| 0a 20 2a 09 09 09 73 74 | 69 6c 6c 20 62 65 20 75 |. *...st|ill be u|
|00001490| 73 65 64 20 66 6f 72 20 | 63 6f 6d 6d 65 6e 74 73 |sed for |comments|
|000014a0| 20 6f 66 20 61 6e 79 20 | 73 6f 72 74 2e 0a 20 2a | of any |sort.. *|
|000014b0| 09 09 09 4e 4f 54 45 3a | 20 54 48 49 53 20 46 49 |...NOTE:| THIS FI|
|000014c0| 45 4c 44 20 49 53 20 43 | 48 45 43 4b 45 44 20 42 |ELD IS C|HECKED B|
|000014d0| 59 20 70 72 65 6c 6f 67 | 2e 0a 20 2a 0a 20 2a 09 |Y prelog|.. *. *.|
|000014e0| 09 65 78 74 72 61 20 5b | 33 30 5d 20 2d 2d 20 57 |.extra [|30] -- W|
|000014f0| 65 6c 6c 2c 20 79 6f 75 | 72 20 67 75 65 73 73 20 |ell, you|r guess |
|00001500| 69 73 20 61 73 20 67 6f | 6f 64 20 61 73 20 6d 69 |is as go|od as mi|
|00001510| 6e 65 2e 20 20 54 68 69 | 73 0a 20 2a 09 09 09 66 |ne. Thi|s. *...f|
|00001520| 69 65 6c 64 20 6d 61 79 | 20 6f 72 20 6d 61 79 20 |ield may| or may |
|00001530| 6e 6f 74 20 65 76 65 6e | 20 65 78 69 73 74 20 6f |not even| exist o|
|00001540| 6e 20 73 6f 6d 65 20 6f | 66 20 74 68 65 0a 20 2a |n some o|f the. *|
|00001550| 09 09 09 65 6e 74 72 69 | 65 73 3b 20 69 6e 20 66 |...entri|es; in f|
|00001560| 61 63 74 20 74 68 65 72 | 65 20 61 72 65 20 73 6f |act ther|e are so|
|00001570| 6d 65 20 65 78 74 72 61 | 20 63 6f 6c 6f 6e 73 20 |me extra| colons |
|00001580| 61 74 20 74 68 65 0a 20 | 2a 09 09 09 65 6e 64 20 |at the. |*...end |
|00001590| 6f 66 20 73 6f 6d 65 20 | 6c 69 6e 65 73 20 69 6e |of some |lines in|
|000015a0| 20 6d 79 20 6f 77 6e 20 | 74 74 79 73 20 66 69 6c | my own |ttys fil|
|000015b0| 65 2e 20 20 41 6e 79 74 | 68 69 6e 67 0a 20 2a 09 |e. Anyt|hing. *.|
|000015c0| 09 09 61 66 74 65 72 20 | 74 68 65 20 63 6f 6d 6d |..after |the comm|
|000015d0| 65 6e 74 73 20 66 69 65 | 6c 64 20 69 73 20 63 61 |ents fie|ld is ca|
|000015e0| 70 74 75 72 65 64 20 76 | 65 72 62 61 74 69 6d 2c |ptured v|erbatim,|
|000015f0| 20 73 6f 20 69 74 0a 20 | 2a 09 09 09 77 69 6c 6c | so it. |*...will|
|00001600| 20 62 65 20 70 75 74 20 | 62 61 63 6b 20 65 78 61 | be put |back exa|
|00001610| 63 74 6c 79 20 74 68 65 | 20 73 61 6d 65 20 77 61 |ctly the| same wa|
|00001620| 79 20 69 74 20 63 61 6d | 65 20 6f 75 74 2e 0a 20 |y it cam|e out.. |
|00001630| 2a 0a 20 2a 09 4f 6e 65 | 20 6c 61 73 74 20 74 68 |*. *.One| last th|
|00001640| 69 6e 67 2c 20 62 65 66 | 6f 72 65 20 77 65 20 67 |ing, bef|ore we g|
|00001650| 65 74 20 6f 6e 20 77 69 | 74 68 20 74 68 65 20 70 |et on wi|th the p|
|00001660| 72 6f 67 72 61 6d 2e 2e | 2e 2e 0a 20 2a 0a 20 2a |rogram..|... *. *|
|00001670| 09 49 4e 53 54 41 4c 4c | 41 54 49 4f 4e 0a 20 2a |.INSTALL|ATION. *|
|00001680| 0a 20 2a 09 54 6f 20 69 | 6e 73 74 61 6c 6c 20 74 |. *.To i|nstall t|
|00001690| 68 69 73 20 70 72 6f 67 | 72 61 6d 20 6f 6e 20 61 |his prog|ram on a|
|000016a0| 20 43 52 44 53 20 75 6e | 64 65 72 20 55 4e 4f 53 | CRDS un|der UNOS|
|000016b0| 20 35 2e 31 2c 20 63 6f | 6d 70 69 6c 65 20 69 74 | 5.1, co|mpile it|
|000016c0| 20 77 69 74 68 20 63 63 | 2c 0a 20 2a 09 6d 6f 76 | with cc|,. *.mov|
|000016d0| 65 20 2f 73 79 73 2f 6c | 6f 67 69 6e 20 74 6f 20 |e /sys/l|ogin to |
|000016e0| 2f 73 79 73 2f 70 6f 73 | 74 5f 6c 6f 67 69 6e 2c |/sys/pos|t_login,|
|000016f0| 20 61 6e 64 20 6d 6f 76 | 65 20 74 68 65 20 63 6f | and mov|e the co|
|00001700| 6d 70 69 6c 65 64 20 63 | 6f 64 65 20 74 6f 0a 20 |mpiled c|ode to. |
|00001710| 2a 09 2f 73 79 73 2f 6c | 6f 67 69 6e 2e 20 20 54 |*./sys/l|ogin. T|
|00001720| 68 69 73 20 69 73 20 61 | 6c 6c 20 74 68 61 74 20 |his is a|ll that |
|00001730| 69 73 20 6e 65 65 64 65 | 64 2c 20 69 74 20 77 69 |is neede|d, it wi|
|00001740| 6c 6c 20 74 61 6b 65 20 | 6f 76 65 72 20 6f 6e 63 |ll take |over onc|
|00001750| 65 20 79 6f 75 0a 20 2a | 09 6c 6f 67 20 6f 66 66 |e you. *|.log off|
|00001760| 2e 20 20 46 6f 72 20 6f | 74 68 65 72 20 76 65 72 |. For o|ther ver|
|00001770| 73 69 6f 6e 73 20 6f 66 | 20 55 4e 4f 53 20 6f 72 |sions of| UNOS or|
|00001780| 20 6f 74 68 65 72 20 55 | 4e 49 58 20 6d 61 63 68 | other U|NIX mach|
|00001790| 69 6e 65 73 2c 20 49 20 | 77 69 6c 6c 0a 20 2a 09 |ines, I |will. *.|
|000017a0| 73 61 79 20 74 68 61 74 | 20 59 4f 55 20 41 52 45 |say that| YOU ARE|
|000017b0| 20 41 54 20 59 4f 55 52 | 20 4f 57 4e 20 52 49 53 | AT YOUR| OWN RIS|
|000017c0| 4b 20 2d 2d 20 70 6c 61 | 79 69 6e 67 20 77 69 74 |K -- pla|ying wit|
|000017d0| 68 20 2f 73 79 73 2f 6c | 6f 67 69 6e 20 69 73 20 |h /sys/l|ogin is |
|000017e0| 61 0a 20 2a 09 76 65 72 | 79 20 64 61 6e 67 65 72 |a. *.ver|y danger|
|000017f0| 6f 75 73 20 74 68 69 6e | 67 20 74 6f 20 64 6f 2c |ous thin|g to do,|
|00001800| 20 61 6e 64 20 49 20 64 | 6f 20 6e 6f 74 20 72 65 | and I d|o not re|
|00001810| 63 6f 6d 6d 65 6e 74 20 | 69 74 20 66 6f 72 20 74 |comment |it for t|
|00001820| 68 6f 73 65 20 77 68 6f | 0a 20 2a 09 61 72 65 20 |hose who|. *.are |
|00001830| 77 65 61 6b 20 61 74 20 | 68 65 61 72 74 2e 20 20 |weak at |heart. |
|00001840| 49 20 63 72 61 73 68 65 | 64 20 6d 79 20 43 52 44 |I crashe|d my CRD|
|00001850| 53 20 63 6f 6d 70 6c 65 | 74 65 6c 79 20 73 65 76 |S comple|tely sev|
|00001860| 65 72 61 6c 20 74 69 6d | 65 73 3b 20 65 76 65 6e |eral tim|es; even|
|00001870| 0a 20 2a 09 74 68 6f 75 | 67 68 20 49 20 68 61 64 |. *.thou|gh I had|
|00001880| 20 6d 75 6c 74 69 70 6c | 65 20 74 74 79 73 20 6c | multipl|e ttys l|
|00001890| 6f 67 67 65 64 20 69 6e | 20 74 6f 20 74 72 79 20 |ogged in| to try |
|000018a0| 74 6f 20 68 61 76 65 20 | 72 65 63 6f 76 65 72 61 |to have |recovera|
|000018b0| 62 6c 65 0a 20 2a 09 73 | 79 73 74 65 6d 20 70 72 |ble. *.s|ystem pr|
|000018c0| 6f 62 6c 65 6d 73 2c 20 | 6f 63 63 61 73 69 6f 6e |oblems, |occasion|
|000018d0| 61 6c 6c 79 20 74 68 65 | 20 57 48 4f 4c 45 20 53 |ally the| WHOLE S|
|000018e0| 59 53 54 45 4d 20 63 61 | 6d 65 20 74 6f 20 69 74 |YSTEM ca|me to it|
|000018f0| 27 73 20 6b 6e 65 65 73 | 20 2d 2d 0a 20 2a 09 49 |'s knees| --. *.I|
|00001900| 20 67 65 74 20 74 68 65 | 20 66 65 65 6c 69 6e 67 | get the| feeling|
|00001910| 20 69 74 20 72 65 61 6c | 6c 79 20 64 69 64 6e 27 | it real|ly didn'|
|00001920| 74 20 6c 69 6b 65 20 77 | 68 61 74 20 49 20 77 61 |t like w|hat I wa|
|00001930| 73 20 64 6f 69 6e 67 2e | 20 20 50 6c 65 61 73 65 |s doing.| Please|
|00001940| 0a 20 2a 09 6e 6f 74 65 | 20 74 68 61 74 20 74 68 |. *.note| that th|
|00001950| 69 73 20 77 61 73 20 61 | 6e 20 65 78 70 65 72 69 |is was a|n experi|
|00001960| 6d 65 6e 74 61 6c 20 74 | 69 6d 65 2c 20 61 6e 64 |mental t|ime, and|
|00001970| 20 4e 4f 57 20 69 74 20 | 77 6f 72 6b 73 20 66 69 | NOW it |works fi|
|00001980| 6e 65 2c 20 49 0a 20 2a | 09 68 61 76 65 20 62 65 |ne, I. *|.have be|
|00001990| 65 6e 20 72 75 6e 6e 69 | 6e 67 20 6d 79 20 6e 65 |en runni|ng my ne|
|000019a0| 77 20 6c 6f 67 69 6e 20 | 70 72 6f 63 65 64 75 72 |w login |procedur|
|000019b0| 65 20 66 6f 72 20 73 65 | 76 65 72 61 6c 20 77 65 |e for se|veral we|
|000019c0| 65 6b 73 2e 20 20 59 6f | 75 20 6d 61 79 0a 20 2a |eks. Yo|u may. *|
|000019d0| 09 61 6c 73 6f 20 77 69 | 73 68 20 74 6f 20 72 75 |.also wi|sh to ru|
|000019e0| 6e 20 22 73 74 72 69 70 | 22 20 6f 6e 20 74 68 65 |n "strip|" on the|
|000019f0| 20 6e 65 77 20 2f 73 79 | 73 2f 6c 6f 67 69 6e 20 | new /sy|s/login |
|00001a00| 66 69 6c 65 2c 20 74 6f | 20 63 75 74 20 64 6f 77 |file, to| cut dow|
|00001a10| 6e 20 69 74 73 0a 20 2a | 09 73 74 6f 72 61 67 65 |n its. *|.storage|
|00001a20| 20 72 65 71 75 69 72 65 | 6d 65 6e 74 73 20 6f 6e | require|ments on|
|00001a30| 20 74 68 65 20 64 69 73 | 6b 20 28 73 74 72 69 70 | the dis|k (strip|
|00001a40| 20 72 65 6d 6f 76 65 73 | 20 73 79 6d 62 6f 6c 69 | removes| symboli|
|00001a50| 63 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 29 2e 0a |c inform|ation)..|
|00001a60| 20 2a 2f 0a 0a 23 69 6e | 63 6c 75 64 65 20 3c 66 | */..#in|clude <f|
|00001a70| 63 6e 74 6c 2e 68 3e 09 | 09 09 09 2f 2a 20 46 6f |cntl.h>.|.../* Fo|
|00001a80| 72 20 66 69 6c 65 20 69 | 2f 6f 09 09 2a 2f 0a 23 |r file i|/o..*/.#|
|00001a90| 69 6e 63 6c 75 64 65 20 | 3c 73 67 74 74 79 2e 68 |include |<sgtty.h|
|00001aa0| 3e 09 09 09 09 2f 2a 20 | 46 6f 72 20 74 74 79 20 |>..../* |For tty |
|00001ab0| 6d 6f 64 65 73 09 2a 2f | 0a 23 69 6e 63 6c 75 64 |modes.*/|.#includ|
|00001ac0| 65 20 3c 73 69 67 6e 61 | 6c 2e 68 3e 09 09 09 09 |e <signa|l.h>....|
|00001ad0| 2f 2a 20 66 6f 72 20 73 | 69 67 71 75 69 74 2f 73 |/* for s|igquit/s|
|00001ae0| 69 67 68 75 70 09 2a 2f | 0a 23 69 6e 63 6c 75 64 |ighup.*/|.#includ|
|00001af0| 65 20 3c 73 74 64 69 6f | 2e 68 3e 09 09 09 09 2f |e <stdio|.h>..../|
|00001b00| 2a 20 66 6f 72 20 66 70 | 72 69 6e 74 66 09 09 2a |* for fp|rintf..*|
|00001b10| 2f 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 79 73 2f |/.#inclu|de <sys/|
|00001b20| 75 74 73 6e 61 6d 65 2e | 68 3e 09 09 09 2f 2a 20 |utsname.|h>.../* |
|00001b30| 66 6f 72 20 75 6e 61 6d | 65 20 63 61 6c 6c 09 2a |for unam|e call.*|
|00001b40| 2f 0a 23 69 6e 63 6c 75 | 64 65 20 3c 74 65 72 6d |/.#inclu|de <term|
|00001b50| 69 6f 2e 68 3e 09 09 09 | 09 2f 2a 20 66 6f 72 20 |io.h>...|./* for |
|00001b60| 74 65 72 6d 69 6e 61 6c | 20 73 65 74 74 69 6e 67 |terminal| setting|
|00001b70| 09 2a 2f 0a 0a 69 6e 74 | 20 61 74 5f 69 6e 69 74 |.*/..int| at_init|
|00001b80| 28 29 3b 0a 0a 69 6e 74 | 20 6e 6f 5f 69 6e 69 74 |();..int| no_init|
|00001b90| 28 29 7b 7d 3b 0a 0a 73 | 74 72 75 63 74 20 74 74 |(){};..s|truct tt|
|00001ba0| 79 65 6e 74 72 79 20 7b | 0a 20 20 20 20 63 68 61 |yentry {|. cha|
|00001bb0| 72 20 73 74 61 74 65 5b | 31 32 5d 3b 09 09 09 09 |r state[|12];....|
|00001bc0| 2f 2a 20 73 74 61 74 65 | 20 22 6f 6e 22 20 6f 72 |/* state| "on" or|
|00001bd0| 20 6f 74 68 65 72 09 2a | 2f 0a 20 20 20 20 63 68 | other.*|/. ch|
|00001be0| 61 72 20 6c 69 6e 65 6e | 6f 5b 34 5d 3b 09 09 09 |ar linen|o[4];...|
|00001bf0| 09 2f 2a 20 6c 69 6e 65 | 6e 6f 20 28 72 61 6e 67 |./* line|no (rang|
|00001c00| 65 20 30 2d 31 31 29 09 | 2a 2f 0a 20 20 20 20 63 |e 0-11).|*/. c|
|00001c10| 68 61 72 20 64 70 61 74 | 68 5b 31 32 5d 3b 09 09 |har dpat|h[12];..|
|00001c20| 09 09 2f 2a 20 64 65 76 | 69 63 65 20 70 61 74 68 |../* dev|ice path|
|00001c30| 20 2f 64 65 76 2f 74 74 | 79 09 2a 2f 0a 20 20 20 | /dev/tt|y.*/. |
|00001c40| 20 63 68 61 72 20 64 65 | 76 6e 75 6d 5b 36 5d 3b | char de|vnum[6];|
|00001c50| 09 09 09 09 2f 2a 20 6d | 61 6a 6f 72 2f 6d 69 6e |..../* m|ajor/min|
|00001c60| 6f 72 2c 20 31 2f 6e 6e | 09 2a 2f 0a 20 20 20 20 |or, 1/nn|.*/. |
|00001c70| 63 68 61 72 20 74 74 79 | 69 64 5b 31 32 5d 3b 09 |char tty|id[12];.|
|00001c80| 09 09 09 2f 2a 20 74 74 | 79 20 74 79 70 65 2c 20 |.../* tt|y type, |
|00001c90| 69 2e 65 2e 20 76 74 31 | 30 30 09 2a 2f 0a 20 20 |i.e. vt1|00.*/. |
|00001ca0| 20 20 63 68 61 72 20 74 | 62 61 75 64 5b 32 30 5d | char t|baud[20]|
|00001cb0| 3b 09 09 09 09 2f 2a 20 | 62 61 75 64 2c 20 73 70 |;..../* |baud, sp|
|00001cc0| 65 65 64 3d 39 36 30 30 | 09 2a 2f 0a 20 20 20 20 |eed=9600|.*/. |
|00001cd0| 63 68 61 72 20 74 73 65 | 74 62 5b 33 30 5d 3b 09 |char tse|tb[30];.|
|00001ce0| 09 09 09 2f 2a 20 74 61 | 62 6c 65 20 28 30 2d 39 |.../* ta|ble (0-9|
|00001cf0| 29 2c 20 72 65 6d 61 72 | 6b 09 2a 2f 0a 20 20 20 |), remar|k.*/. |
|00001d00| 20 63 68 61 72 20 65 78 | 74 72 61 5b 33 30 5d 3b | char ex|tra[30];|
|00001d10| 09 09 09 09 2f 2a 20 61 | 6e 79 74 68 69 6e 67 20 |..../* a|nything |
|00001d20| 65 6c 73 65 20 3f 09 2a | 2f 0a 7d 20 74 74 79 73 |else ?.*|/.} ttys|
|00001d30| 5b 32 30 5d 3b 09 09 09 | 09 09 2f 2a 20 4e 4f 54 |[20];...|../* NOT|
|00001d40| 45 20 6d 61 78 20 32 30 | 20 65 6e 74 72 69 65 73 |E max 20| entries|
|00001d50| 09 2a 2f 0a 0a 69 6e 74 | 20 74 74 79 73 5f 63 6f |.*/..int| ttys_co|
|00001d60| 75 6e 74 3b 09 09 09 09 | 09 2f 2a 20 63 6f 75 6e |unt;....|./* coun|
|00001d70| 74 20 6f 66 20 65 6e 74 | 72 69 65 73 09 2a 2f 0a |t of ent|ries.*/.|
|00001d80| 69 6e 74 20 6d 79 74 74 | 79 65 6e 74 72 79 3b 09 |int mytt|yentry;.|
|00001d90| 09 09 09 09 2f 2a 20 77 | 68 69 63 68 20 65 6e 74 |..../* w|hich ent|
|00001da0| 72 79 20 61 6d 20 49 3f | 09 2a 2f 0a 0a 46 49 4c |ry am I?|.*/..FIL|
|00001db0| 45 20 2a 74 74 79 73 66 | 69 6c 65 3b 09 09 09 09 |E *ttysf|ile;....|
|00001dc0| 09 2f 2a 20 66 69 6c 64 | 65 73 20 66 6f 72 20 2f |./* fild|es for /|
|00001dd0| 65 74 63 2f 74 74 79 73 | 20 2a 2f 0a 0a 69 6e 74 |etc/ttys| */..int|
|00001de0| 20 74 74 79 5f 6c 75 6e | 3b 09 09 09 09 09 2f 2a | tty_lun|;...../*|
|00001df0| 20 6c 6f 67 69 6e 20 74 | 65 72 6d 69 6e 61 6c 20 | login t|erminal |
|00001e00| 75 6e 69 74 09 2a 2f 0a | 46 49 4c 45 20 2a 69 6e |unit.*/.|FILE *in|
|00001e10| 64 65 76 3b 09 09 09 09 | 09 2f 2a 20 73 74 64 69 |dev;....|./* stdi|
|00001e20| 6e 2f 73 74 64 6f 75 74 | 09 09 2a 2f 0a 46 49 4c |n/stdout|..*/.FIL|
|00001e30| 45 20 2a 6f 75 74 64 65 | 76 3b 0a 0a 73 74 72 75 |E *outde|v;..stru|
|00001e40| 63 74 20 73 67 74 74 79 | 62 20 74 74 79 5f 6d 6f |ct sgtty|b tty_mo|
|00001e50| 64 65 3b 09 09 09 09 2f | 2a 20 74 74 79 20 73 65 |de;..../|* tty se|
|00001e60| 74 74 69 6e 67 73 20 73 | 74 72 75 63 74 09 2a 2f |ttings s|truct.*/|
|00001e70| 0a 0a 63 68 61 72 20 70 | 6f 73 74 5f 6c 6f 67 69 |..char p|ost_logi|
|00001e80| 6e 5b 5d 20 3d 20 22 2f | 73 79 73 2f 70 6f 73 74 |n[] = "/|sys/post|
|00001e90| 5f 6c 6f 67 69 6e 22 3b | 09 09 2f 2a 20 6f 72 69 |_login";|../* ori|
|00001ea0| 67 2e 20 6c 6f 67 69 6e | 20 70 72 6f 67 72 61 6d |g. login| program|
|00001eb0| 09 2a 2f 0a 0a 63 68 61 | 72 20 73 31 31 30 5b 5d |.*/..cha|r s110[]|
|00001ec0| 09 3d 20 22 73 70 65 65 | 64 3d 31 31 30 22 3b 09 |.= "spee|d=110";.|
|00001ed0| 09 09 2f 2a 20 54 65 78 | 74 20 66 6f 72 20 74 74 |../* Tex|t for tt|
|00001ee0| 79 6d 6f 64 65 73 09 2a | 2f 0a 63 68 61 72 20 73 |ymodes.*|/.char s|
|00001ef0| 33 30 30 5b 5d 09 3d 20 | 22 73 70 65 65 64 3d 33 |300[].= |"speed=3|
|00001f00| 30 30 22 3b 0a 63 68 61 | 72 20 73 31 32 30 30 5b |00";.cha|r s1200[|
|00001f10| 5d 09 3d 20 22 73 70 65 | 65 64 3d 31 32 30 30 22 |].= "spe|ed=1200"|
|00001f20| 3b 0a 63 68 61 72 20 73 | 39 36 30 30 5b 5d 09 3d |;.char s|9600[].=|
|00001f30| 20 22 73 70 65 65 64 3d | 39 36 30 30 22 3b 0a 63 | "speed=|9600";.c|
|00001f40| 68 61 72 20 73 33 38 34 | 30 30 5b 5d 09 3d 20 22 |har s384|00[].= "|
|00001f50| 73 70 65 65 64 3d 33 38 | 34 30 30 22 3b 0a 0a 63 |speed=38|400";..c|
|00001f60| 68 61 72 20 74 74 79 6d | 61 74 63 68 5b 5d 20 3d |har ttym|atch[] =|
|00001f70| 20 22 2f 64 65 76 2f 74 | 74 79 3f 3f 20 22 3b 09 | "/dev/t|ty?? ";.|
|00001f80| 09 2f 2a 20 72 65 73 65 | 72 76 65 20 73 70 61 63 |./* rese|rve spac|
|00001f90| 65 09 2a 2f 0a 0a 63 68 | 61 72 20 72 6f 74 6f 72 |e.*/..ch|ar rotor|
|00001fa0| 6d 73 67 5b 5d 20 3d 20 | 22 5c 30 30 37 22 3b 0a |msg[] = |"\007";.|
|00001fb0| 0a 73 74 72 75 63 74 20 | 74 73 65 74 20 7b 0a 09 |.struct |tset {..|
|00001fc0| 63 68 61 72 09 74 61 62 | 6c 65 69 64 3b 09 09 09 |char.tab|leid;...|
|00001fd0| 2f 2a 20 74 61 62 6c 65 | 20 6e 61 6d 65 20 28 27 |/* table| name ('|
|00001fe0| 30 27 2d 27 39 27 29 09 | 2a 2f 0a 09 69 6e 74 09 |0'-'9').|*/..int.|
|00001ff0| 28 2a 4c 69 6e 65 5f 69 | 6e 69 74 29 28 29 3b 09 |(*Line_i|nit)();.|
|00002000| 09 09 2f 2a 20 61 6e 79 | 74 68 69 6e 67 20 74 6f |../* any|thing to|
|00002010| 20 64 6f 20 66 69 72 73 | 74 09 2a 2f 0a 09 63 68 | do firs|t.*/..ch|
|00002020| 61 72 09 72 6f 74 6f 72 | 69 3b 09 09 09 09 2f 2a |ar.rotor|i;..../*|
|00002030| 20 72 6f 74 6f 72 20 6e | 61 6d 65 20 28 27 41 27 | rotor n|ame ('A'|
|00002040| 2d 27 5a 27 29 09 2a 2f | 0a 7d 20 74 73 65 74 73 |-'Z').*/|.} tsets|
|00002050| 5b 5d 20 3d 20 7b 0a 0a | 09 27 30 27 2c 6e 6f 5f |[] = {..|.'0',no_|
|00002060| 69 6e 69 74 2c 5c 30 2c | 09 09 2f 2a 20 74 73 65 |init,\0,|../* tse|
|00002070| 74 20 30 2c 20 6e 6f 20 | 69 6e 69 74 2c 20 75 73 |t 0, no |init, us|
|00002080| 65 20 2f 65 74 63 2f 74 | 74 79 73 09 2a 2f 0a 0a |e /etc/t|tys.*/..|
|00002090| 09 27 31 27 2c 6e 6f 5f | 69 6e 69 74 2c 27 41 27 |.'1',no_|init,'A'|
|000020a0| 2c 09 2f 2a 20 74 73 65 | 74 20 31 2c 20 6e 6f 20 |,./* tse|t 1, no |
|000020b0| 69 6e 69 74 2c 20 75 73 | 65 20 72 6f 74 6f 72 20 |init, us|e rotor |
|000020c0| 41 09 09 2a 2f 0a 0a 09 | 27 32 27 2c 61 74 5f 69 |A..*/...|'2',at_i|
|000020d0| 6e 69 74 2c 27 42 27 2c | 09 2f 2a 20 74 73 65 74 |nit,'B',|./* tset|
|000020e0| 20 32 2c 20 22 41 54 78 | 78 22 20 69 6e 69 74 2c | 2, "ATx|x" init,|
|000020f0| 20 75 73 65 20 72 6f 74 | 6f 72 20 42 09 2a 2f 0a | use rot|or B.*/.|
|00002100| 0a 09 5c 30 2c 6e 6f 5f | 69 6e 69 74 2c 5c 30 09 |..\0,no_|init,\0.|
|00002110| 09 2f 2a 20 45 6e 64 20 | 6f 66 20 74 61 62 6c 65 |./* End |of table|
|00002120| 2c 20 6e 6f 20 69 6e 69 | 74 2c 20 75 73 65 20 2f |, no ini|t, use /|
|00002130| 65 74 63 2f 74 74 79 73 | 20 2a 2f 0a 7d 3b 0a 0a |etc/ttys| */.};..|
|00002140| 23 64 65 66 69 6e 65 20 | 4e 55 4d 54 53 45 54 53 |#define |NUMTSETS|
|00002150| 20 73 69 7a 65 6f 66 20 | 74 73 65 74 73 2f 73 69 | sizeof |tsets/si|
|00002160| 7a 65 6f 66 20 74 73 65 | 74 73 5b 30 5d 0a 0a 73 |zeof tse|ts[0]..s|
|00002170| 74 72 75 63 74 20 72 6f | 74 6f 72 20 7b 0a 09 63 |truct ro|tor {..c|
|00002180| 68 61 72 09 72 6f 74 6f | 72 69 64 3b 09 09 09 2f |har.roto|rid;.../|
|00002190| 2a 20 72 6f 74 6f 72 20 | 6e 61 6d 65 20 28 27 41 |* rotor |name ('A|
|000021a0| 27 2d 27 5a 27 29 09 2a | 2f 0a 09 69 6e 74 09 66 |'-'Z').*|/..int.f|
|000021b0| 6c 61 67 73 3b 09 09 09 | 09 2f 2a 20 53 65 6e 73 |lags;...|./* Sens|
|000021c0| 65 20 73 65 74 75 70 20 | 66 6c 61 67 73 09 2a 2f |e setup |flags.*/|
|000021d0| 0a 09 69 6e 74 09 73 70 | 65 65 64 3b 09 09 09 09 |..int.sp|eed;....|
|000021e0| 2f 2a 20 42 61 75 64 20 | 66 6c 61 67 73 09 09 2a |/* Baud |flags..*|
|000021f0| 2f 0a 09 63 68 61 72 09 | 2a 74 62 61 75 64 73 65 |/..char.|*tbaudse|
|00002200| 74 3b 09 09 09 2f 2a 20 | 74 74 79 73 20 74 62 61 |t;.../* |ttys tba|
|00002210| 75 64 20 73 65 74 74 69 | 6e 67 09 2a 2f 0a 7d 20 |ud setti|ng.*/.} |
|00002220| 72 6f 74 6f 72 73 5b 5d | 20 3d 20 7b 0a 0a 09 27 |rotors[]| = {...'|
|00002230| 41 27 2c 43 52 31 2b 4e | 4c 31 2b 43 52 4d 4f 44 |A',CR1+N|L1+CRMOD|
|00002240| 2b 52 41 57 2c 42 39 36 | 30 30 2c 73 39 36 30 30 |+RAW,B96|00,s9600|
|00002250| 2c 09 2f 2a 41 2c 20 66 | 6c 61 67 73 2c 20 69 62 |,./*A, f|lags, ib|
|00002260| 61 75 64 2c 20 74 65 78 | 74 09 2a 2f 0a 09 27 41 |aud, tex|t.*/..'A|
|00002270| 27 2c 43 52 31 2b 4e 4c | 31 2b 43 52 4d 4f 44 2b |',CR1+NL|1+CRMOD+|
|00002280| 52 41 57 2c 42 33 38 34 | 30 30 2c 73 33 38 34 30 |RAW,B384|00,s3840|
|00002290| 30 2c 09 2f 2a 41 2c 20 | 66 6c 61 67 73 2c 20 69 |0,./*A, |flags, i|
|000022a0| 62 61 75 64 2c 20 74 65 | 78 74 09 2a 2f 0a 09 27 |baud, te|xt.*/..'|
|000022b0| 41 27 2c 43 52 31 2b 4e | 4c 31 2b 43 52 4d 4f 44 |A',CR1+N|L1+CRMOD|
|000022c0| 2b 52 41 57 2c 42 31 32 | 30 30 2c 73 31 32 30 30 |+RAW,B12|00,s1200|
|000022d0| 2c 09 2f 2a 41 2c 20 66 | 6c 61 67 73 2c 20 69 62 |,./*A, f|lags, ib|
|000022e0| 61 75 64 2c 20 74 65 78 | 74 09 2a 2f 0a 09 27 41 |aud, tex|t.*/..'A|
|000022f0| 27 2c 43 52 31 2b 4e 4c | 31 2b 43 52 4d 4f 44 2b |',CR1+NL|1+CRMOD+|
|00002300| 52 41 57 2c 42 31 32 30 | 30 2c 73 31 32 30 30 2c |RAW,B120|0,s1200,|
|00002310| 09 2f 2a 41 2c 20 66 6c | 61 67 73 2c 20 69 62 61 |./*A, fl|ags, iba|
|00002320| 75 64 2c 20 74 65 78 74 | 09 2a 2f 0a 0a 09 27 42 |ud, text|.*/...'B|
|00002330| 27 2c 43 52 31 2b 4e 4c | 31 2b 43 52 4d 4f 44 2b |',CR1+NL|1+CRMOD+|
|00002340| 52 41 57 2c 42 33 30 30 | 2c 73 33 30 30 2c 09 2f |RAW,B300|,s300,./|
|00002350| 2a 41 2c 20 66 6c 61 67 | 73 2c 20 69 62 61 75 64 |*A, flag|s, ibaud|
|00002360| 2c 20 74 65 78 74 09 2a | 2f 0a 09 27 42 27 2c 43 |, text.*|/..'B',C|
|00002370| 52 31 2b 4e 4c 31 2b 43 | 52 4d 4f 44 2b 52 41 57 |R1+NL1+C|RMOD+RAW|
|00002380| 2c 42 31 32 30 30 2c 73 | 31 32 30 30 2c 09 2f 2a |,B1200,s|1200,./*|
|00002390| 41 2c 20 66 6c 61 67 73 | 2c 20 69 62 61 75 64 2c |A, flags|, ibaud,|
|000023a0| 20 74 65 78 74 09 2a 2f | 0a 0a 09 5c 30 2c 30 2c | text.*/|...\0,0,|
|000023b0| 30 2c 28 63 68 61 72 20 | 2a 29 5c 30 09 09 2f 2a |0,(char |*)\0../*|
|000023c0| 20 45 6e 64 20 6f 66 20 | 74 61 62 6c 65 20 2a 2f | End of |table */|
|000023d0| 0a 7d 3b 0a 0a 6d 61 69 | 6e 28 61 72 67 63 2c 61 |.};..mai|n(argc,a|
|000023e0| 72 67 76 29 0a 69 6e 74 | 20 61 72 67 63 3b 0a 63 |rgv).int| argc;.c|
|000023f0| 68 61 72 20 2a 2a 61 72 | 67 76 3b 0a 7b 0a 20 20 |har **ar|gv;.{. |
|00002400| 20 20 73 74 72 75 63 74 | 20 75 74 73 6e 61 6d 65 | struct| utsname|
|00002410| 20 73 79 73 6e 61 6d 65 | 3b 09 09 09 2f 2a 20 75 | sysname|;.../* u|
|00002420| 74 73 6e 61 6d 65 20 64 | 65 66 69 6e 69 74 69 6f |tsname d|efinitio|
|00002430| 6e 09 2a 2f 0a 20 20 20 | 20 63 68 61 72 20 74 73 |n.*/. | char ts|
|00002440| 65 74 67 6f 3b 09 09 09 | 09 2f 2a 20 64 65 66 61 |etgo;...|./* defa|
|00002450| 75 6c 74 20 75 73 65 20 | 74 61 62 6c 65 20 30 09 |ult use |table 0.|
|00002460| 2a 2f 0a 20 20 20 20 63 | 68 61 72 20 72 6f 74 6f |*/. c|har roto|
|00002470| 72 67 6f 3b 09 09 09 09 | 2f 2a 20 73 65 61 72 63 |rgo;....|/* searc|
|00002480| 68 20 63 68 61 72 61 63 | 74 65 72 09 2a 2f 0a 20 |h charac|ter.*/. |
|00002490| 20 20 20 69 6e 74 20 69 | 2c 6a 3b 09 09 09 09 09 | int i|,j;.....|
|000024a0| 2f 2a 20 67 65 6e 65 72 | 61 6c 20 70 75 72 70 6f |/* gener|al purpo|
|000024b0| 73 65 09 2a 2f 0a 20 20 | 20 20 69 6e 74 20 74 73 |se.*/. | int ts|
|000024c0| 65 74 6e 75 6d 2c 20 72 | 6f 74 6f 72 6e 75 6d 3b |etnum, r|otornum;|
|000024d0| 09 09 09 2f 2a 20 70 6f | 69 6e 74 65 72 20 63 6f |.../* po|inter co|
|000024e0| 75 6e 74 73 09 2a 2f 0a | 20 20 20 20 63 68 61 72 |unts.*/.| char|
|000024f0| 20 63 68 72 3b 09 09 09 | 09 09 2f 2a 20 67 65 6e | chr;...|../* gen|
|00002500| 65 72 61 6c 20 70 75 72 | 70 75 73 65 09 2a 2f 0a |eral pur|puse.*/.|
|00002510| 0a 20 20 20 20 75 6e 61 | 6d 65 28 26 73 79 73 6e |. una|me(&sysn|
|00002520| 61 6d 65 29 3b 09 09 09 | 09 2f 2a 20 47 65 74 20 |ame);...|./* Get |
|00002530| 73 79 73 74 65 6d 20 6e | 61 6d 65 09 2a 2f 0a 0a |system n|ame.*/..|
|00002540| 20 20 20 20 69 66 20 28 | 61 72 67 63 3d 3d 31 29 | if (|argc==1)|
|00002550| 20 7b 0a 09 74 74 79 5f | 6c 75 6e 20 3d 20 66 64 | {..tty_|lun = fd|
|00002560| 6f 77 6e 28 6f 75 74 64 | 65 76 3d 73 74 64 6f 75 |own(outd|ev=stdou|
|00002570| 74 29 3b 09 09 2f 2a 20 | 67 65 74 20 74 74 79 20 |t);../* |get tty |
|00002580| 6c 6f 67 69 63 61 6c 20 | 75 6e 69 74 09 2a 2f 0a |logical |unit.*/.|
|00002590| 09 69 6e 64 65 76 20 3d | 20 73 74 64 69 6e 3b 09 |.indev =| stdin;.|
|000025a0| 09 09 09 2f 2a 20 67 65 | 74 20 69 2f 6f 20 64 65 |.../* ge|t i/o de|
|000025b0| 76 69 63 65 73 09 2a 2f | 0a 20 20 20 20 7d 20 65 |vices.*/|. } e|
|000025c0| 6c 73 65 20 7b 0a 09 74 | 74 79 5f 6c 75 6e 20 3d |lse {..t|ty_lun =|
|000025d0| 20 66 64 6f 77 6e 28 6f | 75 74 64 65 76 3d 66 69 | fdown(o|utdev=fi|
|000025e0| 6c 65 6f 70 65 6e 28 61 | 72 67 76 5b 31 5d 2c 22 |leopen(a|rgv[1],"|
|000025f0| 77 22 29 29 3b 0a 09 09 | 09 09 09 09 2f 2a 20 67 |w"));...|..../* g|
|00002600| 65 74 20 74 74 79 20 6c | 6f 67 69 63 61 6c 20 75 |et tty l|ogical u|
|00002610| 6e 69 74 20 2a 2f 0a 09 | 69 6e 64 65 76 20 3d 20 |nit */..|indev = |
|00002620| 66 69 6c 65 6f 70 65 6e | 28 61 72 67 76 5b 31 5d |fileopen|(argv[1]|
|00002630| 2c 22 72 22 29 3b 09 09 | 2f 2a 20 61 6e 64 20 67 |,"r");..|/* and g|
|00002640| 65 74 20 69 2f 6f 20 64 | 65 76 69 63 65 73 09 2a |et i/o d|evices.*|
|00002650| 2f 0a 20 20 20 20 7d 0a | 0a 20 20 20 20 73 65 74 |/. }.|. set|
|00002660| 62 75 66 28 69 6e 64 65 | 76 2c 4e 55 4c 4c 29 3b |buf(inde|v,NULL);|
|00002670| 09 09 09 09 2f 2a 20 6e | 6f 20 69 2f 6f 20 62 75 |..../* n|o i/o bu|
|00002680| 66 66 65 72 69 6e 67 09 | 2a 2f 0a 20 20 20 20 73 |ffering.|*/. s|
|00002690| 65 74 62 75 66 28 6f 75 | 74 64 65 76 2c 4e 55 4c |etbuf(ou|tdev,NUL|
|000026a0| 4c 29 3b 0a 20 20 20 20 | 0a 20 20 20 20 73 74 72 |L);. |. str|
|000026b0| 63 70 79 28 74 74 79 6d | 61 74 63 68 2c 74 74 79 |cpy(ttym|atch,tty|
|000026c0| 6e 61 6d 65 28 74 74 79 | 5f 6c 75 6e 29 29 3b 09 |name(tty|_lun));.|
|000026d0| 09 2f 2a 20 73 61 76 65 | 20 64 65 76 69 63 65 20 |./* save| device |
|000026e0| 70 61 74 68 09 2a 2f 0a | 20 20 20 20 73 65 74 63 |path.*/.| setc|
|000026f0| 74 6c 74 65 72 6d 28 74 | 74 79 5f 6c 75 6e 29 3b |tlterm(t|ty_lun);|
|00002700| 09 09 09 2f 2a 20 73 65 | 74 20 63 6f 6e 74 72 6f |.../* se|t contro|
|00002710| 6c 6c 69 6e 67 20 74 65 | 72 6d 09 2a 2f 0a 20 20 |lling te|rm.*/. |
|00002720| 20 20 74 74 79 5f 6c 75 | 6e 3d 6f 70 65 6e 28 74 | tty_lu|n=open(t|
|00002730| 74 79 6d 61 74 63 68 2c | 4f 5f 52 44 57 52 29 3b |tymatch,|O_RDWR);|
|00002740| 09 09 2f 2a 20 72 65 6f | 70 65 6e 20 64 65 76 69 |../* reo|pen devi|
|00002750| 63 65 20 66 6f 72 20 75 | 73 09 2a 2f 0a 0a 20 20 |ce for u|s.*/.. |
|00002760| 20 20 74 74 79 73 5f 63 | 6f 75 6e 74 20 3d 20 30 | ttys_c|ount = 0|
|00002770| 3b 0a 20 20 20 20 74 74 | 79 73 66 69 6c 65 20 3d |;. tt|ysfile =|
|00002780| 20 66 6f 70 65 6e 28 22 | 2f 65 74 63 2f 74 74 79 | fopen("|/etc/tty|
|00002790| 73 22 2c 22 72 22 29 3b | 09 09 2f 2a 20 67 65 74 |s","r");|../* get|
|000027a0| 20 2f 65 74 63 2f 74 74 | 79 73 20 69 6e 66 6f 09 | /etc/tt|ys info.|
|000027b0| 2a 2f 0a 20 20 20 20 77 | 68 69 6c 65 20 28 66 72 |*/. w|hile (fr|
|000027c0| 65 61 64 28 26 63 68 72 | 2c 31 2c 31 2c 74 74 79 |ead(&chr|,1,1,tty|
|000027d0| 73 66 69 6c 65 29 3e 30 | 29 09 09 2f 2a 20 69 66 |sfile)>0|)../* if|
|000027e0| 20 63 68 72 2c 20 67 65 | 74 20 65 6e 74 72 79 09 | chr, ge|t entry.|
|000027f0| 2a 2f 0a 09 67 65 74 65 | 6e 74 72 79 28 63 68 72 |*/..gete|ntry(chr|
|00002800| 29 3b 0a 20 20 20 20 66 | 63 6c 6f 73 65 28 74 74 |);. f|close(tt|
|00002810| 79 73 66 69 6c 65 29 3b | 09 09 09 09 2f 2a 20 68 |ysfile);|..../* h|
|00002820| 61 76 65 20 74 74 79 73 | 20 69 6e 66 6f 72 6d 61 |ave ttys| informa|
|00002830| 74 69 6f 6e 2a 2f 0a 0a | 20 20 20 20 66 6f 72 28 |tion*/..| for(|
|00002840| 69 3d 30 3b 69 3c 74 74 | 79 73 5f 63 6f 75 6e 74 |i=0;i<tt|ys_count|
|00002850| 3b 69 2b 2b 29 20 7b 09 | 09 09 2f 2a 20 73 63 61 |;i++) {.|../* sca|
|00002860| 6e 20 74 74 79 73 20 65 | 6e 74 72 69 65 73 09 2a |n ttys e|ntries.*|
|00002870| 2f 0a 09 69 66 20 28 30 | 3d 3d 73 74 72 63 6d 70 |/..if (0|==strcmp|
|00002880| 28 74 74 79 6d 61 74 63 | 68 2c 74 74 79 73 5b 69 |(ttymatc|h,ttys[i|
|00002890| 5d 2e 64 70 61 74 68 29 | 29 20 7b 2f 2a 20 69 66 |].dpath)|) {/* if|
|000028a0| 20 69 74 20 6d 61 74 63 | 68 65 73 2e 2e 2e 09 2a | it matc|hes....*|
|000028b0| 2f 0a 09 20 20 20 20 74 | 73 65 74 67 6f 20 3d 20 |/.. t|setgo = |
|000028c0| 2a 74 74 79 73 5b 69 5d | 2e 74 73 65 74 62 3b 09 |*ttys[i]|.tsetb;.|
|000028d0| 09 2f 2a 20 67 65 74 20 | 63 68 61 72 61 63 74 65 |./* get |characte|
|000028e0| 72 09 2a 2f 0a 09 20 20 | 20 20 69 66 20 28 28 74 |r.*/.. | if ((t|
|000028f0| 73 65 74 67 6f 3c 27 30 | 27 29 20 7c 7c 20 28 74 |setgo<'0|') || (t|
|00002900| 73 65 74 67 6f 3e 27 39 | 27 29 29 09 2f 2a 20 72 |setgo>'9|'))./* r|
|00002910| 65 73 6f 72 74 20 74 6f | 20 64 65 66 61 75 6c 74 |esort to| default|
|00002920| 3f 09 2a 2f 0a 09 09 74 | 73 65 74 67 6f 3d 27 30 |?.*/...t|setgo='0|
|00002930| 27 3b 0a 09 7d 0a 20 20 | 20 20 7d 0a 0a 20 20 20 |';..}. | }.. |
|00002940| 20 66 6f 72 28 74 73 65 | 74 6e 75 6d 3d 30 3b 74 | for(tse|tnum=0;t|
|00002950| 73 65 74 6e 75 6d 3c 28 | 4e 55 4d 54 53 45 54 53 |setnum<(|NUMTSETS|
|00002960| 29 3b 74 73 65 74 6e 75 | 6d 2b 2b 29 09 2f 2a 20 |);tsetnu|m++)./* |
|00002970| 66 69 6e 64 20 74 73 65 | 74 67 6f 20 69 6e 20 74 |find tse|tgo in t|
|00002980| 73 65 74 73 2a 2f 0a 09 | 69 66 20 28 74 73 65 74 |sets*/..|if (tset|
|00002990| 73 5b 74 73 65 74 6e 75 | 6d 5d 2e 74 61 62 6c 65 |s[tsetnu|m].table|
|000029a0| 69 64 3d 3d 74 73 65 74 | 67 6f 29 20 62 72 65 61 |id==tset|go) brea|
|000029b0| 6b 3b 0a 0a 20 20 20 20 | 28 2a 74 73 65 74 73 5b |k;.. |(*tsets[|
|000029c0| 74 73 65 74 6e 75 6d 5d | 2e 4c 69 6e 65 5f 69 6e |tsetnum]|.Line_in|
|000029d0| 69 74 29 28 29 3b 09 09 | 2f 2a 20 49 6e 69 74 69 |it)();..|/* Initi|
|000029e0| 61 6c 69 7a 65 20 74 68 | 65 20 6c 69 6e 65 09 2a |alize th|e line.*|
|000029f0| 2f 0a 0a 20 20 20 20 72 | 6f 74 6f 72 67 6f 20 3d |/.. r|otorgo =|
|00002a00| 20 74 73 65 74 73 5b 74 | 73 65 74 6e 75 6d 5d 2e | tsets[t|setnum].|
|00002a10| 72 6f 74 6f 72 69 3b 09 | 09 2f 2a 20 67 65 74 20 |rotori;.|./* get |
|00002a20| 74 68 65 20 72 6f 74 6f | 72 20 69 64 65 6e 74 09 |the roto|r ident.|
|00002a30| 2a 2f 0a 0a 20 20 20 20 | 77 68 69 6c 65 20 28 72 |*/.. |while (r|
|00002a40| 6f 74 6f 72 67 6f 21 3d | 5c 30 29 20 7b 09 09 09 |otorgo!=|\0) {...|
|00002a50| 2f 2a 20 64 6f 20 75 6e | 74 69 6c 20 63 72 20 64 |/* do un|til cr d|
|00002a60| 65 74 65 63 74 09 2a 2f | 0a 09 09 09 09 09 09 2f |etect.*/|......./|
|00002a70| 2a 20 75 6e 6c 65 73 73 | 20 72 6f 74 6f 72 67 6f |* unless| rotorgo|
|00002a80| 20 69 73 20 30 09 2a 2f | 0a 09 72 6f 74 6f 72 6e | is 0.*/|..rotorn|
|00002a90| 75 6d 3d 30 3b 09 09 09 | 09 2f 2a 20 73 74 61 72 |um=0;...|./* star|
|00002aa0| 74 20 61 74 20 66 69 72 | 73 74 20 72 6f 74 6f 72 |t at fir|st rotor|
|00002ab0| 09 2a 2f 0a 09 77 68 69 | 6c 65 20 28 72 6f 74 6f |.*/..whi|le (roto|
|00002ac0| 72 73 5b 72 6f 74 6f 72 | 6e 75 6d 5d 2e 72 6f 74 |rs[rotor|num].rot|
|00002ad0| 6f 72 69 64 21 3d 72 6f | 74 6f 72 67 6f 29 20 7b |orid!=ro|torgo) {|
|00002ae0| 2f 2a 20 73 63 61 6e 20 | 6c 69 73 74 20 66 6f 72 |/* scan |list for|
|00002af0| 20 6d 61 74 63 68 2a 2f | 0a 09 20 20 20 20 72 6f | match*/|.. ro|
|00002b00| 74 6f 72 6e 75 6d 2b 2b | 3b 09 09 09 09 2f 2a 20 |tornum++|;..../* |
|00002b10| 67 6f 20 74 6f 20 6e 65 | 78 74 20 69 66 20 6e 6f |go to ne|xt if no|
|00002b20| 74 09 2a 2f 0a 09 20 20 | 20 20 69 66 20 28 72 6f |t.*/.. | if (ro|
|00002b30| 74 6f 72 73 5b 72 6f 74 | 6f 72 6e 75 6d 5d 2e 72 |tors[rot|ornum].r|
|00002b40| 6f 74 6f 72 69 64 3d 3d | 5c 30 29 09 2f 2a 20 64 |otorid==|\0)./* d|
|00002b50| 69 64 20 77 65 20 6e 6f | 74 20 66 69 6e 64 20 69 |id we no|t find i|
|00002b60| 74 3f 09 2a 2f 0a 09 09 | 72 6f 74 6f 72 67 6f 20 |t?.*/...|rotorgo |
|00002b70| 3d 20 5c 30 3b 09 09 09 | 2f 2a 20 4e 6f 74 20 66 |= \0;...|/* Not f|
|00002b80| 6f 75 6e 64 2c 20 47 45 | 54 20 4f 55 54 21 09 2a |ound, GE|T OUT!.*|
|00002b90| 2f 0a 09 7d 0a 09 69 66 | 20 28 72 6f 74 6f 72 67 |/..}..if| (rotorg|
|00002ba0| 6f 21 3d 5c 30 29 20 7b | 09 09 09 2f 2a 20 6e 6f |o!=\0) {|.../* no|
|00002bb0| 77 20 73 63 61 6e 20 67 | 6f 6f 64 20 6f 6e 65 73 |w scan g|ood ones|
|00002bc0| 09 2a 2f 0a 09 20 20 20 | 20 77 68 69 6c 65 20 28 |.*/.. | while (|
|00002bd0| 72 6f 74 6f 72 73 5b 72 | 6f 74 6f 72 6e 75 6d 5d |rotors[r|otornum]|
|00002be0| 2e 72 6f 74 6f 72 69 64 | 3d 3d 72 6f 74 6f 72 67 |.rotorid|==rotorg|
|00002bf0| 6f 29 20 7b 0a 09 09 09 | 09 09 09 2f 2a 20 66 6f |o) {....|.../* fo|
|00002c00| 72 20 65 61 63 68 20 76 | 61 6c 69 64 20 65 6e 74 |r each v|alid ent|
|00002c10| 72 79 09 2a 2f 0a 09 09 | 74 74 79 5f 6d 6f 64 65 |ry.*/...|tty_mode|
|00002c20| 2e 73 67 5f 65 72 61 73 | 65 20 3d 20 43 45 52 41 |.sg_eras|e = CERA|
|00002c30| 53 45 3b 09 2f 2a 20 70 | 72 65 70 61 72 65 20 70 |SE;./* p|repare p|
|00002c40| 61 72 61 6d 65 74 65 72 | 73 09 2a 2f 0a 09 09 74 |arameter|s.*/...t|
|00002c50| 74 79 5f 6d 6f 64 65 2e | 73 67 5f 6b 69 6c 6c 20 |ty_mode.|sg_kill |
|00002c60| 3d 20 43 4b 49 4c 4c 3b | 0a 09 09 74 74 79 5f 6d |= CKILL;|...tty_m|
|00002c70| 6f 64 65 2e 73 67 5f 66 | 6c 61 67 73 20 3d 20 72 |ode.sg_f|lags = r|
|00002c80| 6f 74 6f 72 73 5b 72 6f | 74 6f 72 6e 75 6d 5d 2e |otors[ro|tornum].|
|00002c90| 66 6c 61 67 73 3b 0a 09 | 09 74 74 79 5f 6d 6f 64 |flags;..|.tty_mod|
|00002ca0| 65 2e 73 67 5f 69 73 70 | 65 65 64 20 3d 20 72 6f |e.sg_isp|eed = ro|
|00002cb0| 74 6f 72 73 5b 72 6f 74 | 6f 72 6e 75 6d 5d 2e 73 |tors[rot|ornum].s|
|00002cc0| 70 65 65 64 3b 0a 09 09 | 74 74 79 5f 6d 6f 64 65 |peed;...|tty_mode|
|00002cd0| 2e 73 67 5f 6f 73 70 65 | 65 64 20 3d 20 72 6f 74 |.sg_ospe|ed = rot|
|00002ce0| 6f 72 73 5b 72 6f 74 6f | 72 6e 75 6d 5d 2e 73 70 |ors[roto|rnum].sp|
|00002cf0| 65 65 64 3b 0a 09 09 73 | 74 74 79 28 74 74 79 5f |eed;...s|tty(tty_|
|00002d00| 6c 75 6e 2c 26 74 74 79 | 5f 6d 6f 64 65 29 3b 09 |lun,&tty|_mode);.|
|00002d10| 2f 2a 20 73 65 74 20 74 | 74 79 20 70 61 72 61 6d |/* set t|ty param|
|00002d20| 65 74 65 72 73 09 2a 2f | 0a 09 09 64 65 6c 61 79 |eters.*/|...delay|
|00002d30| 28 31 29 3b 0a 09 09 6a | 3d 30 3b 09 09 09 09 2f |(1);...j|=0;..../|
|00002d40| 2a 20 63 6f 75 6e 74 20 | 6f 66 20 63 72 27 73 09 |* count |of cr's.|
|00002d50| 2a 2f 0a 09 09 77 68 69 | 6c 65 20 28 28 6a 3c 32 |*/...whi|le ((j<2|
|00002d60| 29 20 26 26 20 28 72 65 | 61 64 28 74 74 79 5f 6c |) && (re|ad(tty_l|
|00002d70| 75 6e 2c 26 63 68 72 2c | 31 29 3e 30 29 29 20 7b |un,&chr,|1)>0)) {|
|00002d80| 0a 09 09 2f 2a 20 67 6f | 20 75 6e 74 69 6c 20 32 |.../* go| until 2|
|00002d90| 20 63 72 27 73 2c 20 65 | 6f 66 2c 20 6f 72 20 77 | cr's, e|of, or w|
|00002da0| 65 20 67 65 74 20 61 20 | 62 61 64 20 63 68 72 09 |e get a |bad chr.|
|00002db0| 09 2a 2f 0a 09 09 20 20 | 20 20 69 66 20 28 28 63 |.*/... | if ((c|
|00002dc0| 68 72 3d 3d 27 5c 6e 27 | 29 20 7c 7c 20 28 63 68 |hr=='\n'|) || (ch|
|00002dd0| 72 3d 3d 27 5c 72 27 29 | 29 20 7b 0a 09 09 09 66 |r=='\r')|) {....f|
|00002de0| 70 72 69 6e 74 66 28 6f | 75 74 64 65 76 2c 72 6f |printf(o|utdev,ro|
|00002df0| 74 6f 72 6d 73 67 29 3b | 0a 09 09 09 6a 2b 2b 3b |tormsg);|....j++;|
|00002e00| 09 09 09 2f 2a 20 63 6f | 75 6e 74 20 74 68 65 6d |.../* co|unt them|
|00002e10| 09 09 2a 2f 0a 09 09 20 | 20 20 20 7d 0a 09 09 20 |..*/... | }... |
|00002e20| 20 20 20 65 6c 73 65 0a | 09 09 09 62 72 65 61 6b | else.|...break|
|00002e30| 3b 0a 09 09 7d 0a 0a 09 | 09 69 66 20 28 6a 3d 3d |;...}...|.if (j==|
|00002e40| 32 29 20 7b 09 09 09 2f | 2a 20 77 65 20 67 6f 74 |2) {.../|* we got|
|00002e50| 20 32 20 63 72 27 73 2c | 20 47 4f 21 09 2a 2f 0a | 2 cr's,| GO!.*/.|
|00002e60| 0a 09 09 20 20 20 20 74 | 74 79 73 5f 63 6f 75 6e |... t|tys_coun|
|00002e70| 74 20 3d 20 30 3b 0a 09 | 09 20 20 20 20 74 74 79 |t = 0;..|. tty|
|00002e80| 73 66 69 6c 65 20 3d 20 | 66 6f 70 65 6e 28 22 2f |sfile = |fopen("/|
|00002e90| 65 74 63 2f 74 74 79 73 | 22 2c 22 72 22 29 3b 09 |etc/ttys|","r");.|
|00002ea0| 2f 2a 20 64 6f 20 69 74 | 20 61 67 61 69 6e 09 2a |/* do it| again.*|
|00002eb0| 2f 0a 09 09 20 20 20 20 | 77 68 69 6c 65 20 28 66 |/... |while (f|
|00002ec0| 72 65 61 64 28 26 63 68 | 72 2c 31 2c 31 2c 74 74 |read(&ch|r,1,1,tt|
|00002ed0| 79 73 66 69 6c 65 29 3e | 30 29 09 2f 2a 20 67 65 |ysfile)>|0)./* ge|
|00002ee0| 74 20 65 6e 74 72 79 09 | 2a 2f 0a 09 09 09 67 65 |t entry.|*/....ge|
|00002ef0| 74 65 6e 74 72 79 28 63 | 68 72 29 3b 0a 09 09 20 |tentry(c|hr);... |
|00002f00| 20 20 20 66 63 6c 6f 73 | 65 28 74 74 79 73 66 69 | fclos|e(ttysfi|
|00002f10| 6c 65 29 3b 09 09 2f 2a | 20 68 61 76 65 20 74 74 |le);../*| have tt|
|00002f20| 79 73 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 2a 2f |ys infor|mation*/|
|00002f30| 0a 0a 09 09 20 20 20 20 | 74 74 79 73 66 69 6c 65 |.... |ttysfile|
|00002f40| 20 3d 20 66 6f 70 65 6e | 28 22 2f 65 74 63 2f 74 | = fopen|("/etc/t|
|00002f50| 74 79 73 22 2c 22 77 22 | 29 3b 09 2f 2a 20 6e 6f |tys","w"|);./* no|
|00002f60| 77 20 75 70 64 61 74 65 | 09 2a 2f 0a 09 09 20 20 |w update|.*/... |
|00002f70| 20 20 66 6f 72 28 69 3d | 30 3b 69 3c 74 74 79 73 | for(i=|0;i<ttys|
|00002f80| 5f 63 6f 75 6e 74 3b 69 | 2b 2b 29 20 7b 0a 09 09 |_count;i|++) {...|
|00002f90| 09 69 66 20 28 30 3d 3d | 73 74 72 63 6d 70 28 74 |.if (0==|strcmp(t|
|00002fa0| 74 79 6d 61 74 63 68 2c | 74 74 79 73 5b 69 5d 2e |tymatch,|ttys[i].|
|00002fb0| 64 70 61 74 68 29 29 0a | 09 09 09 20 20 20 20 73 |dpath)).|... s|
|00002fc0| 74 72 63 70 79 28 74 74 | 79 73 5b 69 5d 2e 74 62 |trcpy(tt|ys[i].tb|
|00002fd0| 61 75 64 2c 72 6f 74 6f | 72 73 5b 72 6f 74 6f 72 |aud,roto|rs[rotor|
|00002fe0| 6e 75 6d 5d 2e 74 62 61 | 75 64 73 65 74 29 3b 0a |num].tba|udset);.|
|00002ff0| 09 09 09 09 09 09 2f 2a | 20 6d 61 74 63 68 20 65 |....../*| match e|
|00003000| 6e 74 72 79 20 26 20 63 | 68 61 6e 67 65 09 2a 2f |ntry & c|hange.*/|
|00003010| 0a 09 09 09 66 70 72 69 | 6e 74 66 28 74 74 79 73 |....fpri|ntf(ttys|
|00003020| 66 69 6c 65 2c 22 25 73 | 3a 25 73 3a 25 73 3a 25 |file,"%s|:%s:%s:%|
|00003030| 73 3a 25 73 3a 25 73 3a | 25 73 3a 25 73 5c 6e 22 |s:%s:%s:|%s:%s\n"|
|00003040| 2c 0a 09 09 09 20 20 20 | 20 74 74 79 73 5b 69 5d |,.... | ttys[i]|
|00003050| 2e 73 74 61 74 65 2c 0a | 09 09 09 20 20 20 20 74 |.state,.|... t|
|00003060| 74 79 73 5b 69 5d 2e 6c | 69 6e 65 6e 6f 2c 0a 09 |tys[i].l|ineno,..|
|00003070| 09 09 20 20 20 20 74 74 | 79 73 5b 69 5d 2e 64 70 |.. tt|ys[i].dp|
|00003080| 61 74 68 2c 0a 09 09 09 | 20 20 20 20 74 74 79 73 |ath,....| ttys|
|00003090| 5b 69 5d 2e 64 65 76 6e | 75 6d 2c 0a 09 09 09 20 |[i].devn|um,.... |
|000030a0| 20 20 20 74 74 79 73 5b | 69 5d 2e 74 74 79 69 64 | ttys[|i].ttyid|
|000030b0| 2c 0a 09 09 09 20 20 20 | 20 74 74 79 73 5b 69 5d |,.... | ttys[i]|
|000030c0| 2e 74 62 61 75 64 2c 0a | 09 09 09 20 20 20 20 74 |.tbaud,.|... t|
|000030d0| 74 79 73 5b 69 5d 2e 74 | 73 65 74 62 2c 0a 09 09 |tys[i].t|setb,...|
|000030e0| 09 20 20 20 20 74 74 79 | 73 5b 69 5d 2e 65 78 74 |. tty|s[i].ext|
|000030f0| 72 61 0a 09 09 09 29 3b | 09 09 09 2f 2a 20 70 75 |ra....);|.../* pu|
|00003100| 74 20 62 61 63 6b 20 69 | 6e 20 66 69 6c 65 09 2a |t back i|n file.*|
|00003110| 2f 0a 09 09 20 20 20 20 | 7d 3b 0a 09 09 20 20 20 |/... |};... |
|00003120| 20 66 63 6c 6f 73 65 28 | 74 74 79 73 66 69 6c 65 | fclose(|ttysfile|
|00003130| 29 3b 0a 09 09 20 20 20 | 20 72 6f 74 6f 72 67 6f |);... | rotorgo|
|00003140| 20 3d 20 5c 30 3b 09 09 | 2f 2a 20 64 6f 6e 65 2c | = \0;..|/* done,|
|00003150| 20 65 78 69 74 09 09 2a | 2f 0a 09 09 7d 20 65 6c | exit..*|/...} el|
|00003160| 73 65 20 7b 0a 09 09 20 | 20 20 20 72 6f 74 6f 72 |se {... | rotor|
|00003170| 6e 75 6d 2b 2b 3b 09 09 | 09 2f 2a 20 6f 74 68 65 |num++;..|./* othe|
|00003180| 72 77 69 73 65 20 6e 65 | 78 74 20 65 6e 74 72 79 |rwise ne|xt entry|
|00003190| 09 2a 2f 0a 09 09 7d 0a | 09 20 20 20 20 7d 20 2f |.*/...}.|. } /|
|000031a0| 2a 20 65 6e 64 20 77 68 | 69 6c 65 20 6d 61 74 63 |* end wh|ile matc|
|000031b0| 68 69 6e 67 20 72 6f 74 | 6f 72 67 6f 20 2a 2f 0a |hing rot|orgo */.|
|000031c0| 09 7d 20 2f 2a 20 65 6e | 64 20 69 66 20 28 72 6f |.} /* en|d if (ro|
|000031d0| 74 6f 72 67 6f 29 20 2a | 2f 0a 20 20 20 20 7d 20 |torgo) *|/. } |
|000031e0| 2f 2a 20 65 6e 64 20 77 | 68 69 6c 65 20 28 72 6f |/* end w|hile (ro|
|000031f0| 74 6f 72 67 6f 29 20 2a | 2f 0a 0a 20 20 20 20 66 |torgo) *|/.. f|
|00003200| 70 72 69 6e 74 66 28 6f | 75 74 64 65 76 2c 22 5c |printf(o|utdev,"\|
|00003210| 6e 5c 6e 43 68 61 72 6c | 65 73 20 52 69 76 65 72 |n\nCharl|es River|
|00003220| 20 44 61 74 61 20 53 79 | 73 74 65 6d 73 20 36 38 | Data Sy|stems 68|
|00003230| 2f 33 35 22 29 3b 0a 20 | 20 20 20 69 66 20 28 2a |/35");. | if (*|
|00003240| 73 79 73 6e 61 6d 65 2e | 6e 6f 64 65 6e 61 6d 65 |sysname.|nodename|
|00003250| 29 09 09 09 2f 2a 20 69 | 66 20 6e 6f 64 65 6e 61 |).../* i|f nodena|
|00003260| 6d 65 2c 20 70 72 69 6e | 74 20 69 74 2a 2f 0a 09 |me, prin|t it*/..|
|00003270| 66 70 72 69 6e 74 66 28 | 6f 75 74 64 65 76 2c 22 |fprintf(|outdev,"|
|00003280| 20 28 25 73 29 22 2c 73 | 79 73 6e 61 6d 65 2e 6e | (%s)",s|ysname.n|
|00003290| 6f 64 65 6e 61 6d 65 29 | 3b 0a 20 20 20 20 66 70 |odename)|;. fp|
|000032a0| 72 69 6e 74 66 28 6f 75 | 74 64 65 76 2c 22 5c 6e |rintf(ou|tdev,"\n|
|000032b0| 5c 30 31 35 22 29 3b 0a | 0a 20 20 20 20 66 65 78 |\015");.|. fex|
|000032c0| 65 63 6c 28 70 6f 73 74 | 5f 6c 6f 67 69 6e 2c 20 |ecl(post|_login, |
|000032d0| 69 6e 64 65 76 2c 20 6f | 75 74 64 65 76 2c 20 6f |indev, o|utdev, o|
|000032e0| 75 74 64 65 76 2c 20 22 | 6c 6f 67 69 6e 22 2c 20 |utdev, "|login", |
|000032f0| 74 74 79 6d 61 74 63 68 | 2c 20 30 29 3b 0a 20 20 |ttymatch|, 0);. |
|00003300| 20 20 65 78 69 74 28 31 | 29 3b 09 09 09 09 09 2f | exit(1|);...../|
|00003310| 2a 20 4e 65 76 65 72 20 | 67 65 74 20 68 65 72 65 |* Never |get here|
|00003320| 3f 3f 3f 09 2a 2f 0a 7d | 0a 0a 67 65 74 65 6e 74 |???.*/.}|..getent|
|00003330| 72 79 28 61 29 20 2f 2a | 20 70 61 72 73 65 20 65 |ry(a) /*| parse e|
|00003340| 6e 74 72 79 20 66 72 6f | 6d 20 2f 65 74 63 2f 74 |ntry fro|m /etc/t|
|00003350| 74 79 73 20 66 69 6c 65 | 2c 20 69 6e 63 72 65 6d |tys file|, increm|
|00003360| 65 6e 74 20 74 74 79 73 | 5f 63 6f 75 6e 74 20 2a |ent ttys|_count *|
|00003370| 2f 0a 63 68 61 72 20 61 | 3b 0a 7b 0a 20 20 20 20 |/.char a|;.{. |
|00003380| 63 68 61 72 20 2a 70 74 | 72 3b 09 09 09 09 2f 2a |char *pt|r;..../*|
|00003390| 20 66 69 65 6c 64 20 70 | 6f 69 6e 74 65 72 20 69 | field p|ointer i|
|000033a0| 6e 20 72 65 63 6f 72 64 | 09 2a 2f 0a 20 20 20 20 |n record|.*/. |
|000033b0| 63 68 61 72 20 2a 74 62 | 6c 5b 38 5d 3b 09 09 09 |char *tb|l[8];...|
|000033c0| 2f 2a 20 74 74 79 73 20 | 72 65 63 6f 72 64 20 66 |/* ttys |record f|
|000033d0| 69 65 6c 64 20 70 6f 69 | 6e 74 65 72 73 09 2a 2f |ield poi|nters.*/|
|000033e0| 0a 20 20 20 20 69 6e 74 | 20 69 3b 09 09 09 09 2f |. int| i;..../|
|000033f0| 2a 20 66 69 65 6c 64 20 | 6e 75 6d 62 65 72 2c 20 |* field |number, |
|00003400| 67 65 6e 65 72 61 6c 20 | 70 75 72 70 6f 73 65 2a |general |purpose*|
|00003410| 2f 0a 0a 20 20 20 20 74 | 62 6c 5b 30 5d 3d 74 74 |/.. t|bl[0]=tt|
|00003420| 79 73 5b 74 74 79 73 5f | 63 6f 75 6e 74 5d 2e 73 |ys[ttys_|count].s|
|00003430| 74 61 74 65 3b 09 09 2f | 2a 20 70 6f 69 6e 74 20 |tate;../|* point |
|00003440| 74 6f 20 66 69 65 6c 64 | 73 20 09 2a 2f 0a 20 20 |to field|s .*/. |
|00003450| 20 20 74 62 6c 5b 31 5d | 3d 74 74 79 73 5b 74 74 | tbl[1]|=ttys[tt|
|00003460| 79 73 5f 63 6f 75 6e 74 | 5d 2e 6c 69 6e 65 6e 6f |ys_count|].lineno|
|00003470| 3b 0a 20 20 20 20 74 62 | 6c 5b 32 5d 3d 74 74 79 |;. tb|l[2]=tty|
|00003480| 73 5b 74 74 79 73 5f 63 | 6f 75 6e 74 5d 2e 64 70 |s[ttys_c|ount].dp|
|00003490| 61 74 68 3b 0a 20 20 20 | 20 74 62 6c 5b 33 5d 3d |ath;. | tbl[3]=|
|000034a0| 74 74 79 73 5b 74 74 79 | 73 5f 63 6f 75 6e 74 5d |ttys[tty|s_count]|
|000034b0| 2e 64 65 76 6e 75 6d 3b | 0a 20 20 20 20 74 62 6c |.devnum;|. tbl|
|000034c0| 5b 34 5d 3d 74 74 79 73 | 5b 74 74 79 73 5f 63 6f |[4]=ttys|[ttys_co|
|000034d0| 75 6e 74 5d 2e 74 74 79 | 69 64 3b 0a 20 20 20 20 |unt].tty|id;. |
|000034e0| 74 62 6c 5b 35 5d 3d 74 | 74 79 73 5b 74 74 79 73 |tbl[5]=t|tys[ttys|
|000034f0| 5f 63 6f 75 6e 74 5d 2e | 74 62 61 75 64 3b 0a 20 |_count].|tbaud;. |
|00003500| 20 20 20 74 62 6c 5b 36 | 5d 3d 74 74 79 73 5b 74 | tbl[6|]=ttys[t|
|00003510| 74 79 73 5f 63 6f 75 6e | 74 5d 2e 74 73 65 74 62 |tys_coun|t].tsetb|
|00003520| 3b 0a 20 20 20 20 74 62 | 6c 5b 37 5d 3d 74 74 79 |;. tb|l[7]=tty|
|00003530| 73 5b 74 74 79 73 5f 63 | 6f 75 6e 74 5d 2e 65 78 |s[ttys_c|ount].ex|
|00003540| 74 72 61 3b 0a 0a 20 20 | 20 20 66 6f 72 28 69 3d |tra;.. | for(i=|
|00003550| 30 3b 69 3c 38 3b 69 2b | 2b 29 20 2a 74 62 6c 5b |0;i<8;i+|+) *tbl[|
|00003560| 69 5d 3d 30 3b 09 09 09 | 2f 2a 20 69 6e 69 74 20 |i]=0;...|/* init |
|00003570| 66 69 65 6c 64 73 20 74 | 6f 20 6e 75 6c 6c 09 2a |fields t|o null.*|
|00003580| 2f 0a 0a 20 20 20 20 69 | 20 3d 20 30 3b 09 09 09 |/.. i| = 0;...|
|00003590| 09 09 2f 2a 20 73 74 61 | 72 74 20 61 74 20 66 69 |../* sta|rt at fi|
|000035a0| 72 73 74 20 66 69 65 6c | 64 09 2a 2f 0a 20 20 20 |rst fiel|d.*/. |
|000035b0| 20 77 68 69 6c 65 20 28 | 61 21 3d 31 30 29 20 7b | while (|a!=10) {|
|000035c0| 09 09 09 09 2f 2a 20 77 | 61 74 63 68 20 66 6f 72 |..../* w|atch for|
|000035d0| 20 45 4f 4c 09 2a 2f 0a | 09 70 74 72 3d 74 62 6c | EOL.*/.|.ptr=tbl|
|000035e0| 5b 69 5d 3b 09 09 09 09 | 2f 2a 20 70 6f 69 6e 74 |[i];....|/* point|
|000035f0| 20 61 74 20 66 69 65 6c | 64 09 2a 2f 0a 09 77 68 | at fiel|d.*/..wh|
|00003600| 69 6c 65 20 28 28 61 21 | 3d 31 30 29 20 26 26 20 |ile ((a!|=10) && |
|00003610| 28 28 69 3d 3d 37 29 20 | 7c 7c 20 28 61 21 3d 35 |((i==7) ||| (a!=5|
|00003620| 38 29 29 29 20 7b 0a 09 | 20 20 20 20 2a 70 74 72 |8))) {..| *ptr|
|00003630| 2b 2b 3d 61 3b 09 09 09 | 09 2f 2a 20 73 61 76 65 |++=a;...|./* save|
|00003640| 20 63 68 72 20 69 66 20 | 76 61 6c 69 64 09 2a 2f | chr if |valid.*/|
|00003650| 0a 09 20 20 20 20 69 66 | 20 28 66 72 65 61 64 28 |.. if| (fread(|
|00003660| 26 61 2c 31 2c 31 2c 74 | 74 79 73 66 69 6c 65 29 |&a,1,1,t|tysfile)|
|00003670| 3d 3d 30 29 20 61 3d 31 | 30 3b 2f 2a 20 45 4f 46 |==0) a=1|0;/* EOF|
|00003680| 2c 20 74 65 72 6d 69 6e | 61 74 65 09 2a 2f 0a 09 |, termin|ate.*/..|
|00003690| 7d 0a 09 69 66 20 28 61 | 21 3d 31 30 29 0a 09 20 |}..if (a|!=10).. |
|000036a0| 20 20 20 69 66 20 28 66 | 72 65 61 64 28 26 61 2c | if (f|read(&a,|
|000036b0| 31 2c 31 2c 74 74 79 73 | 66 69 6c 65 29 3d 3d 30 |1,1,ttys|file)==0|
|000036c0| 29 20 61 3d 31 30 3b 2f | 2a 20 69 73 20 74 68 65 |) a=10;/|* is the|
|000036d0| 72 65 20 6e 65 78 74 20 | 66 69 65 6c 64 3f 09 2a |re next |field?.*|
|000036e0| 2f 0a 09 2a 70 74 72 3d | 30 3b 09 09 09 09 09 2f |/..*ptr=|0;...../|
|000036f0| 2a 20 6d 61 72 6b 20 65 | 6e 64 20 6f 66 20 73 74 |* mark e|nd of st|
|00003700| 72 69 6e 67 09 2a 2f 0a | 09 69 66 20 28 69 3c 37 |ring.*/.|.if (i<7|
|00003710| 29 20 69 2b 2b 3b 09 09 | 09 09 2f 2a 20 6e 65 78 |) i++;..|../* nex|
|00003720| 74 20 66 69 65 6c 64 20 | 70 74 72 09 2a 2f 0a 20 |t field |ptr.*/. |
|00003730| 20 20 20 7d 0a 20 20 20 | 20 74 74 79 73 5f 63 6f | }. | ttys_co|
|00003740| 75 6e 74 2b 2b 3b 09 09 | 09 09 2f 2a 20 63 6f 75 |unt++;..|../* cou|
|00003750| 6e 74 20 6c 69 6e 65 2d | 69 74 65 6d 09 2a 2f 0a |nt line-|item.*/.|
|00003760| 7d 0a 0a 61 74 5f 69 6e | 69 74 28 29 0a 7b 0a 20 |}..at_in|it().{. |
|00003770| 20 20 20 69 6e 74 20 61 | 77 61 6b 65 20 3d 20 30 | int a|wake = 0|
|00003780| 3b 0a 20 20 20 20 63 68 | 61 72 20 6a 75 6e 6b 3b |;. ch|ar junk;|
|00003790| 0a 0a 20 20 20 20 74 74 | 79 5f 6d 6f 64 65 2e 73 |.. tt|y_mode.s|
|000037a0| 67 5f 65 72 61 73 65 20 | 3d 20 43 45 52 41 53 45 |g_erase |= CERASE|
|000037b0| 3b 09 09 09 2f 2a 20 70 | 72 65 70 61 72 65 20 70 |;.../* p|repare p|
|000037c0| 61 72 61 6d 65 74 65 72 | 73 09 2a 2f 0a 20 20 20 |arameter|s.*/. |
|000037d0| 20 74 74 79 5f 6d 6f 64 | 65 2e 73 67 5f 6b 69 6c | tty_mod|e.sg_kil|
|000037e0| 6c 20 3d 20 43 4b 49 4c | 4c 3b 0a 20 20 20 20 74 |l = CKIL|L;. t|
|000037f0| 74 79 5f 6d 6f 64 65 2e | 73 67 5f 66 6c 61 67 73 |ty_mode.|sg_flags|
|00003800| 20 3d 20 43 52 31 2b 4e | 4c 31 2b 43 52 4d 4f 44 | = CR1+N|L1+CRMOD|
|00003810| 2b 52 41 57 3b 0a 20 20 | 20 20 74 74 79 5f 6d 6f |+RAW;. | tty_mo|
|00003820| 64 65 2e 73 67 5f 69 73 | 70 65 65 64 20 3d 20 42 |de.sg_is|peed = B|
|00003830| 31 32 30 30 3b 0a 20 20 | 20 20 74 74 79 5f 6d 6f |1200;. | tty_mo|
|00003840| 64 65 2e 73 67 5f 6f 73 | 70 65 65 64 20 3d 20 42 |de.sg_os|peed = B|
|00003850| 31 32 30 30 3b 0a 20 20 | 20 20 73 74 74 79 28 74 |1200;. | stty(t|
|00003860| 74 79 5f 6c 75 6e 2c 26 | 74 74 79 5f 6d 6f 64 65 |ty_lun,&|tty_mode|
|00003870| 29 3b 09 09 09 2f 2a 20 | 73 65 74 20 74 74 79 20 |);.../* |set tty |
|00003880| 70 61 72 61 6d 65 74 65 | 72 73 09 2a 2f 0a 0a 20 |paramete|rs.*/.. |
|00003890| 20 20 20 73 6c 65 65 70 | 28 34 29 3b 0a 20 20 20 | sleep|(4);. |
|000038a0| 20 66 70 72 69 6e 74 66 | 28 6f 75 74 64 65 76 2c | fprintf|(outdev,|
|000038b0| 22 2b 2b 2b 22 29 3b 09 | 09 09 2f 2a 20 67 65 74 |"+++");.|../* get|
|000038c0| 20 6d 6f 64 65 6d 73 20 | 61 74 74 65 6e 74 69 6f | modems |attentio|
|000038d0| 6e 09 2a 2f 0a 20 20 20 | 20 73 6c 65 65 70 28 34 |n.*/. | sleep(4|
|000038e0| 29 3b 0a 20 20 20 20 66 | 70 72 69 6e 74 66 28 6f |);. f|printf(o|
|000038f0| 75 74 64 65 76 2c 22 5c | 72 22 29 3b 0a 20 20 20 |utdev,"\|r");. |
|00003900| 20 73 6c 65 65 70 28 31 | 29 3b 0a 20 20 20 20 66 | sleep(1|);. f|
|00003910| 70 72 69 6e 74 66 28 6f | 75 74 64 65 76 2c 22 41 |printf(o|utdev,"A|
|00003920| 54 5a 5c 72 22 29 3b 09 | 09 09 2f 2a 20 72 65 73 |TZ\r");.|../* res|
|00003930| 65 74 20 6d 6f 64 65 6d | 09 09 2a 2f 0a 20 20 20 |et modem|..*/. |
|00003940| 20 73 6c 65 65 70 28 31 | 29 3b 0a 20 20 20 20 66 | sleep(1|);. f|
|00003950| 70 72 69 6e 74 66 28 6f | 75 74 64 65 76 2c 22 41 |printf(o|utdev,"A|
|00003960| 54 53 30 3d 31 5c 72 22 | 29 3b 09 09 09 2f 2a 20 |TS0=1\r"|);.../* |
|00003970| 61 75 74 6f 20 61 6e 73 | 77 65 72 09 09 2a 2f 0a |auto ans|wer..*/.|
|00003980| 20 20 20 20 73 6c 65 65 | 70 28 31 29 3b 0a 20 20 | slee|p(1);. |
|00003990| 20 20 6a 75 6e 6b 3d 27 | 20 27 3b 0a 20 20 20 20 | junk='| ';. |
|000039a0| 77 68 69 6c 65 28 6a 75 | 6e 6b 21 3d 27 31 27 29 |while(ju|nk!='1')|
|000039b0| 20 72 65 61 64 28 74 74 | 79 5f 6c 75 6e 2c 26 6a | read(tt|y_lun,&j|
|000039c0| 75 6e 6b 2c 31 29 3b 09 | 2f 2a 20 66 6c 75 73 68 |unk,1);.|/* flush|
|000039d0| 20 69 6e 70 75 74 20 62 | 75 66 66 65 72 09 2a 2f | input b|uffer.*/|
|000039e0| 0a 20 20 20 20 77 68 69 | 6c 65 28 6a 75 6e 6b 21 |. whi|le(junk!|
|000039f0| 3d 27 5c 72 27 29 20 72 | 65 61 64 28 74 74 79 5f |='\r') r|ead(tty_|
|00003a00| 6c 75 6e 2c 26 6a 75 6e | 6b 2c 31 29 3b 0a 7d 0a |lun,&jun|k,1);.}.|
|00003a10| 53 48 41 52 5f 45 4f 46 | 0a 63 68 6d 6f 64 20 2b |SHAR_EOF|.chmod +|
|00003a20| 78 20 27 70 72 65 6c 6f | 67 2e 63 27 0a 23 09 45 |x 'prelo|g.c'.#.E|
|00003a30| 6e 64 20 6f 66 20 73 68 | 65 6c 6c 20 61 72 63 68 |nd of sh|ell arch|
|00003a40| 69 76 65 0a 65 78 69 74 | 20 30 0a |ive.exit| 0. |
+--------+-------------------------+-------------------------+--------+--------+