home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / pty4 / part03 < prev    next >
SHell self-extracting ARchive  |  1992-02-19  |  64.0 KB

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).

ConfidenceProgramDetectionMatch TypeSupport
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 32 39 20 52 45 50 | 4f 53 54 3a 20 47 65 6e |i129 REP|OST: Gen|
|00000060| 65 72 61 6c 69 7a 65 64 | 20 69 6e 74 65 72 66 61 |eralized| interfa|
|00000070| 63 65 20 74 6f 20 70 73 | 65 75 64 6f 2d 74 74 79 |ce to ps|eudo-tty|
|00000080| 20 64 65 76 69 63 65 73 | 2c 20 50 61 72 74 30 33 | devices|, Part03|
|00000090| 2f 30 39 0a 53 65 6e 64 | 65 72 3a 20 75 6e 69 78 |/09.Send|er: unix|
|000000a0| 2d 73 6f 75 72 63 65 73 | 2d 6d 6f 64 65 72 61 74 |-sources|-moderat|
|000000b0| 6f 72 40 70 61 2e 64 65 | 63 2e 63 6f 6d 0a 41 70 |or@pa.de|c.com.Ap|
|000000c0| 70 72 6f 76 65 64 3a 20 | 76 69 78 69 65 40 70 61 |proved: |vixie@pa|
|000000d0| 2e 64 65 63 2e 63 6f 6d | 0a 0a 5b 20 74 68 65 20 |.dec.com|..[ the |
|000000e0| 66 69 72 73 74 20 76 65 | 72 73 69 6f 6e 20 6f 66 |first ve|rsion of|
|000000f0| 20 70 61 72 74 30 33 20 | 68 61 64 20 61 20 72 61 | part03 |had a ra|
|00000100| 77 20 5c 72 20 66 6c 6f | 61 74 69 6e 67 20 61 72 |w \r flo|ating ar|
|00000110| 6f 75 6e 64 20 69 6e 20 | 6f 6e 65 20 6f 66 0a 20 |ound in |one of. |
|00000120| 20 74 68 65 20 73 74 72 | 69 6e 67 73 2c 20 61 6e | the str|ings, an|
|00000130| 64 20 6e 6e 74 70 20 64 | 6f 65 73 6e 27 74 20 64 |d nntp d|oesn't d|
|00000140| 6f 20 77 65 6c 6c 20 77 | 69 74 68 20 74 68 69 73 |o well w|ith this|
|00000150| 2e 20 20 69 20 63 68 61 | 6e 67 65 64 20 74 68 65 |. i cha|nged the|
|00000160| 20 72 61 77 0a 20 20 5c | 72 20 74 6f 20 61 20 22 | raw. \|r to a "|
|00000170| 5c 72 22 20 74 68 61 74 | 20 74 68 65 20 63 20 63 |\r" that| the c c|
|00000180| 6f 6d 70 69 6c 65 72 20 | 77 69 6c 6c 20 63 6f 6e |ompiler |will con|
|00000190| 76 65 72 74 20 62 61 63 | 6b 20 74 6f 20 61 20 72 |vert bac|k to a r|
|000001a0| 61 77 20 6f 6e 65 2e 20 | 2d 2d 76 69 78 20 5d 0a |aw one. |--vix ].|
|000001b0| 0a 53 75 62 6d 69 74 74 | 65 64 2d 42 79 3a 20 62 |.Submitt|ed-By: b|
|000001c0| 72 6e 73 74 6e 64 40 6e | 79 75 2e 65 64 75 20 28 |rnstnd@n|yu.edu (|
|000001d0| 44 61 6e 20 42 65 72 6e | 73 74 65 69 6e 29 0a 50 |Dan Bern|stein).P|
|000001e0| 6f 73 74 69 6e 67 2d 4e | 75 6d 62 65 72 3a 20 56 |osting-N|umber: V|
|000001f0| 6f 6c 75 6d 65 20 32 35 | 2c 20 49 73 73 75 65 20 |olume 25|, Issue |
|00000200| 31 32 39 0a 41 72 63 68 | 69 76 65 2d 4e 61 6d 65 |129.Arch|ive-Name|
|00000210| 3a 20 70 74 79 34 2f 70 | 61 72 74 30 33 0a 0a 23 |: pty4/p|art03..#|
|00000220| 21 20 2f 62 69 6e 2f 73 | 68 0a 23 20 54 68 69 73 |! /bin/s|h.# This|
|00000230| 20 69 73 20 61 20 73 68 | 65 6c 6c 20 61 72 63 68 | is a sh|ell arch|
|00000240| 69 76 65 2e 20 20 52 65 | 6d 6f 76 65 20 61 6e 79 |ive. Re|move any|
|00000250| 74 68 69 6e 67 20 62 65 | 66 6f 72 65 20 74 68 69 |thing be|fore thi|
|00000260| 73 20 6c 69 6e 65 2c 20 | 74 68 65 6e 20 75 6e 70 |s line, |then unp|
|00000270| 61 63 6b 0a 23 20 69 74 | 20 62 79 20 73 61 76 69 |ack.# it| by savi|
|00000280| 6e 67 20 69 74 20 69 6e | 74 6f 20 61 20 66 69 6c |ng it in|to a fil|
|00000290| 65 20 61 6e 64 20 74 79 | 70 69 6e 67 20 22 73 68 |e and ty|ping "sh|
|000002a0| 20 66 69 6c 65 22 2e 20 | 20 54 6f 20 6f 76 65 72 | file". | To over|
|000002b0| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 0a 23 |write ex|isting.#|
|000002c0| 20 66 69 6c 65 73 2c 20 | 74 79 70 65 20 22 73 68 | files, |type "sh|
|000002d0| 20 66 69 6c 65 20 2d 63 | 22 2e 20 20 59 6f 75 20 | file -c|". You |
|000002e0| 63 61 6e 20 61 6c 73 6f | 20 66 65 65 64 20 74 68 |can also| feed th|
|000002f0| 69 73 20 61 73 20 73 74 | 61 6e 64 61 72 64 20 69 |is as st|andard i|
|00000300| 6e 70 75 74 20 76 69 61 | 0a 23 20 75 6e 73 68 61 |nput via|.# unsha|
|00000310| 72 2c 20 6f 72 20 62 79 | 20 74 79 70 69 6e 67 20 |r, or by| typing |
|00000320| 22 73 68 20 3c 66 69 6c | 65 22 2c 20 65 2e 67 2e |"sh <fil|e", e.g.|
|00000330| 2e 20 20 49 66 20 74 68 | 69 73 20 61 72 63 68 69 |. If th|is archi|
|00000340| 76 65 20 69 73 20 63 6f | 6d 70 6c 65 74 65 2c 20 |ve is co|mplete, |
|00000350| 79 6f 75 0a 23 20 77 69 | 6c 6c 20 73 65 65 20 74 |you.# wi|ll see t|
|00000360| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 6d 65 73 |he follo|wing mes|
|00000370| 73 61 67 65 20 61 74 20 | 74 68 65 20 65 6e 64 3a |sage at |the end:|
|00000380| 0a 23 09 09 22 45 6e 64 | 20 6f 66 20 61 72 63 68 |.#.."End| of arch|
|00000390| 69 76 65 20 33 20 28 6f | 66 20 39 29 2e 22 0a 23 |ive 3 (o|f 9).".#|
|000003a0| 20 43 6f 6e 74 65 6e 74 | 73 3a 20 20 43 48 41 4e | Content|s: CHAN|
|000003b0| 47 45 53 20 43 48 45 43 | 4b 43 4f 4e 46 2e 63 20 |GES CHEC|KCONF.c |
|000003c0| 49 4d 50 41 43 54 20 57 | 54 46 20 67 65 74 6f 70 |IMPACT W|TF getop|
|000003d0| 74 2e 63 20 70 74 79 2d | 62 61 73 69 63 2e 31 0a |t.c pty-|basic.1.|
|000003e0| 23 20 20 20 70 74 79 63 | 6f 6d 6d 2e 63 20 70 74 |# ptyc|omm.c pt|
|000003f0| 79 67 65 74 2e 63 20 70 | 74 79 73 6c 61 76 65 2e |yget.c p|tyslave.|
|00000400| 63 20 70 74 79 74 65 78 | 74 73 2e 63 20 72 61 64 |c ptytex|ts.c rad|
|00000410| 69 78 73 6f 72 74 2e 33 | 20 72 61 6c 6c 6f 63 2e |ixsort.3| ralloc.|
|00000420| 63 0a 23 20 20 20 73 65 | 73 73 6c 69 73 74 2e 63 |c.# se|sslist.c|
|00000430| 20 73 65 73 73 6d 65 6e | 75 2e 63 20 73 65 73 73 | sessmen|u.c sess|
|00000440| 6e 61 6d 65 2e 63 20 73 | 69 67 64 66 6c 2e 63 20 |name.c s|igdfl.c |
|00000450| 77 68 6f 2e 63 20 77 72 | 69 74 65 2e 63 0a 23 20 |who.c wr|ite.c.# |
|00000460| 57 72 61 70 70 65 64 20 | 62 79 20 76 69 78 69 65 |Wrapped |by vixie|
|00000470| 40 63 6f 67 6e 69 74 69 | 6f 6e 2e 70 61 2e 64 65 |@cogniti|on.pa.de|
|00000480| 63 2e 63 6f 6d 20 6f 6e | 20 57 65 64 20 46 65 62 |c.com on| Wed Feb|
|00000490| 20 31 39 20 31 33 3a 33 | 35 3a 30 33 20 31 39 39 | 19 13:3|5:03 199|
|000004a0| 32 0a 50 41 54 48 3d 2f | 62 69 6e 3a 2f 75 73 72 |2.PATH=/|bin:/usr|
|000004b0| 2f 62 69 6e 3a 2f 75 73 | 72 2f 75 63 62 20 3b 20 |/bin:/us|r/ucb ; |
|000004c0| 65 78 70 6f 72 74 20 50 | 41 54 48 0a 69 66 20 74 |export P|ATH.if t|
|000004d0| 65 73 74 20 2d 66 20 27 | 43 48 41 4e 47 45 53 27 |est -f '|CHANGES'|
|000004e0| 20 2d 61 20 22 24 7b 31 | 7d 22 20 21 3d 20 22 2d | -a "${1|}" != "-|
|000004f0| 63 22 20 3b 20 74 68 65 | 6e 20 0a 20 20 65 63 68 |c" ; the|n . ech|
|00000500| 6f 20 73 68 61 72 3a 20 | 57 69 6c 6c 20 6e 6f 74 |o shar: |Will not|
|00000510| 20 63 6c 6f 62 62 65 72 | 20 65 78 69 73 74 69 6e | clobber| existin|
|00000520| 67 20 66 69 6c 65 20 5c | 22 27 43 48 41 4e 47 45 |g file \|"'CHANGE|
|00000530| 53 27 5c 22 0a 65 6c 73 | 65 0a 65 63 68 6f 20 73 |S'\".els|e.echo s|
|00000540| 68 61 72 3a 20 45 78 74 | 72 61 63 74 69 6e 67 20 |har: Ext|racting |
|00000550| 5c 22 27 43 48 41 4e 47 | 45 53 27 5c 22 20 5c 28 |\"'CHANG|ES'\" \(|
|00000560| 33 38 38 33 20 63 68 61 | 72 61 63 74 65 72 73 5c |3883 cha|racters\|
|00000570| 29 0a 73 65 64 20 22 73 | 2f 5e 58 2f 2f 22 20 3e |).sed "s|/^X//" >|
|00000580| 27 43 48 41 4e 47 45 53 | 27 20 3c 3c 27 45 4e 44 |'CHANGES|' <<'END|
|00000590| 5f 4f 46 5f 46 49 4c 45 | 27 0a 58 32 2f 39 2f 39 |_OF_FILE|'.X2/9/9|
|000005a0| 32 3a 20 70 74 79 20 34 | 2e 30 2e 0a 58 32 2f 39 |2: pty 4|.0..X2/9|
|000005b0| 2f 39 32 3a 20 46 69 78 | 65 64 20 75 70 20 64 6f |/92: Fix|ed up do|
|000005c0| 63 75 6d 65 6e 74 61 74 | 69 6f 6e 2c 20 68 6f 70 |cumentat|ion, hop|
|000005d0| 65 66 75 6c 6c 79 20 66 | 6f 72 20 74 68 65 20 6c |efully f|or the l|
|000005e0| 61 73 74 20 74 69 6d 65 | 2e 0a 58 31 2f 32 39 2f |ast time|..X1/29/|
|000005f0| 39 32 3a 20 43 68 61 6e | 67 65 64 20 49 4e 53 54 |92: Chan|ged INST|
|00000600| 41 4c 4c 2e 63 20 74 6f | 20 72 65 70 6f 72 74 20 |ALL.c to| report |
|00000610| 63 68 6f 77 6e 20 72 6f | 6f 74 20 66 6f 72 20 49 |chown ro|ot for I|
|00000620| 4e 53 54 41 4c 4c 20 72 | 6f 6f 74 2e 20 54 6e 78 |NSTALL r|oot. Tnx|
|00000630| 20 49 53 2e 0a 58 31 2f | 32 37 2f 39 32 3a 20 41 | IS..X1/|27/92: A|
|00000640| 64 64 65 64 20 41 42 52 | 54 2d 3e 49 4f 54 20 69 |dded ABR|T->IOT i|
|00000650| 66 6e 64 65 66 20 69 6e | 20 73 69 67 64 66 6c 2e |fndef in| sigdfl.|
|00000660| 63 2e 0a 58 31 2f 32 37 | 2f 39 32 3a 20 43 68 61 |c..X1/27|/92: Cha|
|00000670| 6e 67 65 64 20 73 69 67 | 64 66 6c 2e 63 20 74 6f |nged sig|dfl.c to|
|00000680| 20 7a 65 72 6f 20 74 68 | 65 20 73 69 67 76 65 63 | zero th|e sigvec|
|00000690| 73 20 72 61 74 68 65 72 | 20 74 68 61 6e 20 73 65 |s rather| than se|
|000006a0| 74 74 69 6e 67 20 73 76 | 5f 66 6c 61 67 73 2e 0a |tting sv|_flags..|
|000006b0| 58 31 2f 31 36 2f 39 32 | 3a 20 70 74 79 20 34 2e |X1/16/92|: pty 4.|
|000006c0| 30 2c 20 73 65 63 6f 6e | 64 20 67 61 6d 6d 61 2e |0, secon|d gamma.|
|000006d0| 0a 58 31 2f 31 33 2f 39 | 32 3a 20 44 6f 65 73 20 |.X1/13/9|2: Does |
|000006e0| 69 74 20 77 6f 72 6b 20 | 6f 6e 20 61 6e 20 49 72 |it work |on an Ir|
|000006f0| 69 73 3f 20 4e 6f 62 6f | 64 79 20 6b 6e 6f 77 73 |is? Nobo|dy knows|
|00000700| 2e 20 0a 58 31 2f 31 33 | 2f 39 32 3a 20 41 64 64 |. .X1/13|/92: Add|
|00000710| 65 64 20 49 52 49 53 5f | 55 47 48 5f 50 54 59 53 |ed IRIS_|UGH_PTYS|
|00000720| 20 74 6f 20 70 74 79 67 | 65 74 2e 63 2e 20 54 6e | to ptyg|et.c. Tn|
|00000730| 78 20 49 52 49 53 2c 20 | 49 20 74 68 69 6e 6b 2e |x IRIS, |I think.|
|00000740| 0a 58 31 2f 31 33 2f 39 | 32 3a 20 43 68 61 6e 67 |.X1/13/9|2: Chang|
|00000750| 65 64 20 66 61 74 61 6c | 20 74 6f 20 77 61 72 6e |ed fatal| to warn|
|00000760| 69 6e 67 20 66 6f 72 20 | 74 63 74 70 67 72 70 20 |ing for |tctpgrp |
|00000770| 66 61 69 6c 75 72 65 20 | 69 6e 20 70 74 79 73 6c |failure |in ptysl|
|00000780| 61 76 65 2e 63 2e 20 54 | 6e 78 20 49 52 49 53 2e |ave.c. T|nx IRIS.|
|00000790| 0a 58 31 2f 31 33 2f 39 | 32 3a 20 69 66 6e 64 65 |.X1/13/9|2: ifnde|
|000007a0| 66 27 65 64 20 53 59 53 | 56 20 66 6f 72 20 75 74 |f'ed SYS|V for ut|
|000007b0| 5f 68 6f 73 74 20 69 6e | 20 70 74 79 6c 6f 67 73 |_host in| ptylogs|
|000007c0| 2e 63 2e 20 54 6e 78 20 | 49 52 49 53 2e 0a 58 31 |.c. Tnx |IRIS..X1|
|000007d0| 2f 31 33 2f 39 32 3a 20 | 41 64 64 65 64 20 63 6f |/13/92: |Added co|
|000007e0| 6e 66 69 67 2f 73 79 73 | 76 2e 68 20 74 6f 20 64 |nfig/sys|v.h to d|
|000007f0| 69 73 74 72 69 62 75 74 | 69 6f 6e 2e 20 54 6e 78 |istribut|ion. Tnx|
|00000800| 20 49 52 49 53 2e 0a 58 | 31 2f 31 33 2f 39 32 3a | IRIS..X|1/13/92:|
|00000810| 20 41 64 64 65 64 20 50 | 54 59 4c 49 42 53 2c 20 | Added P|TYLIBS, |
|00000820| 6e 6f 74 65 64 20 69 74 | 73 20 75 73 65 20 69 6e |noted it|s use in|
|00000830| 20 52 45 41 44 4d 45 2e | 20 54 6e 78 20 49 52 49 | README.| Tnx IRI|
|00000840| 53 2e 0a 58 31 2f 31 33 | 2f 39 32 3a 20 52 65 70 |S..X1/13|/92: Rep|
|00000850| 6c 61 63 65 64 20 43 43 | 4f 50 54 4d 5a 20 77 69 |laced CC|OPTMZ wi|
|00000860| 74 68 20 4f 50 54 4d 5a | 2e 0a 58 31 2f 31 33 2f |th OPTMZ|..X1/13/|
|00000870| 39 32 3a 20 4e 6f 74 65 | 64 20 69 6e 20 43 41 4c |92: Note|d in CAL|
|00000880| 4c 53 20 74 68 61 74 20 | 54 54 59 5f 54 45 52 4d |LS that |TTY_TERM|
|00000890| 49 4f 20 73 65 65 6d 73 | 20 74 6f 20 77 6f 72 6b |IO seems| to work|
|000008a0| 2e 20 54 6e 78 20 49 52 | 49 53 2e 0a 58 31 2f 31 |. Tnx IR|IS..X1/1|
|000008b0| 33 2f 39 32 3a 20 41 64 | 61 70 74 65 64 20 74 74 |3/92: Ad|apted tt|
|000008c0| 79 5f 69 6e 69 74 6d 6f | 64 65 73 20 66 6f 72 20 |y_initmo|des for |
|000008d0| 54 54 59 5f 54 45 52 4d | 49 4f 2e 20 55 67 68 2c |TTY_TERM|IO. Ugh,|
|000008e0| 20 75 67 68 2e 20 54 6e | 78 20 49 52 49 53 2e 0a | ugh. Tn|x IRIS..|
|000008f0| 58 31 2f 31 33 2f 39 32 | 3a 20 41 64 61 70 74 65 |X1/13/92|: Adapte|
|00000900| 64 20 74 74 79 5f 6d 75 | 6e 67 65 6d 6f 64 65 73 |d tty_mu|ngemodes|
|00000910| 20 66 6f 72 20 54 54 59 | 5f 54 45 52 4d 49 4f 2e | for TTY|_TERMIO.|
|00000920| 20 55 67 68 2e 20 54 6e | 78 20 49 52 49 53 2e 0a | Ugh. Tn|x IRIS..|
|00000930| 58 31 2f 31 33 2f 39 32 | 3a 20 41 64 61 70 74 65 |X1/13/92|: Adapte|
|00000940| 64 20 74 74 79 5f 6d 6f | 64 69 66 79 6d 6f 64 65 |d tty_mo|difymode|
|00000950| 73 20 66 6f 72 20 54 54 | 59 5f 54 45 52 4d 49 4f |s for TT|Y_TERMIO|
|00000960| 20 28 70 6f 6f 72 6c 79 | 29 2e 20 54 6e 78 20 49 | (poorly|). Tnx I|
|00000970| 52 49 53 2e 0a 58 31 2f | 31 33 2f 39 32 3a 20 41 |RIS..X1/|13/92: A|
|00000980| 64 61 70 74 65 64 20 74 | 74 79 5f 67 65 74 6d 6f |dapted t|ty_getmo|
|00000990| 64 65 73 20 61 6e 64 20 | 74 74 79 5f 73 65 74 6d |des and |tty_setm|
|000009a0| 6f 64 65 73 20 66 6f 72 | 20 54 54 59 5f 54 45 52 |odes for| TTY_TER|
|000009b0| 4d 49 4f 2e 20 54 6e 78 | 20 49 52 49 53 2e 0a 58 |MIO. Tnx| IRIS..X|
|000009c0| 31 2f 31 33 2f 39 32 3a | 20 49 6e 20 70 74 79 74 |1/13/92:| In ptyt|
|000009d0| 74 79 2e 63 20 75 73 65 | 64 20 69 66 64 65 66 73 |ty.c use|d ifdefs|
|000009e0| 20 66 6f 72 20 46 49 4f | 4e 52 45 41 44 20 61 6e | for FIO|NREAD an|
|000009f0| 64 20 54 49 4f 43 45 58 | 43 4c 2e 20 54 6e 78 20 |d TIOCEX|CL. Tnx |
|00000a00| 49 52 49 53 2e 0a 58 31 | 2f 31 33 2f 39 32 3a 20 |IRIS..X1|/13/92: |
|00000a10| 41 64 61 70 74 65 64 20 | 70 74 79 74 74 79 2e 68 |Adapted |ptytty.h|
|00000a20| 20 66 6f 72 20 54 54 59 | 5f 54 45 52 4d 49 4f 2e | for TTY|_TERMIO.|
|00000a30| 20 54 6e 78 20 49 52 49 | 53 2e 0a 58 31 2f 31 33 | Tnx IRI|S..X1/13|
|00000a40| 2f 39 32 3a 20 41 64 64 | 65 64 20 54 54 59 5f 54 |/92: Add|ed TTY_T|
|00000a50| 45 52 4d 49 4f 20 6f 70 | 74 69 6f 6e 20 74 6f 20 |ERMIO op|tion to |
|00000a60| 63 6f 6e 66 69 67 2f 74 | 74 79 6f 70 74 73 2e 68 |config/t|tyopts.h|
|00000a70| 2e 20 54 6e 78 20 49 52 | 49 53 2e 0a 58 31 2f 31 |. Tnx IR|IS..X1/1|
|00000a80| 33 2f 39 32 3a 20 47 61 | 76 65 20 69 6e 20 61 6e |3/92: Ga|ve in an|
|00000a90| 64 20 6d 61 64 65 20 74 | 74 79 5f 63 6f 70 79 6d |d made t|ty_copym|
|00000aa0| 6f 64 65 73 20 64 6f 20 | 61 20 73 74 72 75 63 74 |odes do |a struct|
|00000ab0| 20 63 6f 70 79 2e 0a 58 | 31 2f 31 33 2f 39 32 3a | copy..X|1/13/92:|
|00000ac0| 20 46 69 78 65 64 20 74 | 79 70 6f 20 69 6e 20 53 | Fixed t|ypo in S|
|00000ad0| 45 43 55 52 49 54 59 2e | 20 54 6e 78 20 4b 53 2e |ECURITY.| Tnx KS.|
|00000ae0| 0a 58 31 2f 31 33 2f 39 | 32 3a 20 46 69 78 65 64 |.X1/13/9|2: Fixed|
|00000af0| 20 74 79 70 6f 20 69 6e | 20 70 74 79 2d 62 61 73 | typo in| pty-bas|
|00000b00| 69 63 2e 31 2e 20 54 6e | 78 20 4b 53 2e 0a 58 31 |ic.1. Tn|x KS..X1|
|00000b10| 2f 31 32 2f 39 32 3a 20 | 52 65 70 6c 61 63 65 64 |/12/92: |Replaced|
|00000b20| 20 3c 73 67 74 74 79 2e | 68 3e 20 77 69 74 68 20 | <sgtty.|h> with |
|00000b30| 3c 73 79 73 2f 69 6f 63 | 74 6c 2e 68 3e 20 69 6e |<sys/ioc|tl.h> in|
|00000b40| 20 70 74 79 74 74 79 2e | 68 2e 20 54 6e 78 20 49 | ptytty.|h. Tnx I|
|00000b50| 52 49 53 2e 0a 58 31 2f | 31 32 2f 39 32 3a 20 41 |RIS..X1/|12/92: A|
|00000b60| 64 64 65 64 20 63 68 6d | 6f 64 20 37 30 30 20 66 |dded chm|od 700 f|
|00000b70| 6f 72 20 61 6c 6c 20 73 | 68 65 6c 6c 20 73 63 72 |or all s|hell scr|
|00000b80| 69 70 74 73 20 69 6e 20 | 4d 61 6b 65 66 69 6c 65 |ipts in |Makefile|
|00000b90| 2e 0a 58 31 2f 31 32 2f | 39 32 3a 20 52 65 6d 6f |..X1/12/|92: Remo|
|00000ba0| 76 65 64 20 3c 73 79 73 | 2f 74 69 6d 65 62 2e 68 |ved <sys|/timeb.h|
|00000bb0| 3e 20 66 72 6f 6d 20 77 | 61 6c 6c 2e 63 20 61 6e |> from w|all.c an|
|00000bc0| 64 20 77 72 69 74 65 2e | 63 2e 20 54 6e 78 20 49 |d write.|c. Tnx I|
|00000bd0| 52 49 53 2e 0a 58 31 2f | 31 32 2f 39 32 3a 20 49 |RIS..X1/|12/92: I|
|00000be0| 6e 20 73 65 70 61 72 61 | 74 65 20 65 66 66 6f 72 |n separa|te effor|
|00000bf0| 74 20 67 6f 74 20 69 74 | 20 77 6f 72 6b 69 6e 67 |t got it| working|
|00000c00| 20 6f 6e 20 61 6e 20 49 | 52 49 53 2e 20 53 65 65 | on an I|RIS. See|
|00000c10| 20 61 62 6f 76 65 2e 0a | 58 31 32 2f 32 32 2f 39 | above..|X12/22/9|
|00000c20| 31 3a 20 70 74 79 20 34 | 2e 30 2c 20 66 69 72 73 |1: pty 4|.0, firs|
|00000c30| 74 20 67 61 6d 6d 61 21 | 20 28 53 74 69 6c 6c 20 |t gamma!| (Still |
|00000c40| 68 61 76 65 20 74 6f 20 | 69 6e 74 65 67 72 61 74 |have to |integrat|
|00000c50| 65 20 42 53 44 20 34 2e | 34 20 76 65 72 73 69 6f |e BSD 4.|4 versio|
|00000c60| 6e 2e 29 0a 58 31 32 2f | 32 32 2f 39 31 3a 20 43 |n.).X12/|22/91: C|
|00000c70| 68 61 6e 67 65 64 20 76 | 61 72 69 6f 75 73 20 74 |hanged v|arious t|
|00000c80| 68 69 6e 67 73 20 69 6e | 20 74 68 65 20 64 6f 63 |hings in| the doc|
|00000c90| 75 6d 65 6e 74 61 74 69 | 6f 6e 2e 0a 58 31 32 2f |umentati|on..X12/|
|00000ca0| 32 32 2f 39 31 3a 20 46 | 69 78 65 64 20 65 78 69 |22/91: F|ixed exi|
|00000cb0| 74 20 63 6f 64 65 20 72 | 65 70 6f 72 74 69 6e 67 |t code r|eporting|
|00000cc0| 20 66 6f 72 2c 20 65 2e | 67 2e 2c 20 44 49 45 5f | for, e.|g., DIE_|
|00000cd0| 4e 4f 50 54 59 53 2e 0a | 58 31 32 2f 32 32 2f 39 |NOPTYS..|X12/22/9|
|00000ce0| 31 3a 20 43 68 61 6e 67 | 65 64 20 50 4f 53 49 58 |1: Chang|ed POSIX|
|00000cf0| 20 74 6f 20 50 4f 53 49 | 58 5f 53 49 4c 4c 49 4e | to POSI|X_SILLIN|
|00000d00| 45 53 53 2e 20 53 65 65 | 20 63 6f 6e 66 69 67 2f |ESS. See| config/|
|00000d10| 70 6f 73 69 78 2e 68 2e | 0a 58 31 32 2f 32 30 2f |posix.h.|.X12/20/|
|00000d20| 39 31 3a 20 41 64 64 65 | 64 20 43 43 4f 50 54 4d |91: Adde|d CCOPTM|
|00000d30| 5a 20 69 6e 20 4d 61 6b | 65 66 69 6c 65 20 66 6f |Z in Mak|efile fo|
|00000d40| 72 20 72 61 64 69 78 73 | 6f 72 74 2e 0a 58 31 32 |r radixs|ort..X12|
|00000d50| 2f 31 39 2f 39 31 3a 20 | 41 64 64 65 64 20 42 4c |/19/91: |Added BL|
|00000d60| 55 52 42 2e 0a 58 31 32 | 2f 31 39 2f 39 31 3a 20 |URB..X12|/19/91: |
|00000d70| 41 64 64 65 64 20 54 45 | 53 54 53 2e 0a 58 31 32 |Added TE|STS..X12|
|00000d80| 2f 31 39 2f 39 31 3a 20 | 43 6c 65 61 6e 65 64 20 |/19/91: |Cleaned |
|00000d90| 75 70 20 52 45 41 44 4d | 45 2e 0a 58 31 32 2f 31 |up READM|E..X12/1|
|00000da0| 39 2f 39 31 3a 20 41 64 | 64 65 64 20 57 54 46 2c |9/91: Ad|ded WTF,|
|00000db0| 20 6e 6f 74 65 64 20 53 | 75 6e 4f 53 20 34 2e 30 | noted S|unOS 4.0|
|00000dc0| 2e 33 20 66 6f 72 63 65 | 66 67 20 62 75 67 20 69 |.3 force|fg bug i|
|00000dd0| 6e 20 52 45 41 44 4d 45 | 2e 0a 58 31 32 2f 31 38 |n README|..X12/18|
|00000de0| 2f 39 31 3a 20 46 69 78 | 65 64 20 62 75 67 20 69 |/91: Fix|ed bug i|
|00000df0| 6e 20 73 65 73 73 6d 65 | 6e 75 27 73 20 73 65 73 |n sessme|nu's ses|
|00000e00| 73 6c 69 73 74 20 70 61 | 72 73 69 6e 67 2e 0a 58 |slist pa|rsing..X|
|00000e10| 31 32 2f 31 37 2f 39 31 | 3a 20 46 69 78 65 64 20 |12/17/91|: Fixed |
|00000e20| 75 70 20 64 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e |up docum|entation|
|00000e30| 20 61 20 62 69 74 3b 20 | 72 65 66 65 72 72 65 64 | a bit; |referred|
|00000e40| 20 74 6f 20 63 68 65 63 | 6b 70 74 79 73 20 69 6e | to chec|kptys in|
|00000e50| 20 52 45 41 44 4d 45 2e | 0a 58 31 32 2f 31 36 2f | README.|.X12/16/|
|00000e60| 39 31 3a 20 41 64 64 65 | 64 20 43 50 50 20 64 65 |91: Adde|d CPP de|
|00000e70| 66 69 6e 65 20 74 6f 20 | 4d 61 6b 65 66 69 6c 65 |fine to |Makefile|
|00000e80| 2e 0a 58 31 32 2f 31 35 | 2f 39 31 3a 20 41 64 64 |..X12/15|/91: Add|
|00000e90| 65 64 20 2d 78 69 2e 0a | 58 31 32 2f 31 35 2f 39 |ed -xi..|X12/15/9|
|00000ea0| 31 3a 20 53 74 61 72 74 | 65 64 20 6d 61 63 68 69 |1: Start|ed machi|
|00000eb0| 6e 65 20 6c 69 73 74 20 | 69 6e 20 4d 61 6b 65 66 |ne list |in Makef|
|00000ec0| 69 6c 65 2e 0a 58 31 32 | 2f 31 35 2f 39 31 3a 20 |ile..X12|/15/91: |
|00000ed0| 41 64 64 65 64 20 45 57 | 4f 55 4c 44 42 4c 4f 43 |Added EW|OULDBLOC|
|00000ee0| 4b 20 69 6e 20 70 74 79 | 73 65 63 75 72 65 2e 63 |K in pty|secure.c|
|00000ef0| 20 66 6f 72 20 44 6f 6d | 61 69 6e 2f 4f 53 2e 0a | for Dom|ain/OS..|
|00000f00| 58 31 32 2f 31 34 2f 39 | 31 3a 20 41 64 64 65 64 |X12/14/9|1: Added|
|00000f10| 20 74 61 72 67 65 74 2d | 6c 69 73 74 20 74 61 72 | target-|list tar|
|00000f20| 67 65 74 2e 0a 58 31 32 | 2f 31 34 2f 39 31 3a 20 |get..X12|/14/91: |
|00000f30| 41 64 64 65 64 20 6c 69 | 6e 74 20 74 61 72 67 65 |Added li|nt targe|
|00000f40| 74 2e 0a 58 31 32 2f 31 | 33 2f 39 31 3a 20 43 68 |t..X12/1|3/91: Ch|
|00000f50| 61 6e 67 65 64 20 6d 61 | 73 74 65 72 20 73 6f 20 |anged ma|ster so |
|00000f60| 74 68 61 74 20 69 74 20 | 63 6f 6e 74 69 6e 75 65 |that it |continue|
|00000f70| 73 20 63 68 69 6c 64 20 | 6f 6e 20 61 6e 79 20 72 |s child |on any r|
|00000f80| 65 63 6f 6e 6e 65 63 74 | 2e 20 54 6e 78 20 53 53 |econnect|. Tnx SS|
|00000f90| 2e 0a 58 31 31 2f 32 34 | 2f 39 31 3a 20 43 68 61 |..X11/24|/91: Cha|
|00000fa0| 6e 67 65 64 20 6d 61 73 | 74 65 72 20 74 6f 20 72 |nged mas|ter to r|
|00000fb0| 75 6e 20 6f 6e 6c 79 20 | 61 73 20 65 66 66 65 63 |un only |as effec|
|00000fc0| 74 69 76 65 20 75 69 64 | 2e 0a 58 31 31 2f 31 38 |tive uid|..X11/18|
|00000fd0| 2f 39 31 3a 20 41 64 64 | 65 64 20 54 45 52 4d 2c |/91: Add|ed TERM,|
|00000fe0| 20 55 53 52 31 2c 20 55 | 53 52 32 20 69 67 6e 6f | USR1, U|SR2 igno|
|00000ff0| 72 69 6e 67 20 74 6f 20 | 6d 61 73 74 65 72 2e 20 |ring to |master. |
|00001000| 54 6e 78 20 53 53 2e 0a | 58 31 31 2f 39 2f 39 31 |Tnx SS..|X11/9/91|
|00001010| 3a 20 41 64 64 65 64 20 | 5c 66 50 20 69 6e 20 73 |: Added |\fP in s|
|00001020| 79 6e 74 61 78 20 73 65 | 63 74 69 6f 6e 73 20 69 |yntax se|ctions i|
|00001030| 6e 20 70 74 79 2d 6f 70 | 74 73 2e 31 2c 20 70 74 |n pty-op|ts.1, pt|
|00001040| 79 2e 31 2e 20 54 6e 78 | 20 53 53 2e 0a 58 31 31 |y.1. Tnx| SS..X11|
|00001050| 2f 39 2f 39 31 3a 20 41 | 64 64 65 64 20 3c 73 79 |/9/91: A|dded <sy|
|00001060| 73 2f 74 79 70 65 73 2e | 68 3e 20 62 65 66 6f 72 |s/types.|h> befor|
|00001070| 65 20 3c 75 74 6d 70 2e | 68 3e 20 69 6e 20 7b 75 |e <utmp.|h> in {u|
|00001080| 73 65 72 73 2c 77 68 6f | 7d 2e 63 2e 20 44 6f 6d |sers,who|}.c. Dom|
|00001090| 61 69 6e 2f 4f 53 20 69 | 64 69 6f 63 79 2e 0a 58 |ain/OS i|diocy..X|
|000010a0| 31 31 2f 39 2f 39 31 3a | 20 46 69 78 65 64 20 64 |11/9/91:| Fixed d|
|000010b0| 65 70 65 6e 64 65 6e 63 | 69 65 73 20 66 6f 72 20 |ependenc|ies for |
|000010c0| 43 48 45 43 4b 43 4f 4e | 46 20 61 6e 64 20 49 4e |CHECKCON|F and IN|
|000010d0| 53 54 41 4c 4c 2e 0a 58 | 31 31 2f 33 2f 39 31 3a |STALL..X|11/3/91:|
|000010e0| 20 41 64 64 65 64 20 70 | 72 6f 70 65 72 20 2e 68 | Added p|roper .h|
|000010f0| 20 64 65 70 65 6e 64 65 | 6e 63 69 65 73 20 69 6e | depende|ncies in|
|00001100| 20 4d 61 6b 65 66 69 6c | 65 20 28 66 69 6e 61 6c | Makefil|e (final|
|00001110| 6c 79 29 2e 0a 58 31 30 | 2f 32 37 2f 39 31 3a 20 |ly)..X10|/27/91: |
|00001120| 41 64 64 65 64 20 65 78 | 69 74 28 30 29 20 61 74 |Added ex|it(0) at|
|00001130| 20 65 6e 64 20 6f 66 20 | 73 65 73 73 6c 69 73 74 | end of |sesslist|
|00001140| 2e 63 2e 20 54 6e 78 20 | 53 53 2e 0a 58 31 30 2f |.c. Tnx |SS..X10/|
|00001150| 32 37 2f 39 31 3a 20 46 | 69 78 65 64 20 70 74 79 |27/91: F|ixed pty|
|00001160| 73 65 63 75 72 65 2e 63 | 2d 2d 2d 69 74 20 64 69 |secure.c|---it di|
|00001170| 64 6e 27 74 20 75 6e 64 | 6f 20 63 68 6d 6f 64 20 |dn't und|o chmod |
|00001180| 66 6f 72 20 73 6f 6d 65 | 20 73 65 74 75 70 73 2e |for some| setups.|
|00001190| 20 54 6e 78 20 53 53 2e | 0a 58 31 30 2f 32 37 2f | Tnx SS.|.X10/27/|
|000011a0| 39 31 3a 20 41 64 64 65 | 64 20 6d 61 6b 65 20 63 |91: Adde|d make c|
|000011b0| 6c 65 61 6e 2e 20 54 6e | 78 20 53 53 2e 0a 58 31 |lean. Tn|x SS..X1|
|000011c0| 30 2f 32 37 2f 39 31 3a | 20 41 64 64 65 64 20 63 |0/27/91:| Added c|
|000011d0| 68 65 63 6b 70 74 79 73 | 2e 38 2e 0a 58 31 30 2f |heckptys|.8..X10/|
|000011e0| 32 37 2f 39 31 3a 20 43 | 68 61 6e 67 65 64 20 63 |27/91: C|hanged c|
|000011f0| 68 65 63 6b 70 74 79 73 | 20 74 6f 20 62 65 20 69 |heckptys| to be i|
|00001200| 6e 73 74 61 6c 6c 65 64 | 20 6e 6f 6e 2d 73 65 74 |nstalled| non-set|
|00001210| 75 69 64 2e 0a 58 31 30 | 2f 32 36 2f 39 31 3a 20 |uid..X10|/26/91: |
|00001220| 41 64 64 65 64 20 70 74 | 79 2e 31 2c 20 70 74 79 |Added pt|y.1, pty|
|00001230| 2d 62 61 73 69 63 2e 31 | 2c 20 70 74 79 2d 6f 70 |-basic.1|, pty-op|
|00001240| 74 73 2e 31 2c 20 73 65 | 73 73 2e 31 2c 20 63 6f |ts.1, se|ss.1, co|
|00001250| 6e 64 6f 6d 2e 31 2e 0a | 58 31 30 2f 32 36 2f 39 |ndom.1..|X10/26/9|
|00001260| 31 3a 20 54 6f 73 73 65 | 64 20 6f 6c 64 20 6d 61 |1: Tosse|d old ma|
|00001270| 6e 20 70 61 67 65 73 2e | 0a 58 31 30 2f 32 36 2f |n pages.|.X10/26/|
|00001280| 39 31 3a 20 41 64 64 65 | 64 20 44 49 45 5f 45 58 |91: Adde|d DIE_EX|
|00001290| 49 53 54 20 66 6f 72 20 | 70 74 79 73 69 67 6c 65 |IST for |ptysigle|
|000012a0| 72 2e 63 2e 0a 58 31 30 | 2f 32 36 2f 39 31 3a 20 |r.c..X10|/26/91: |
|000012b0| 41 64 64 65 64 20 44 49 | 45 5f 45 4c 53 45 20 66 |Added DI|E_ELSE f|
|000012c0| 6f 72 20 70 74 79 73 69 | 67 6c 65 72 2e 63 2e 0a |or ptysi|gler.c..|
|000012d0| 58 31 30 2f 32 36 2f 39 | 31 3a 20 46 69 78 65 64 |X10/26/9|1: Fixed|
|000012e0| 20 70 74 79 6d 61 69 6e | 20 74 6f 20 64 69 65 28 | ptymain| to die(|
|000012f0| 53 45 54 4d 4f 44 45 53 | 29 20 69 6e 20 61 6e 20 |SETMODES|) in an |
|00001300| 69 6d 70 6f 73 73 69 62 | 6c 65 20 73 69 74 75 61 |impossib|le situa|
|00001310| 74 69 6f 6e 2e 0a 58 31 | 30 2f 32 36 2f 39 31 3a |tion..X1|0/26/91:|
|00001320| 20 43 68 61 6e 67 65 64 | 20 61 20 66 65 77 20 64 | Changed| a few d|
|00001330| 69 65 28 29 20 76 61 6c | 75 65 73 20 69 6e 20 70 |ie() val|ues in p|
|00001340| 74 79 6d 61 69 6e 2e 63 | 2e 0a 58 31 30 2f 32 35 |tymain.c|..X10/25|
|00001350| 2f 39 31 3a 20 4e 65 65 | 64 20 74 6f 20 61 64 64 |/91: Nee|d to add|
|00001360| 20 2a 2e 68 20 74 6f 20 | 4d 61 6b 65 66 69 6c 65 | *.h to |Makefile|
|00001370| 2e 2e 2e 0a 58 31 30 2f | 32 35 2f 39 31 3a 20 52 |....X10/|25/91: R|
|00001380| 65 6d 6f 76 65 64 20 6c | 61 73 74 20 74 72 61 63 |emoved l|ast trac|
|00001390| 65 73 20 6f 66 20 6f 6c | 64 20 67 65 74 6f 70 74 |es of ol|d getopt|
|000013a0| 20 73 63 68 69 7a 6f 70 | 68 72 65 6e 69 61 2e 0a | schizop|hrenia..|
|000013b0| 58 31 30 2f 32 35 2f 39 | 31 3a 20 43 68 61 6e 67 |X10/25/9|1: Chang|
|000013c0| 65 64 20 2a 72 6f 74 61 | 74 65 20 74 6f 20 70 72 |ed *rota|te to pr|
|000013d0| 65 73 65 72 76 65 20 6d | 6f 64 65 73 20 6f 66 20 |eserve m|odes of |
|000013e0| 6c 6f 67 20 66 69 6c 65 | 73 2e 0a 58 31 30 2f 32 |log file|s..X10/2|
|000013f0| 35 2f 39 31 3a 20 41 64 | 64 65 64 20 73 65 73 73 |5/91: Ad|ded sess|
|00001400| 6e 6f 77 69 6e 69 74 2c | 20 73 63 6e 6f 77 69 6e |nowinit,| scnowin|
|00001410| 69 74 2e 0a 58 31 30 2f | 32 35 2f 39 31 3a 20 41 |it..X10/|25/91: A|
|00001420| 64 64 65 64 20 73 65 73 | 73 72 6f 74 61 74 65 2c |dded ses|srotate,|
|00001430| 20 73 63 6c 6f 67 72 6f | 74 61 74 65 2e 0a 58 31 | sclogro|tate..X1|
|00001440| 30 2f 32 35 2f 39 31 3a | 20 46 69 78 65 64 20 6f |0/25/91:| Fixed o|
|00001450| 66 66 2d 62 79 2d 6f 6e | 65 20 6f 6e 20 72 65 6d |ff-by-on|e on rem|
|00001460| 6f 74 65 6c 65 6e 2e 0a | 58 31 30 2f 32 35 2f 39 |otelen..|X10/25/9|
|00001470| 31 3a 20 43 68 61 6e 67 | 65 64 20 77 74 6d 70 72 |1: Chang|ed wtmpr|
|00001480| 6f 74 61 74 65 20 74 6f | 20 64 65 70 65 6e 64 20 |otate to| depend |
|00001490| 6f 6e 20 63 6f 6e 66 69 | 67 2f 77 74 6d 70 66 69 |on confi|g/wtmpfi|
|000014a0| 6c 65 2e 68 20 70 72 6f | 70 65 72 6c 79 2e 0a 58 |le.h pro|perly..X|
|000014b0| 5b 6c 6f 67 20 69 73 20 | 6e 6f 74 20 63 6f 6d 70 |[log is |not comp|
|000014c0| 6c 65 74 65 20 62 65 66 | 6f 72 65 20 74 68 69 73 |lete bef|ore this|
|000014d0| 20 70 6f 69 6e 74 5d 0a | 58 31 30 2f 36 2f 39 31 | point].|X10/6/91|
|000014e0| 3a 20 41 64 64 65 64 20 | 2d 78 73 53 2e 0a 58 39 |: Added |-xsS..X9|
|000014f0| 2f 33 30 2f 39 31 3a 20 | 70 74 79 20 34 2e 30 2c |/30/91: |pty 4.0,|
|00001500| 20 73 65 63 6f 6e 64 20 | 62 65 74 61 2e 0a 45 4e | second |beta..EN|
|00001510| 44 5f 4f 46 5f 46 49 4c | 45 0a 69 66 20 74 65 73 |D_OF_FIL|E.if tes|
|00001520| 74 20 33 38 38 33 20 2d | 6e 65 20 60 77 63 20 2d |t 3883 -|ne `wc -|
|00001530| 63 20 3c 27 43 48 41 4e | 47 45 53 27 60 3b 20 74 |c <'CHAN|GES'`; t|
|00001540| 68 65 6e 0a 20 20 20 20 | 65 63 68 6f 20 73 68 61 |hen. |echo sha|
|00001550| 72 3a 20 5c 22 27 43 48 | 41 4e 47 45 53 27 5c 22 |r: \"'CH|ANGES'\"|
|00001560| 20 75 6e 70 61 63 6b 65 | 64 20 77 69 74 68 20 77 | unpacke|d with w|
|00001570| 72 6f 6e 67 20 73 69 7a | 65 21 0a 66 69 0a 23 20 |rong siz|e!.fi.# |
|00001580| 65 6e 64 20 6f 66 20 27 | 43 48 41 4e 47 45 53 27 |end of '|CHANGES'|
|00001590| 0a 66 69 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |.fi.if t|est -f '|
|000015a0| 43 48 45 43 4b 43 4f 4e | 46 2e 63 27 20 2d 61 20 |CHECKCON|F.c' -a |
|000015b0| 22 24 7b 31 7d 22 20 21 | 3d 20 22 2d 63 22 20 3b |"${1}" !|= "-c" ;|
|000015c0| 20 74 68 65 6e 20 0a 20 | 20 65 63 68 6f 20 73 68 | then . | echo sh|
|000015d0| 61 72 3a 20 57 69 6c 6c | 20 6e 6f 74 20 63 6c 6f |ar: Will| not clo|
|000015e0| 62 62 65 72 20 65 78 69 | 73 74 69 6e 67 20 66 69 |bber exi|sting fi|
|000015f0| 6c 65 20 5c 22 27 43 48 | 45 43 4b 43 4f 4e 46 2e |le \"'CH|ECKCONF.|
|00001600| 63 27 5c 22 0a 65 6c 73 | 65 0a 65 63 68 6f 20 73 |c'\".els|e.echo s|
|00001610| 68 61 72 3a 20 45 78 74 | 72 61 63 74 69 6e 67 20 |har: Ext|racting |
|00001620| 5c 22 27 43 48 45 43 4b | 43 4f 4e 46 2e 63 27 5c |\"'CHECK|CONF.c'\|
|00001630| 22 20 5c 28 32 37 32 34 | 20 63 68 61 72 61 63 74 |" \(2724| charact|
|00001640| 65 72 73 5c 29 0a 73 65 | 64 20 22 73 2f 5e 58 2f |ers\).se|d "s/^X/|
|00001650| 2f 22 20 3e 27 43 48 45 | 43 4b 43 4f 4e 46 2e 63 |/" >'CHE|CKCONF.c|
|00001660| 27 20 3c 3c 27 45 4e 44 | 5f 4f 46 5f 46 49 4c 45 |' <<'END|_OF_FILE|
|00001670| 27 0a 58 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |'.X#incl|ude <std|
|00001680| 69 6f 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |io.h>.X#|include |
|00001690| 3c 73 79 73 2f 74 79 70 | 65 73 2e 68 3e 0a 58 23 |<sys/typ|es.h>.X#|
|000016a0| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 74 69 6d |include |<sys/tim|
|000016b0| 65 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |e.h>.X#i|nclude <|
|000016c0| 73 79 73 2f 73 74 61 74 | 2e 68 3e 0a 58 23 69 6e |sys/stat|.h>.X#in|
|000016d0| 63 6c 75 64 65 20 3c 73 | 79 73 2f 66 69 6c 65 2e |clude <s|ys/file.|
|000016e0| 68 3e 0a 58 23 69 6e 63 | 6c 75 64 65 20 22 63 6f |h>.X#inc|lude "co|
|000016f0| 6e 66 69 67 2f 66 64 73 | 65 74 74 72 6f 75 62 6c |nfig/fds|ettroubl|
|00001700| 65 2e 68 22 0a 58 23 69 | 6e 63 6c 75 64 65 20 22 |e.h".X#i|nclude "|
|00001710| 63 6f 6e 66 69 67 2f 67 | 65 6e 65 72 69 63 70 74 |config/g|enericpt|
|00001720| 72 2e 68 22 0a 58 23 69 | 6e 63 6c 75 64 65 20 22 |r.h".X#i|nclude "|
|00001730| 63 6f 6e 66 69 67 2f 64 | 65 76 6d 74 79 2e 68 22 |config/d|evmty.h"|
|00001740| 0a 58 23 69 6e 63 6c 75 | 64 65 20 22 63 6f 6e 66 |.X#inclu|de "conf|
|00001750| 69 67 2f 64 65 76 73 74 | 79 2e 68 22 0a 58 23 69 |ig/devst|y.h".X#i|
|00001760| 6e 63 6c 75 64 65 20 22 | 63 6f 6e 66 69 67 2f 70 |nclude "|config/p|
|00001770| 6f 73 69 78 2e 68 22 0a | 58 23 69 6e 63 6c 75 64 |osix.h".|X#includ|
|00001780| 65 20 22 63 6f 6e 66 69 | 67 2f 70 74 79 62 69 6e |e "confi|g/ptybin|
|00001790| 2e 68 22 0a 58 23 69 6e | 63 6c 75 64 65 20 22 63 |.h".X#in|clude "c|
|000017a0| 6f 6e 66 69 67 2f 70 74 | 79 64 69 72 2e 68 22 0a |onfig/pt|ydir.h".|
|000017b0| 58 23 69 6e 63 6c 75 64 | 65 20 22 63 6f 6e 66 69 |X#includ|e "confi|
|000017c0| 67 2f 70 74 79 65 78 74 | 2e 68 22 0a 58 23 69 6e |g/ptyext|.h".X#in|
|000017d0| 63 6c 75 64 65 20 22 63 | 6f 6e 66 69 67 2f 70 74 |clude "c|onfig/pt|
|000017e0| 79 67 72 6f 75 70 2e 68 | 22 0a 58 23 69 6e 63 6c |ygroup.h|".X#incl|
|000017f0| 75 64 65 20 22 63 6f 6e | 66 69 67 2f 70 74 79 6c |ude "con|fig/ptyl|
|00001800| 6f 6e 67 6e 61 6d 65 2e | 68 22 0a 58 23 69 6e 63 |ongname.|h".X#inc|
|00001810| 6c 75 64 65 20 22 63 6f | 6e 66 69 67 2f 70 74 79 |lude "co|nfig/pty|
|00001820| 6d 6f 64 65 73 2e 68 22 | 0a 58 23 69 6e 63 6c 75 |modes.h"|.X#inclu|
|00001830| 64 65 20 22 63 6f 6e 66 | 69 67 2f 70 74 79 6f 70 |de "conf|ig/ptyop|
|00001840| 74 73 2e 68 22 0a 58 23 | 69 6e 63 6c 75 64 65 20 |ts.h".X#|include |
|00001850| 22 63 6f 6e 66 69 67 2f | 74 74 79 6f 70 74 73 2e |"config/|ttyopts.|
|00001860| 68 22 0a 58 23 69 6e 63 | 6c 75 64 65 20 22 63 6f |h".X#inc|lude "co|
|00001870| 6e 66 69 67 2f 73 65 73 | 73 63 6f 6e 6e 66 69 6c |nfig/ses|sconnfil|
|00001880| 65 2e 68 22 0a 58 23 69 | 6e 63 6c 75 64 65 20 22 |e.h".X#i|nclude "|
|00001890| 63 6f 6e 66 69 67 2f 73 | 65 73 73 66 69 6c 65 2e |config/s|essfile.|
|000018a0| 68 22 0a 58 23 69 6e 63 | 6c 75 64 65 20 3c 75 74 |h".X#inc|lude <ut|
|000018b0| 6d 70 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |mp.h>.X#|include |
|000018c0| 22 63 6f 6e 66 69 67 2f | 75 74 6d 70 66 69 6c 65 |"config/|utmpfile|
|000018d0| 2e 68 22 0a 58 23 69 6e | 63 6c 75 64 65 20 22 63 |.h".X#in|clude "c|
|000018e0| 6f 6e 66 69 67 2f 77 74 | 6d 70 66 69 6c 65 2e 68 |onfig/wt|mpfile.h|
|000018f0| 22 0a 58 23 69 6e 63 6c | 75 64 65 20 3c 67 72 70 |".X#incl|ude <grp|
|00001900| 2e 68 3e 0a 58 0a 6d 61 | 69 6e 28 29 0a 58 7b 0a |.h>.X.ma|in().X{.|
|00001910| 58 20 69 6e 74 20 6e 6f | 74 68 69 6e 67 3b 0a 58 |X int no|thing;.X|
|00001920| 20 73 74 72 75 63 74 20 | 67 72 6f 75 70 20 2a 67 | struct |group *g|
|00001930| 72 70 3b 0a 58 20 70 72 | 69 6e 74 66 28 22 43 68 |rp;.X pr|intf("Ch|
|00001940| 65 63 6b 20 74 68 72 6f | 75 67 68 20 74 68 69 73 |eck thro|ugh this|
|00001950| 20 6c 69 73 74 20 63 61 | 72 65 66 75 6c 6c 79 2e | list ca|refully.|
|00001960| 5c 6e 22 29 3b 0a 58 20 | 70 72 69 6e 74 66 28 22 |\n");.X |printf("|
|00001970| 6d 61 73 74 65 72 20 74 | 74 79 20 65 78 74 65 6e |master t|ty exten|
|00001980| 73 69 6f 6e 3a 20 25 73 | 5c 6e 22 2c 44 45 56 4d |sion: %s|\n",DEVM|
|00001990| 54 59 29 3b 0a 58 20 70 | 72 69 6e 74 66 28 22 73 |TY);.X p|rintf("s|
|000019a0| 6c 61 76 65 20 74 74 79 | 20 65 78 74 65 6e 73 69 |lave tty| extensi|
|000019b0| 6f 6e 3a 20 25 73 5c 6e | 22 2c 44 45 56 53 54 59 |on: %s\n|",DEVSTY|
|000019c0| 29 3b 0a 58 20 70 72 69 | 6e 74 66 28 22 70 74 79 |);.X pri|ntf("pty|
|000019d0| 20 6e 61 6d 65 73 3a 20 | 25 73 5b 25 73 5d 5b 25 | names: |%s[%s][%|
|000019e0| 73 5d 5c 6e 22 2c 44 45 | 56 4d 54 59 2c 50 54 59 |s]\n",DE|VMTY,PTY|
|000019f0| 45 58 54 31 2c 50 54 59 | 45 58 54 32 29 3b 0a 58 |EXT1,PTY|EXT2);.X|
|00001a00| 20 70 72 69 6e 74 66 28 | 22 70 74 79 20 62 69 6e | printf(|"pty bin|
|00001a10| 61 72 79 20 64 69 72 65 | 63 74 6f 72 79 3a 20 25 |ary dire|ctory: %|
|00001a20| 73 5c 6e 22 2c 50 54 59 | 42 49 4e 29 3b 0a 58 20 |s\n",PTY|BIN);.X |
|00001a30| 70 72 69 6e 74 66 28 22 | 70 74 79 20 73 65 73 73 |printf("|pty sess|
|00001a40| 69 6f 6e 20 64 69 72 65 | 63 74 6f 72 79 3a 20 25 |ion dire|ctory: %|
|00001a50| 73 5c 6e 22 2c 50 54 59 | 44 49 52 29 3b 0a 58 20 |s\n",PTY|DIR);.X |
|00001a60| 70 72 69 6e 74 66 28 22 | 75 74 6d 70 20 66 69 6c |printf("|utmp fil|
|00001a70| 65 3a 20 25 73 20 20 77 | 74 6d 70 20 66 69 6c 65 |e: %s w|tmp file|
|00001a80| 3a 20 25 73 5c 6e 22 2c | 55 54 4d 50 5f 46 49 4c |: %s\n",|UTMP_FIL|
|00001a90| 45 2c 57 54 4d 50 5f 46 | 49 4c 45 29 3b 0a 58 20 |E,WTMP_F|ILE);.X |
|00001aa0| 70 72 69 6e 74 66 28 22 | 73 65 73 73 69 6f 6e 2d |printf("|session-|
|00001ab0| 63 6f 6e 6e 65 63 74 69 | 6f 6e 20 6e 6f 77 3a 20 |connecti|on now: |
|00001ac0| 25 73 20 20 6c 6f 67 3a | 20 25 73 5c 6e 22 2c 53 |%s log:| %s\n",S|
|00001ad0| 45 53 53 43 4f 4e 4e 4e | 4f 57 5f 46 49 4c 45 2c |ESSCONNN|OW_FILE,|
|00001ae0| 53 45 53 53 43 4f 4e 4e | 4c 4f 47 5f 46 49 4c 45 |SESSCONN|LOG_FILE|
|00001af0| 29 3b 0a 58 20 70 72 69 | 6e 74 66 28 22 73 65 73 |);.X pri|ntf("ses|
|00001b00| 73 69 6f 6e 20 6e 6f 77 | 3a 20 25 73 20 20 6c 6f |sion now|: %s lo|
|00001b10| 67 3a 20 25 73 5c 6e 22 | 2c 53 45 53 53 4e 4f 57 |g: %s\n"|,SESSNOW|
|00001b20| 5f 46 49 4c 45 2c 53 45 | 53 53 4c 4f 47 5f 46 49 |_FILE,SE|SSLOG_FI|
|00001b30| 4c 45 29 3b 0a 58 23 69 | 66 64 65 66 20 44 45 53 |LE);.X#i|fdef DES|
|00001b40| 50 45 52 41 54 45 5f 46 | 44 5f 53 45 54 0a 58 20 |PERATE_F|D_SET.X |
|00001b50| 70 72 69 6e 74 66 28 22 | 44 45 53 50 45 52 41 54 |printf("|DESPERAT|
|00001b60| 45 5f 46 44 5f 53 45 54 | 20 74 75 72 6e 65 64 20 |E_FD_SET| turned |
|00001b70| 6f 6e 2e 5c 6e 22 29 3b | 0a 58 23 65 6c 73 65 0a |on.\n");|.X#else.|
|00001b80| 58 23 69 66 64 65 66 20 | 4c 41 43 4b 49 4e 47 5f |X#ifdef |LACKING_|
|00001b90| 46 44 5f 5a 45 52 4f 0a | 58 20 70 72 69 6e 74 66 |FD_ZERO.|X printf|
|00001ba0| 28 22 4c 41 43 4b 49 4e | 47 5f 46 44 5f 5a 45 52 |("LACKIN|G_FD_ZER|
|00001bb0| 4f 20 74 75 72 6e 65 64 | 20 6f 6e 2e 5c 6e 22 29 |O turned| on.\n")|
|00001bc0| 3b 0a 58 23 65 6c 73 65 | 0a 58 20 70 72 69 6e 74 |;.X#else|.X print|
|00001bd0| 66 28 22 53 79 73 74 65 | 6d 20 6d 75 73 74 20 68 |f("Syste|m must h|
|00001be0| 61 76 65 20 6e 6f 72 6d | 61 6c 20 66 64 5f 73 65 |ave norm|al fd_se|
|00001bf0| 74 20 61 6e 64 20 46 44 | 5f 5a 45 52 4f 20 73 75 |t and FD|_ZERO su|
|00001c00| 70 70 6f 72 74 2e 5c 6e | 22 29 3b 0a 58 23 65 6e |pport.\n|");.X#en|
|00001c10| 64 69 66 0a 58 23 65 6e | 64 69 66 0a 58 20 2f 2a |dif.X#en|dif.X /*|
|00001c20| 20 58 58 58 3a 20 47 45 | 4e 45 52 49 43 50 54 52 | XXX: GE|NERICPTR|
|00001c30| 3f 20 2a 2f 0a 58 23 69 | 66 64 65 66 20 50 4f 53 |? */.X#i|fdef POS|
|00001c40| 49 58 5f 53 49 4c 4c 49 | 4e 45 53 53 0a 58 20 70 |IX_SILLI|NESS.X p|
|00001c50| 72 69 6e 74 66 28 22 50 | 4f 53 49 58 20 74 75 72 |rintf("P|OSIX tur|
|00001c60| 6e 65 64 20 6f 6e 2e 20 | 53 79 73 74 65 6d 20 6d |ned on. |System m|
|00001c70| 75 73 74 20 68 61 76 65 | 20 73 65 74 73 69 64 28 |ust have| setsid(|
|00001c80| 29 2e 5c 6e 22 29 3b 0a | 58 23 65 6c 73 65 0a 58 |).\n");.|X#else.X|
|00001c90| 20 70 72 69 6e 74 66 28 | 22 50 4f 53 49 58 20 74 | printf(|"POSIX t|
|00001ca0| 75 72 6e 65 64 20 6f 66 | 66 2e 20 53 79 73 74 65 |urned of|f. Syste|
|00001cb0| 6d 20 73 68 6f 75 6c 64 | 20 6e 6f 74 20 68 61 76 |m should| not hav|
|00001cc0| 65 20 73 65 74 73 69 64 | 28 29 2e 5c 6e 22 29 3b |e setsid|().\n");|
|00001cd0| 0a 58 23 65 6e 64 69 66 | 0a 58 20 70 72 69 6e 74 |.X#endif|.X print|
|00001ce0| 66 28 22 70 74 79 20 67 | 72 6f 75 70 3a 20 25 64 |f("pty g|roup: %d|
|00001cf0| 2e 20 22 2c 50 54 59 47 | 52 4f 55 50 29 3b 0a 58 |. ",PTYG|ROUP);.X|
|00001d00| 20 67 72 70 20 3d 20 67 | 65 74 67 72 6e 61 6d 28 | grp = g|etgrnam(|
|00001d10| 22 74 74 79 22 29 3b 0a | 58 20 69 66 20 28 21 67 |"tty");.|X if (!g|
|00001d20| 72 70 29 0a 58 20 20 20 | 70 72 69 6e 74 66 28 22 |rp).X |printf("|
|00001d30| 5c 6e 41 61 63 6b 21 20 | 59 6f 75 20 73 68 6f 75 |\nAack! |You shou|
|00001d40| 6c 64 20 61 64 64 20 61 | 20 74 74 79 20 67 72 6f |ld add a| tty gro|
|00001d50| 75 70 2c 20 67 72 6f 75 | 70 20 25 64 2c 20 74 6f |up, grou|p %d, to|
|00001d60| 20 2f 65 74 63 2f 67 72 | 6f 75 70 2e 5c 6e 22 2c | /etc/gr|oup.\n",|
|00001d70| 50 54 59 47 52 4f 55 50 | 29 3b 0a 58 20 65 6c 73 |PTYGROUP|);.X els|
|00001d80| 65 0a 58 20 20 20 69 66 | 20 28 67 72 70 2d 3e 67 |e.X if| (grp->g|
|00001d90| 72 5f 67 69 64 20 3d 3d | 20 50 54 59 47 52 4f 55 |r_gid ==| PTYGROU|
|00001da0| 50 29 0a 58 20 20 20 20 | 20 70 72 69 6e 74 66 28 |P).X | printf(|
|00001db0| 22 4f 6b 61 79 2c 20 74 | 68 69 73 20 6d 61 74 63 |"Okay, t|his matc|
|00001dc0| 68 65 73 20 74 68 65 20 | 74 74 79 20 65 6e 74 72 |hes the |tty entr|
|00001dd0| 79 20 69 6e 20 2f 65 74 | 63 2f 67 72 6f 75 70 2e |y in /et|c/group.|
|00001de0| 5c 6e 22 29 3b 0a 58 20 | 20 20 65 6c 73 65 0a 58 |\n");.X | else.X|
|00001df0| 20 20 20 20 20 70 72 69 | 6e 74 66 28 22 5c 6e 41 | pri|ntf("\nA|
|00001e00| 61 63 6b 21 20 54 68 69 | 73 20 64 6f 65 73 6e 27 |ack! Thi|s doesn'|
|00001e10| 74 20 6d 61 74 63 68 20 | 74 68 65 20 74 74 79 20 |t match |the tty |
|00001e20| 67 72 6f 75 70 20 65 6e | 74 72 79 20 28 25 64 29 |group en|try (%d)|
|00001e30| 20 69 6e 20 2f 65 74 63 | 2f 67 72 6f 75 70 2e 5c | in /etc|/group.\|
|00001e40| 6e 59 6f 75 20 73 68 6f | 75 6c 64 20 70 72 6f 62 |nYou sho|uld prob|
|00001e50| 61 62 6c 79 20 65 64 69 | 74 20 63 6f 6e 66 69 67 |ably edi|t config|
|00001e60| 2f 70 74 79 67 72 6f 75 | 70 2e 68 2e 5c 6e 22 2c |/ptygrou|p.h.\n",|
|00001e70| 67 72 70 2d 3e 67 72 5f | 67 69 64 29 3b 0a 58 20 |grp->gr_|gid);.X |
|00001e80| 70 72 69 6e 74 66 28 22 | 73 65 73 73 69 6f 6e 20 |printf("|session |
|00001e90| 6c 6f 6e 67 20 6e 61 6d | 65 20 6c 65 6e 67 74 68 |long nam|e length|
|00001ea0| 3a 20 25 64 5c 6e 22 2c | 50 54 59 4c 4f 4e 47 4e |: %d\n",|PTYLONGN|
|00001eb0| 41 4d 45 4c 45 4e 29 3b | 0a 58 20 70 72 69 6e 74 |AMELEN);|.X print|
|00001ec0| 66 28 22 70 74 79 20 6d | 6f 64 65 73 3a 20 25 6f |f("pty m|odes: %o|
|00001ed0| 20 75 73 65 64 20 25 6f | 20 75 6e 75 73 65 64 5c | used %o| unused\|
|00001ee0| 6e 22 2c 50 54 59 4d 4f | 44 45 5f 55 53 45 44 2c |n",PTYMO|DE_USED,|
|00001ef0| 50 54 59 4d 4f 44 45 5f | 55 4e 55 53 45 44 29 3b |PTYMODE_|UNUSED);|
|00001f00| 0a 58 20 70 72 69 6e 74 | 66 28 22 4d 55 53 54 4e |.X print|f("MUSTN|
|00001f10| 4f 54 3a 20 22 29 3b 20 | 6e 6f 74 68 69 6e 67 20 |OT: "); |nothing |
|00001f20| 3d 20 31 3b 0a 58 23 69 | 66 64 65 66 20 50 54 59 |= 1;.X#i|fdef PTY|
|00001f30| 5f 4d 55 53 54 4e 4f 54 | 5f 53 45 53 53 49 4f 4e |_MUSTNOT|_SESSION|
|00001f40| 0a 58 20 70 72 69 6e 74 | 66 28 22 73 65 73 73 69 |.X print|f("sessi|
|00001f50| 6f 6e 20 22 29 3b 20 6e | 6f 74 68 69 6e 67 20 3d |on "); n|othing =|
|00001f60| 20 30 3b 0a 58 23 65 6e | 64 69 66 0a 58 23 69 66 | 0;.X#en|dif.X#if|
|00001f70| 64 65 66 20 50 54 59 5f | 4d 55 53 54 4e 4f 54 5f |def PTY_|MUSTNOT_|
|00001f80| 55 54 4d 50 48 4f 53 54 | 0a 58 20 70 72 69 6e 74 |UTMPHOST|.X print|
|00001f90| 66 28 22 75 74 6d 70 68 | 6f 73 74 20 22 29 3b 20 |f("utmph|ost "); |
|00001fa0| 6e 6f 74 68 69 6e 67 20 | 3d 20 30 3b 0a 58 23 65 |nothing |= 0;.X#e|
|00001fb0| 6e 64 69 66 0a 58 23 69 | 66 64 65 66 20 50 54 59 |ndif.X#i|fdef PTY|
|00001fc0| 5f 4d 55 53 54 4e 4f 54 | 5f 55 54 4d 50 0a 58 20 |_MUSTNOT|_UTMP.X |
|00001fd0| 70 72 69 6e 74 66 28 22 | 75 74 6d 70 20 22 29 3b |printf("|utmp ");|
|00001fe0| 20 6e 6f 74 68 69 6e 67 | 20 3d 20 30 3b 0a 58 23 | nothing| = 0;.X#|
|00001ff0| 65 6e 64 69 66 0a 58 23 | 69 66 64 65 66 20 50 54 |endif.X#|ifdef PT|
|00002000| 59 5f 4d 55 53 54 4e 4f | 54 5f 57 54 4d 50 0a 58 |Y_MUSTNO|T_WTMP.X|
|00002010| 20 70 72 69 6e 74 66 28 | 22 77 74 6d 70 20 22 29 | printf(|"wtmp ")|
|00002020| 3b 20 6e 6f 74 68 69 6e | 67 20 3d 20 30 3b 0a 58 |; nothin|g = 0;.X|
|00002030| 23 65 6e 64 69 66 0a 58 | 23 69 66 64 65 66 20 50 |#endif.X|#ifdef P|
|00002040| 54 59 5f 4d 55 53 54 4e | 4f 54 5f 43 48 4f 57 4e |TY_MUSTN|OT_CHOWN|
|00002050| 0a 58 20 70 72 69 6e 74 | 66 28 22 63 68 6f 77 6e |.X print|f("chown|
|00002060| 20 22 29 3b 20 6e 6f 74 | 68 69 6e 67 20 3d 20 30 | "); not|hing = 0|
|00002070| 3b 0a 58 23 65 6e 64 69 | 66 0a 58 20 69 66 20 28 |;.X#endi|f.X if (|
|00002080| 6e 6f 74 68 69 6e 67 29 | 20 70 72 69 6e 74 66 28 |nothing)| printf(|
|00002090| 22 28 6e 6f 74 68 69 6e | 67 29 22 29 3b 0a 58 20 |"(nothin|g)");.X |
|000020a0| 70 72 69 6e 74 66 28 22 | 5c 6e 22 29 3b 0a 58 23 |printf("|\n");.X#|
|000020b0| 69 66 64 65 66 20 54 54 | 59 5f 41 55 58 43 48 41 |ifdef TT|Y_AUXCHA|
|000020c0| 52 53 0a 58 20 70 72 69 | 6e 74 66 28 22 53 79 73 |RS.X pri|ntf("Sys|
|000020d0| 74 65 6d 20 6d 75 73 74 | 20 73 75 70 70 6f 72 74 |tem must| support|
|000020e0| 20 74 74 79 20 61 75 78 | 69 6c 69 61 72 79 20 63 | tty aux|iliary c|
|000020f0| 68 61 72 61 63 74 65 72 | 73 2e 5c 6e 22 29 3b 0a |haracter|s.\n");.|
|00002100| 58 23 65 6e 64 69 66 0a | 58 23 69 66 64 65 66 20 |X#endif.|X#ifdef |
|00002110| 54 54 59 5f 57 49 4e 44 | 4f 57 53 0a 58 20 70 72 |TTY_WIND|OWS.X pr|
|00002120| 69 6e 74 66 28 22 53 79 | 73 74 65 6d 20 6d 75 73 |intf("Sy|stem mus|
|00002130| 74 20 73 75 70 70 6f 72 | 74 20 74 74 79 20 77 69 |t suppor|t tty wi|
|00002140| 6e 64 6f 77 73 20 61 6e | 64 20 53 49 47 57 49 4e |ndows an|d SIGWIN|
|00002150| 43 48 2e 5c 6e 22 29 3b | 0a 58 23 65 6e 64 69 66 |CH.\n");|.X#endif|
|00002160| 0a 58 20 65 78 69 74 28 | 30 29 3b 0a 58 7d 0a 45 |.X exit(|0);.X}.E|
|00002170| 4e 44 5f 4f 46 5f 46 49 | 4c 45 0a 69 66 20 74 65 |ND_OF_FI|LE.if te|
|00002180| 73 74 20 32 37 32 34 20 | 2d 6e 65 20 60 77 63 20 |st 2724 |-ne `wc |
|00002190| 2d 63 20 3c 27 43 48 45 | 43 4b 43 4f 4e 46 2e 63 |-c <'CHE|CKCONF.c|
|000021a0| 27 60 3b 20 74 68 65 6e | 0a 20 20 20 20 65 63 68 |'`; then|. ech|
|000021b0| 6f 20 73 68 61 72 3a 20 | 5c 22 27 43 48 45 43 4b |o shar: |\"'CHECK|
|000021c0| 43 4f 4e 46 2e 63 27 5c | 22 20 75 6e 70 61 63 6b |CONF.c'\|" unpack|
|000021d0| 65 64 20 77 69 74 68 20 | 77 72 6f 6e 67 20 73 69 |ed with |wrong si|
|000021e0| 7a 65 21 0a 66 69 0a 23 | 20 65 6e 64 20 6f 66 20 |ze!.fi.#| end of |
|000021f0| 27 43 48 45 43 4b 43 4f | 4e 46 2e 63 27 0a 66 69 |'CHECKCO|NF.c'.fi|
|00002200| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 49 4d 50 |.if test| -f 'IMP|
|00002210| 41 43 54 27 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |ACT' -a |"${1}" !|
|00002220| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|00002230| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|00002240| 20 6e 6f 74 20 63 6c 6f | 62 62 65 72 20 65 78 69 | not clo|bber exi|
|00002250| 73 74 69 6e 67 20 66 69 | 6c 65 20 5c 22 27 49 4d |sting fi|le \"'IM|
|00002260| 50 41 43 54 27 5c 22 0a | 65 6c 73 65 0a 65 63 68 |PACT'\".|else.ech|
|00002270| 6f 20 73 68 61 72 3a 20 | 45 78 74 72 61 63 74 69 |o shar: |Extracti|
|00002280| 6e 67 20 5c 22 27 49 4d | 50 41 43 54 27 5c 22 20 |ng \"'IM|PACT'\" |
|00002290| 5c 28 32 34 35 38 20 63 | 68 61 72 61 63 74 65 72 |\(2458 c|haracter|
|000022a0| 73 5c 29 0a 73 65 64 20 | 22 73 2f 5e 58 2f 2f 22 |s\).sed |"s/^X//"|
|000022b0| 20 3e 27 49 4d 50 41 43 | 54 27 20 3c 3c 27 45 4e | >'IMPAC|T' <<'EN|
|000022c0| 44 5f 4f 46 5f 46 49 4c | 45 27 0a 58 20 20 5b 20 |D_OF_FIL|E'.X [ |
|000022d0| 70 74 79 20 5d 0a 58 3e | 20 49 73 20 69 74 20 73 |pty ].X>| Is it s|
|000022e0| 65 6c 66 2d 63 6f 6e 74 | 61 69 6e 65 64 2c 20 6f |elf-cont|ained, o|
|000022f0| 72 20 64 6f 65 73 20 69 | 74 0a 58 3e 20 72 65 71 |r does i|t.X> req|
|00002300| 75 69 72 65 20 6f 74 68 | 65 72 20 6d 6f 64 73 3f |uire oth|er mods?|
|00002310| 0a 58 0a 54 68 65 72 65 | 20 61 72 65 20 63 65 72 |.X.There| are cer|
|00002320| 74 61 69 6e 20 64 65 63 | 69 73 69 6f 6e 73 20 77 |tain dec|isions w|
|00002330| 68 69 63 68 20 61 6e 79 | 6f 6e 65 20 69 6e 73 74 |hich any|one inst|
|00002340| 61 6c 6c 69 6e 67 20 70 | 74 79 20 68 61 73 20 74 |alling p|ty has t|
|00002350| 6f 20 6d 61 6b 65 3a 0a | 58 0a 58 31 2e 20 53 68 |o make:.|X.X1. Sh|
|00002360| 6f 75 6c 64 20 70 74 79 | 20 72 75 6e 20 73 65 74 |ould pty| run set|
|00002370| 75 69 64 20 72 6f 6f 74 | 2c 20 6f 72 20 73 65 74 |uid root|, or set|
|00002380| 75 69 64 20 73 6f 6d 65 | 20 6f 74 68 65 72 20 75 |uid some| other u|
|00002390| 73 65 72 2c 20 73 61 79 | 20 60 60 70 74 79 27 27 |ser, say| ``pty''|
|000023a0| 3f 0a 49 66 20 74 68 65 | 20 6c 61 74 74 65 72 2c |?.If the| latter,|
|000023b0| 20 74 68 65 6e 20 74 68 | 65 20 6e 65 77 20 75 73 | then th|e new us|
|000023c0| 65 72 20 73 68 6f 75 6c | 64 20 62 65 20 61 64 64 |er shoul|d be add|
|000023d0| 65 64 20 74 6f 20 2f 65 | 74 63 2f 70 61 73 73 77 |ed to /e|tc/passw|
|000023e0| 64 2c 20 61 6e 64 20 69 | 74 0a 77 6f 75 6c 64 20 |d, and i|t.would |
|000023f0| 68 65 6c 70 20 74 6f 20 | 68 61 76 65 20 75 74 6d |help to |have utm|
|00002400| 70 20 61 6e 64 20 77 74 | 6d 70 20 6f 77 6e 65 64 |p and wt|mp owned|
|00002410| 20 62 79 20 74 68 61 74 | 20 75 73 65 72 2e 20 49 | by that| user. I|
|00002420| 74 27 73 20 67 65 6e 65 | 72 61 6c 6c 79 0a 73 69 |t's gene|rally.si|
|00002430| 6d 70 6c 65 72 20 74 6f | 20 68 61 76 65 20 70 74 |mpler to| have pt|
|00002440| 79 20 72 75 6e 6e 69 6e | 67 20 73 65 74 75 69 64 |y runnin|g setuid|
|00002450| 20 72 6f 6f 74 2e 20 54 | 68 69 73 20 61 6c 73 6f | root. T|his also|
|00002460| 20 6c 65 74 73 20 69 74 | 20 63 68 6f 77 6e 20 61 | lets it| chown a|
|00002470| 6e 64 0a 63 68 6d 6f 64 | 20 74 74 79 20 64 65 76 |nd.chmod| tty dev|
|00002480| 69 63 65 20 66 69 6c 65 | 73 2e 0a 58 0a 58 32 2e |ice file|s..X.X2.|
|00002490| 20 70 74 79 27 73 20 49 | 4e 53 54 41 4c 4c 20 70 | pty's I|NSTALL p|
|000024a0| 72 6f 67 72 61 6d 20 63 | 6f 70 69 65 73 20 74 68 |rogram c|opies th|
|000024b0| 65 20 62 69 6e 61 72 69 | 65 73 20 74 6f 20 73 6f |e binari|es to so|
|000024c0| 6d 65 20 64 69 72 65 63 | 74 6f 72 79 2c 20 61 6e |me direc|tory, an|
|000024d0| 64 20 73 65 74 73 0a 75 | 70 20 61 20 64 69 72 65 |d sets.u|p a dire|
|000024e0| 63 74 6f 72 79 20 77 68 | 65 72 65 20 70 74 79 20 |ctory wh|ere pty |
|000024f0| 63 61 6e 20 73 74 6f 72 | 65 20 73 65 73 73 69 6f |can stor|e sessio|
|00002500| 6e 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 2e 20 57 |n inform|ation. W|
|00002510| 68 65 72 65 20 64 6f 20 | 74 68 6f 73 65 20 74 77 |here do |those tw|
|00002520| 6f 0a 64 69 72 65 63 74 | 6f 72 69 65 73 20 67 6f |o.direct|ories go|
|00002530| 3f 20 54 68 65 20 64 65 | 66 61 75 6c 74 73 20 61 |? The de|faults a|
|00002540| 72 65 20 2f 75 73 72 2f | 6c 6f 63 61 6c 2f 70 74 |re /usr/|local/pt|
|00002550| 79 62 69 6e 20 61 6e 64 | 20 2f 75 73 72 2f 6c 6f |ybin and| /usr/lo|
|00002560| 63 61 6c 2f 65 74 63 2f | 70 74 79 2e 0a 70 74 79 |cal/etc/|pty..pty|
|00002570| 20 61 6c 73 6f 20 6d 61 | 69 6e 74 61 69 6e 73 20 | also ma|intains |
|00002580| 66 6f 75 72 20 73 65 73 | 73 69 6f 6e 20 6c 6f 67 |four ses|sion log|
|00002590| 20 66 69 6c 65 73 20 61 | 6e 61 6c 6f 67 6f 75 73 | files a|nalogous|
|000025a0| 20 74 6f 20 75 74 6d 70 | 2f 77 74 6d 70 2c 20 61 | to utmp|/wtmp, a|
|000025b0| 6c 6c 20 69 6e 0a 58 2f | 75 73 72 2f 6c 6f 63 61 |ll in.X/|usr/loca|
|000025c0| 6c 2f 65 74 63 20 62 79 | 20 64 65 66 61 75 6c 74 |l/etc by| default|
|000025d0| 2e 0a 58 0a 58 33 2e 20 | 70 74 79 20 63 6f 6d 65 |..X.X3. |pty come|
|000025e0| 73 20 77 69 74 68 20 73 | 6f 6d 65 20 63 6c 6f 6e |s with s|ome clon|
|000025f0| 65 73 20 6f 66 20 65 78 | 69 73 74 69 6e 67 20 70 |es of ex|isting p|
|00002600| 72 6f 67 72 61 6d 73 3a | 20 62 69 66 66 2c 20 6c |rograms:| biff, l|
|00002610| 6f 63 6b 2c 20 6d 65 73 | 67 2c 0a 73 63 72 69 70 |ock, mes|g,.scrip|
|00002620| 74 2c 20 74 74 79 2c 20 | 75 73 65 72 73 2c 20 77 |t, tty, |users, w|
|00002630| 61 6c 6c 2c 20 77 68 6f | 2c 20 77 68 6f 61 6d 69 |all, who|, whoami|
|00002640| 2c 20 77 72 69 74 65 2e | 20 49 6e 20 6d 61 6e 79 |, write.| In many|
|00002650| 20 63 61 73 65 73 20 74 | 68 65 73 65 20 6f 66 66 | cases t|hese off|
|00002660| 65 72 0a 66 65 61 74 75 | 72 65 73 20 62 65 79 6f |er.featu|res beyo|
|00002670| 6e 64 20 74 68 65 20 73 | 74 61 6e 64 61 72 64 20 |nd the s|tandard |
|00002680| 76 65 72 73 69 6f 6e 73 | 3a 20 66 6f 72 20 69 6e |versions|: for in|
|00002690| 73 74 61 6e 63 65 2c 20 | 69 66 20 70 74 79 20 68 |stance, |if pty h|
|000026a0| 61 73 20 77 72 69 74 65 | 0a 70 65 72 6d 69 73 73 |as write|.permiss|
|000026b0| 69 6f 6e 20 74 6f 20 75 | 74 6d 70 2c 20 74 68 65 |ion to u|tmp, the|
|000026c0| 6e 20 73 63 72 69 70 74 | 20 28 77 68 69 63 68 20 |n script| (which |
|000026d0| 69 73 20 6a 75 73 74 20 | 61 20 74 69 6e 79 20 73 |is just |a tiny s|
|000026e0| 68 65 6c 6c 20 73 63 72 | 69 70 74 29 20 77 69 6c |hell scr|ipt) wil|
|000026f0| 6c 0a 68 61 76 65 20 61 | 20 75 74 6d 70 20 65 6e |l.have a| utmp en|
|00002700| 74 72 79 2c 20 73 6f 20 | 74 61 6c 6b 2f 6d 61 69 |try, so |talk/mai|
|00002710| 6c 2f 77 72 69 74 65 2f | 65 74 63 2e 20 77 69 6c |l/write/|etc. wil|
|00002720| 6c 20 77 6f 72 6b 2e 20 | 53 68 6f 75 6c 64 20 74 |l work. |Should t|
|00002730| 68 65 79 0a 72 65 70 6c | 61 63 65 20 74 68 65 20 |hey.repl|ace the |
|00002740| 73 79 73 74 65 6d 20 76 | 65 72 73 69 6f 6e 73 3f |system v|ersions?|
|00002750| 0a 58 0a 58 34 2e 20 70 | 74 79 20 63 6f 6d 65 73 |.X.X4. p|ty comes|
|00002760| 20 77 69 74 68 20 73 6f | 6d 65 20 70 72 6f 67 72 | with so|me progr|
|00002770| 61 6d 73 20 77 68 69 63 | 68 20 62 65 6c 6f 6e 67 |ams whic|h belong|
|00002780| 20 69 6e 20 72 63 2e 6c | 6f 63 61 6c 3a 20 75 74 | in rc.l|ocal: ut|
|00002790| 6d 70 69 6e 69 74 20 64 | 6f 65 73 20 61 0a 6d 6f |mpinit d|oes a.mo|
|000027a0| 72 65 20 70 72 6f 66 65 | 73 73 69 6f 6e 61 6c 20 |re profe|ssional |
|000027b0| 6a 6f 62 20 6f 66 20 75 | 74 6d 70 20 69 6e 69 74 |job of u|tmp init|
|000027c0| 69 61 6c 69 7a 61 74 69 | 6f 6e 20 74 68 61 6e 20 |ializati|on than |
|000027d0| 69 6e 69 74 20 64 6f 65 | 73 3b 20 73 65 73 73 6e |init doe|s; sessn|
|000027e0| 6f 77 69 6e 69 74 0a 61 | 6e 64 20 73 63 6e 6f 77 |owinit.a|nd scnow|
|000027f0| 69 6e 69 74 20 69 6e 69 | 74 69 61 6c 69 7a 65 20 |init ini|tialize |
|00002800| 70 74 79 27 73 20 73 65 | 73 73 69 6f 6e 20 6c 6f |pty's se|ssion lo|
|00002810| 67 20 66 69 6c 65 73 2e | 20 53 68 6f 75 6c 64 20 |g files.| Should |
|00002820| 74 68 65 73 65 20 62 65 | 20 61 64 64 65 64 20 74 |these be| added t|
|00002830| 6f 0a 72 63 2e 6c 6f 63 | 61 6c 3f 0a 58 0a 58 35 |o.rc.loc|al?.X.X5|
|00002840| 2e 20 70 74 79 20 63 6f | 6d 65 73 20 77 69 74 68 |. pty co|mes with|
|00002850| 20 73 6f 6d 65 20 70 72 | 6f 67 72 61 6d 73 20 77 | some pr|ograms w|
|00002860| 68 69 63 68 20 62 65 6c | 6f 6e 67 20 69 6e 20 64 |hich bel|ong in d|
|00002870| 61 69 6c 79 2c 20 77 65 | 65 6b 6c 79 2c 20 6f 72 |aily, we|ekly, or|
|00002880| 20 6d 6f 6e 74 68 6c 79 | 0a 63 72 6f 6e 20 73 63 | monthly|.cron sc|
|00002890| 72 69 70 74 73 3a 20 77 | 74 6d 70 72 6f 74 61 74 |ripts: w|tmprotat|
|000028a0| 65 2c 20 73 65 73 73 72 | 6f 74 61 74 65 2c 20 61 |e, sessr|otate, a|
|000028b0| 6e 64 20 73 63 6c 6f 67 | 72 6f 74 61 74 65 2e 20 |nd sclog|rotate. |
|000028c0| 4f 6e 20 61 6e 79 20 6d | 6f 64 65 72 6e 0a 73 79 |On any m|odern.sy|
|000028d0| 73 74 65 6d 2c 20 6f 66 | 20 63 6f 75 72 73 65 2c |stem, of| course,|
|000028e0| 20 77 74 6d 70 20 69 73 | 20 72 6f 74 61 74 65 64 | wtmp is| rotated|
|000028f0| 20 61 6e 79 77 61 79 2c | 20 62 75 74 20 73 68 6f | anyway,| but sho|
|00002900| 75 6c 64 20 73 65 73 73 | 72 6f 74 61 74 65 20 61 |uld sess|rotate a|
|00002910| 6e 64 0a 73 63 6c 6f 67 | 72 6f 74 61 74 65 20 62 |nd.sclog|rotate b|
|00002920| 65 20 61 64 64 65 64 20 | 74 6f 20 63 72 6f 6e 20 |e added |to cron |
|00002930| 73 63 72 69 70 74 73 3f | 20 4f 6e 65 20 6f 74 68 |scripts?| One oth|
|00002940| 65 72 20 70 72 6f 67 72 | 61 6d 2c 20 63 68 65 63 |er progr|am, chec|
|00002950| 6b 70 74 79 73 2c 0a 70 | 72 6f 64 75 63 65 73 20 |kptys,.p|roduces |
|00002960| 61 20 72 65 70 6f 72 74 | 20 6f 6e 20 74 68 65 20 |a report| on the |
|00002970| 65 6e 74 69 72 65 20 70 | 74 79 20 73 75 62 73 79 |entire p|ty subsy|
|00002980| 73 74 65 6d 2c 20 61 6e | 64 20 63 61 6e 20 61 6c |stem, an|d can al|
|00002990| 73 6f 20 62 65 20 72 75 | 6e 20 66 72 6f 6d 0a 63 |so be ru|n from.c|
|000029a0| 72 6f 6e 2e 0a 58 0a 58 | 36 2e 20 70 74 79 20 63 |ron..X.X|6. pty c|
|000029b0| 6f 6d 65 73 20 77 69 74 | 68 20 73 6f 6d 65 20 6f |omes wit|h some o|
|000029c0| 74 68 65 72 20 75 74 69 | 6c 69 74 69 65 73 20 6e |ther uti|lities n|
|000029d0| 6f 74 20 64 69 72 65 63 | 74 6c 79 20 72 65 6c 61 |ot direc|tly rela|
|000029e0| 74 65 64 20 74 6f 20 73 | 65 73 73 69 6f 6e 0a 6d |ted to s|ession.m|
|000029f0| 61 6e 61 67 65 6d 65 6e | 74 2e 20 46 6f 72 20 69 |anagemen|t. For i|
|00002a00| 6e 73 74 61 6e 63 65 2c | 20 74 72 65 63 6f 72 64 |nstance,| trecord|
|00002a10| 20 61 6e 64 20 74 70 6c | 61 79 20 6d 61 6b 65 20 | and tpl|ay make |
|00002a20| 74 79 70 65 73 63 72 69 | 70 74 73 20 69 6e 20 61 |typescri|pts in a|
|00002a30| 0a 73 70 65 63 69 61 6c | 20 66 6f 72 6d 61 74 20 |.special| format |
|00002a40| 77 68 69 63 68 20 69 6e | 63 6c 75 64 65 73 20 74 |which in|cludes t|
|00002a50| 68 65 20 74 69 6d 69 6e | 67 20 62 65 74 77 65 65 |he timin|g betwee|
|00002a60| 6e 20 63 68 61 72 61 63 | 74 65 72 73 2e 20 4d 79 |n charac|ters. My|
|00002a70| 20 74 73 63 72 69 70 74 | 0a 75 74 69 6c 69 74 79 | tscript|.utility|
|00002a80| 20 77 6f 72 6b 73 20 6a | 75 73 74 20 6c 69 6b 65 | works j|ust like|
|00002a90| 20 73 63 72 69 70 74 20 | 62 75 74 20 6d 61 6b 65 | script |but make|
|00002aa0| 73 20 61 20 74 61 70 65 | 73 63 72 69 70 74 20 77 |s a tape|script w|
|00002ab0| 68 69 63 68 20 79 6f 75 | 20 63 61 6e 20 70 6c 61 |hich you| can pla|
|00002ac0| 79 0a 62 61 63 6b 20 6c | 61 74 65 72 2e 20 28 54 |y.back l|ater. (T|
|00002ad0| 68 69 73 20 69 73 20 67 | 72 65 61 74 20 66 6f 72 |his is g|reat for|
|00002ae0| 20 74 61 6c 6b 20 63 6f | 6e 76 65 72 73 61 74 69 | talk co|nversati|
|00002af0| 6f 6e 73 20 61 6e 64 20 | 6f 74 68 65 72 20 69 6e |ons and |other in|
|00002b00| 74 65 72 61 63 74 69 76 | 65 0a 73 65 73 73 69 6f |teractiv|e.sessio|
|00002b10| 6e 73 2e 29 20 53 68 6f | 75 6c 64 20 74 68 65 73 |ns.) Sho|uld thes|
|00002b20| 65 20 75 74 69 6c 69 74 | 69 65 73 20 62 65 20 70 |e utilit|ies be p|
|00002b30| 61 72 74 20 6f 66 20 61 | 20 75 73 65 72 27 73 20 |art of a| user's |
|00002b40| 73 74 61 6e 64 61 72 64 | 20 70 61 74 68 3f 0a 53 |standard| path?.S|
|00002b50| 68 6f 75 6c 64 20 70 74 | 79 20 69 74 73 65 6c 66 |hould pt|y itself|
|00002b60| 20 62 65 20 70 61 72 74 | 20 6f 66 20 61 20 75 73 | be part| of a us|
|00002b70| 65 72 27 73 20 73 74 61 | 6e 64 61 72 64 20 70 61 |er's sta|ndard pa|
|00002b80| 74 68 3f 0a 58 0a 58 37 | 2e 20 53 68 6f 75 6c 64 |th?.X.X7|. Should|
|00002b90| 20 73 6f 6d 65 20 73 65 | 63 75 72 65 20 74 74 79 | some se|cure tty|
|00002ba0| 73 20 62 65 20 73 65 74 | 20 61 73 69 64 65 20 66 |s be set| aside f|
|00002bb0| 6f 72 20 70 74 79 27 73 | 20 75 73 65 3f 20 49 74 |or pty's| use? It|
|00002bc0| 27 73 20 65 61 73 79 20 | 74 6f 0a 63 6f 6e 66 69 |'s easy |to.confi|
|00002bd0| 67 75 72 65 20 70 74 79 | 20 73 6f 20 74 68 61 74 |gure pty| so that|
|00002be0| 20 69 74 20 6f 6e 6c 79 | 20 75 73 65 73 20 28 65 | it only| uses (e|
|00002bf0| 2e 67 2e 29 20 74 74 79 | 5b 75 2d 7a 5d 2a 2c 20 |.g.) tty|[u-z]*, |
|00002c00| 77 68 69 63 68 20 61 72 | 65 20 61 6c 77 61 79 73 |which ar|e always|
|00002c10| 0a 6d 6f 64 65 20 36 30 | 30 20 72 6f 6f 74 20 72 |.mode 60|0 root r|
|00002c20| 61 74 68 65 72 20 74 68 | 61 6e 20 6d 6f 64 65 20 |ather th|an mode |
|00002c30| 36 36 36 20 72 6f 6f 74 | 2e 20 4f 72 20 70 74 79 |666 root|. Or pty|
|00002c40| 20 63 61 6e 20 6a 75 73 | 74 20 63 6f 6d 70 65 74 | can jus|t compet|
|00002c50| 65 20 66 6f 72 0a 69 6e | 73 65 63 75 72 65 20 74 |e for.in|secure t|
|00002c60| 74 79 73 20 6c 69 6b 65 | 20 65 76 65 72 79 6f 6e |tys like| everyon|
|00002c70| 65 20 65 6c 73 65 2e 0a | 45 4e 44 5f 4f 46 5f 46 |e else..|END_OF_F|
|00002c80| 49 4c 45 0a 69 66 20 74 | 65 73 74 20 32 34 35 38 |ILE.if t|est 2458|
|00002c90| 20 2d 6e 65 20 60 77 63 | 20 2d 63 20 3c 27 49 4d | -ne `wc| -c <'IM|
|00002ca0| 50 41 43 54 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |PACT'`; |then. |
|00002cb0| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 49 | echo sh|ar: \"'I|
|00002cc0| 4d 50 41 43 54 27 5c 22 | 20 75 6e 70 61 63 6b 65 |MPACT'\"| unpacke|
|00002cd0| 64 20 77 69 74 68 20 77 | 72 6f 6e 67 20 73 69 7a |d with w|rong siz|
|00002ce0| 65 21 0a 66 69 0a 23 20 | 65 6e 64 20 6f 66 20 27 |e!.fi.# |end of '|
|00002cf0| 49 4d 50 41 43 54 27 0a | 66 69 0a 69 66 20 74 65 |IMPACT'.|fi.if te|
|00002d00| 73 74 20 2d 66 20 27 57 | 54 46 27 20 2d 61 20 22 |st -f 'W|TF' -a "|
|00002d10| 24 7b 31 7d 22 20 21 3d | 20 22 2d 63 22 20 3b 20 |${1}" !=| "-c" ; |
|00002d20| 74 68 65 6e 20 0a 20 20 | 65 63 68 6f 20 73 68 61 |then . |echo sha|
|00002d30| 72 3a 20 57 69 6c 6c 20 | 6e 6f 74 20 63 6c 6f 62 |r: Will |not clob|
|00002d40| 62 65 72 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ber exis|ting fil|
|00002d50| 65 20 5c 22 27 57 54 46 | 27 5c 22 0a 65 6c 73 65 |e \"'WTF|'\".else|
|00002d60| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 45 78 74 72 |.echo sh|ar: Extr|
|00002d70| 61 63 74 69 6e 67 20 5c | 22 27 57 54 46 27 5c 22 |acting \|"'WTF'\"|
|00002d80| 20 5c 28 32 33 35 33 20 | 63 68 61 72 61 63 74 65 | \(2353 |characte|
|00002d90| 72 73 5c 29 0a 73 65 64 | 20 22 73 2f 5e 58 2f 2f |rs\).sed| "s/^X//|
|00002da0| 22 20 3e 27 57 54 46 27 | 20 3c 3c 27 45 4e 44 5f |" >'WTF'| <<'END_|
|00002db0| 4f 46 5f 46 49 4c 45 27 | 0a 42 4c 55 52 42 3a 20 |OF_FILE'|.BLURB: |
|00002dc0| 67 65 6e 65 72 61 6c 20 | 62 6c 75 72 62 20 6f 6e |general |blurb on|
|00002dd0| 20 77 68 61 74 20 70 74 | 79 20 64 6f 65 73 20 66 | what pt|y does f|
|00002de0| 6f 72 20 79 6f 75 2e 0a | 58 0a 52 45 41 44 4d 45 |or you..|X.README|
|00002df0| 3a 20 74 68 65 20 66 69 | 72 73 74 20 74 68 69 6e |: the fi|rst thin|
|00002e00| 67 20 79 6f 75 20 73 68 | 6f 75 6c 64 20 72 65 61 |g you sh|ould rea|
|00002e10| 64 3b 20 67 69 76 65 73 | 20 62 61 73 69 63 20 69 |d; gives| basic i|
|00002e20| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 6e 64 0a 63 |nformati|on and.c|
|00002e30| 72 65 64 69 74 73 2c 20 | 61 6e 64 20 74 65 6c 6c |redits, |and tell|
|00002e40| 73 20 79 6f 75 20 68 6f | 77 20 74 6f 20 67 65 74 |s you ho|w to get|
|00002e50| 20 70 74 79 20 72 75 6e | 6e 69 6e 67 2e 0a 58 0a | pty run|ning..X.|
|00002e60| 58 46 4f 52 4d 4c 45 54 | 54 45 52 3a 20 74 68 65 |XFORMLET|TER: the|
|00002e70| 20 66 6f 72 6d 20 6c 65 | 74 74 65 72 20 79 6f 75 | form le|tter you|
|00002e80| 20 73 68 6f 75 6c 64 20 | 73 65 6e 64 20 62 61 63 | should |send bac|
|00002e90| 6b 20 74 6f 20 6d 65 20 | 77 68 65 6e 20 79 6f 75 |k to me |when you|
|00002ea0| 20 67 65 74 20 74 6f 0a | 73 74 65 70 20 23 31 32 | get to.|step #12|
|00002eb0| 20 69 6e 20 52 45 41 44 | 4d 45 2e 0a 58 0a 53 59 | in READ|ME..X.SY|
|00002ec0| 53 43 4f 4e 46 3a 20 61 | 20 73 68 65 6c 6c 20 73 |SCONF: a| shell s|
|00002ed0| 63 72 69 70 74 20 77 68 | 69 63 68 20 6c 6f 6f 6b |cript wh|ich look|
|00002ee0| 73 20 66 6f 72 20 76 61 | 72 69 6f 75 73 20 66 65 |s for va|rious fe|
|00002ef0| 61 74 75 72 65 73 20 6f | 66 20 79 6f 75 72 20 73 |atures o|f your s|
|00002f00| 79 73 74 65 6d 0a 61 6e | 64 20 63 68 61 6e 67 65 |ystem.an|d change|
|00002f10| 73 20 63 6f 6e 66 69 67 | 2f 2a 20 61 63 63 6f 72 |s config|/* accor|
|00002f20| 64 69 6e 67 6c 79 2e 0a | 58 0a 57 54 46 3a 20 74 |dingly..|X.WTF: t|
|00002f30| 68 69 73 20 66 69 6c 65 | 2c 20 64 65 74 61 69 6c |his file|, detail|
|00002f40| 69 6e 67 20 77 68 61 74 | 20 74 68 65 2c 20 75 68 |ing what| the, uh|
|00002f50| 2c 20 66 69 6c 65 73 20 | 69 6e 20 74 68 69 73 20 |, files |in this |
|00002f60| 64 69 73 74 72 69 62 75 | 74 69 6f 6e 20 61 72 65 |distribu|tion are|
|00002f70| 0a 66 6f 72 2e 0a 58 0a | 43 41 4c 4c 53 3a 20 61 |.for..X.|CALLS: a|
|00002f80| 20 64 65 74 61 69 6c 65 | 64 20 6c 69 73 74 20 6f | detaile|d list o|
|00002f90| 66 20 61 6c 6c 20 74 68 | 65 20 73 79 73 63 61 6c |f all th|e syscal|
|00002fa0| 6c 73 20 61 6e 64 20 6c | 69 62 72 61 72 79 20 63 |ls and l|ibrary c|
|00002fb0| 61 6c 6c 73 20 75 73 65 | 64 20 62 79 0a 70 74 79 |alls use|d by.pty|
|00002fc0| 2c 20 66 6f 6c 6c 6f 77 | 65 64 20 62 79 20 61 20 |, follow|ed by a |
|00002fd0| 62 72 65 61 6b 64 6f 77 | 6e 20 6f 66 20 74 68 65 |breakdow|n of the|
|00002fe0| 20 63 61 6c 6c 73 20 69 | 6e 74 6f 20 67 72 6f 75 | calls i|nto grou|
|00002ff0| 70 73 20 61 6e 64 20 61 | 20 64 65 73 63 72 69 70 |ps and a| descrip|
|00003000| 74 69 6f 6e 0a 6f 66 20 | 77 68 61 74 20 79 6f 75 |tion.of |what you|
|00003010| 20 68 61 76 65 20 74 6f | 20 64 6f 20 74 6f 20 70 | have to| do to p|
|00003020| 6f 72 74 20 65 61 63 68 | 20 67 72 6f 75 70 2e 20 |ort each| group. |
|00003030| 54 68 69 73 20 69 73 20 | 74 68 65 20 6d 6f 73 74 |This is |the most|
|00003040| 20 69 6d 70 6f 72 74 61 | 6e 74 0a 66 69 6c 65 20 | importa|nt.file |
|00003050| 74 6f 20 72 65 61 64 20 | 69 66 20 79 6f 75 27 72 |to read |if you'r|
|00003060| 65 20 67 6f 69 6e 67 20 | 74 6f 20 70 6f 72 74 20 |e going |to port |
|00003070| 70 74 79 20 74 6f 20 61 | 20 6e 6f 6e 2d 42 53 44 |pty to a| non-BSD|
|00003080| 20 73 79 73 74 65 6d 2e | 0a 58 0a 43 48 41 4e 47 | system.|.X.CHANG|
|00003090| 45 53 3a 20 72 65 76 65 | 72 73 65 20 63 68 72 6f |ES: reve|rse chro|
|000030a0| 6e 6f 6c 6f 67 69 63 61 | 6c 20 6c 69 73 74 20 6f |nologica|l list o|
|000030b0| 66 20 6d 6f 73 74 20 6f | 66 20 74 68 65 20 63 68 |f most o|f the ch|
|000030c0| 61 6e 67 65 73 20 74 6f | 20 70 74 79 20 34 2e 30 |anges to| pty 4.0|
|000030d0| 2e 0a 58 0a 43 4f 50 59 | 52 49 47 48 54 3a 20 73 |..X.COPY|RIGHT: s|
|000030e0| 68 6f 72 74 20 65 78 70 | 6c 61 6e 61 74 69 6f 6e |hort exp|lanation|
|000030f0| 20 6f 66 20 74 68 65 20 | 63 6f 70 79 69 6e 67 20 | of the |copying |
|00003100| 72 69 67 68 74 73 20 49 | 27 6d 20 67 69 76 69 6e |rights I|'m givin|
|00003110| 67 20 79 6f 75 2e 0a 58 | 0a 58 46 49 4c 45 53 3a |g you..X|.XFILES:|
|00003120| 20 6c 69 73 74 20 6f 66 | 20 61 6c 6c 20 74 68 65 | list of| all the|
|00003130| 20 66 69 6c 65 73 20 69 | 6e 20 74 68 65 20 70 74 | files i|n the pt|
|00003140| 79 20 34 2e 30 20 64 69 | 73 74 72 69 62 75 74 69 |y 4.0 di|stributi|
|00003150| 6f 6e 2c 20 69 6e 20 73 | 6f 6d 65 20 6f 72 64 65 |on, in s|ome orde|
|00003160| 72 3b 0a 75 73 65 64 20 | 62 79 20 60 60 6d 61 6b |r;.used |by ``mak|
|00003170| 65 20 73 68 61 72 27 27 | 2c 20 66 6f 72 20 65 78 |e shar''|, for ex|
|00003180| 61 6d 70 6c 65 2e 0a 58 | 0a 4f 42 4a 45 43 54 53 |ample..X|.OBJECTS|
|00003190| 3a 20 6c 69 73 74 20 6f | 66 20 61 6c 6c 20 74 68 |: list o|f all th|
|000031a0| 65 20 2e 6f 20 66 69 6c | 65 73 20 63 72 65 61 74 |e .o fil|es creat|
|000031b0| 65 64 20 77 68 69 6c 65 | 20 63 6f 6d 70 69 6c 69 |ed while| compili|
|000031c0| 6e 67 20 70 74 79 2e 0a | 58 0a 42 49 4e 41 52 49 |ng pty..|X.BINARI|
|000031d0| 45 53 3a 20 6c 69 73 74 | 20 6f 66 20 61 6c 6c 20 |ES: list| of all |
|000031e0| 74 68 65 20 65 78 65 63 | 75 74 61 62 6c 65 73 20 |the exec|utables |
|000031f0| 63 72 65 61 74 65 64 20 | 62 79 20 60 60 6d 61 6b |created |by ``mak|
|00003200| 65 27 27 2e 0a 58 0a 4d | 61 6b 65 66 69 6c 65 3a |e''..X.M|akefile:|
|00003210| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 73 20 66 6f | instruc|tions fo|
|00003220| 72 20 6d 61 6b 65 2c 20 | 69 6e 20 61 20 72 65 61 |r make, |in a rea|
|00003230| 73 6f 6e 61 62 6c 79 20 | 70 6f 72 74 61 62 6c 65 |sonably |portable|
|00003240| 20 66 6f 72 6d 61 74 2e | 0a 58 0a 54 45 53 54 53 | format.|.X.TESTS|
|00003250| 3a 20 74 79 70 65 73 63 | 72 69 70 74 20 6f 66 20 |: typesc|ript of |
|00003260| 61 20 74 79 70 69 63 61 | 6c 20 70 74 79 20 74 65 |a typica|l pty te|
|00003270| 73 74 20 72 75 6e 2e 0a | 58 0a 4e 45 57 3a 20 65 |st run..|X.NEW: e|
|00003280| 78 70 6c 61 6e 61 74 69 | 6f 6e 20 6f 66 20 74 68 |xplanati|on of th|
|00003290| 65 20 69 6d 70 6f 72 74 | 61 6e 74 20 64 69 66 66 |e import|ant diff|
|000032a0| 65 72 65 6e 63 65 73 20 | 62 65 74 77 65 65 6e 20 |erences |between |
|000032b0| 70 74 79 20 33 2e 30 20 | 61 6e 64 20 70 74 79 20 |pty 3.0 |and pty |
|000032c0| 34 2e 30 2e 0a 58 0a 4e | 4f 54 45 53 3a 20 72 61 |4.0..X.N|OTES: ra|
|000032d0| 6e 64 6f 6d 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |ndom imp|lementat|
|000032e0| 69 6f 6e 20 6e 6f 74 65 | 73 2e 20 54 68 69 73 20 |ion note|s. This |
|000032f0| 69 73 20 74 68 65 20 66 | 69 72 73 74 20 70 6c 61 |is the f|irst pla|
|00003300| 63 65 20 74 6f 20 74 75 | 72 6e 20 74 6f 0a 69 66 |ce to tu|rn to.if|
|00003310| 20 79 6f 75 27 72 65 20 | 6e 6f 74 20 73 75 72 65 | you're |not sure|
|00003320| 20 61 62 6f 75 74 20 73 | 6f 6d 65 74 68 69 6e 67 | about s|omething|
|00003330| 20 69 6e 20 74 68 65 20 | 63 6f 64 65 2e 0a 58 0a | in the |code..X.|
|00003340| 49 4d 50 41 43 54 3a 20 | 72 6f 75 67 68 20 6f 75 |IMPACT: |rough ou|
|00003350| 74 6c 69 6e 65 20 6f 66 | 20 68 6f 77 20 70 74 79 |tline of| how pty|
|00003360| 20 61 66 66 65 63 74 73 | 20 74 68 65 20 72 65 73 | affects| the res|
|00003370| 74 20 6f 66 20 74 68 65 | 20 73 79 73 74 65 6d 2e |t of the| system.|
|00003380| 0a 58 0a 53 45 43 55 52 | 49 54 59 3a 20 64 75 6c |.X.SECUR|ITY: dul|
|00003390| 6c 20 65 78 70 6c 61 6e | 61 74 69 6f 6e 20 6f 66 |l explan|ation of|
|000033a0| 20 74 68 65 20 69 6e 63 | 72 65 64 69 62 6c 65 20 | the inc|redible |
|000033b0| 74 6f 72 74 75 72 65 20 | 70 74 79 20 34 2e 30 20 |torture |pty 4.0 |
|000033c0| 68 61 73 20 74 6f 20 67 | 6f 0a 74 68 72 6f 75 67 |has to g|o.throug|
|000033d0| 68 20 74 6f 20 65 6e 73 | 75 72 65 20 74 68 61 74 |h to ens|ure that|
|000033e0| 20 61 20 74 74 79 20 69 | 73 20 60 60 63 6c 65 61 | a tty i|s ``clea|
|000033f0| 6e 27 27 2e 0a 58 0a 51 | 55 45 53 54 49 4f 4e 53 |n''..X.Q|UESTIONS|
|00003400| 3a 20 71 75 65 73 74 69 | 6f 6e 73 20 61 6e 64 20 |: questi|ons and |
|00003410| 70 74 79 2d 62 61 73 65 | 64 20 61 6e 73 77 65 72 |pty-base|d answer|
|00003420| 73 2c 20 6d 6f 73 74 6c | 79 20 73 74 6f 6c 65 6e |s, mostl|y stolen|
|00003430| 20 66 72 6f 6d 20 74 68 | 65 0a 55 53 45 4e 45 54 | from th|e.USENET|
|00003440| 20 6e 65 77 73 67 72 6f | 75 70 20 63 6f 6d 70 2e | newsgro|up comp.|
|00003450| 75 6e 69 78 2e 71 75 65 | 73 74 69 6f 6e 73 2e 0a |unix.que|stions..|
|00003460| 58 0a 58 2a 2e 64 72 61 | 66 74 2a 3a 20 64 72 61 |X.X*.dra|ft*: dra|
|00003470| 66 74 20 70 61 70 65 72 | 73 20 64 65 61 6c 69 6e |ft paper|s dealin|
|00003480| 67 20 77 69 74 68 20 72 | 61 6e 64 6f 6d 20 74 6f |g with r|andom to|
|00003490| 70 69 63 73 20 6f 66 20 | 70 6f 73 73 69 62 6c 65 |pics of |possible|
|000034a0| 20 69 6e 74 65 72 65 73 | 74 2e 0a 53 45 53 53 2e | interes|t..SESS.|
|000034b0| 64 72 61 66 74 32 20 6c | 65 61 64 73 20 74 68 65 |draft2 l|eads the|
|000034c0| 20 72 65 61 64 65 72 20 | 74 68 72 6f 75 67 68 20 | reader |through |
|000034d0| 61 20 73 65 73 73 69 6f | 6e 20 6d 61 6e 61 67 65 |a sessio|n manage|
|000034e0| 6d 65 6e 74 20 74 75 74 | 6f 72 69 61 6c 2e 0a 58 |ment tut|orial..X|
|000034f0| 0a 58 2a 2e 31 3a 20 6d | 61 6e 20 70 61 67 65 73 |.X*.1: m|an pages|
|00003500| 20 66 6f 72 20 75 73 65 | 72 20 70 72 6f 67 72 61 | for use|r progra|
|00003510| 6d 73 2e 0a 58 0a 58 2a | 2e 33 3a 20 6d 61 6e 20 |ms..X.X*|.3: man |
|00003520| 70 61 67 65 73 20 66 6f | 72 20 6c 69 62 72 61 72 |pages fo|r librar|
|00003530| 69 65 73 2e 0a 58 0a 58 | 2a 2e 37 3a 20 6d 61 6e |ies..X.X|*.7: man|
|00003540| 20 70 61 67 65 73 20 67 | 69 76 69 6e 67 20 67 65 | pages g|iving ge|
|00003550| 6e 65 72 61 6c 20 69 6e | 66 6f 72 6d 61 74 69 6f |neral in|formatio|
|00003560| 6e 2e 0a 58 0a 58 2a 2e | 38 3a 20 6d 61 6e 20 70 |n..X.X*.|8: man p|
|00003570| 61 67 65 73 20 66 6f 72 | 20 73 79 73 61 64 6d 69 |ages for| sysadmi|
|00003580| 6e 20 70 72 6f 67 72 61 | 6d 73 2e 0a 58 0a 58 2a |n progra|ms..X.X*|
|00003590| 2e 63 3a 20 43 20 73 6f | 75 72 63 65 20 66 69 6c |.c: C so|urce fil|
|000035a0| 65 73 2e 0a 58 0a 58 2a | 2e 68 3a 20 43 20 68 65 |es..X.X*|.h: C he|
|000035b0| 61 64 65 72 20 66 69 6c | 65 73 2e 0a 58 0a 58 2a |ader fil|es..X.X*|
|000035c0| 2e 73 68 3a 20 73 68 20 | 73 6f 75 72 63 65 20 66 |.sh: sh |source f|
|000035d0| 69 6c 65 73 2e 20 4d 61 | 6b 65 66 69 6c 65 20 64 |iles. Ma|kefile d|
|000035e0| 6f 65 73 20 74 68 65 20 | 77 6f 72 6b 20 6f 66 20 |oes the |work of |
|000035f0| 60 60 63 6f 6d 70 69 6c | 69 6e 67 27 27 20 74 68 |``compil|ing'' th|
|00003600| 65 73 65 2e 0a 58 0a 63 | 6f 6e 66 69 67 2f 2a 2e |ese..X.c|onfig/*.|
|00003610| 68 3a 20 63 6f 6e 66 69 | 67 75 72 61 74 69 6f 6e |h: confi|guration|
|00003620| 20 66 69 6c 65 73 2e 20 | 49 6e 73 74 65 61 64 20 | files. |Instead |
|00003630| 6f 66 20 61 20 62 69 67 | 20 63 6f 6e 66 69 67 2e |of a big| config.|
|00003640| 68 2c 20 6f 72 20 6c 6f | 74 73 20 6f 66 0a 6f 70 |h, or lo|ts of.op|
|00003650| 74 69 6f 6e 73 20 73 70 | 72 65 61 64 20 74 68 72 |tions sp|read thr|
|00003660| 6f 75 67 68 20 4d 61 6b | 65 66 69 6c 65 20 6f 72 |ough Mak|efile or|
|00003670| 20 74 68 72 6f 75 67 68 | 20 69 6e 64 69 76 69 64 | through| individ|
|00003680| 75 61 6c 20 66 69 6c 65 | 73 2c 20 61 6c 6c 0a 63 |ual file|s, all.c|
|00003690| 6f 6d 70 69 6c 65 2d 74 | 69 6d 65 20 6f 70 74 69 |ompile-t|ime opti|
|000036a0| 6f 6e 73 20 61 72 65 20 | 63 6f 6c 6c 65 63 74 65 |ons are |collecte|
|000036b0| 64 20 68 65 72 65 2e 20 | 53 59 53 43 4f 4e 46 20 |d here. |SYSCONF |
|000036c0| 65 64 69 74 73 20 73 6f | 6d 65 20 6f 66 20 74 68 |edits so|me of th|
|000036d0| 65 73 65 2e 0a 59 6f 75 | 20 63 61 6e 20 65 64 69 |ese..You| can edi|
|000036e0| 74 20 74 68 65 6d 20 74 | 6f 6f 2e 20 4f 72 20 73 |t them t|oo. Or s|
|000036f0| 74 65 61 6c 20 74 68 65 | 6d 20 66 6f 72 20 6f 74 |teal the|m for ot|
|00003700| 68 65 72 20 70 72 6f 67 | 72 61 6d 73 2e 0a 45 4e |her prog|rams..EN|
|00003710| 44 5f 4f 46 5f 46 49 4c | 45 0a 69 66 20 74 65 73 |D_OF_FIL|E.if tes|
|00003720| 74 20 32 33 35 33 20 2d | 6e 65 20 60 77 63 20 2d |t 2353 -|ne `wc -|
|00003730| 63 20 3c 27 57 54 46 27 | 60 3b 20 74 68 65 6e 0a |c <'WTF'|`; then.|
|00003740| 20 20 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 5c | echo| shar: \|
|00003750| 22 27 57 54 46 27 5c 22 | 20 75 6e 70 61 63 6b 65 |"'WTF'\"| unpacke|
|00003760| 64 20 77 69 74 68 20 77 | 72 6f 6e 67 20 73 69 7a |d with w|rong siz|
|00003770| 65 21 0a 66 69 0a 23 20 | 65 6e 64 20 6f 66 20 27 |e!.fi.# |end of '|
|00003780| 57 54 46 27 0a 66 69 0a | 69 66 20 74 65 73 74 20 |WTF'.fi.|if test |
|00003790| 2d 66 20 27 67 65 74 6f | 70 74 2e 63 27 20 2d 61 |-f 'geto|pt.c' -a|
|000037a0| 20 22 24 7b 31 7d 22 20 | 21 3d 20 22 2d 63 22 20 | "${1}" |!= "-c" |
|000037b0| 3b 20 74 68 65 6e 20 0a | 20 20 65 63 68 6f 20 73 |; then .| echo s|
|000037c0| 68 61 72 3a 20 57 69 6c | 6c 20 6e 6f 74 20 63 6c |har: Wil|l not cl|
|000037d0| 6f 62 62 65 72 20 65 78 | 69 73 74 69 6e 67 20 66 |obber ex|isting f|
|000037e0| 69 6c 65 20 5c 22 27 67 | 65 74 6f 70 74 2e 63 27 |ile \"'g|etopt.c'|
|000037f0| 5c 22 0a 65 6c 73 65 0a | 65 63 68 6f 20 73 68 61 |\".else.|echo sha|
|00003800| 72 3a 20 45 78 74 72 61 | 63 74 69 6e 67 20 5c 22 |r: Extra|cting \"|
|00003810| 27 67 65 74 6f 70 74 2e | 63 27 5c 22 20 5c 28 33 |'getopt.|c'\" \(3|
|00003820| 32 37 36 20 63 68 61 72 | 61 63 74 65 72 73 5c 29 |276 char|acters\)|
|00003830| 0a 73 65 64 20 22 73 2f | 5e 58 2f 2f 22 20 3e 27 |.sed "s/|^X//" >'|
|00003840| 67 65 74 6f 70 74 2e 63 | 27 20 3c 3c 27 45 4e 44 |getopt.c|' <<'END|
|00003850| 5f 4f 46 5f 46 49 4c 45 | 27 0a 58 2f 2a 20 67 65 |_OF_FILE|'.X/* ge|
|00003860| 74 6f 70 74 2e 63 2c 20 | 67 65 74 6f 70 74 2e 68 |topt.c, |getopt.h|
|00003870| 3a 20 28 79 65 74 20 61 | 6e 6f 74 68 65 72 29 20 |: (yet a|nother) |
|00003880| 69 6d 70 72 6f 76 65 64 | 20 67 65 74 6f 70 74 20 |improved| getopt |
|00003890| 63 6c 6f 6e 65 0a 44 61 | 6e 69 65 6c 20 4a 2e 20 |clone.Da|niel J. |
|000038a0| 42 65 72 6e 73 74 65 69 | 6e 2c 20 62 72 6e 73 74 |Bernstei|n, brnst|
|000038b0| 6e 64 40 6e 79 75 2e 65 | 64 75 2e 0a 4e 6f 20 64 |nd@nyu.e|du..No d|
|000038c0| 65 70 65 6e 64 65 6e 63 | 69 65 73 2e 0a 52 65 71 |ependenc|ies..Req|
|000038d0| 75 69 72 65 73 20 73 74 | 64 69 6f 2e 0a 58 31 30 |uires st|dio..X10|
|000038e0| 2f 32 30 2f 39 31 3a 20 | 52 65 6d 6f 76 65 64 20 |/20/91: |Removed |
|000038f0| 2d 44 47 45 54 4f 50 54 | 5f 53 48 55 54 5f 55 50 |-DGETOPT|_SHUT_UP|
|00003900| 2e 20 5b 73 69 67 68 5d | 0a 58 38 2f 32 36 2f 39 |. [sigh]|.X8/26/9|
|00003910| 31 3a 20 41 64 64 65 64 | 20 2d 44 47 45 54 4f 50 |1: Added| -DGETOP|
|00003920| 54 5f 53 48 55 54 5f 55 | 50 2e 0a 58 38 2f 32 35 |T_SHUT_U|P..X8/25|
|00003930| 2f 39 31 3a 20 43 68 61 | 6e 67 65 64 20 67 65 74 |/91: Cha|nged get|
|00003940| 6f 70 74 20 74 6f 20 6e | 6f 74 20 73 6b 69 70 20 |opt to n|ot skip |
|00003950| 62 6c 61 6e 6b 20 61 72 | 67 75 6d 65 6e 74 73 2e |blank ar|guments.|
|00003960| 0a 58 37 2f 36 2f 39 31 | 3a 20 42 61 73 65 6c 69 |.X7/6/91|: Baseli|
|00003970| 6e 65 2e 20 67 65 74 6f | 70 74 20 31 2e 30 2c 20 |ne. geto|pt 1.0, |
|00003980| 70 75 62 6c 69 63 20 64 | 6f 6d 61 69 6e 2e 0a 4e |public d|omain..N|
|00003990| 6f 20 6b 6e 6f 77 6e 20 | 70 61 74 65 6e 74 20 70 |o known |patent p|
|000039a0| 72 6f 62 6c 65 6d 73 2e | 0a 58 0a 54 68 69 73 20 |roblems.|.X.This |
|000039b0| 69 73 20 61 20 63 6c 6f | 6e 65 20 6f 66 20 74 68 |is a clo|ne of th|
|000039c0| 65 20 75 73 75 61 6c 20 | 67 65 74 6f 70 74 28 29 |e usual |getopt()|
|000039d0| 20 66 75 6e 63 74 69 6f | 6e 73 2e 20 49 74 20 69 | functio|ns. It i|
|000039e0| 6e 63 6c 75 64 65 73 20 | 6f 70 74 65 72 72 20 73 |ncludes |opterr s|
|000039f0| 6f 0a 74 68 61 74 20 79 | 6f 75 20 63 61 6e 20 74 |o.that y|ou can t|
|00003a00| 75 72 6e 20 6f 66 66 20 | 65 72 72 6f 72 20 68 61 |urn off |error ha|
|00003a10| 6e 64 6c 69 6e 67 2c 20 | 6f 70 74 70 6f 73 20 73 |ndling, |optpos s|
|00003a20| 6f 20 74 68 61 74 20 79 | 6f 75 20 63 61 6e 20 66 |o that y|ou can f|
|00003a30| 69 6e 64 20 6f 75 74 0a | 65 78 61 63 74 6c 79 20 |ind out.|exactly |
|00003a40| 77 68 65 72 65 20 74 68 | 65 20 70 72 6f 63 65 73 |where th|e proces|
|00003a50| 73 69 6e 67 20 69 73 20 | 75 70 20 74 6f 20 28 69 |sing is |up to (i|
|00003a60| 6e 73 74 65 61 64 20 6f | 66 20 6a 75 73 74 20 77 |nstead o|f just w|
|00003a70| 68 69 63 68 20 61 72 67 | 75 6d 65 6e 74 29 2c 0a |hich arg|ument),.|
|00003a80| 6f 70 74 70 72 6f 62 6c | 65 6d 20 73 6f 20 74 68 |optprobl|em so th|
|00003a90| 61 74 20 79 6f 75 20 63 | 61 6e 20 61 63 63 75 72 |at you c|an accur|
|00003aa0| 61 74 65 6c 79 20 64 69 | 61 67 6e 6f 73 65 20 65 |ately di|agnose e|
|00003ab0| 72 72 6f 72 73 20 79 6f | 75 72 73 65 6c 66 2c 20 |rrors yo|urself, |
|00003ac0| 61 6e 64 0a 6f 70 74 70 | 72 6f 67 6e 61 6d 65 20 |and.optp|rogname |
|00003ad0| 73 6f 20 74 68 61 74 20 | 79 6f 75 20 63 61 6e 20 |so that |you can |
|00003ae0| 73 65 74 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 |set the |program |
|00003af0| 6e 61 6d 65 20 66 6f 72 | 20 67 65 74 6f 70 74 2d |name for| getopt-|
|00003b00| 67 65 6e 65 72 61 74 65 | 64 0a 65 72 72 6f 72 73 |generate|d.errors|
|00003b10| 2e 20 67 65 74 6f 70 74 | 28 29 20 74 61 6b 65 73 |. getopt|() takes|
|00003b20| 20 6d 75 63 68 20 6d 6f | 72 65 20 63 61 72 65 20 | much mo|re care |
|00003b30| 74 6f 20 65 6e 73 75 72 | 65 20 74 68 61 74 20 61 |to ensur|e that a|
|00003b40| 6c 6c 20 74 68 65 20 76 | 61 72 69 61 62 6c 65 73 |ll the v|ariables|
|00003b50| 0a 73 74 69 6c 6c 20 6d | 61 6b 65 20 73 65 6e 73 |.still m|ake sens|
|00003b60| 65 20 75 70 6f 6e 20 65 | 72 72 6f 72 73 20 61 6e |e upon e|rrors an|
|00003b70| 64 20 45 4f 46 2e 20 28 | 6f 70 74 70 72 6f 62 6c |d EOF. (|optprobl|
|00003b80| 65 6d 20 69 73 20 61 20 | 63 68 61 72 61 63 74 65 |em is a |characte|
|00003b90| 72 2e 20 49 66 0a 61 72 | 67 76 5b 6f 70 74 69 6e |r. If.ar|gv[optin|
|00003ba0| 64 5d 20 69 73 20 30 2c | 20 74 68 65 20 70 72 6f |d] is 0,| the pro|
|00003bb0| 62 6c 65 6d 20 69 73 20 | 61 20 6d 69 73 73 69 6e |blem is |a missin|
|00003bc0| 67 20 61 72 67 75 6d 65 | 6e 74 3b 20 6f 74 68 65 |g argume|nt; othe|
|00003bd0| 72 77 69 73 65 20 69 74 | 27 73 20 61 6e 0a 69 6c |rwise it|'s an.il|
|00003be0| 6c 65 67 61 6c 20 6f 70 | 74 69 6f 6e 20 63 68 61 |legal op|tion cha|
|00003bf0| 72 61 63 74 65 72 2e 29 | 20 55 6e 6c 65 73 73 20 |racter.)| Unless |
|00003c00| 79 6f 75 20 64 65 66 69 | 6e 65 20 47 45 54 4f 50 |you defi|ne GETOP|
|00003c10| 54 4f 52 49 47 44 45 46 | 2c 20 74 68 65 20 68 65 |TORIGDEF|, the he|
|00003c20| 61 64 65 72 0a 66 69 6c | 65 20 72 65 64 65 66 69 |ader.fil|e redefi|
|00003c30| 6e 65 73 20 61 6c 6c 20 | 6e 61 6d 65 73 20 73 6f |nes all |names so|
|00003c40| 20 74 68 61 74 20 79 6f | 75 20 64 6f 6e 27 74 20 | that yo|u don't |
|00003c50| 68 61 76 65 20 74 6f 20 | 77 6f 72 72 79 20 61 62 |have to |worry ab|
|00003c60| 6f 75 74 20 63 6f 6e 66 | 6c 69 63 74 73 0a 77 69 |out conf|licts.wi|
|00003c70| 74 68 20 6c 69 62 63 2e | 20 46 69 6e 61 6c 6c 79 |th libc.| Finally|
|00003c80| 2c 20 74 68 65 20 63 6f | 64 65 20 69 73 20 70 75 |, the co|de is pu|
|00003c90| 62 6c 69 63 2d 64 6f 6d | 61 69 6e 2c 20 73 6f 20 |blic-dom|ain, so |
|00003ca0| 79 6f 75 20 73 68 6f 75 | 6c 64 20 66 65 65 6c 20 |you shou|ld feel |
|00003cb0| 66 72 65 65 0a 74 6f 20 | 75 73 65 20 74 68 65 73 |free.to |use thes|
|00003cc0| 65 20 65 78 74 72 61 20 | 66 65 61 74 75 72 65 73 |e extra |features|
|00003cd0| 20 69 6e 20 79 6f 75 72 | 20 6f 77 6e 20 70 72 6f | in your| own pro|
|00003ce0| 67 72 61 6d 73 20 61 6e | 64 20 6a 75 73 74 20 61 |grams an|d just a|
|00003cf0| 74 74 61 63 68 20 61 20 | 63 6f 70 79 0a 6f 66 20 |ttach a |copy.of |
|00003d00| 74 68 69 73 2e 0a 58 0a | 4e 6f 74 65 20 74 68 61 |this..X.|Note tha|
|00003d10| 74 20 6f 70 74 69 6e 64 | 20 61 6e 64 20 6f 70 74 |t optind| and opt|
|00003d20| 70 6f 73 20 63 61 6e 20 | 62 65 20 72 65 61 64 20 |pos can |be read |
|00003d30| 28 6f 72 20 73 65 74 29 | 20 61 6e 79 20 74 69 6d |(or set)| any tim|
|00003d40| 65 2c 20 62 75 74 20 74 | 68 65 0a 6f 66 66 69 63 |e, but t|he.offic|
|00003d50| 69 61 6c 20 67 65 74 6f | 70 74 20 69 6e 74 65 72 |ial geto|pt inter|
|00003d60| 66 61 63 65 20 6f 6e 6c | 79 20 64 65 66 69 6e 65 |face onl|y define|
|00003d70| 73 20 6f 70 74 69 6e 64 | 20 77 68 65 6e 20 67 65 |s optind| when ge|
|00003d80| 74 6f 70 74 28 29 20 72 | 65 74 75 72 6e 73 20 45 |topt() r|eturns E|
|00003d90| 4f 46 2e 0a 57 65 20 64 | 65 66 69 6e 65 20 6f 70 |OF..We d|efine op|
|00003da0| 74 70 72 6f 62 6c 65 6d | 20 6f 6e 6c 79 20 77 68 |tproblem| only wh|
|00003db0| 65 6e 20 67 65 74 6f 70 | 74 28 29 20 72 65 74 75 |en getop|t() retu|
|00003dc0| 72 6e 73 20 27 3f 27 2c | 20 6f 70 74 61 72 67 20 |rns '?',| optarg |
|00003dd0| 61 6c 6c 20 74 68 65 0a | 74 69 6d 65 2c 20 61 6e |all the.|time, an|
|00003de0| 64 20 6f 70 74 70 72 6f | 67 72 61 6d 20 6f 6e 6c |d optpro|gram onl|
|00003df0| 79 20 61 66 74 65 72 20 | 67 65 74 6f 70 74 28 29 |y after |getopt()|
|00003e00| 20 68 61 73 20 62 65 65 | 6e 20 63 61 6c 6c 65 64 | has bee|n called|
|00003e10| 20 61 74 20 6c 65 61 73 | 74 20 6f 6e 63 65 2e 0a | at leas|t once..|
|00003e20| 58 0a 58 2a 2f 0a 58 0a | 58 23 69 6e 63 6c 75 64 |X.X*/.X.|X#includ|
|00003e30| 65 20 3c 73 74 64 69 6f | 2e 68 3e 20 2f 2a 20 66 |e <stdio|.h> /* f|
|00003e40| 6f 72 20 45 4f 46 20 61 | 6e 64 20 73 74 64 65 72 |or EOF a|nd stder|
|00003e50| 72 2d 2d 2d 74 61 6c 6b | 20 61 62 6f 75 74 20 69 |r---talk| about i|
|00003e60| 6d 6d 6f 64 75 6c 61 72 | 69 74 79 21 20 2a 2f 0a |mmodular|ity! */.|
|00003e70| 58 23 69 6e 63 6c 75 64 | 65 20 22 67 65 74 6f 70 |X#includ|e "getop|
|00003e80| 74 2e 68 22 0a 58 0a 69 | 6e 74 20 6f 70 74 69 6e |t.h".X.i|nt optin|
|00003e90| 64 20 3d 20 31 3b 0a 69 | 6e 74 20 6f 70 74 70 6f |d = 1;.i|nt optpo|
|00003ea0| 73 20 3d 20 30 3b 0a 69 | 6e 74 20 6f 70 74 65 72 |s = 0;.i|nt opter|
|00003eb0| 72 20 3d 20 31 3b 0a 63 | 68 61 72 20 2a 6f 70 74 |r = 1;.c|har *opt|
|00003ec0| 61 72 67 20 3d 20 30 3b | 0a 69 6e 74 20 6f 70 74 |arg = 0;|.int opt|
|00003ed0| 70 72 6f 62 6c 65 6d 20 | 3d 20 30 3b 0a 63 68 61 |problem |= 0;.cha|
|00003ee0| 72 20 2a 6f 70 74 70 72 | 6f 67 6e 61 6d 65 20 3d |r *optpr|ogname =|
|00003ef0| 20 30 3b 0a 69 6e 74 20 | 6f 70 74 65 6f 66 20 3d | 0;.int |opteof =|
|00003f00| 20 45 4f 46 3b 0a 58 0a | 69 6e 74 20 67 65 74 6f | EOF;.X.|int geto|
|00003f10| 70 74 28 61 72 67 63 2c | 61 72 67 76 2c 6f 70 74 |pt(argc,|argv,opt|
|00003f20| 73 29 0a 69 6e 74 20 61 | 72 67 63 3b 0a 63 68 61 |s).int a|rgc;.cha|
|00003f30| 72 20 2a 2a 61 72 67 76 | 3b 0a 63 68 61 72 20 2a |r **argv|;.char *|
|00003f40| 6f 70 74 73 3b 0a 58 7b | 0a 58 20 69 6e 74 20 63 |opts;.X{|.X int c|
|00003f50| 3b 0a 58 20 63 68 61 72 | 20 2a 73 3b 0a 58 0a 58 |;.X char| *s;.X.X|
|00003f60| 20 6f 70 74 61 72 67 20 | 3d 20 30 3b 0a 58 20 69 | optarg |= 0;.X i|
|00003f70| 66 20 28 21 6f 70 74 70 | 72 6f 67 6e 61 6d 65 29 |f (!optp|rogname)|
|00003f80| 0a 58 20 20 7b 0a 58 20 | 20 20 6f 70 74 70 72 6f |.X {.X | optpro|
|00003f90| 67 6e 61 6d 65 20 3d 20 | 2a 61 72 67 76 3b 0a 58 |gname = |*argv;.X|
|00003fa0| 20 20 20 69 66 20 28 21 | 6f 70 74 70 72 6f 67 6e | if (!|optprogn|
|00003fb0| 61 6d 65 29 20 2f 2a 20 | 6f 68 20 62 6f 79 20 2a |ame) /* |oh boy *|
|00003fc0| 2f 0a 58 20 20 20 20 20 | 6f 70 74 70 72 6f 67 6e |/.X |optprogn|
|00003fd0| 61 6d 65 20 3d 20 22 22 | 3b 20 2f 2a 58 58 58 2a |ame = ""|; /*XXX*|
|00003fe0| 2f 0a 58 20 20 20 66 6f | 72 20 28 73 20 3d 20 6f |/.X fo|r (s = o|
|00003ff0| 70 74 70 72 6f 67 6e 61 | 6d 65 3b 2a 73 3b 2b 2b |ptprogna|me;*s;++|
|00004000| 73 29 0a 58 20 20 20 20 | 20 69 66 20 28 2a 73 20 |s).X | if (*s |
|00004010| 3d 3d 20 27 2f 27 29 0a | 58 20 20 20 20 20 20 20 |== '/').|X |
|00004020| 6f 70 74 70 72 6f 67 6e | 61 6d 65 20 3d 20 73 20 |optprogn|ame = s |
|00004030| 2b 20 31 3b 0a 58 20 20 | 7d 0a 58 20 69 66 20 28 |+ 1;.X |}.X if (|
|00004040| 21 61 72 67 76 20 7c 7c | 20 28 6f 70 74 69 6e 64 |!argv ||| (optind|
|00004050| 20 3e 3d 20 61 72 67 63 | 29 20 7c 7c 20 21 61 72 | >= argc|) || !ar|
|00004060| 67 76 5b 6f 70 74 69 6e | 64 5d 29 0a 58 20 20 20 |gv[optin|d]).X |
|00004070| 72 65 74 75 72 6e 20 6f | 70 74 65 6f 66 3b 0a 58 |return o|pteof;.X|
|00004080| 20 77 68 69 6c 65 20 28 | 6f 70 74 70 6f 73 20 26 | while (|optpos &|
|00004090| 26 20 21 61 72 67 76 5b | 6f 70 74 69 6e 64 5d 5b |& !argv[|optind][|
|000040a0| 6f 70 74 70 6f 73 5d 29 | 0a 58 20 20 7b 0a 58 20 |optpos])|.X {.X |
|000040b0| 20 20 2f 2a 20 77 65 20 | 73 69 6d 70 6c 79 20 73 | /* we |simply s|
|000040c0| 6b 69 70 20 62 6c 61 6e | 6b 20 61 72 67 75 6d 65 |kip blan|k argume|
|000040d0| 6e 74 73 2e 2e 2e 20 6e | 6f 74 20 61 6e 79 20 6d |nts... n|ot any m|
|000040e0| 6f 72 65 20 2a 2f 0a 58 | 20 20 20 2b 2b 6f 70 74 |ore */.X| ++opt|
|000040f0| 69 6e 64 3b 0a 58 20 20 | 20 6f 70 74 70 6f 73 20 |ind;.X | optpos |
|00004100| 3d 20 30 3b 0a 58 20 20 | 20 69 66 20 28 28 6f 70 |= 0;.X | if ((op|
|00004110| 74 69 6e 64 20 3e 3d 20 | 61 72 67 63 29 20 7c 7c |tind >= |argc) |||
|00004120| 20 21 61 72 67 76 5b 6f | 70 74 69 6e 64 5d 29 0a | !argv[o|ptind]).|
|00004130| 58 20 20 20 20 20 72 65 | 74 75 72 6e 20 6f 70 74 |X re|turn opt|
|00004140| 65 6f 66 3b 0a 58 20 20 | 7d 0a 58 20 69 66 20 28 |eof;.X |}.X if (|
|00004150| 21 6f 70 74 70 6f 73 29 | 0a 58 20 20 7b 0a 58 20 |!optpos)|.X {.X |
|00004160| 20 20 69 66 20 28 61 72 | 67 76 5b 6f 70 74 69 6e | if (ar|gv[optin|
|00004170| 64 5d 5b 30 5d 20 21 3d | 20 27 2d 27 29 0a 58 20 |d][0] !=| '-').X |
|00004180| 20 20 20 20 72 65 74 75 | 72 6e 20 6f 70 74 65 6f | retu|rn opteo|
|00004190| 66 3b 0a 58 20 20 20 2b | 2b 6f 70 74 70 6f 73 3b |f;.X +|+optpos;|
|000041a0| 0a 58 20 20 20 63 20 3d | 20 61 72 67 76 5b 6f 70 |.X c =| argv[op|
|000041b0| 74 69 6e 64 5d 5b 31 5d | 3b 0a 58 20 20 20 69 66 |tind][1]|;.X if|
|000041c0| 20 28 28 63 20 3d 3d 20 | 27 2d 27 29 20 7c 7c 20 | ((c == |'-') || |
|000041d0| 28 63 20 3d 3d 20 30 29 | 29 0a 58 20 20 20 20 7b |(c == 0)|).X {|
|000041e0| 0a 58 20 20 20 20 20 2f | 2a 20 58 58 58 3a 20 74 |.X /|* XXX: t|
|000041f0| 68 69 73 20 62 65 68 61 | 76 69 6f 72 20 6f 66 20 |his beha|vior of |
|00004200| 22 2d 22 20 69 73 20 73 | 74 75 70 69 64 20 2a 2f |"-" is s|tupid */|
|00004210| 0a 58 20 20 20 20 20 69 | 66 20 28 63 29 0a 58 20 |.X i|f (c).X |
|00004220| 20 20 20 20 20 20 2b 2b | 6f 70 74 69 6e 64 3b 0a | ++|optind;.|
|00004230| 58 20 20 20 20 20 6f 70 | 74 70 6f 73 20 3d 20 30 |X op|tpos = 0|
|00004240| 3b 0a 58 20 20 20 20 20 | 72 65 74 75 72 6e 20 6f |;.X |return o|
|00004250| 70 74 65 6f 66 3b 0a 58 | 20 20 20 20 7d 0a 58 20 |pteof;.X| }.X |
|00004260| 20 20 2f 2a 20 6f 74 68 | 65 72 77 69 73 65 20 63 | /* oth|erwise c|
|00004270| 20 69 73 20 72 65 61 73 | 73 69 67 6e 65 64 20 62 | is reas|signed b|
|00004280| 65 6c 6f 77 20 2a 2f 0a | 58 20 20 7d 0a 58 20 63 |elow */.|X }.X c|
|00004290| 20 3d 20 61 72 67 76 5b | 6f 70 74 69 6e 64 5d 5b | = argv[|optind][|
|000042a0| 6f 70 74 70 6f 73 5d 3b | 0a 58 20 2b 2b 6f 70 74 |optpos];|.X ++opt|
|000042b0| 70 6f 73 3b 0a 58 20 73 | 20 3d 20 6f 70 74 73 3b |pos;.X s| = opts;|
|000042c0| 0a 58 20 77 68 69 6c 65 | 20 28 2a 73 29 0a 58 20 |.X while| (*s).X |
|000042d0| 20 7b 0a 58 20 20 20 69 | 66 20 28 63 20 3d 3d 20 | {.X i|f (c == |
|000042e0| 2a 73 29 0a 58 20 20 20 | 20 7b 0a 58 20 20 20 20 |*s).X | {.X |
|000042f0| 20 69 66 20 28 73 5b 31 | 5d 20 3d 3d 20 27 3a 27 | if (s[1|] == ':'|
|00004300| 29 0a 58 20 20 20 20 20 | 20 7b 0a 58 20 20 20 20 |).X | {.X |
|00004310| 20 20 20 6f 70 74 61 72 | 67 20 3d 20 61 72 67 76 | optar|g = argv|
|00004320| 5b 6f 70 74 69 6e 64 5d | 20 2b 20 6f 70 74 70 6f |[optind]| + optpo|
|00004330| 73 3b 0a 58 20 20 20 20 | 20 20 20 2b 2b 6f 70 74 |s;.X | ++opt|
|00004340| 69 6e 64 3b 0a 58 20 20 | 20 20 20 20 20 6f 70 74 |ind;.X | opt|
|00004350| 70 6f 73 20 3d 20 30 3b | 0a 58 20 20 20 20 20 20 |pos = 0;|.X |
|00004360| 20 69 66 20 28 21 2a 6f | 70 74 61 72 67 29 0a 58 | if (!*o|ptarg).X|
|00004370| 20 20 20 20 20 20 20 20 | 7b 0a 58 20 20 20 20 20 | |{.X |
|00004380| 20 20 20 20 6f 70 74 61 | 72 67 20 3d 20 61 72 67 | opta|rg = arg|
|00004390| 76 5b 6f 70 74 69 6e 64 | 5d 3b 0a 58 20 20 20 20 |v[optind|];.X |
|000043a0| 20 20 20 20 20 69 66 20 | 28 28 6f 70 74 69 6e 64 | if |((optind|
|000043b0| 20 3e 3d 20 61 72 67 63 | 29 20 7c 7c 20 21 6f 70 | >= argc|) || !op|
|000043c0| 74 61 72 67 29 20 2f 2a | 20 61 72 67 75 6d 65 6e |targ) /*| argumen|
|000043d0| 74 20 70 61 73 74 20 65 | 6e 64 20 2a 2f 0a 58 20 |t past e|nd */.X |
|000043e0| 20 20 20 20 20 20 20 20 | 20 7b 0a 58 20 20 20 20 | | {.X |
|000043f0| 20 20 20 20 20 20 20 6f | 70 74 70 72 6f 62 6c 65 | o|ptproble|
|00004400| 6d 20 3d 20 63 3b 0a 58 | 20 20 20 20 20 20 20 20 |m = c;.X| |
|00004410| 20 20 20 69 66 20 28 6f | 70 74 65 72 72 29 0a 58 | if (o|pterr).X|
|00004420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 66 70 72 | | fpr|
|00004430| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 22 25 73 3a |intf(std|err,"%s:|
|00004440| 20 6f 70 74 69 6f 6e 20 | 72 65 71 75 69 72 65 73 | option |requires|
|00004450| 20 61 6e 20 61 72 67 75 | 6d 65 6e 74 20 2d 2d 20 | an argu|ment -- |
|00004460| 25 63 5c 6e 22 0a 58 20 | 20 20 20 20 20 20 20 20 |%c\n".X | |
|00004470| 20 20 20 20 20 20 2c 6f | 70 74 70 72 6f 67 6e 61 | ,o|ptprogna|
|00004480| 6d 65 2c 63 29 3b 0a 58 | 20 20 20 20 20 20 20 20 |me,c);.X| |
|00004490| 20 20 20 72 65 74 75 72 | 6e 20 27 3f 27 3b 0a 58 | retur|n '?';.X|
|000044a0| 20 20 20 20 20 20 20 20 | 20 20 7d 0a 58 09 20 2b | | }.X. +|
|000044b0| 2b 6f 70 74 69 6e 64 3b | 0a 58 20 20 20 20 20 20 |+optind;|.X |
|000044c0| 20 20 7d 0a 58 20 20 20 | 20 20 20 7d 0a 58 20 20 | }.X | }.X |
|000044d0| 20 20 20 72 65 74 75 72 | 6e 20 63 3b 0a 58 20 20 | retur|n c;.X |
|000044e0| 20 20 7d 0a 58 20 20 20 | 2b 2b 73 3b 0a 58 20 20 | }.X |++s;.X |
|000044f0| 20 69 66 20 28 2a 73 20 | 3d 3d 20 27 3a 27 29 0a | if (*s |== ':').|
|00004500| 58 20 20 20 20 20 2b 2b | 73 3b 0a 58 20 20 7d 0a |X ++|s;.X }.|
|00004510| 58 20 6f 70 74 70 72 6f | 62 6c 65 6d 20 3d 20 63 |X optpro|blem = c|
|00004520| 3b 0a 58 20 69 66 20 28 | 6f 70 74 65 72 72 29 0a |;.X if (|opterr).|
|00004530| 58 20 20 20 66 70 72 69 | 6e 74 66 28 73 74 64 65 |X fpri|ntf(stde|
|00004540| 72 72 2c 22 25 73 3a 20 | 69 6c 6c 65 67 61 6c 20 |rr,"%s: |illegal |
|00004550| 6f 70 74 69 6f 6e 20 2d | 2d 20 25 63 5c 6e 22 2c |option -|- %c\n",|
|00004560| 6f 70 74 70 72 6f 67 6e | 61 6d 65 2c 63 29 3b 0a |optprogn|ame,c);.|
|00004570| 58 20 72 65 74 75 72 6e | 20 27 3f 27 3b 0a 58 7d |X return| '?';.X}|
|00004580| 0a 45 4e 44 5f 4f 46 5f | 46 49 4c 45 0a 69 66 20 |.END_OF_|FILE.if |
|00004590| 74 65 73 74 20 33 32 37 | 36 20 2d 6e 65 20 60 77 |test 327|6 -ne `w|
|000045a0| 63 20 2d 63 20 3c 27 67 | 65 74 6f 70 74 2e 63 27 |c -c <'g|etopt.c'|
|000045b0| 60 3b 20 74 68 65 6e 0a | 20 20 20 20 65 63 68 6f |`; then.| echo|
|000045c0| 20 73 68 61 72 3a 20 5c | 22 27 67 65 74 6f 70 74 | shar: \|"'getopt|
|000045d0| 2e 63 27 5c 22 20 75 6e | 70 61 63 6b 65 64 20 77 |.c'\" un|packed w|
|000045e0| 69 74 68 20 77 72 6f 6e | 67 20 73 69 7a 65 21 0a |ith wron|g size!.|
|000045f0| 66 69 0a 23 20 65 6e 64 | 20 6f 66 20 27 67 65 74 |fi.# end| of 'get|
|00004600| 6f 70 74 2e 63 27 0a 66 | 69 0a 69 66 20 74 65 73 |opt.c'.f|i.if tes|
|00004610| 74 20 2d 66 20 27 70 74 | 79 2d 62 61 73 69 63 2e |t -f 'pt|y-basic.|
|00004620| 31 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |1' -a "$|{1}" != |
|00004630| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|00004640| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|00004650| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|00004660| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 70 74 79 2d |ing file| \"'pty-|
|00004670| 62 61 73 69 63 2e 31 27 | 5c 22 0a 65 6c 73 65 0a |basic.1'|\".else.|
|00004680| 65 63 68 6f 20 73 68 61 | 72 3a 20 45 78 74 72 61 |echo sha|r: Extra|
|00004690| 63 74 69 6e 67 20 5c 22 | 27 70 74 79 2d 62 61 73 |cting \"|'pty-bas|
|000046a0| 69 63 2e 31 27 5c 22 20 | 5c 28 33 31 32 37 20 63 |ic.1'\" |\(3127 c|
|000046b0| 68 61 72 61 63 74 65 72 | 73 5c 29 0a 73 65 64 20 |haracter|s\).sed |
|000046c0| 22 73 2f 5e 58 2f 2f 22 | 20 3e 27 70 74 79 2d 62 |"s/^X//"| >'pty-b|
|000046d0| 61 73 69 63 2e 31 27 20 | 3c 3c 27 45 4e 44 5f 4f |asic.1' |<<'END_O|
|000046e0| 46 5f 46 49 4c 45 27 0a | 58 2e 54 48 20 70 74 79 |F_FILE'.|X.TH pty|
|000046f0| 2d 62 61 73 69 63 20 31 | 0a 58 2e 53 48 20 4e 41 |-basic 1|.X.SH NA|
|00004700| 4d 45 0a 70 74 79 2d 62 | 61 73 69 63 20 5c 2d 20 |ME.pty-b|asic \- |
|00004710| 72 75 6e 20 61 20 70 72 | 6f 67 72 61 6d 20 75 6e |run a pr|ogram un|
|00004720| 64 65 72 20 61 20 70 73 | 65 75 64 6f 2d 74 65 72 |der a ps|eudo-ter|
|00004730| 6d 69 6e 61 6c 20 73 65 | 73 73 69 6f 6e 0a 58 2e |minal se|ssion.X.|
|00004740| 53 48 20 53 59 4e 54 41 | 58 0a 70 74 79 0a 58 2e |SH SYNTA|X.pty.X.|
|00004750| 49 20 70 72 6f 67 72 61 | 6d 0a 58 5b 0a 58 2e 49 |I progra|m.X[.X.I|
|00004760| 20 61 72 67 20 2e 2e 2e | 0a 58 5d 0a 58 2e 53 48 | arg ...|.X].X.SH|
|00004770| 20 44 45 53 43 52 49 50 | 54 49 4f 4e 0a 54 68 69 | DESCRIP|TION.Thi|
|00004780| 73 20 6d 61 6e 20 70 61 | 67 65 20 64 65 73 63 72 |s man pa|ge descr|
|00004790| 69 62 65 73 20 74 68 65 | 20 65 66 66 65 63 74 73 |ibes the| effects|
|000047a0| 20 6f 66 0a 58 2e 42 20 | 70 74 79 0a 77 69 74 68 | of.X.B |pty.with|
|000047b0| 6f 75 74 20 61 6e 79 20 | 6f 70 74 69 6f 6e 73 2e |out any |options.|
|000047c0| 0a 58 46 6f 72 20 61 20 | 67 65 6e 65 72 61 6c 20 |.XFor a |general |
|000047d0| 6f 76 65 72 76 69 65 77 | 20 6f 66 0a 58 2e 42 20 |overview| of.X.B |
|000047e0| 70 74 79 2c 0a 73 65 65 | 20 74 68 65 0a 58 2e 42 |pty,.see| the.X.B|
|000047f0| 20 70 74 79 28 31 29 0a | 6d 61 6e 20 70 61 67 65 | pty(1).|man page|
|00004800| 2e 0a 58 46 6f 72 20 61 | 20 64 65 73 63 72 69 70 |..XFor a| descrip|
|00004810| 74 69 6f 6e 20 6f 66 0a | 74 68 65 20 6f 70 74 69 |tion of.|the opti|
|00004820| 6f 6e 73 2c 0a 73 65 65 | 20 74 68 65 0a 58 2e 42 |ons,.see| the.X.B|
|00004830| 20 70 74 79 2d 6f 70 74 | 73 28 31 29 0a 6d 61 6e | pty-opt|s(1).man|
|00004840| 20 70 61 67 65 2e 0a 58 | 0a 58 45 78 65 63 75 74 | page..X|.XExecut|
|00004850| 69 6e 67 0a 58 2e 42 20 | 70 74 79 20 5c 66 49 70 |ing.X.B |pty \fIp|
|00004860| 72 6f 67 72 61 6d 0a 68 | 61 73 20 61 70 70 72 6f |rogram.h|as appro|
|00004870| 78 69 6d 61 74 65 6c 79 | 20 74 68 65 20 73 61 6d |ximately| the sam|
|00004880| 65 20 65 66 66 65 63 74 | 20 61 73 20 65 78 65 63 |e effect| as exec|
|00004890| 75 74 69 6e 67 0a 58 2e | 49 20 70 72 6f 67 72 61 |uting.X.|I progra|
|000048a0| 6d 0a 58 28 77 69 74 68 | 20 7a 65 72 6f 20 6f 72 |m.X(with| zero or|
|000048b0| 20 6d 6f 72 65 20 61 72 | 67 75 6d 65 6e 74 73 29 | more ar|guments)|
|000048c0| 2e 0a 58 2e 49 20 70 72 | 6f 67 72 61 6d 0a 69 73 |..X.I pr|ogram.is|
|000048d0| 20 72 75 6e 20 75 6e 64 | 65 72 20 61 20 70 73 65 | run und|er a pse|
|000048e0| 75 64 6f 2d 74 65 72 6d | 69 6e 61 6c 2e 20 54 68 |udo-term|inal. Th|
|000048f0| 69 73 20 6d 65 61 6e 73 | 20 73 65 76 65 72 61 6c |is means| several|
|00004900| 20 74 68 69 6e 67 73 3a | 0a 58 0a 58 31 2e 20 49 | things:|.X.X1. I|
|00004910| 74 73 20 73 74 61 6e 64 | 61 72 64 20 69 6e 70 75 |ts stand|ard inpu|
|00004920| 74 2c 20 6f 75 74 70 75 | 74 2c 20 61 6e 64 20 65 |t, outpu|t, and e|
|00004930| 72 72 6f 72 20 64 65 73 | 63 72 69 70 74 6f 72 73 |rror des|criptors|
|00004940| 20 61 72 65 20 72 65 64 | 69 72 65 63 74 65 64 20 | are red|irected |
|00004950| 74 6f 20 61 0a 70 73 65 | 75 64 6f 2d 74 65 72 6d |to a.pse|udo-term|
|00004960| 69 6e 61 6c 20 64 65 76 | 69 63 65 20 64 72 69 76 |inal dev|ice driv|
|00004970| 65 72 2c 20 77 69 74 68 | 20 65 66 66 65 63 74 73 |er, with| effects|
|00004980| 20 64 6f 63 75 6d 65 6e | 74 65 64 20 69 6e 0a 58 | documen|ted in.X|
|00004990| 2e 42 20 70 74 79 28 34 | 29 0a 61 6e 64 0a 58 2e |.B pty(4|).and.X.|
|000049a0| 42 20 74 74 79 28 34 29 | 2e 0a 54 68 69 73 20 6d |B tty(4)|..This m|
|000049b0| 65 61 6e 73 20 74 68 61 | 74 0a 58 2e 49 20 70 72 |eans tha|t.X.I pr|
|000049c0| 6f 67 72 61 6d 0a 6d 61 | 79 20 75 73 65 0a 58 2e |ogram.ma|y use.X.|
|000049d0| 42 20 69 6f 63 74 6c 28 | 29 2c 0a 66 6f 72 20 65 |B ioctl(|),.for e|
|000049e0| 78 61 6d 70 6c 65 2c 20 | 74 6f 20 61 66 66 65 63 |xample, |to affec|
|000049f0| 74 20 74 68 65 0a 70 73 | 65 75 64 6f 2d 74 65 72 |t the.ps|eudo-ter|
|00004a00| 6d 69 6e 61 6c 2e 0a 53 | 6f 20 70 72 6f 67 72 61 |minal..S|o progra|
|00004a10| 6d 73 20 73 75 63 68 20 | 61 73 0a 58 2e 42 20 76 |ms such |as.X.B v|
|00004a20| 69 2c 0a 77 68 69 63 68 | 20 6e 6f 72 6d 61 6c 6c |i,.which| normall|
|00004a30| 79 20 63 61 6e 6e 6f 74 | 20 62 65 20 72 75 6e 0a |y cannot| be run.|
|00004a40| 69 6e 73 69 64 65 20 61 | 20 70 69 70 65 2c 20 77 |inside a| pipe, w|
|00004a50| 69 6c 6c 20 73 65 65 20 | 61 20 74 65 72 6d 69 6e |ill see |a termin|
|00004a60| 61 6c 20 69 6e 73 74 65 | 61 64 2e 0a 58 28 4f 66 |al inste|ad..X(Of|
|00004a70| 20 63 6f 75 72 73 65 2c | 0a 58 2e 42 20 70 74 79 | course,|.X.B pty|
|00004a80| 0a 6d 61 79 20 62 65 20 | 70 75 74 0a 69 6e 74 6f |.may be |put.into|
|00004a90| 20 61 20 70 69 70 65 2e | 29 0a 58 0a 58 32 2e 0a | a pipe.|).X.X2..|
|00004aa0| 58 2e 42 20 69 73 61 74 | 74 79 28 29 0a 61 6e 64 |X.B isat|ty().and|
|00004ab0| 20 73 74 64 69 6f 27 73 | 20 62 75 66 66 65 72 69 | stdio's| bufferi|
|00004ac0| 6e 67 20 77 69 6c 6c 20 | 63 6f 6e 73 69 64 65 72 |ng will |consider|
|00004ad0| 20 74 68 6f 73 65 20 64 | 65 73 63 72 69 70 74 6f | those d|escripto|
|00004ae0| 72 73 20 74 6f 20 62 65 | 0a 70 6f 69 6e 74 69 6e |rs to be|.pointin|
|00004af0| 67 20 74 6f 20 61 20 74 | 65 72 6d 69 6e 61 6c 2c |g to a t|erminal,|
|00004b00| 20 77 69 74 68 20 65 66 | 66 65 63 74 73 20 64 6f | with ef|fects do|
|00004b10| 63 75 6d 65 6e 74 65 64 | 20 69 6e 0a 58 2e 42 20 |cumented| in.X.B |
|00004b20| 69 73 61 74 74 79 28 33 | 29 0a 61 6e 64 0a 58 2e |isatty(3|).and.X.|
|00004b30| 42 20 73 65 74 62 75 66 | 28 33 29 2e 0a 54 68 69 |B setbuf|(3)..Thi|
|00004b40| 73 20 6d 65 61 6e 73 20 | 74 68 61 74 20 69 66 20 |s means |that if |
|00004b50| 0a 58 2e 49 20 70 72 6f | 67 72 61 6d 0a 75 73 65 |.X.I pro|gram.use|
|00004b60| 73 20 73 74 64 69 6f 2c | 20 69 74 73 20 6f 75 74 |s stdio,| its out|
|00004b70| 70 75 74 20 77 69 6c 6c | 20 62 65 0a 6c 69 6e 65 |put will| be.line|
|00004b80| 2d 62 75 66 66 65 72 65 | 64 2e 0a 58 0a 58 33 2e |-buffere|d..X.X3.|
|00004b90| 20 49 6e 70 75 74 20 74 | 6f 0a 58 2e 42 20 70 74 | Input t|o.X.B pt|
|00004ba0| 79 20 5c 66 49 70 72 6f | 67 72 61 6d 0a 69 73 20 |y \fIpro|gram.is |
|00004bb0| 70 61 73 73 65 64 20 74 | 68 72 6f 75 67 68 20 74 |passed t|hrough t|
|00004bc0| 6f 20 74 68 65 20 70 73 | 65 75 64 6f 2d 74 65 72 |o the ps|eudo-ter|
|00004bd0| 6d 69 6e 61 6c 0a 69 6e | 70 75 74 2e 20 4f 75 74 |minal.in|put. Out|
|00004be0| 70 75 74 20 61 6e 64 20 | 65 72 72 6f 72 20 74 6f |put and |error to|
|00004bf0| 20 74 68 65 20 70 73 65 | 75 64 6f 2d 74 65 72 6d | the pse|udo-term|
|00004c00| 69 6e 61 6c 20 61 72 65 | 20 70 61 73 73 65 64 20 |inal are| passed |
|00004c10| 74 68 72 6f 75 67 68 20 | 74 6f 20 74 68 65 0a 6f |through |to the.o|
|00004c20| 75 74 70 75 74 20 6f 66 | 0a 58 2e 42 20 70 74 79 |utput of|.X.B pty|
|00004c30| 20 5c 66 49 70 72 6f 67 | 72 61 6d 2e 0a 58 0a 58 | \fIprog|ram..X.X|
|00004c40| 34 2e 0a 58 2e 49 20 70 | 72 6f 67 72 61 6d 0a 68 |4..X.I p|rogram.h|
|00004c50| 61 73 20 63 6f 6e 74 72 | 6f 6c 6c 69 6e 67 20 74 |as contr|olling t|
|00004c60| 65 72 6d 69 6e 61 6c 20 | 73 65 74 20 74 6f 20 74 |erminal |set to t|
|00004c70| 68 65 20 70 73 65 75 64 | 6f 2d 74 65 72 6d 69 6e |he pseud|o-termin|
|00004c80| 61 6c 2c 20 77 69 74 68 | 0a 65 66 66 65 63 74 73 |al, with|.effects|
|00004c90| 20 64 6f 63 75 6d 65 6e | 74 65 64 20 69 6e 0a 58 | documen|ted in.X|
|00004ca0| 2e 42 20 74 74 79 28 34 | 29 2e 0a 58 0a 58 35 2e |.B tty(4|)..X.X5.|
|00004cb0| 0a 58 2e 42 20 70 74 79 | 20 5c 66 49 70 72 6f 67 |.X.B pty| \fIprog|
|00004cc0| 72 61 6d 0a 6d 75 73 74 | 20 68 61 76 65 20 61 6e |ram.must| have an|
|00004cd0| 20 6f 72 69 67 69 6e 61 | 6c 20 63 6f 6e 74 72 6f | origina|l contro|
|00004ce0| 6c 6c 69 6e 67 20 74 74 | 79 2e 0a 58 2e 42 20 70 |lling tt|y..X.B p|
|00004cf0| 74 79 0a 63 6f 6e 73 69 | 64 65 72 73 20 74 68 65 |ty.consi|ders the|
|00004d00| 20 63 6f 6e 74 72 6f 6c | 6c 69 6e 67 20 74 74 79 | control|ling tty|
|00004d10| 20 74 6f 20 62 65 20 74 | 68 65 20 66 69 72 73 74 | to be t|he first|
|00004d20| 20 6f 66 0a 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e | of.the |followin|
|00004d30| 67 20 77 68 69 63 68 20 | 72 65 73 70 6f 6e 64 73 |g which |responds|
|00004d40| 20 74 6f 20 61 20 54 49 | 4f 43 47 50 47 52 50 20 | to a TI|OCGPGRP |
|00004d50| 69 6f 63 74 6c 3a 0a 64 | 65 73 63 72 69 70 74 6f |ioctl:.d|escripto|
|00004d60| 72 20 33 2c 20 2f 64 65 | 76 2f 74 74 79 2c 20 64 |r 3, /de|v/tty, d|
|00004d70| 65 73 63 72 69 70 74 6f | 72 20 30 2c 20 64 65 73 |escripto|r 0, des|
|00004d80| 63 72 69 70 74 6f 72 20 | 31 2c 0a 64 65 73 63 72 |criptor |1,.descr|
|00004d90| 69 70 74 6f 72 20 32 2e | 0a 58 2e 42 20 70 74 79 |iptor 2.|.X.B pty|
|00004da0| 0a 73 65 74 73 20 74 68 | 61 74 20 74 65 72 6d 69 |.sets th|at termi|
|00004db0| 6e 61 6c 20 74 6f 20 63 | 68 61 72 61 63 74 65 72 |nal to c|haracter|
|00004dc0| 2d 61 74 2d 61 2d 74 69 | 6d 65 2c 20 6e 6f 2d 65 |-at-a-ti|me, no-e|
|00004dd0| 63 68 6f 20 6d 6f 64 65 | 2c 0a 74 6f 20 64 6f 20 |cho mode|,.to do |
|00004de0| 61 73 20 6c 69 74 74 6c | 65 20 70 72 6f 63 65 73 |as littl|e proces|
|00004df0| 73 69 6e 67 20 61 73 20 | 70 6f 73 73 69 62 6c 65 |sing as |possible|
|00004e00| 2e 0a 49 74 20 73 65 74 | 73 20 74 68 65 20 70 73 |..It set|s the ps|
|00004e10| 65 75 64 6f 2d 74 65 72 | 6d 69 6e 61 6c 20 74 6f |eudo-ter|minal to|
|00004e20| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 6d 6f | the ori|ginal mo|
|00004e30| 64 65 2e 0a 57 68 65 6e | 0a 58 2e 49 20 70 72 6f |de..When|.X.I pro|
|00004e40| 67 72 61 6d 0a 66 69 6e | 69 73 68 65 73 2c 0a 58 |gram.fin|ishes,.X|
|00004e50| 2e 42 20 70 74 79 0a 73 | 65 74 73 20 74 68 65 20 |.B pty.s|ets the |
|00004e60| 6f 72 69 67 69 6e 61 6c | 20 74 65 72 6d 69 6e 61 |original| termina|
|00004e70| 6c 20 62 61 63 6b 20 74 | 6f 20 69 74 73 20 6f 72 |l back t|o its or|
|00004e80| 69 67 69 6e 61 6c 20 6d | 6f 64 65 2e 0a 41 6e 79 |iginal m|ode..Any|
|00004e90| 20 6d 6f 64 65 20 63 68 | 61 6e 67 65 73 20 6f 6e | mode ch|anges on|
|00004ea0| 20 74 68 65 20 70 73 65 | 75 64 6f 2d 74 65 72 6d | the pse|udo-term|
|00004eb0| 69 6e 61 6c 20 77 69 6c | 6c 20 62 65 20 6c 6f 73 |inal wil|l be los|
|00004ec0| 74 2e 0a 54 68 65 20 6f | 72 69 67 69 6e 61 6c 20 |t..The o|riginal |
|00004ed0| 74 65 72 6d 69 6e 61 6c | 20 69 73 20 61 6c 73 6f |terminal| is also|
|00004ee0| 20 72 65 73 65 74 20 77 | 68 65 6e 65 76 65 72 0a | reset w|henever.|
|00004ef0| 58 2e 49 20 70 72 6f 67 | 72 61 6d 0a 69 73 20 73 |X.I prog|ram.is s|
|00004f00| 74 6f 70 70 65 64 0a 58 | 28 61 6e 64 20 74 68 65 |topped.X|(and the|
|00004f10| 6e 20 73 65 74 20 62 61 | 63 6b 20 74 6f 20 63 68 |n set ba|ck to ch|
|00004f20| 61 72 61 63 74 65 72 2d | 61 74 2d 61 2d 74 69 6d |aracter-|at-a-tim|
|00004f30| 65 20 6d 6f 64 65 20 77 | 68 65 6e 0a 58 2e 49 20 |e mode w|hen.X.I |
|00004f40| 70 72 6f 67 72 61 6d 0a | 69 73 20 72 65 73 74 61 |program.|is resta|
|00004f50| 72 74 65 64 29 2e 0a 58 | 0a 58 36 2e 0a 56 61 72 |rted)..X|.X6..Var|
|00004f60| 69 6f 75 73 20 73 69 67 | 6e 61 6c 73 20 74 6f 0a |ious sig|nals to.|
|00004f70| 58 2e 42 20 70 74 79 20 | 5c 66 49 70 72 6f 67 72 |X.B pty |\fIprogr|
|00004f80| 61 6d 0a 61 72 65 20 63 | 6f 6e 76 65 72 74 65 64 |am.are c|onverted|
|00004f90| 20 69 6e 74 6f 20 48 55 | 50 73 20 66 6f 72 0a 58 | into HU|Ps for.X|
|00004fa0| 2e 49 20 70 72 6f 67 72 | 61 6d 2e 0a 53 69 6e 67 |.I progr|am..Sing|
|00004fb0| 6c 65 2d 70 72 6f 63 65 | 73 73 20 73 69 67 6e 61 |le-proce|ss signa|
|00004fc0| 6c 73 20 6d 61 79 20 66 | 61 69 6c 20 75 70 6f 6e |ls may f|ail upon|
|00004fd0| 0a 58 2e 42 20 70 74 79 | 20 5c 66 49 70 72 6f 67 |.X.B pty| \fIprog|
|00004fe0| 72 61 6d 2e 0a 50 72 6f | 63 65 73 73 20 67 72 6f |ram..Pro|cess gro|
|00004ff0| 75 70 20 73 69 67 6e 61 | 6c 73 20 61 73 20 64 65 |up signa|ls as de|
|00005000| 73 63 72 69 62 65 64 20 | 69 6e 0a 58 2e 42 20 74 |scribed |in.X.B t|
|00005010| 74 79 28 34 29 0a 77 69 | 6c 6c 20 61 66 66 65 63 |ty(4).wi|ll affec|
|00005020| 74 20 69 74 20 6e 6f 72 | 6d 61 6c 6c 79 2e 0a 58 |t it nor|mally..X|
|00005030| 0a 58 37 2e 0a 41 6c 6c | 20 6e 6f 72 6d 61 6c 20 |.X7..All| normal |
|00005040| 65 78 69 74 73 20 28 69 | 6e 63 6c 75 64 69 6e 67 |exits (i|ncluding|
|00005050| 20 73 69 67 6e 61 6c 20 | 65 78 69 74 73 29 20 66 | signal |exits) f|
|00005060| 6f 72 0a 58 2e 49 20 70 | 72 6f 67 72 61 6d 0a 61 |or.X.I p|rogram.a|
|00005070| 72 65 20 63 6f 6e 76 65 | 72 74 65 64 0a 69 6e 74 |re conve|rted.int|
|00005080| 6f 20 65 78 69 74 20 63 | 6f 64 65 20 30 2e 0a 4f |o exit c|ode 0..O|
|00005090| 74 68 65 72 20 65 78 69 | 74 20 63 6f 64 65 73 20 |ther exi|t codes |
|000050a0| 69 6e 64 69 63 61 74 65 | 20 76 61 72 69 6f 75 73 |indicate| various|
|000050b0| 20 6e 65 77 2c 0a 70 74 | 79 2d 72 65 6c 61 74 65 | new,.pt|y-relate|
|000050c0| 64 20 70 72 6f 62 6c 65 | 6d 73 2c 20 77 68 69 63 |d proble|ms, whic|
|000050d0| 68 20 61 72 65 20 61 6c | 73 6f 20 61 6e 6e 6f 75 |h are al|so annou|
|000050e0| 6e 63 65 64 20 6f 6e 20 | 74 68 65 20 73 74 61 6e |nced on |the stan|
|000050f0| 64 61 72 64 20 65 72 72 | 6f 72 20 6f 66 0a 58 2e |dard err|or of.X.|
|00005100| 42 20 70 74 79 20 5c 66 | 49 70 72 6f 67 72 61 6d |B pty \f|Iprogram|
|00005110| 2e 0a 58 0a 58 38 2e 0a | 41 6c 6c 20 66 69 6c 65 |..X.X8..|All file|
|00005120| 20 64 65 73 63 72 69 70 | 74 6f 72 73 20 65 78 63 | descrip|tors exc|
|00005130| 65 70 74 20 30 2c 20 31 | 2c 20 61 6e 64 20 32 20 |ept 0, 1|, and 2 |
|00005140| 61 72 65 20 63 6c 6f 73 | 65 64 2e 0a 58 33 20 69 |are clos|ed..X3 i|
|00005150| 73 20 72 65 6f 70 65 6e | 65 64 20 61 73 20 74 68 |s reopen|ed as th|
|00005160| 65 20 6e 65 77 20 2f 64 | 65 76 2f 74 74 79 2c 0a |e new /d|ev/tty,.|
|00005170| 69 2e 65 2e 2c 0a 74 68 | 65 20 70 73 65 75 64 6f |i.e.,.th|e pseudo|
|00005180| 2d 74 65 72 6d 69 6e 61 | 6c 2e 0a 41 6c 6c 20 63 |-termina|l..All c|
|00005190| 6f 6e 74 72 6f 6c 6c 69 | 6e 67 20 74 65 72 6d 69 |ontrolli|ng termi|
|000051a0| 6e 61 6c 20 69 6f 63 74 | 6c 73 0a 6d 65 6e 74 69 |nal ioct|ls.menti|
|000051b0| 6f 6e 65 64 20 69 6e 0a | 58 2e 42 20 74 74 79 28 |oned in.|X.B tty(|
|000051c0| 34 29 0a 6d 61 79 20 62 | 65 20 61 70 70 6c 69 65 |4).may b|e applie|
|000051d0| 64 20 74 6f 20 66 69 6c | 65 20 64 65 73 63 72 69 |d to fil|e descri|
|000051e0| 70 74 6f 72 20 33 20 69 | 6e 73 74 65 61 64 2e 0a |ptor 3 i|nstead..|
|000051f0| 58 0a 4e 6f 74 65 20 74 | 68 61 74 0a 58 2e 42 20 |X.Note t|hat.X.B |
|00005200| 70 74 79 0a 74 72 61 6e | 73 6d 69 74 73 20 6a 6f |pty.tran|smits jo|
|00005210| 62 20 63 6f 6e 74 72 6f | 6c 20 74 72 61 6e 73 70 |b contro|l transp|
|00005220| 61 72 65 6e 74 6c 79 3a | 0a 69 66 0a 58 2e 49 20 |arently:|.if.X.I |
|00005230| 70 72 6f 67 72 61 6d 0a | 73 74 6f 70 73 20 77 69 |program.|stops wi|
|00005240| 74 68 20 28 73 61 79 29 | 0a 61 20 54 54 49 4e 2c |th (say)|.a TTIN,|
|00005250| 20 74 68 65 6e 0a 58 2e | 42 20 70 74 79 20 5c 66 | then.X.|B pty \f|
|00005260| 49 70 72 6f 67 72 61 6d | 0a 77 69 6c 6c 20 61 6c |Iprogram|.will al|
|00005270| 73 6f 20 73 74 6f 70 20 | 77 69 74 68 20 61 20 54 |so stop |with a T|
|00005280| 54 49 4e 2e 0a 57 68 65 | 6e 0a 58 2e 42 20 70 74 |TIN..Whe|n.X.B pt|
|00005290| 79 20 5c 66 49 70 72 6f | 67 72 61 6d 0a 69 73 20 |y \fIpro|gram.is |
|000052a0| 63 6f 6e 74 69 6e 75 65 | 64 2c 0a 58 2e 49 20 70 |continue|d,.X.I p|
|000052b0| 72 6f 67 72 61 6d 0a 77 | 69 6c 6c 20 72 65 63 65 |rogram.w|ill rece|
|000052c0| 69 76 65 20 61 20 43 4f | 4e 54 2e 0a 58 2e 53 48 |ive a CO|NT..X.SH|
|000052d0| 20 56 45 52 53 49 4f 4e | 0a 70 74 79 20 76 65 72 | VERSION|.pty ver|
|000052e0| 73 69 6f 6e 20 34 2e 30 | 2c 20 32 2f 39 2f 39 32 |sion 4.0|, 2/9/92|
|000052f0| 2e 0a 58 2e 53 48 20 41 | 55 54 48 4f 52 0a 43 6f |..X.SH A|UTHOR.Co|
|00005300| 70 79 72 69 67 68 74 20 | 31 39 39 32 2c 20 44 61 |pyright |1992, Da|
|00005310| 6e 69 65 6c 20 4a 2e 20 | 42 65 72 6e 73 74 65 69 |niel J. |Bernstei|
|00005320| 6e 2e 0a 58 2e 53 48 20 | 22 53 45 45 20 41 4c 53 |n..X.SH |"SEE ALS|
|00005330| 4f 22 0a 70 74 79 28 31 | 29 2c 0a 70 74 79 2d 6f |O".pty(1|),.pty-o|
|00005340| 70 74 73 28 31 29 2c 0a | 73 65 73 73 28 31 29 2c |pts(1),.|sess(1),|
|00005350| 0a 63 6f 6e 64 6f 6d 28 | 31 29 2c 0a 70 74 79 28 |.condom(|1),.pty(|
|00005360| 34 29 2c 0a 74 74 79 28 | 34 29 0a 45 4e 44 5f 4f |4),.tty(|4).END_O|
|00005370| 46 5f 46 49 4c 45 0a 69 | 66 20 74 65 73 74 20 33 |F_FILE.i|f test 3|
|00005380| 31 32 37 20 2d 6e 65 20 | 60 77 63 20 2d 63 20 3c |127 -ne |`wc -c <|
|00005390| 27 70 74 79 2d 62 61 73 | 69 63 2e 31 27 60 3b 20 |'pty-bas|ic.1'`; |
|000053a0| 74 68 65 6e 0a 20 20 20 | 20 65 63 68 6f 20 73 68 |then. | echo sh|
|000053b0| 61 72 3a 20 5c 22 27 70 | 74 79 2d 62 61 73 69 63 |ar: \"'p|ty-basic|
|000053c0| 2e 31 27 5c 22 20 75 6e | 70 61 63 6b 65 64 20 77 |.1'\" un|packed w|
|000053d0| 69 74 68 20 77 72 6f 6e | 67 20 73 69 7a 65 21 0a |ith wron|g size!.|
|000053e0| 66 69 0a 23 20 65 6e 64 | 20 6f 66 20 27 70 74 79 |fi.# end| of 'pty|
|000053f0| 2d 62 61 73 69 63 2e 31 | 27 0a 66 69 0a 69 66 20 |-basic.1|'.fi.if |
|00005400| 74 65 73 74 20 2d 66 20 | 27 70 74 79 63 6f 6d 6d |test -f |'ptycomm|
|00005410| 2e 63 27 20 2d 61 20 22 | 24 7b 31 7d 22 20 21 3d |.c' -a "|${1}" !=|
|00005420| 20 22 2d 63 22 20 3b 20 | 74 68 65 6e 20 0a 20 20 | "-c" ; |then . |
|00005430| 65 63 68 6f 20 73 68 61 | 72 3a 20 57 69 6c 6c 20 |echo sha|r: Will |
|00005440| 6e 6f 74 20 63 6c 6f 62 | 62 65 72 20 65 78 69 73 |not clob|ber exis|
|00005450| 74 69 6e 67 20 66 69 6c | 65 20 5c 22 27 70 74 79 |ting fil|e \"'pty|
|00005460| 63 6f 6d 6d 2e 63 27 5c | 22 0a 65 6c 73 65 0a 65 |comm.c'\|".else.e|
|00005470| 63 68 6f 20 73 68 61 72 | 3a 20 45 78 74 72 61 63 |cho shar|: Extrac|
|00005480| 74 69 6e 67 20 5c 22 27 | 70 74 79 63 6f 6d 6d 2e |ting \"'|ptycomm.|
|00005490| 63 27 5c 22 20 5c 28 33 | 34 36 35 20 63 68 61 72 |c'\" \(3|465 char|
|000054a0| 61 63 74 65 72 73 5c 29 | 0a 73 65 64 20 22 73 2f |acters\)|.sed "s/|
|000054b0| 5e 58 2f 2f 22 20 3e 27 | 70 74 79 63 6f 6d 6d 2e |^X//" >'|ptycomm.|
|000054c0| 63 27 20 3c 3c 27 45 4e | 44 5f 4f 46 5f 46 49 4c |c' <<'EN|D_OF_FIL|
|000054d0| 45 27 0a 58 23 69 6e 63 | 6c 75 64 65 20 3c 73 79 |E'.X#inc|lude <sy|
|000054e0| 73 2f 74 79 70 65 73 2e | 68 3e 0a 58 23 69 6e 63 |s/types.|h>.X#inc|
|000054f0| 6c 75 64 65 20 3c 73 79 | 73 2f 74 69 6d 65 2e 68 |lude <sy|s/time.h|
|00005500| 3e 0a 58 23 69 6e 63 6c | 75 64 65 20 3c 73 79 73 |>.X#incl|ude <sys|
|00005510| 2f 73 6f 63 6b 65 74 2e | 68 3e 0a 58 23 69 6e 63 |/socket.|h>.X#inc|
|00005520| 6c 75 64 65 20 3c 73 79 | 73 2f 75 6e 2e 68 3e 0a |lude <sy|s/un.h>.|
|00005530| 58 23 69 6e 63 6c 75 64 | 65 20 3c 73 79 73 2f 75 |X#includ|e <sys/u|
|00005540| 69 6f 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |io.h>.X#|include |
|00005550| 3c 65 72 72 6e 6f 2e 68 | 3e 0a 65 78 74 65 72 6e |<errno.h|>.extern|
|00005560| 20 69 6e 74 20 65 72 72 | 6e 6f 3b 0a 58 23 69 6e | int err|no;.X#in|
|00005570| 63 6c 75 64 65 20 22 66 | 6d 74 2e 68 22 0a 58 23 |clude "f|mt.h".X#|
|00005580| 69 6e 63 6c 75 64 65 20 | 22 63 6f 6e 66 69 67 2f |include |"config/|
|00005590| 70 74 79 65 78 74 2e 68 | 22 0a 58 23 69 6e 63 6c |ptyext.h|".X#incl|
|000055a0| 75 64 65 20 22 70 74 79 | 63 6f 6d 6d 2e 68 22 0a |ude "pty|comm.h".|
|000055b0| 58 23 69 6e 63 6c 75 64 | 65 20 22 70 74 79 6d 69 |X#includ|e "ptymi|
|000055c0| 73 63 2e 68 22 0a 58 0a | 58 2f 2a 0a 55 6e 64 65 |sc.h".X.|X/*.Unde|
|000055d0| 72 20 6d 6f 73 74 20 76 | 65 72 73 69 6f 6e 73 20 |r most v|ersions |
|000055e0| 6f 66 20 53 75 6e 4f 53 | 20 61 6e 64 20 55 6c 74 |of SunOS| and Ult|
|000055f0| 72 69 78 2c 20 61 73 20 | 77 65 6c 6c 20 61 73 20 |rix, as |well as |
|00005600| 6c 6f 74 73 20 6f 66 20 | 6f 74 68 65 72 20 73 79 |lots of |other sy|
|00005610| 73 74 65 6d 73 2c 0a 66 | 69 6c 65 20 64 65 73 63 |stems,.f|ile desc|
|00005620| 72 69 70 74 6f 72 20 70 | 61 73 73 69 6e 67 20 64 |riptor p|assing d|
|00005630| 6f 65 73 6e 27 74 20 77 | 6f 72 6b 2e 20 54 68 65 |oesn't w|ork. The|
|00005640| 20 6d 6f 73 74 20 69 6d | 70 6f 72 74 61 6e 74 20 | most im|portant |
|00005650| 70 72 6f 62 6c 65 6d 20 | 69 73 20 74 68 61 74 0a |problem |is that.|
|00005660| 69 6e 20 73 6f 6d 65 20 | 73 69 74 75 61 74 69 6f |in some |situatio|
|00005670| 6e 73 20 72 65 63 76 6d | 73 67 28 29 20 6d 61 79 |ns recvm|sg() may|
|00005680| 20 72 65 74 75 72 6e 20 | 30 20 77 69 74 68 6f 75 | return |0 withou|
|00005690| 74 20 61 63 74 75 61 6c | 6c 79 20 77 61 69 74 69 |t actual|ly waiti|
|000056a0| 6e 67 20 74 6f 0a 72 65 | 63 65 69 76 65 20 74 68 |ng to.re|ceive th|
|000056b0| 65 20 66 69 6c 65 20 64 | 65 73 63 72 69 70 74 6f |e file d|escripto|
|000056c0| 72 73 3b 20 69 6e 20 6f | 74 68 65 72 20 77 6f 72 |rs; in o|ther wor|
|000056d0| 64 73 2c 20 6d 73 67 5f | 61 63 63 72 69 67 68 74 |ds, msg_|accright|
|000056e0| 73 6c 65 6e 20 6d 61 79 | 20 62 65 0a 73 70 6f 72 |slen may| be.spor|
|000056f0| 61 64 69 63 61 6c 6c 79 | 20 30 2e 20 54 68 65 20 |adically| 0. The |
|00005700| 77 6f 72 6b 61 72 6f 75 | 6e 64 20 68 65 72 65 20 |workarou|nd here |
|00005710| 69 73 20 74 6f 20 70 61 | 75 73 65 20 76 65 72 79 |is to pa|use very|
|00005720| 20 62 72 69 65 66 6c 79 | 20 28 31 2f 31 30 30 20 | briefly| (1/100 |
|00005730| 6f 66 20 61 0a 73 65 63 | 6f 6e 64 29 20 61 6e 64 |of a.sec|ond) and|
|00005740| 20 74 72 79 20 74 68 65 | 20 72 65 63 76 6d 73 67 | try the| recvmsg|
|00005750| 28 29 20 61 67 61 69 6e | 2c 20 75 70 20 74 6f 20 |() again|, up to |
|00005760| 31 30 30 20 74 69 6d 65 | 73 2e 20 49 27 64 20 70 |100 time|s. I'd p|
|00005770| 72 65 66 65 72 20 73 65 | 65 69 6e 67 0a 74 68 65 |refer se|eing.the|
|00005780| 20 62 75 67 20 66 69 78 | 65 64 2e 0a 58 2a 2f 0a | bug fix|ed..X*/.|
|00005790| 58 0a 58 23 64 65 66 69 | 6e 65 20 45 53 54 55 50 |X.X#defi|ne ESTUP|
|000057a0| 49 44 20 45 49 4e 50 52 | 4f 47 52 45 53 53 20 2f |ID EINPR|OGRESS /|
|000057b0| 2a 20 5b 73 69 67 68 5d | 20 2a 2f 0a 58 0a 73 74 |* [sigh]| */.X.st|
|000057c0| 61 74 69 63 20 69 6e 74 | 20 63 6f 6d 6d 5f 70 61 |atic int| comm_pa|
|000057d0| 74 68 28 73 2c 65 78 74 | 2c 75 69 64 29 0a 63 68 |th(s,ext|,uid).ch|
|000057e0| 61 72 20 2a 73 3b 0a 63 | 68 61 72 20 2a 65 78 74 |ar *s;.c|har *ext|
|000057f0| 3b 0a 69 6e 74 20 75 69 | 64 3b 0a 58 7b 0a 58 20 |;.int ui|d;.X{.X |
|00005800| 69 6e 74 20 69 3b 0a 58 | 20 63 68 61 72 20 2a 74 |int i;.X| char *t|
|00005810| 3b 0a 58 0a 58 2f 2a 20 | 61 73 20 61 20 6c 61 73 |;.X.X/* |as a las|
|00005820| 74 20 6c 61 79 65 72 20 | 6f 66 20 70 72 6f 74 65 |t layer |of prote|
|00005830| 63 74 69 6f 6e 20 77 65 | 20 6d 61 6b 65 20 73 75 |ction we| make su|
|00005840| 72 65 20 74 68 61 74 20 | 77 65 20 6f 6e 6c 79 20 |re that |we only |
|00005850| 63 72 65 61 74 65 20 2a | 2f 0a 58 2f 2a 20 76 61 |create *|/.X/* va|
|00005860| 6c 69 64 20 66 69 6c 65 | 6e 61 6d 65 73 2e 2e 2e |lid file|names...|
|00005870| 20 2a 2f 0a 58 20 66 6f | 72 20 28 69 20 3d 20 30 | */.X fo|r (i = 0|
|00005880| 3b 50 54 59 45 58 54 31 | 5b 69 5d 3b 2b 2b 69 29 |;PTYEXT1|[i];++i)|
|00005890| 0a 58 20 20 20 69 66 20 | 28 65 78 74 5b 30 5d 20 |.X if |(ext[0] |
|000058a0| 3d 3d 20 50 54 59 45 58 | 54 31 5b 69 5d 29 0a 58 |== PTYEX|T1[i]).X|
|000058b0| 20 20 20 20 20 62 72 65 | 61 6b 3b 0a 58 20 69 66 | bre|ak;.X if|
|000058c0| 20 28 21 50 54 59 45 58 | 54 31 5b 69 5d 29 0a 58 | (!PTYEX|T1[i]).X|
|000058d0| 20 20 20 72 65 74 75 72 | 6e 20 2d 31 3b 0a 58 20 | retur|n -1;.X |
|000058e0| 66 6f 72 20 28 69 20 3d | 20 30 3b 50 54 59 45 58 |for (i =| 0;PTYEX|
|000058f0| 54 32 5b 69 5d 3b 2b 2b | 69 29 0a 58 20 20 20 69 |T2[i];++|i).X i|
|00005900| 66 20 28 65 78 74 5b 31 | 5d 20 3d 3d 20 50 54 59 |f (ext[1|] == PTY|
|00005910| 45 58 54 32 5b 69 5d 29 | 0a 58 20 20 20 20 20 62 |EXT2[i])|.X b|
|00005920| 72 65 61 6b 3b 0a 58 20 | 69 66 20 28 21 50 54 59 |reak;.X |if (!PTY|
|00005930| 45 58 54 32 5b 69 5d 29 | 0a 58 20 20 20 72 65 74 |EXT2[i])|.X ret|
|00005940| 75 72 6e 20 2d 31 3b 0a | 58 20 74 20 3d 20 73 3b |urn -1;.|X t = s;|
|00005950| 0a 58 20 74 20 2b 3d 20 | 66 6d 74 5f 73 74 72 6e |.X t += |fmt_strn|
|00005960| 63 70 79 28 74 2c 22 63 | 6f 6d 6d 2e 22 2c 30 29 |cpy(t,"c|omm.",0)|
|00005970| 3b 0a 58 20 74 20 2b 3d | 20 66 6d 74 5f 75 69 6e |;.X t +=| fmt_uin|
|00005980| 74 28 74 2c 75 69 64 29 | 3b 0a 58 20 2a 74 2b 2b |t(t,uid)|;.X *t++|
|00005990| 20 3d 20 27 2e 27 3b 0a | 58 20 2a 74 2b 2b 20 3d | = '.';.|X *t++ =|
|000059a0| 20 65 78 74 5b 30 5d 3b | 0a 58 20 2a 74 2b 2b 20 | ext[0];|.X *t++ |
|000059b0| 3d 20 65 78 74 5b 31 5d | 3b 0a 58 20 2a 74 20 3d |= ext[1]|;.X *t =|
|000059c0| 20 30 3b 0a 58 20 72 65 | 74 75 72 6e 20 30 3b 0a | 0;.X re|turn 0;.|
|000059d0| 58 7d 0a 58 0a 69 6e 74 | 20 63 6f 6d 6d 5f 72 65 |X}.X.int| comm_re|
|000059e0| 61 64 28 65 78 74 2c 75 | 69 64 29 0a 63 68 61 72 |ad(ext,u|id).char|
|000059f0| 20 2a 65 78 74 3b 0a 69 | 6e 74 20 75 69 64 3b 0a | *ext;.i|nt uid;.|
|00005a00| 58 7b 0a 58 20 69 6e 74 | 20 73 3b 0a 58 20 73 74 |X{.X int| s;.X st|
|00005a10| 72 75 63 74 20 73 6f 63 | 6b 61 64 64 72 5f 75 6e |ruct soc|kaddr_un|
|00005a20| 20 73 61 3b 0a 58 0a 58 | 20 69 66 20 28 28 73 20 | sa;.X.X| if ((s |
|00005a30| 3d 20 73 6f 63 6b 65 74 | 28 41 46 5f 55 4e 49 58 |= socket|(AF_UNIX|
|00005a40| 2c 53 4f 43 4b 5f 53 54 | 52 45 41 4d 2c 30 29 29 |,SOCK_ST|REAM,0))|
|00005a50| 20 3d 3d 20 2d 31 29 0a | 58 20 20 20 72 65 74 75 | == -1).|X retu|
|00005a60| 72 6e 20 2d 31 3b 0a 58 | 20 73 61 2e 73 75 6e 5f |rn -1;.X| sa.sun_|
|00005a70| 66 61 6d 69 6c 79 20 3d | 20 41 46 5f 55 4e 49 58 |family =| AF_UNIX|
|00005a80| 3b 0a 58 20 69 66 20 28 | 63 6f 6d 6d 5f 70 61 74 |;.X if (|comm_pat|
|00005a90| 68 28 73 61 2e 73 75 6e | 5f 70 61 74 68 2c 65 78 |h(sa.sun|_path,ex|
|00005aa0| 74 2c 75 69 64 29 20 3d | 3d 20 2d 31 29 0a 58 20 |t,uid) =|= -1).X |
|00005ab0| 20 20 72 65 74 75 72 6e | 20 2d 31 3b 0a 58 20 75 | return| -1;.X u|
|00005ac0| 6e 6c 69 6e 6b 28 73 61 | 2e 73 75 6e 5f 70 61 74 |nlink(sa|.sun_pat|
|00005ad0| 68 29 3b 0a 58 20 69 66 | 20 28 62 69 6e 64 28 73 |h);.X if| (bind(s|
|00005ae0| 2c 28 73 74 72 75 63 74 | 20 73 6f 63 6b 61 64 64 |,(struct| sockadd|
|00005af0| 72 20 2a 29 20 26 73 61 | 2c 73 74 72 6c 65 6e 28 |r *) &sa|,strlen(|
|00005b00| 73 61 2e 73 75 6e 5f 70 | 61 74 68 29 20 2b 20 32 |sa.sun_p|ath) + 2|
|00005b10| 29 20 3d 3d 20 2d 31 29 | 0a 58 20 20 20 72 65 74 |) == -1)|.X ret|
|00005b20| 75 72 6e 20 2d 31 3b 0a | 58 20 69 66 20 28 6c 69 |urn -1;.|X if (li|
|00005b30| 73 74 65 6e 28 73 2c 35 | 29 20 3d 3d 20 2d 31 29 |sten(s,5|) == -1)|
|00005b40| 0a 58 20 20 20 72 65 74 | 75 72 6e 20 2d 31 3b 0a |.X ret|urn -1;.|
|00005b50| 58 20 72 65 74 75 72 6e | 20 73 3b 0a 58 7d 0a 58 |X return| s;.X}.X|
|00005b60| 0a 69 6e 74 20 63 6f 6d | 6d 5f 61 63 63 65 70 74 |.int com|m_accept|
|00005b70| 28 66 64 29 0a 69 6e 74 | 20 66 64 3b 0a 58 7b 0a |(fd).int| fd;.X{.|
|00005b80| 58 20 73 74 72 75 63 74 | 20 73 6f 63 6b 61 64 64 |X struct| sockadd|
|00005b90| 72 5f 75 6e 20 73 61 3b | 0a 58 20 69 6e 74 20 73 |r_un sa;|.X int s|
|00005ba0| 61 6c 65 6e 3b 0a 58 20 | 73 61 6c 65 6e 20 3d 20 |alen;.X |salen = |
|00005bb0| 73 69 7a 65 6f 66 28 73 | 61 29 3b 0a 58 20 72 65 |sizeof(s|a);.X re|
|00005bc0| 74 75 72 6e 20 61 63 63 | 65 70 74 28 66 64 2c 28 |turn acc|ept(fd,(|
|00005bd0| 73 74 72 75 63 74 20 73 | 6f 63 6b 61 64 64 72 20 |struct s|ockaddr |
|00005be0| 2a 29 20 26 73 61 2c 26 | 73 61 6c 65 6e 29 3b 0a |*) &sa,&|salen);.|
|00005bf0| 58 7d 0a 58 0a 69 6e 74 | 20 63 6f 6d 6d 5f 75 6e |X}.X.int| comm_un|
|00005c00| 6c 69 6e 6b 28 65 78 74 | 2c 75 69 64 29 0a 63 68 |link(ext|,uid).ch|
|00005c10| 61 72 20 2a 65 78 74 3b | 0a 69 6e 74 20 75 69 64 |ar *ext;|.int uid|
|00005c20| 3b 0a 58 7b 0a 58 20 73 | 74 72 75 63 74 20 73 6f |;.X{.X s|truct so|
|00005c30| 63 6b 61 64 64 72 5f 75 | 6e 20 73 61 3b 0a 58 20 |ckaddr_u|n sa;.X |
|00005c40| 69 66 20 28 63 6f 6d 6d | 5f 70 61 74 68 28 73 61 |if (comm|_path(sa|
|00005c50| 2e 73 75 6e 5f 70 61 74 | 68 2c 65 78 74 2c 75 69 |.sun_pat|h,ext,ui|
|00005c60| 64 29 20 3d 3d 20 2d 31 | 29 0a 58 20 20 20 72 65 |d) == -1|).X re|
|00005c70| 74 75 72 6e 20 2d 31 3b | 0a 58 20 72 65 74 75 72 |turn -1;|.X retur|
|00005c80| 6e 20 75 6e 6c 69 6e 6b | 28 73 61 2e 73 75 6e 5f |n unlink|(sa.sun_|
|00005c90| 70 61 74 68 29 3b 0a 58 | 7d 0a 58 0a 69 6e 74 20 |path);.X|}.X.int |
|00005ca0| 63 6f 6d 6d 5f 77 72 69 | 74 65 28 65 78 74 2c 75 |comm_wri|te(ext,u|
|00005cb0| 69 64 29 0a 63 68 61 72 | 20 2a 65 78 74 3b 0a 69 |id).char| *ext;.i|
|00005cc0| 6e 74 20 75 69 64 3b 0a | 58 7b 0a 58 20 69 6e 74 |nt uid;.|X{.X int|
|00005cd0| 20 73 3b 0a 58 20 73 74 | 72 75 63 74 20 73 6f 63 | s;.X st|ruct soc|
|00005ce0| 6b 61 64 64 72 5f 75 6e | 20 73 61 3b 0a 58 0a 58 |kaddr_un| sa;.X.X|
|00005cf0| 20 69 66 20 28 28 73 20 | 3d 20 73 6f 63 6b 65 74 | if ((s |= socket|
|00005d00| 28 41 46 5f 55 4e 49 58 | 2c 53 4f 43 4b 5f 53 54 |(AF_UNIX|,SOCK_ST|
|00005d10| 52 45 41 4d 2c 30 29 29 | 20 3d 3d 20 2d 31 29 0a |REAM,0))| == -1).|
|00005d20| 58 20 20 20 72 65 74 75 | 72 6e 20 2d 31 3b 0a 58 |X retu|rn -1;.X|
|00005d30| 20 73 61 2e 73 75 6e 5f | 66 61 6d 69 6c 79 20 3d | sa.sun_|family =|
|00005d40| 20 41 46 5f 55 4e 49 58 | 3b 0a 58 20 69 66 20 28 | AF_UNIX|;.X if (|
|00005d50| 63 6f 6d 6d 5f 70 61 74 | 68 28 73 61 2e 73 75 6e |comm_pat|h(sa.sun|
|00005d60| 5f 70 61 74 68 2c 65 78 | 74 2c 75 69 64 29 20 3d |_path,ex|t,uid) =|
|00005d70| 3d 20 2d 31 29 0a 58 20 | 20 20 72 65 74 75 72 6e |= -1).X | return|
|00005d80| 20 2d 31 3b 0a 58 20 69 | 66 20 28 63 6f 6e 6e 65 | -1;.X i|f (conne|
|00005d90| 63 74 28 73 2c 28 73 74 | 72 75 63 74 20 73 6f 63 |ct(s,(st|ruct soc|
|00005da0| 6b 61 64 64 72 20 2a 29 | 20 26 73 61 2c 73 74 72 |kaddr *)| &sa,str|
|00005db0| 6c 65 6e 28 73 61 2e 73 | 75 6e 5f 70 61 74 68 29 |len(sa.s|un_path)|
|00005dc0| 20 2b 20 32 29 20 3d 3d | 20 2d 31 29 0a 58 20 20 | + 2) ==| -1).X |
|00005dd0| 20 72 65 74 75 72 6e 20 | 2d 31 3b 0a 58 20 72 65 | return |-1;.X re|
|00005de0| 74 75 72 6e 20 73 3b 0a | 58 7d 0a 58 0a 69 6e 74 |turn s;.|X}.X.int|
|00005df0| 20 63 73 70 28 66 64 63 | 6f 6d 6d 2c 66 64 29 0a | csp(fdc|omm,fd).|
|00005e00| 69 6e 74 20 66 64 63 6f | 6d 6d 3b 0a 69 6e 74 20 |int fdco|mm;.int |
|00005e10| 66 64 3b 0a 58 7b 0a 58 | 20 73 74 72 75 63 74 20 |fd;.X{.X| struct |
|00005e20| 6d 73 67 68 64 72 20 6d | 73 67 5b 32 5d 3b 0a 58 |msghdr m|sg[2];.X|
|00005e30| 20 69 6e 74 20 61 63 63 | 5b 35 5d 3b 0a 58 20 73 | int acc|[5];.X s|
|00005e40| 74 72 75 63 74 20 69 6f | 76 65 63 20 69 5b 32 5d |truct io|vec i[2]|
|00005e50| 3b 0a 58 0a 58 20 6d 73 | 67 5b 30 5d 2e 6d 73 67 |;.X.X ms|g[0].msg|
|00005e60| 5f 6e 61 6d 65 20 3d 20 | 30 3b 0a 58 20 6d 73 67 |_name = |0;.X msg|
|00005e70| 5b 30 5d 2e 6d 73 67 5f | 6e 61 6d 65 6c 65 6e 20 |[0].msg_|namelen |
|00005e80| 3d 20 30 3b 0a 58 20 6d | 73 67 5b 30 5d 2e 6d 73 |= 0;.X m|sg[0].ms|
|00005e90| 67 5f 69 6f 76 20 3d 20 | 69 3b 20 2f 2a 20 67 72 |g_iov = |i; /* gr|
|00005ea0| 72 72 72 20 2a 2f 0a 58 | 20 6d 73 67 5b 30 5d 2e |rrr */.X| msg[0].|
|00005eb0| 6d 73 67 5f 69 6f 76 6c | 65 6e 20 3d 20 30 3b 0a |msg_iovl|en = 0;.|
|00005ec0| 58 20 6d 73 67 5b 30 5d | 2e 6d 73 67 5f 61 63 63 |X msg[0]|.msg_acc|
|00005ed0| 72 69 67 68 74 73 20 3d | 20 28 63 61 64 64 72 5f |rights =| (caddr_|
|00005ee0| 74 29 20 61 63 63 3b 0a | 58 20 6d 73 67 5b 30 5d |t) acc;.|X msg[0]|
|00005ef0| 2e 6d 73 67 5f 61 63 63 | 72 69 67 68 74 73 6c 65 |.msg_acc|rightsle|
|00005f00| 6e 20 3d 20 73 69 7a 65 | 6f 66 28 69 6e 74 29 3b |n = size|of(int);|
|00005f10| 0a 58 0a 58 20 61 63 63 | 5b 30 5d 20 3d 20 66 64 |.X.X acc|[0] = fd|
|00005f20| 3b 0a 58 0a 58 20 72 65 | 74 75 72 6e 20 73 65 6e |;.X.X re|turn sen|
|00005f30| 64 6d 73 67 28 66 64 63 | 6f 6d 6d 2c 6d 73 67 2c |dmsg(fdc|omm,msg,|
|00005f40| 30 29 3b 0a 58 7d 0a 58 | 0a 69 6e 74 20 63 6f 6d |0);.X}.X|.int com|
|00005f50| 6d 5f 70 75 74 66 64 28 | 66 64 63 6f 6d 6d 2c 66 |m_putfd(|fdcomm,f|
|00005f60| 64 29 0a 69 6e 74 20 66 | 64 63 6f 6d 6d 3b 0a 69 |d).int f|dcomm;.i|
|00005f70| 6e 74 20 66 64 3b 0a 58 | 7b 0a 58 20 69 6e 74 20 |nt fd;.X|{.X int |
|00005f80| 74 72 69 65 73 3b 0a 58 | 20 66 6f 72 20 28 74 72 |tries;.X| for (tr|
|00005f90| 69 65 73 20 3d 20 30 3b | 74 72 69 65 73 20 3c 20 |ies = 0;|tries < |
|00005fa0| 31 30 30 3b 2b 2b 74 72 | 69 65 73 29 0a 58 20 20 |100;++tr|ies).X |
|00005fb0| 20 69 66 20 28 63 73 70 | 28 66 64 63 6f 6d 6d 2c | if (csp|(fdcomm,|
|00005fc0| 66 64 29 20 3d 3d 20 30 | 29 0a 58 20 20 20 20 20 |fd) == 0|).X |
|00005fd0| 72 65 74 75 72 6e 20 30 | 3b 0a 58 20 72 65 74 75 |return 0|;.X retu|
|00005fe0| 72 6e 20 2d 31 3b 0a 58 | 7d 0a 58 0a 73 74 61 74 |rn -1;.X|}.X.stat|
|00005ff0| 69 63 20 69 6e 74 20 63 | 67 66 28 66 64 63 6f 6d |ic int c|gf(fdcom|
|00006000| 6d 29 0a 69 6e 74 20 66 | 64 63 6f 6d 6d 3b 0a 58 |m).int f|dcomm;.X|
|00006010| 7b 0a 58 20 73 74 72 75 | 63 74 20 6d 73 67 68 64 |{.X stru|ct msghd|
|00006020| 72 20 6d 73 67 5b 32 5d | 3b 0a 58 20 69 6e 74 20 |r msg[2]|;.X int |
|00006030| 61 63 63 5b 35 5d 3b 0a | 58 20 73 74 72 75 63 74 |acc[5];.|X struct|
|00006040| 20 69 6f 76 65 63 20 69 | 5b 32 5d 3b 0a 58 20 69 | iovec i|[2];.X i|
|00006050| 6e 74 20 72 3b 0a 58 0a | 58 20 6d 73 67 5b 30 5d |nt r;.X.|X msg[0]|
|00006060| 2e 6d 73 67 5f 6e 61 6d | 65 20 3d 20 30 3b 0a 58 |.msg_nam|e = 0;.X|
|00006070| 20 6d 73 67 5b 30 5d 2e | 6d 73 67 5f 6e 61 6d 65 | msg[0].|msg_name|
|00006080| 6c 65 6e 20 3d 20 30 3b | 0a 58 20 6d 73 67 5b 30 |len = 0;|.X msg[0|
|00006090| 5d 2e 6d 73 67 5f 69 6f | 76 20 3d 20 69 3b 20 2f |].msg_io|v = i; /|
|000060a0| 2a 20 67 72 72 72 72 20 | 2a 2f 0a 58 20 6d 73 67 |* grrrr |*/.X msg|
|000060b0| 5b 30 5d 2e 6d 73 67 5f | 69 6f 76 6c 65 6e 20 3d |[0].msg_|iovlen =|
|000060c0| 20 30 3b 0a 58 20 6d 73 | 67 5b 30 5d 2e 6d 73 67 | 0;.X ms|g[0].msg|
|000060d0| 5f 61 63 63 72 69 67 68 | 74 73 20 3d 20 28 63 61 |_accrigh|ts = (ca|
|000060e0| 64 64 72 5f 74 29 20 61 | 63 63 3b 0a 58 20 6d 73 |ddr_t) a|cc;.X ms|
|000060f0| 67 5b 30 5d 2e 6d 73 67 | 5f 61 63 63 72 69 67 68 |g[0].msg|_accrigh|
|00006100| 74 73 6c 65 6e 20 3d 20 | 73 69 7a 65 6f 66 28 69 |tslen = |sizeof(i|
|00006110| 6e 74 29 3b 0a 58 0a 58 | 20 64 6f 0a 58 20 20 20 |nt);.X.X| do.X |
|00006120| 72 20 3d 20 72 65 63 76 | 6d 73 67 28 66 64 63 6f |r = recv|msg(fdco|
|00006130| 6d 6d 2c 6d 73 67 2c 30 | 29 3b 0a 58 20 77 68 69 |mm,msg,0|);.X whi|
|00006140| 6c 65 20 28 28 72 20 3d | 3d 20 2d 31 29 20 26 26 |le ((r =|= -1) &&|
|00006150| 20 28 28 65 72 72 6e 6f | 20 3d 3d 20 45 49 4e 54 | ((errno| == EINT|
|00006160| 52 29 20 7c 7c 20 28 65 | 72 72 6e 6f 20 3d 3d 20 |R) || (e|rrno == |
|00006170| 45 57 4f 55 4c 44 42 4c | 4f 43 4b 29 29 29 3b 0a |EWOULDBL|OCK)));.|
|00006180| 58 20 69 66 20 28 72 20 | 3d 3d 20 2d 31 29 0a 58 |X if (r |== -1).X|
|00006190| 20 20 20 72 65 74 75 72 | 6e 20 2d 31 3b 0a 58 20 | retur|n -1;.X |
|000061a0| 69 66 20 28 6d 73 67 5b | 30 5d 2e 6d 73 67 5f 61 |if (msg[|0].msg_a|
|000061b0| 63 63 72 69 67 68 74 73 | 6c 65 6e 20 21 3d 20 73 |ccrights|len != s|
|000061c0| 69 7a 65 6f 66 28 69 6e | 74 29 29 0a 58 20 20 7b |izeof(in|t)).X {|
|000061d0| 0a 58 20 20 20 65 72 72 | 6e 6f 20 3d 20 45 53 54 |.X err|no = EST|
|000061e0| 55 50 49 44 3b 20 2f 2a | 20 69 74 20 64 69 64 6e |UPID; /*| it didn|
|000061f0| 27 74 20 61 72 72 69 76 | 65 2e 20 2a 2f 0a 58 20 |'t arriv|e. */.X |
|00006200| 20 20 72 65 74 75 72 6e | 20 2d 31 3b 0a 58 20 20 | return| -1;.X |
|00006210| 7d 0a 58 20 72 65 74 75 | 72 6e 20 61 63 63 5b 30 |}.X retu|rn acc[0|
|00006220| 5d 3b 0a 58 7d 0a 58 0a | 69 6e 74 20 63 6f 6d 6d |];.X}.X.|int comm|
|00006230| 5f 67 65 74 66 64 28 66 | 64 63 6f 6d 6d 29 0a 69 |_getfd(f|dcomm).i|
|00006240| 6e 74 20 66 64 63 6f 6d | 6d 3b 0a 58 7b 0a 58 20 |nt fdcom|m;.X{.X |
|00006250| 69 6e 74 20 66 64 3b 0a | 58 20 69 6e 74 20 74 72 |int fd;.|X int tr|
|00006260| 69 65 73 3b 0a 58 0a 58 | 20 66 6f 72 20 28 74 72 |ies;.X.X| for (tr|
|00006270| 69 65 73 20 3d 20 30 3b | 74 72 69 65 73 20 3c 20 |ies = 0;|tries < |
|00006280| 31 30 30 3b 2b 2b 74 72 | 69 65 73 29 0a 58 20 20 |100;++tr|ies).X |
|00006290| 7b 0a 58 20 20 20 66 64 | 20 3d 20 63 67 66 28 66 |{.X fd| = cgf(f|
|000062a0| 64 63 6f 6d 6d 29 3b 0a | 58 20 20 20 69 66 20 28 |dcomm);.|X if (|
|000062b0| 66 64 20 21 3d 20 2d 31 | 29 0a 58 20 20 20 20 20 |fd != -1|).X |
|000062c0| 72 65 74 75 72 6e 20 66 | 64 3b 0a 58 20 20 20 67 |return f|d;.X g|
|000062d0| 61 61 72 67 68 28 31 30 | 30 30 30 29 3b 0a 58 20 |aargh(10|000);.X |
|000062e0| 20 7d 0a 58 20 72 65 74 | 75 72 6e 20 2d 31 3b 0a | }.X ret|urn -1;.|
|000062f0| 58 7d 0a 45 4e 44 5f 4f | 46 5f 46 49 4c 45 0a 69 |X}.END_O|F_FILE.i|
|00006300| 66 20 74 65 73 74 20 33 | 34 36 35 20 2d 6e 65 20 |f test 3|465 -ne |
|00006310| 60 77 63 20 2d 63 20 3c | 27 70 74 79 63 6f 6d 6d |`wc -c <|'ptycomm|
|00006320| 2e 63 27 60 3b 20 74 68 | 65 6e 0a 20 20 20 20 65 |.c'`; th|en. e|
|00006330| 63 68 6f 20 73 68 61 72 | 3a 20 5c 22 27 70 74 79 |cho shar|: \"'pty|
|00006340| 63 6f 6d 6d 2e 63 27 5c | 22 20 75 6e 70 61 63 6b |comm.c'\|" unpack|
|00006350| 65 64 20 77 69 74 68 20 | 77 72 6f 6e 67 20 73 69 |ed with |wrong si|
|00006360| 7a 65 21 0a 66 69 0a 23 | 20 65 6e 64 20 6f 66 20 |ze!.fi.#| end of |
|00006370| 27 70 74 79 63 6f 6d 6d | 2e 63 27 0a 66 69 0a 69 |'ptycomm|.c'.fi.i|
|00006380| 66 20 74 65 73 74 20 2d | 66 20 27 70 74 79 67 65 |f test -|f 'ptyge|
|00006390| 74 2e 63 27 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |t.c' -a |"${1}" !|
|000063a0| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|000063b0| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|000063c0| 20 6e 6f 74 20 63 6c 6f | 62 62 65 72 20 65 78 69 | not clo|bber exi|
|000063d0| 73 74 69 6e 67 20 66 69 | 6c 65 20 5c 22 27 70 74 |sting fi|le \"'pt|
|000063e0| 79 67 65 74 2e 63 27 5c | 22 0a 65 6c 73 65 0a 65 |yget.c'\|".else.e|
|000063f0| 63 68 6f 20 73 68 61 72 | 3a 20 45 78 74 72 61 63 |cho shar|: Extrac|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.