home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume39 / tcp_wrappers / part04 < prev    next >
SHell self-extracting ARchive  |  1993-09-29  |  41.6 KB

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: part04

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 6d 69 73 63 0a 46 72 |.sources|.misc.Fr|
|00000020| 6f 6d 3a 20 77 69 65 74 | 73 65 40 77 7a 76 2e 77 |om: wiet|se@wzv.w|
|00000030| 69 6e 2e 74 75 65 2e 6e | 6c 20 28 57 69 65 74 73 |in.tue.n|l (Wiets|
|00000040| 65 20 56 65 6e 65 6d 61 | 29 0a 53 75 62 6a 65 63 |e Venema|).Subjec|
|00000050| 74 3a 20 76 33 39 69 31 | 31 33 3a 20 20 74 63 70 |t: v39i1|13: tcp|
|00000060| 5f 77 72 61 70 70 65 72 | 73 20 2d 20 54 43 50 2f |_wrapper|s - TCP/|
|00000070| 49 50 20 64 61 65 6d 6f | 6e 20 77 72 61 70 70 65 |IP daemo|n wrappe|
|00000080| 72 73 2c 20 76 36 2e 30 | 2c 20 50 61 72 74 30 34 |rs, v6.0|, Part04|
|00000090| 2f 30 34 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |/04.Mess|age-ID: |
|000000a0| 3c 31 39 39 33 53 65 70 | 32 39 2e 32 32 30 30 32 |<1993Sep|29.22002|
|000000b0| 32 2e 32 36 35 36 34 40 | 73 70 61 72 6b 79 2e 73 |2.26564@|sparky.s|
|000000c0| 74 65 72 6c 69 6e 67 2e | 63 6f 6d 3e 0a 58 2d 4d |terling.|com>.X-M|
|000000d0| 64 34 2d 53 69 67 6e 61 | 74 75 72 65 3a 20 65 35 |d4-Signa|ture: e5|
|000000e0| 62 63 39 38 66 63 36 33 | 34 30 38 64 62 64 39 31 |bc98fc63|408dbd91|
|000000f0| 32 37 63 38 31 34 62 61 | 64 63 61 37 33 39 0a 53 |27c814ba|dca739.S|
|00000100| 65 6e 64 65 72 3a 20 6b | 65 6e 74 40 73 70 61 72 |ender: k|ent@spar|
|00000110| 6b 79 2e 73 74 65 72 6c | 69 6e 67 2e 63 6f 6d 20 |ky.sterl|ing.com |
|00000120| 28 4b 65 6e 74 20 4c 61 | 6e 64 66 69 65 6c 64 29 |(Kent La|ndfield)|
|00000130| 0a 4f 72 67 61 6e 69 7a | 61 74 69 6f 6e 3a 20 45 |.Organiz|ation: E|
|00000140| 69 6e 64 68 6f 76 65 6e | 20 55 6e 69 76 65 72 73 |indhoven| Univers|
|00000150| 69 74 79 20 6f 66 20 54 | 65 63 68 6e 6f 6c 6f 67 |ity of T|echnolog|
|00000160| 79 2c 20 54 68 65 20 4e | 65 74 68 65 72 6c 61 6e |y, The N|etherlan|
|00000170| 64 73 0a 44 61 74 65 3a | 20 57 65 64 2c 20 32 39 |ds.Date:| Wed, 29|
|00000180| 20 53 65 70 20 31 39 39 | 33 20 32 32 3a 30 30 3a | Sep 199|3 22:00:|
|00000190| 32 32 20 47 4d 54 0a 41 | 70 70 72 6f 76 65 64 3a |22 GMT.A|pproved:|
|000001a0| 20 6b 65 6e 74 40 73 70 | 61 72 6b 79 2e 73 74 65 | kent@sp|arky.ste|
|000001b0| 72 6c 69 6e 67 2e 63 6f | 6d 0a 0a 53 75 62 6d 69 |rling.co|m..Submi|
|000001c0| 74 74 65 64 2d 62 79 3a | 20 77 69 65 74 73 65 40 |tted-by:| wietse@|
|000001d0| 77 7a 76 2e 77 69 6e 2e | 74 75 65 2e 6e 6c 20 28 |wzv.win.|tue.nl (|
|000001e0| 57 69 65 74 73 65 20 56 | 65 6e 65 6d 61 29 0a 50 |Wietse V|enema).P|
|000001f0| 6f 73 74 69 6e 67 2d 6e | 75 6d 62 65 72 3a 20 56 |osting-n|umber: V|
|00000200| 6f 6c 75 6d 65 20 33 39 | 2c 20 49 73 73 75 65 20 |olume 39|, Issue |
|00000210| 31 31 33 0a 41 72 63 68 | 69 76 65 2d 6e 61 6d 65 |113.Arch|ive-name|
|00000220| 3a 20 74 63 70 5f 77 72 | 61 70 70 65 72 73 2f 70 |: tcp_wr|appers/p|
|00000230| 61 72 74 30 34 0a 45 6e | 76 69 72 6f 6e 6d 65 6e |art04.En|vironmen|
|00000240| 74 3a 20 55 4e 49 58 2c | 20 49 4e 45 54 0a 53 75 |t: UNIX,| INET.Su|
|00000250| 70 65 72 73 65 64 65 73 | 3a 20 6c 6f 67 5f 74 63 |persedes|: log_tc|
|00000260| 70 3a 20 56 6f 6c 75 6d | 65 20 33 36 2c 20 49 73 |p: Volum|e 36, Is|
|00000270| 73 75 65 20 34 2d 36 0a | 0a 23 21 20 2f 62 69 6e |sue 4-6.|.#! /bin|
|00000280| 2f 73 68 0a 23 20 54 68 | 69 73 20 69 73 20 61 20 |/sh.# Th|is is a |
|00000290| 73 68 65 6c 6c 20 61 72 | 63 68 69 76 65 2e 20 20 |shell ar|chive. |
|000002a0| 52 65 6d 6f 76 65 20 61 | 6e 79 74 68 69 6e 67 20 |Remove a|nything |
|000002b0| 62 65 66 6f 72 65 20 74 | 68 69 73 20 6c 69 6e 65 |before t|his line|
|000002c0| 2c 20 74 68 65 6e 20 75 | 6e 70 61 63 6b 0a 23 20 |, then u|npack.# |
|000002d0| 69 74 20 62 79 20 73 61 | 76 69 6e 67 20 69 74 20 |it by sa|ving it |
|000002e0| 69 6e 74 6f 20 61 20 66 | 69 6c 65 20 61 6e 64 20 |into a f|ile and |
|000002f0| 74 79 70 69 6e 67 20 22 | 73 68 20 66 69 6c 65 22 |typing "|sh file"|
|00000300| 2e 20 20 54 6f 20 6f 76 | 65 72 77 72 69 74 65 20 |. To ov|erwrite |
|00000310| 65 78 69 73 74 69 6e 67 | 0a 23 20 66 69 6c 65 73 |existing|.# files|
|00000320| 2c 20 74 79 70 65 20 22 | 73 68 20 66 69 6c 65 20 |, type "|sh file |
|00000330| 2d 63 22 2e 20 20 59 6f | 75 20 63 61 6e 20 61 6c |-c". Yo|u can al|
|00000340| 73 6f 20 66 65 65 64 20 | 74 68 69 73 20 61 73 20 |so feed |this as |
|00000350| 73 74 61 6e 64 61 72 64 | 20 69 6e 70 75 74 20 76 |standard| input v|
|00000360| 69 61 0a 23 20 75 6e 73 | 68 61 72 2c 20 6f 72 20 |ia.# uns|har, or |
|00000370| 62 79 20 74 79 70 69 6e | 67 20 22 73 68 20 3c 66 |by typin|g "sh <f|
|00000380| 69 6c 65 22 2c 20 65 2e | 67 2e 2e 20 20 49 66 20 |ile", e.|g.. If |
|00000390| 74 68 69 73 20 61 72 63 | 68 69 76 65 20 69 73 20 |this arc|hive is |
|000003a0| 63 6f 6d 70 6c 65 74 65 | 2c 20 79 6f 75 0a 23 20 |complete|, you.# |
|000003b0| 77 69 6c 6c 20 73 65 65 | 20 74 68 65 20 66 6f 6c |will see| the fol|
|000003c0| 6c 6f 77 69 6e 67 20 6d | 65 73 73 61 67 65 20 61 |lowing m|essage a|
|000003d0| 74 20 74 68 65 20 65 6e | 64 3a 0a 23 09 09 22 45 |t the en|d:.#.."E|
|000003e0| 6e 64 20 6f 66 20 61 72 | 63 68 69 76 65 20 34 20 |nd of ar|chive 4 |
|000003f0| 28 6f 66 20 34 29 2e 22 | 0a 23 20 43 6f 6e 74 65 |(of 4)."|.# Conte|
|00000400| 6e 74 73 3a 20 20 73 74 | 72 63 61 73 65 63 6d 70 |nts: st|rcasecmp|
|00000410| 2e 63 20 73 74 72 74 6f | 6b 2e 63 20 74 63 70 64 |.c strto|k.c tcpd|
|00000420| 2e 38 20 74 63 70 64 2e | 63 20 74 6c 69 2e 63 20 |.8 tcpd.|c tli.c |
|00000430| 74 72 79 2e 63 0a 23 20 | 20 20 77 6f 72 6b 61 72 |try.c.# | workar|
|00000440| 6f 75 6e 64 73 2e 63 20 | 36 63 6f 6d 70 61 74 2e |ounds.c |6compat.|
|00000450| 63 0a 23 20 57 72 61 70 | 70 65 64 20 62 79 20 77 |c.# Wrap|ped by w|
|00000460| 69 65 74 73 65 40 77 7a | 76 20 6f 6e 20 57 65 64 |ietse@wz|v on Wed|
|00000470| 20 53 65 70 20 32 39 20 | 31 38 3a 34 35 3a 34 37 | Sep 29 |18:45:47|
|00000480| 20 31 39 39 33 0a 50 41 | 54 48 3d 2f 62 69 6e 3a | 1993.PA|TH=/bin:|
|00000490| 2f 75 73 72 2f 62 69 6e | 3a 2f 75 73 72 2f 75 63 |/usr/bin|:/usr/uc|
|000004a0| 62 20 3b 20 65 78 70 6f | 72 74 20 50 41 54 48 0a |b ; expo|rt PATH.|
|000004b0| 69 66 20 74 65 73 74 20 | 2d 66 20 73 74 72 63 61 |if test |-f strca|
|000004c0| 73 65 63 6d 70 2e 63 20 | 2d 61 20 22 24 7b 31 7d |secmp.c |-a "${1}|
|000004d0| 22 20 21 3d 20 22 2d 63 | 22 20 3b 20 74 68 65 6e |" != "-c|" ; then|
|000004e0| 20 0a 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 57 | . echo| shar: W|
|000004f0| 69 6c 6c 20 6e 6f 74 20 | 6f 76 65 72 2d 77 72 69 |ill not |over-wri|
|00000500| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|00000510| 20 5c 22 73 74 72 63 61 | 73 65 63 6d 70 2e 63 5c | \"strca|secmp.c\|
|00000520| 22 0a 65 6c 73 65 0a 65 | 63 68 6f 20 73 68 61 72 |".else.e|cho shar|
|00000530| 3a 20 45 78 74 72 61 63 | 74 69 6e 67 20 5c 22 73 |: Extrac|ting \"s|
|00000540| 74 72 63 61 73 65 63 6d | 70 2e 63 5c 22 20 5c 28 |trcasecm|p.c\" \(|
|00000550| 33 38 36 37 20 63 68 61 | 72 61 63 74 65 72 73 5c |3867 cha|racters\|
|00000560| 29 0a 73 65 64 20 22 73 | 2f 5e 58 2f 2f 22 20 3e |).sed "s|/^X//" >|
|00000570| 73 74 72 63 61 73 65 63 | 6d 70 2e 63 20 3c 3c 27 |strcasec|mp.c <<'|
|00000580| 45 4e 44 5f 4f 46 5f 73 | 74 72 63 61 73 65 63 6d |END_OF_s|trcasecm|
|00000590| 70 2e 63 27 0a 58 2f 2a | 0a 58 20 2a 20 43 6f 70 |p.c'.X/*|.X * Cop|
|000005a0| 79 72 69 67 68 74 20 28 | 63 29 20 31 39 38 37 20 |yright (|c) 1987 |
|000005b0| 52 65 67 65 6e 74 73 20 | 6f 66 20 74 68 65 20 55 |Regents |of the U|
|000005c0| 6e 69 76 65 72 73 69 74 | 79 20 6f 66 20 43 61 6c |niversit|y of Cal|
|000005d0| 69 66 6f 72 6e 69 61 2e | 0a 58 20 2a 20 41 6c 6c |ifornia.|.X * All|
|000005e0| 20 72 69 67 68 74 73 20 | 72 65 73 65 72 76 65 64 | rights |reserved|
|000005f0| 2e 0a 58 20 2a 0a 58 20 | 2a 20 52 65 64 69 73 74 |..X *.X |* Redist|
|00000600| 72 69 62 75 74 69 6f 6e | 20 61 6e 64 20 75 73 65 |ribution| and use|
|00000610| 20 69 6e 20 73 6f 75 72 | 63 65 20 61 6e 64 20 62 | in sour|ce and b|
|00000620| 69 6e 61 72 79 20 66 6f | 72 6d 73 20 61 72 65 20 |inary fo|rms are |
|00000630| 70 65 72 6d 69 74 74 65 | 64 0a 58 20 2a 20 70 72 |permitte|d.X * pr|
|00000640| 6f 76 69 64 65 64 20 74 | 68 61 74 20 74 68 65 20 |ovided t|hat the |
|00000650| 61 62 6f 76 65 20 63 6f | 70 79 72 69 67 68 74 20 |above co|pyright |
|00000660| 6e 6f 74 69 63 65 20 61 | 6e 64 20 74 68 69 73 20 |notice a|nd this |
|00000670| 70 61 72 61 67 72 61 70 | 68 20 61 72 65 0a 58 20 |paragrap|h are.X |
|00000680| 2a 20 64 75 70 6c 69 63 | 61 74 65 64 20 69 6e 20 |* duplic|ated in |
|00000690| 61 6c 6c 20 73 75 63 68 | 20 66 6f 72 6d 73 20 61 |all such| forms a|
|000006a0| 6e 64 20 74 68 61 74 20 | 61 6e 79 20 64 6f 63 75 |nd that |any docu|
|000006b0| 6d 65 6e 74 61 74 69 6f | 6e 2c 0a 58 20 2a 20 61 |mentatio|n,.X * a|
|000006c0| 64 76 65 72 74 69 73 69 | 6e 67 20 6d 61 74 65 72 |dvertisi|ng mater|
|000006d0| 69 61 6c 73 2c 20 61 6e | 64 20 6f 74 68 65 72 20 |ials, an|d other |
|000006e0| 6d 61 74 65 72 69 61 6c | 73 20 72 65 6c 61 74 65 |material|s relate|
|000006f0| 64 20 74 6f 20 73 75 63 | 68 0a 58 20 2a 20 64 69 |d to suc|h.X * di|
|00000700| 73 74 72 69 62 75 74 69 | 6f 6e 20 61 6e 64 20 75 |stributi|on and u|
|00000710| 73 65 20 61 63 6b 6e 6f | 77 6c 65 64 67 65 20 74 |se ackno|wledge t|
|00000720| 68 61 74 20 74 68 65 20 | 73 6f 66 74 77 61 72 65 |hat the |software|
|00000730| 20 77 61 73 20 64 65 76 | 65 6c 6f 70 65 64 0a 58 | was dev|eloped.X|
|00000740| 20 2a 20 62 79 20 74 68 | 65 20 55 6e 69 76 65 72 | * by th|e Univer|
|00000750| 73 69 74 79 20 6f 66 20 | 43 61 6c 69 66 6f 72 6e |sity of |Californ|
|00000760| 69 61 2c 20 42 65 72 6b | 65 6c 65 79 2e 20 20 54 |ia, Berk|eley. T|
|00000770| 68 65 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 0a 58 |he name |of the.X|
|00000780| 20 2a 20 55 6e 69 76 65 | 72 73 69 74 79 20 6d 61 | * Unive|rsity ma|
|00000790| 79 20 6e 6f 74 20 62 65 | 20 75 73 65 64 20 74 6f |y not be| used to|
|000007a0| 20 65 6e 64 6f 72 73 65 | 20 6f 72 20 70 72 6f 6d | endorse| or prom|
|000007b0| 6f 74 65 20 70 72 6f 64 | 75 63 74 73 20 64 65 72 |ote prod|ucts der|
|000007c0| 69 76 65 64 0a 58 20 2a | 20 66 72 6f 6d 20 74 68 |ived.X *| from th|
|000007d0| 69 73 20 73 6f 66 74 77 | 61 72 65 20 77 69 74 68 |is softw|are with|
|000007e0| 6f 75 74 20 73 70 65 63 | 69 66 69 63 20 70 72 69 |out spec|ific pri|
|000007f0| 6f 72 20 77 72 69 74 74 | 65 6e 20 70 65 72 6d 69 |or writt|en permi|
|00000800| 73 73 69 6f 6e 2e 0a 58 | 20 2a 20 54 48 49 53 20 |ssion..X| * THIS |
|00000810| 53 4f 46 54 57 41 52 45 | 20 49 53 20 50 52 4f 56 |SOFTWARE| IS PROV|
|00000820| 49 44 45 44 20 60 60 41 | 53 20 49 53 27 27 20 41 |IDED ``A|S IS'' A|
|00000830| 4e 44 20 57 49 54 48 4f | 55 54 20 41 4e 59 20 45 |ND WITHO|UT ANY E|
|00000840| 58 50 52 45 53 53 20 4f | 52 0a 58 20 2a 20 49 4d |XPRESS O|R.X * IM|
|00000850| 50 4c 49 45 44 20 57 41 | 52 52 41 4e 54 49 45 53 |PLIED WA|RRANTIES|
|00000860| 2c 20 49 4e 43 4c 55 44 | 49 4e 47 2c 20 57 49 54 |, INCLUD|ING, WIT|
|00000870| 48 4f 55 54 20 4c 49 4d | 49 54 41 54 49 4f 4e 2c |HOUT LIM|ITATION,|
|00000880| 20 54 48 45 20 49 4d 50 | 4c 49 45 44 0a 58 20 2a | THE IMP|LIED.X *|
|00000890| 20 57 41 52 52 41 4e 54 | 49 45 53 20 4f 46 20 4d | WARRANT|IES OF M|
|000008a0| 45 52 43 48 41 4e 54 49 | 42 49 4c 49 54 59 20 41 |ERCHANTI|BILITY A|
|000008b0| 4e 44 20 46 49 54 4e 45 | 53 53 20 46 4f 52 20 41 |ND FITNE|SS FOR A|
|000008c0| 20 50 41 52 54 49 43 55 | 4c 41 52 20 50 55 52 50 | PARTICU|LAR PURP|
|000008d0| 4f 53 45 2e 0a 58 20 2a | 2f 0a 58 0a 58 23 69 66 |OSE..X *|/.X.X#if|
|000008e0| 20 64 65 66 69 6e 65 64 | 28 4c 49 42 43 5f 53 43 | defined|(LIBC_SC|
|000008f0| 43 53 29 20 26 26 20 21 | 64 65 66 69 6e 65 64 28 |CS) && !|defined(|
|00000900| 6c 69 6e 74 29 0a 58 73 | 74 61 74 69 63 20 63 68 |lint).Xs|tatic ch|
|00000910| 61 72 20 73 63 63 73 69 | 64 5b 5d 20 3d 20 22 40 |ar sccsi|d[] = "@|
|00000920| 28 23 29 73 74 72 63 61 | 73 65 63 6d 70 2e 63 09 |(#)strca|secmp.c.|
|00000930| 35 2e 36 20 28 42 65 72 | 6b 65 6c 65 79 29 20 36 |5.6 (Ber|keley) 6|
|00000940| 2f 32 37 2f 38 38 22 3b | 0a 58 23 65 6e 64 69 66 |/27/88";|.X#endif|
|00000950| 20 2f 2a 20 4c 49 42 43 | 5f 53 43 43 53 20 61 6e | /* LIBC|_SCCS an|
|00000960| 64 20 6e 6f 74 20 6c 69 | 6e 74 20 2a 2f 0a 58 0a |d not li|nt */.X.|
|00000970| 58 2f 2a 20 53 6f 6d 65 | 20 65 6e 76 69 72 6f 6e |X/* Some| environ|
|00000980| 6d 65 6e 74 73 20 64 6f | 6e 27 74 20 64 65 66 69 |ments do|n't defi|
|00000990| 6e 65 20 75 5f 63 68 61 | 72 20 2d 2d 20 57 5a 56 |ne u_cha|r -- WZV|
|000009a0| 20 2a 2f 0a 58 23 69 66 | 20 30 0a 58 23 69 6e 63 | */.X#if| 0.X#inc|
|000009b0| 6c 75 64 65 20 3c 73 79 | 73 2f 74 79 70 65 73 2e |lude <sy|s/types.|
|000009c0| 68 3e 0a 58 23 65 6c 73 | 65 0a 58 74 79 70 65 64 |h>.X#els|e.Xtyped|
|000009d0| 65 66 20 75 6e 73 69 67 | 6e 65 64 20 63 68 61 72 |ef unsig|ned char|
|000009e0| 20 75 5f 63 68 61 72 3b | 0a 58 23 65 6e 64 69 66 | u_char;|.X#endif|
|000009f0| 0a 58 0a 58 2f 2a 0a 58 | 20 2a 20 54 68 69 73 20 |.X.X/*.X| * This |
|00000a00| 61 72 72 61 79 20 69 73 | 20 64 65 73 69 67 6e 65 |array is| designe|
|00000a10| 64 20 66 6f 72 20 6d 61 | 70 70 69 6e 67 20 75 70 |d for ma|pping up|
|00000a20| 70 65 72 20 61 6e 64 20 | 6c 6f 77 65 72 20 63 61 |per and |lower ca|
|00000a30| 73 65 20 6c 65 74 74 65 | 72 0a 58 20 2a 20 74 6f |se lette|r.X * to|
|00000a40| 67 65 74 68 65 72 20 66 | 6f 72 20 61 20 63 61 73 |gether f|or a cas|
|00000a50| 65 20 69 6e 64 65 70 65 | 6e 64 65 6e 74 20 63 6f |e indepe|ndent co|
|00000a60| 6d 70 61 72 69 73 6f 6e | 2e 20 20 54 68 65 20 6d |mparison|. The m|
|00000a70| 61 70 70 69 6e 67 73 20 | 61 72 65 0a 58 20 2a 20 |appings |are.X * |
|00000a80| 62 61 73 65 64 20 75 70 | 6f 6e 20 61 73 63 69 69 |based up|on ascii|
|00000a90| 20 63 68 61 72 61 63 74 | 65 72 20 73 65 71 75 65 | charact|er seque|
|00000aa0| 6e 63 65 73 2e 0a 58 20 | 2a 2f 0a 58 73 74 61 74 |nces..X |*/.Xstat|
|00000ab0| 69 63 20 75 5f 63 68 61 | 72 20 63 68 61 72 6d 61 |ic u_cha|r charma|
|00000ac0| 70 5b 5d 20 3d 20 7b 0a | 58 09 27 5c 30 30 30 27 |p[] = {.|X.'\000'|
|00000ad0| 2c 20 27 5c 30 30 31 27 | 2c 20 27 5c 30 30 32 27 |, '\001'|, '\002'|
|00000ae0| 2c 20 27 5c 30 30 33 27 | 2c 20 27 5c 30 30 34 27 |, '\003'|, '\004'|
|00000af0| 2c 20 27 5c 30 30 35 27 | 2c 20 27 5c 30 30 36 27 |, '\005'|, '\006'|
|00000b00| 2c 20 27 5c 30 30 37 27 | 2c 0a 58 09 27 5c 30 31 |, '\007'|,.X.'\01|
|00000b10| 30 27 2c 20 27 5c 30 31 | 31 27 2c 20 27 5c 30 31 |0', '\01|1', '\01|
|00000b20| 32 27 2c 20 27 5c 30 31 | 33 27 2c 20 27 5c 30 31 |2', '\01|3', '\01|
|00000b30| 34 27 2c 20 27 5c 30 31 | 35 27 2c 20 27 5c 30 31 |4', '\01|5', '\01|
|00000b40| 36 27 2c 20 27 5c 30 31 | 37 27 2c 0a 58 09 27 5c |6', '\01|7',.X.'\|
|00000b50| 30 32 30 27 2c 20 27 5c | 30 32 31 27 2c 20 27 5c |020', '\|021', '\|
|00000b60| 30 32 32 27 2c 20 27 5c | 30 32 33 27 2c 20 27 5c |022', '\|023', '\|
|00000b70| 30 32 34 27 2c 20 27 5c | 30 32 35 27 2c 20 27 5c |024', '\|025', '\|
|00000b80| 30 32 36 27 2c 20 27 5c | 30 32 37 27 2c 0a 58 09 |026', '\|027',.X.|
|00000b90| 27 5c 30 33 30 27 2c 20 | 27 5c 30 33 31 27 2c 20 |'\030', |'\031', |
|00000ba0| 27 5c 30 33 32 27 2c 20 | 27 5c 30 33 33 27 2c 20 |'\032', |'\033', |
|00000bb0| 27 5c 30 33 34 27 2c 20 | 27 5c 30 33 35 27 2c 20 |'\034', |'\035', |
|00000bc0| 27 5c 30 33 36 27 2c 20 | 27 5c 30 33 37 27 2c 0a |'\036', |'\037',.|
|00000bd0| 58 09 27 5c 30 34 30 27 | 2c 20 27 5c 30 34 31 27 |X.'\040'|, '\041'|
|00000be0| 2c 20 27 5c 30 34 32 27 | 2c 20 27 5c 30 34 33 27 |, '\042'|, '\043'|
|00000bf0| 2c 20 27 5c 30 34 34 27 | 2c 20 27 5c 30 34 35 27 |, '\044'|, '\045'|
|00000c00| 2c 20 27 5c 30 34 36 27 | 2c 20 27 5c 30 34 37 27 |, '\046'|, '\047'|
|00000c10| 2c 0a 58 09 27 5c 30 35 | 30 27 2c 20 27 5c 30 35 |,.X.'\05|0', '\05|
|00000c20| 31 27 2c 20 27 5c 30 35 | 32 27 2c 20 27 5c 30 35 |1', '\05|2', '\05|
|00000c30| 33 27 2c 20 27 5c 30 35 | 34 27 2c 20 27 5c 30 35 |3', '\05|4', '\05|
|00000c40| 35 27 2c 20 27 5c 30 35 | 36 27 2c 20 27 5c 30 35 |5', '\05|6', '\05|
|00000c50| 37 27 2c 0a 58 09 27 5c | 30 36 30 27 2c 20 27 5c |7',.X.'\|060', '\|
|00000c60| 30 36 31 27 2c 20 27 5c | 30 36 32 27 2c 20 27 5c |061', '\|062', '\|
|00000c70| 30 36 33 27 2c 20 27 5c | 30 36 34 27 2c 20 27 5c |063', '\|064', '\|
|00000c80| 30 36 35 27 2c 20 27 5c | 30 36 36 27 2c 20 27 5c |065', '\|066', '\|
|00000c90| 30 36 37 27 2c 0a 58 09 | 27 5c 30 37 30 27 2c 20 |067',.X.|'\070', |
|00000ca0| 27 5c 30 37 31 27 2c 20 | 27 5c 30 37 32 27 2c 20 |'\071', |'\072', |
|00000cb0| 27 5c 30 37 33 27 2c 20 | 27 5c 30 37 34 27 2c 20 |'\073', |'\074', |
|00000cc0| 27 5c 30 37 35 27 2c 20 | 27 5c 30 37 36 27 2c 20 |'\075', |'\076', |
|00000cd0| 27 5c 30 37 37 27 2c 0a | 58 09 27 5c 31 30 30 27 |'\077',.|X.'\100'|
|00000ce0| 2c 20 27 5c 31 34 31 27 | 2c 20 27 5c 31 34 32 27 |, '\141'|, '\142'|
|00000cf0| 2c 20 27 5c 31 34 33 27 | 2c 20 27 5c 31 34 34 27 |, '\143'|, '\144'|
|00000d00| 2c 20 27 5c 31 34 35 27 | 2c 20 27 5c 31 34 36 27 |, '\145'|, '\146'|
|00000d10| 2c 20 27 5c 31 34 37 27 | 2c 0a 58 09 27 5c 31 35 |, '\147'|,.X.'\15|
|00000d20| 30 27 2c 20 27 5c 31 35 | 31 27 2c 20 27 5c 31 35 |0', '\15|1', '\15|
|00000d30| 32 27 2c 20 27 5c 31 35 | 33 27 2c 20 27 5c 31 35 |2', '\15|3', '\15|
|00000d40| 34 27 2c 20 27 5c 31 35 | 35 27 2c 20 27 5c 31 35 |4', '\15|5', '\15|
|00000d50| 36 27 2c 20 27 5c 31 35 | 37 27 2c 0a 58 09 27 5c |6', '\15|7',.X.'\|
|00000d60| 31 36 30 27 2c 20 27 5c | 31 36 31 27 2c 20 27 5c |160', '\|161', '\|
|00000d70| 31 36 32 27 2c 20 27 5c | 31 36 33 27 2c 20 27 5c |162', '\|163', '\|
|00000d80| 31 36 34 27 2c 20 27 5c | 31 36 35 27 2c 20 27 5c |164', '\|165', '\|
|00000d90| 31 36 36 27 2c 20 27 5c | 31 36 37 27 2c 0a 58 09 |166', '\|167',.X.|
|00000da0| 27 5c 31 37 30 27 2c 20 | 27 5c 31 37 31 27 2c 20 |'\170', |'\171', |
|00000db0| 27 5c 31 37 32 27 2c 20 | 27 5c 31 33 33 27 2c 20 |'\172', |'\133', |
|00000dc0| 27 5c 31 33 34 27 2c 20 | 27 5c 31 33 35 27 2c 20 |'\134', |'\135', |
|00000dd0| 27 5c 31 33 36 27 2c 20 | 27 5c 31 33 37 27 2c 0a |'\136', |'\137',.|
|00000de0| 58 09 27 5c 31 34 30 27 | 2c 20 27 5c 31 34 31 27 |X.'\140'|, '\141'|
|00000df0| 2c 20 27 5c 31 34 32 27 | 2c 20 27 5c 31 34 33 27 |, '\142'|, '\143'|
|00000e00| 2c 20 27 5c 31 34 34 27 | 2c 20 27 5c 31 34 35 27 |, '\144'|, '\145'|
|00000e10| 2c 20 27 5c 31 34 36 27 | 2c 20 27 5c 31 34 37 27 |, '\146'|, '\147'|
|00000e20| 2c 0a 58 09 27 5c 31 35 | 30 27 2c 20 27 5c 31 35 |,.X.'\15|0', '\15|
|00000e30| 31 27 2c 20 27 5c 31 35 | 32 27 2c 20 27 5c 31 35 |1', '\15|2', '\15|
|00000e40| 33 27 2c 20 27 5c 31 35 | 34 27 2c 20 27 5c 31 35 |3', '\15|4', '\15|
|00000e50| 35 27 2c 20 27 5c 31 35 | 36 27 2c 20 27 5c 31 35 |5', '\15|6', '\15|
|00000e60| 37 27 2c 0a 58 09 27 5c | 31 36 30 27 2c 20 27 5c |7',.X.'\|160', '\|
|00000e70| 31 36 31 27 2c 20 27 5c | 31 36 32 27 2c 20 27 5c |161', '\|162', '\|
|00000e80| 31 36 33 27 2c 20 27 5c | 31 36 34 27 2c 20 27 5c |163', '\|164', '\|
|00000e90| 31 36 35 27 2c 20 27 5c | 31 36 36 27 2c 20 27 5c |165', '\|166', '\|
|00000ea0| 31 36 37 27 2c 0a 58 09 | 27 5c 31 37 30 27 2c 20 |167',.X.|'\170', |
|00000eb0| 27 5c 31 37 31 27 2c 20 | 27 5c 31 37 32 27 2c 20 |'\171', |'\172', |
|00000ec0| 27 5c 31 37 33 27 2c 20 | 27 5c 31 37 34 27 2c 20 |'\173', |'\174', |
|00000ed0| 27 5c 31 37 35 27 2c 20 | 27 5c 31 37 36 27 2c 20 |'\175', |'\176', |
|00000ee0| 27 5c 31 37 37 27 2c 0a | 58 09 27 5c 32 30 30 27 |'\177',.|X.'\200'|
|00000ef0| 2c 20 27 5c 32 30 31 27 | 2c 20 27 5c 32 30 32 27 |, '\201'|, '\202'|
|00000f00| 2c 20 27 5c 32 30 33 27 | 2c 20 27 5c 32 30 34 27 |, '\203'|, '\204'|
|00000f10| 2c 20 27 5c 32 30 35 27 | 2c 20 27 5c 32 30 36 27 |, '\205'|, '\206'|
|00000f20| 2c 20 27 5c 32 30 37 27 | 2c 0a 58 09 27 5c 32 31 |, '\207'|,.X.'\21|
|00000f30| 30 27 2c 20 27 5c 32 31 | 31 27 2c 20 27 5c 32 31 |0', '\21|1', '\21|
|00000f40| 32 27 2c 20 27 5c 32 31 | 33 27 2c 20 27 5c 32 31 |2', '\21|3', '\21|
|00000f50| 34 27 2c 20 27 5c 32 31 | 35 27 2c 20 27 5c 32 31 |4', '\21|5', '\21|
|00000f60| 36 27 2c 20 27 5c 32 31 | 37 27 2c 0a 58 09 27 5c |6', '\21|7',.X.'\|
|00000f70| 32 32 30 27 2c 20 27 5c | 32 32 31 27 2c 20 27 5c |220', '\|221', '\|
|00000f80| 32 32 32 27 2c 20 27 5c | 32 32 33 27 2c 20 27 5c |222', '\|223', '\|
|00000f90| 32 32 34 27 2c 20 27 5c | 32 32 35 27 2c 20 27 5c |224', '\|225', '\|
|00000fa0| 32 32 36 27 2c 20 27 5c | 32 32 37 27 2c 0a 58 09 |226', '\|227',.X.|
|00000fb0| 27 5c 32 33 30 27 2c 20 | 27 5c 32 33 31 27 2c 20 |'\230', |'\231', |
|00000fc0| 27 5c 32 33 32 27 2c 20 | 27 5c 32 33 33 27 2c 20 |'\232', |'\233', |
|00000fd0| 27 5c 32 33 34 27 2c 20 | 27 5c 32 33 35 27 2c 20 |'\234', |'\235', |
|00000fe0| 27 5c 32 33 36 27 2c 20 | 27 5c 32 33 37 27 2c 0a |'\236', |'\237',.|
|00000ff0| 58 09 27 5c 32 34 30 27 | 2c 20 27 5c 32 34 31 27 |X.'\240'|, '\241'|
|00001000| 2c 20 27 5c 32 34 32 27 | 2c 20 27 5c 32 34 33 27 |, '\242'|, '\243'|
|00001010| 2c 20 27 5c 32 34 34 27 | 2c 20 27 5c 32 34 35 27 |, '\244'|, '\245'|
|00001020| 2c 20 27 5c 32 34 36 27 | 2c 20 27 5c 32 34 37 27 |, '\246'|, '\247'|
|00001030| 2c 0a 58 09 27 5c 32 35 | 30 27 2c 20 27 5c 32 35 |,.X.'\25|0', '\25|
|00001040| 31 27 2c 20 27 5c 32 35 | 32 27 2c 20 27 5c 32 35 |1', '\25|2', '\25|
|00001050| 33 27 2c 20 27 5c 32 35 | 34 27 2c 20 27 5c 32 35 |3', '\25|4', '\25|
|00001060| 35 27 2c 20 27 5c 32 35 | 36 27 2c 20 27 5c 32 35 |5', '\25|6', '\25|
|00001070| 37 27 2c 0a 58 09 27 5c | 32 36 30 27 2c 20 27 5c |7',.X.'\|260', '\|
|00001080| 32 36 31 27 2c 20 27 5c | 32 36 32 27 2c 20 27 5c |261', '\|262', '\|
|00001090| 32 36 33 27 2c 20 27 5c | 32 36 34 27 2c 20 27 5c |263', '\|264', '\|
|000010a0| 32 36 35 27 2c 20 27 5c | 32 36 36 27 2c 20 27 5c |265', '\|266', '\|
|000010b0| 32 36 37 27 2c 0a 58 09 | 27 5c 32 37 30 27 2c 20 |267',.X.|'\270', |
|000010c0| 27 5c 32 37 31 27 2c 20 | 27 5c 32 37 32 27 2c 20 |'\271', |'\272', |
|000010d0| 27 5c 32 37 33 27 2c 20 | 27 5c 32 37 34 27 2c 20 |'\273', |'\274', |
|000010e0| 27 5c 32 37 35 27 2c 20 | 27 5c 32 37 36 27 2c 20 |'\275', |'\276', |
|000010f0| 27 5c 32 37 37 27 2c 0a | 58 09 27 5c 33 30 30 27 |'\277',.|X.'\300'|
|00001100| 2c 20 27 5c 33 34 31 27 | 2c 20 27 5c 33 34 32 27 |, '\341'|, '\342'|
|00001110| 2c 20 27 5c 33 34 33 27 | 2c 20 27 5c 33 34 34 27 |, '\343'|, '\344'|
|00001120| 2c 20 27 5c 33 34 35 27 | 2c 20 27 5c 33 34 36 27 |, '\345'|, '\346'|
|00001130| 2c 20 27 5c 33 34 37 27 | 2c 0a 58 09 27 5c 33 35 |, '\347'|,.X.'\35|
|00001140| 30 27 2c 20 27 5c 33 35 | 31 27 2c 20 27 5c 33 35 |0', '\35|1', '\35|
|00001150| 32 27 2c 20 27 5c 33 35 | 33 27 2c 20 27 5c 33 35 |2', '\35|3', '\35|
|00001160| 34 27 2c 20 27 5c 33 35 | 35 27 2c 20 27 5c 33 35 |4', '\35|5', '\35|
|00001170| 36 27 2c 20 27 5c 33 35 | 37 27 2c 0a 58 09 27 5c |6', '\35|7',.X.'\|
|00001180| 33 36 30 27 2c 20 27 5c | 33 36 31 27 2c 20 27 5c |360', '\|361', '\|
|00001190| 33 36 32 27 2c 20 27 5c | 33 36 33 27 2c 20 27 5c |362', '\|363', '\|
|000011a0| 33 36 34 27 2c 20 27 5c | 33 36 35 27 2c 20 27 5c |364', '\|365', '\|
|000011b0| 33 36 36 27 2c 20 27 5c | 33 36 37 27 2c 0a 58 09 |366', '\|367',.X.|
|000011c0| 27 5c 33 37 30 27 2c 20 | 27 5c 33 37 31 27 2c 20 |'\370', |'\371', |
|000011d0| 27 5c 33 37 32 27 2c 20 | 27 5c 33 33 33 27 2c 20 |'\372', |'\333', |
|000011e0| 27 5c 33 33 34 27 2c 20 | 27 5c 33 33 35 27 2c 20 |'\334', |'\335', |
|000011f0| 27 5c 33 33 36 27 2c 20 | 27 5c 33 33 37 27 2c 0a |'\336', |'\337',.|
|00001200| 58 09 27 5c 33 34 30 27 | 2c 20 27 5c 33 34 31 27 |X.'\340'|, '\341'|
|00001210| 2c 20 27 5c 33 34 32 27 | 2c 20 27 5c 33 34 33 27 |, '\342'|, '\343'|
|00001220| 2c 20 27 5c 33 34 34 27 | 2c 20 27 5c 33 34 35 27 |, '\344'|, '\345'|
|00001230| 2c 20 27 5c 33 34 36 27 | 2c 20 27 5c 33 34 37 27 |, '\346'|, '\347'|
|00001240| 2c 0a 58 09 27 5c 33 35 | 30 27 2c 20 27 5c 33 35 |,.X.'\35|0', '\35|
|00001250| 31 27 2c 20 27 5c 33 35 | 32 27 2c 20 27 5c 33 35 |1', '\35|2', '\35|
|00001260| 33 27 2c 20 27 5c 33 35 | 34 27 2c 20 27 5c 33 35 |3', '\35|4', '\35|
|00001270| 35 27 2c 20 27 5c 33 35 | 36 27 2c 20 27 5c 33 35 |5', '\35|6', '\35|
|00001280| 37 27 2c 0a 58 09 27 5c | 33 36 30 27 2c 20 27 5c |7',.X.'\|360', '\|
|00001290| 33 36 31 27 2c 20 27 5c | 33 36 32 27 2c 20 27 5c |361', '\|362', '\|
|000012a0| 33 36 33 27 2c 20 27 5c | 33 36 34 27 2c 20 27 5c |363', '\|364', '\|
|000012b0| 33 36 35 27 2c 20 27 5c | 33 36 36 27 2c 20 27 5c |365', '\|366', '\|
|000012c0| 33 36 37 27 2c 0a 58 09 | 27 5c 33 37 30 27 2c 20 |367',.X.|'\370', |
|000012d0| 27 5c 33 37 31 27 2c 20 | 27 5c 33 37 32 27 2c 20 |'\371', |'\372', |
|000012e0| 27 5c 33 37 33 27 2c 20 | 27 5c 33 37 34 27 2c 20 |'\373', |'\374', |
|000012f0| 27 5c 33 37 35 27 2c 20 | 27 5c 33 37 36 27 2c 20 |'\375', |'\376', |
|00001300| 27 5c 33 37 37 27 2c 0a | 58 7d 3b 0a 58 0a 58 73 |'\377',.|X};.X.Xs|
|00001310| 74 72 63 61 73 65 63 6d | 70 28 73 31 2c 20 73 32 |trcasecm|p(s1, s2|
|00001320| 29 0a 58 09 63 68 61 72 | 20 2a 73 31 2c 20 2a 73 |).X.char| *s1, *s|
|00001330| 32 3b 0a 58 7b 0a 58 09 | 72 65 67 69 73 74 65 72 |2;.X{.X.|register|
|00001340| 20 75 5f 63 68 61 72 09 | 2a 63 6d 20 3d 20 63 68 | u_char.|*cm = ch|
|00001350| 61 72 6d 61 70 2c 0a 58 | 09 09 09 2a 75 73 31 20 |armap,.X|...*us1 |
|00001360| 3d 20 28 75 5f 63 68 61 | 72 20 2a 29 73 31 2c 0a |= (u_cha|r *)s1,.|
|00001370| 58 09 09 09 2a 75 73 32 | 20 3d 20 28 75 5f 63 68 |X...*us2| = (u_ch|
|00001380| 61 72 20 2a 29 73 32 3b | 0a 58 0a 58 09 77 68 69 |ar *)s2;|.X.X.whi|
|00001390| 6c 65 20 28 63 6d 5b 2a | 75 73 31 5d 20 3d 3d 20 |le (cm[*|us1] == |
|000013a0| 63 6d 5b 2a 75 73 32 2b | 2b 5d 29 0a 58 09 09 69 |cm[*us2+|+]).X..i|
|000013b0| 66 20 28 2a 75 73 31 2b | 2b 20 3d 3d 20 27 5c 30 |f (*us1+|+ == '\0|
|000013c0| 27 29 0a 58 09 09 09 72 | 65 74 75 72 6e 28 30 29 |').X...r|eturn(0)|
|000013d0| 3b 0a 58 09 72 65 74 75 | 72 6e 28 63 6d 5b 2a 75 |;.X.retu|rn(cm[*u|
|000013e0| 73 31 5d 20 2d 20 63 6d | 5b 2a 2d 2d 75 73 32 5d |s1] - cm|[*--us2]|
|000013f0| 29 3b 0a 58 7d 0a 58 0a | 58 73 74 72 6e 63 61 73 |);.X}.X.|Xstrncas|
|00001400| 65 63 6d 70 28 73 31 2c | 20 73 32 2c 20 6e 29 0a |ecmp(s1,| s2, n).|
|00001410| 58 09 63 68 61 72 20 2a | 73 31 2c 20 2a 73 32 3b |X.char *|s1, *s2;|
|00001420| 0a 58 09 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 |.X.regis|ter int |
|00001430| 6e 3b 0a 58 7b 0a 58 09 | 72 65 67 69 73 74 65 72 |n;.X{.X.|register|
|00001440| 20 75 5f 63 68 61 72 09 | 2a 63 6d 20 3d 20 63 68 | u_char.|*cm = ch|
|00001450| 61 72 6d 61 70 2c 0a 58 | 09 09 09 2a 75 73 31 20 |armap,.X|...*us1 |
|00001460| 3d 20 28 75 5f 63 68 61 | 72 20 2a 29 73 31 2c 0a |= (u_cha|r *)s1,.|
|00001470| 58 09 09 09 2a 75 73 32 | 20 3d 20 28 75 5f 63 68 |X...*us2| = (u_ch|
|00001480| 61 72 20 2a 29 73 32 3b | 0a 58 0a 58 09 77 68 69 |ar *)s2;|.X.X.whi|
|00001490| 6c 65 20 28 2d 2d 6e 20 | 3e 3d 20 30 20 26 26 20 |le (--n |>= 0 && |
|000014a0| 63 6d 5b 2a 75 73 31 5d | 20 3d 3d 20 63 6d 5b 2a |cm[*us1]| == cm[*|
|000014b0| 75 73 32 2b 2b 5d 29 0a | 58 09 09 69 66 20 28 2a |us2++]).|X..if (*|
|000014c0| 75 73 31 2b 2b 20 3d 3d | 20 27 5c 30 27 29 0a 58 |us1++ ==| '\0').X|
|000014d0| 09 09 09 72 65 74 75 72 | 6e 28 30 29 3b 0a 58 09 |...retur|n(0);.X.|
|000014e0| 72 65 74 75 72 6e 28 6e | 20 3c 20 30 20 3f 20 30 |return(n| < 0 ? 0|
|000014f0| 20 3a 20 63 6d 5b 2a 75 | 73 31 5d 20 2d 20 63 6d | : cm[*u|s1] - cm|
|00001500| 5b 2a 2d 2d 75 73 32 5d | 29 3b 0a 58 7d 0a 45 4e |[*--us2]|);.X}.EN|
|00001510| 44 5f 4f 46 5f 73 74 72 | 63 61 73 65 63 6d 70 2e |D_OF_str|casecmp.|
|00001520| 63 0a 69 66 20 74 65 73 | 74 20 33 38 36 37 20 2d |c.if tes|t 3867 -|
|00001530| 6e 65 20 60 77 63 20 2d | 63 20 3c 73 74 72 63 61 |ne `wc -|c <strca|
|00001540| 73 65 63 6d 70 2e 63 60 | 3b 20 74 68 65 6e 0a 20 |secmp.c`|; then. |
|00001550| 20 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 5c 22 | echo |shar: \"|
|00001560| 73 74 72 63 61 73 65 63 | 6d 70 2e 63 5c 22 20 75 |strcasec|mp.c\" u|
|00001570| 6e 70 61 63 6b 65 64 20 | 77 69 74 68 20 77 72 6f |npacked |with wro|
|00001580| 6e 67 20 73 69 7a 65 21 | 0a 66 69 0a 23 20 65 6e |ng size!|.fi.# en|
|00001590| 64 20 6f 66 20 6f 76 65 | 72 77 72 69 74 69 6e 67 |d of ove|rwriting|
|000015a0| 20 63 68 65 63 6b 0a 66 | 69 0a 69 66 20 74 65 73 | check.f|i.if tes|
|000015b0| 74 20 2d 66 20 73 74 72 | 74 6f 6b 2e 63 20 2d 61 |t -f str|tok.c -a|
|000015c0| 20 22 24 7b 31 7d 22 20 | 21 3d 20 22 2d 63 22 20 | "${1}" |!= "-c" |
|000015d0| 3b 20 74 68 65 6e 20 0a | 20 20 65 63 68 6f 20 73 |; then .| echo s|
|000015e0| 68 61 72 3a 20 57 69 6c | 6c 20 6e 6f 74 20 6f 76 |har: Wil|l not ov|
|000015f0| 65 72 2d 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |er-write| existin|
|00001600| 67 20 66 69 6c 65 20 5c | 22 73 74 72 74 6f 6b 2e |g file \|"strtok.|
|00001610| 63 5c 22 0a 65 6c 73 65 | 0a 65 63 68 6f 20 73 68 |c\".else|.echo sh|
|00001620| 61 72 3a 20 45 78 74 72 | 61 63 74 69 6e 67 20 5c |ar: Extr|acting \|
|00001630| 22 73 74 72 74 6f 6b 2e | 63 5c 22 20 5c 28 32 39 |"strtok.|c\" \(29|
|00001640| 37 36 20 63 68 61 72 61 | 63 74 65 72 73 5c 29 0a |76 chara|cters\).|
|00001650| 73 65 64 20 22 73 2f 5e | 58 2f 2f 22 20 3e 73 74 |sed "s/^|X//" >st|
|00001660| 72 74 6f 6b 2e 63 20 3c | 3c 27 45 4e 44 5f 4f 46 |rtok.c <|<'END_OF|
|00001670| 5f 73 74 72 74 6f 6b 2e | 63 27 0a 58 2f 2a 0a 58 |_strtok.|c'.X/*.X|
|00001680| 20 2a 20 43 6f 70 79 72 | 69 67 68 74 20 28 63 29 | * Copyr|ight (c)|
|00001690| 20 31 39 38 38 20 52 65 | 67 65 6e 74 73 20 6f 66 | 1988 Re|gents of|
|000016a0| 20 74 68 65 20 55 6e 69 | 76 65 72 73 69 74 79 20 | the Uni|versity |
|000016b0| 6f 66 20 43 61 6c 69 66 | 6f 72 6e 69 61 2e 0a 58 |of Calif|ornia..X|
|000016c0| 20 2a 20 41 6c 6c 20 72 | 69 67 68 74 73 20 72 65 | * All r|ights re|
|000016d0| 73 65 72 76 65 64 2e 0a | 58 20 2a 0a 58 20 2a 20 |served..|X *.X * |
|000016e0| 52 65 64 69 73 74 72 69 | 62 75 74 69 6f 6e 20 61 |Redistri|bution a|
|000016f0| 6e 64 20 75 73 65 20 69 | 6e 20 73 6f 75 72 63 65 |nd use i|n source|
|00001700| 20 61 6e 64 20 62 69 6e | 61 72 79 20 66 6f 72 6d | and bin|ary form|
|00001710| 73 2c 20 77 69 74 68 20 | 6f 72 20 77 69 74 68 6f |s, with |or witho|
|00001720| 75 74 0a 58 20 2a 20 6d | 6f 64 69 66 69 63 61 74 |ut.X * m|odificat|
|00001730| 69 6f 6e 2c 20 61 72 65 | 20 70 65 72 6d 69 74 74 |ion, are| permitt|
|00001740| 65 64 20 70 72 6f 76 69 | 64 65 64 20 74 68 61 74 |ed provi|ded that|
|00001750| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 63 | the fol|lowing c|
|00001760| 6f 6e 64 69 74 69 6f 6e | 73 0a 58 20 2a 20 61 72 |ondition|s.X * ar|
|00001770| 65 20 6d 65 74 3a 0a 58 | 20 2a 20 31 2e 20 52 65 |e met:.X| * 1. Re|
|00001780| 64 69 73 74 72 69 62 75 | 74 69 6f 6e 73 20 6f 66 |distribu|tions of|
|00001790| 20 73 6f 75 72 63 65 20 | 63 6f 64 65 20 6d 75 73 | source |code mus|
|000017a0| 74 20 72 65 74 61 69 6e | 20 74 68 65 20 61 62 6f |t retain| the abo|
|000017b0| 76 65 20 63 6f 70 79 72 | 69 67 68 74 0a 58 20 2a |ve copyr|ight.X *|
|000017c0| 20 20 20 20 6e 6f 74 69 | 63 65 2c 20 74 68 69 73 | noti|ce, this|
|000017d0| 20 6c 69 73 74 20 6f 66 | 20 63 6f 6e 64 69 74 69 | list of| conditi|
|000017e0| 6f 6e 73 20 61 6e 64 20 | 74 68 65 20 66 6f 6c 6c |ons and |the foll|
|000017f0| 6f 77 69 6e 67 20 64 69 | 73 63 6c 61 69 6d 65 72 |owing di|sclaimer|
|00001800| 2e 0a 58 20 2a 20 32 2e | 20 52 65 64 69 73 74 72 |..X * 2.| Redistr|
|00001810| 69 62 75 74 69 6f 6e 73 | 20 69 6e 20 62 69 6e 61 |ibutions| in bina|
|00001820| 72 79 20 66 6f 72 6d 20 | 6d 75 73 74 20 72 65 70 |ry form |must rep|
|00001830| 72 6f 64 75 63 65 20 74 | 68 65 20 61 62 6f 76 65 |roduce t|he above|
|00001840| 20 63 6f 70 79 72 69 67 | 68 74 0a 58 20 2a 20 20 | copyrig|ht.X * |
|00001850| 20 20 6e 6f 74 69 63 65 | 2c 20 74 68 69 73 20 6c | notice|, this l|
|00001860| 69 73 74 20 6f 66 20 63 | 6f 6e 64 69 74 69 6f 6e |ist of c|ondition|
|00001870| 73 20 61 6e 64 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |s and th|e follow|
|00001880| 69 6e 67 20 64 69 73 63 | 6c 61 69 6d 65 72 20 69 |ing disc|laimer i|
|00001890| 6e 20 74 68 65 0a 58 20 | 2a 20 20 20 20 64 6f 63 |n the.X |* doc|
|000018a0| 75 6d 65 6e 74 61 74 69 | 6f 6e 20 61 6e 64 2f 6f |umentati|on and/o|
|000018b0| 72 20 6f 74 68 65 72 20 | 6d 61 74 65 72 69 61 6c |r other |material|
|000018c0| 73 20 70 72 6f 76 69 64 | 65 64 20 77 69 74 68 20 |s provid|ed with |
|000018d0| 74 68 65 20 64 69 73 74 | 72 69 62 75 74 69 6f 6e |the dist|ribution|
|000018e0| 2e 0a 58 20 2a 20 33 2e | 20 41 6c 6c 20 61 64 76 |..X * 3.| All adv|
|000018f0| 65 72 74 69 73 69 6e 67 | 20 6d 61 74 65 72 69 61 |ertising| materia|
|00001900| 6c 73 20 6d 65 6e 74 69 | 6f 6e 69 6e 67 20 66 65 |ls menti|oning fe|
|00001910| 61 74 75 72 65 73 20 6f | 72 20 75 73 65 20 6f 66 |atures o|r use of|
|00001920| 20 74 68 69 73 20 73 6f | 66 74 77 61 72 65 0a 58 | this so|ftware.X|
|00001930| 20 2a 20 20 20 20 6d 75 | 73 74 20 64 69 73 70 6c | * mu|st displ|
|00001940| 61 79 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |ay the f|ollowing|
|00001950| 20 61 63 6b 6e 6f 77 6c | 65 64 67 65 6d 65 6e 74 | acknowl|edgement|
|00001960| 3a 0a 58 20 2a 09 54 68 | 69 73 20 70 72 6f 64 75 |:.X *.Th|is produ|
|00001970| 63 74 20 69 6e 63 6c 75 | 64 65 73 20 73 6f 66 74 |ct inclu|des soft|
|00001980| 77 61 72 65 20 64 65 76 | 65 6c 6f 70 65 64 20 62 |ware dev|eloped b|
|00001990| 79 20 74 68 65 20 55 6e | 69 76 65 72 73 69 74 79 |y the Un|iversity|
|000019a0| 20 6f 66 0a 58 20 2a 09 | 43 61 6c 69 66 6f 72 6e | of.X *.|Californ|
|000019b0| 69 61 2c 20 42 65 72 6b | 65 6c 65 79 20 61 6e 64 |ia, Berk|eley and|
|000019c0| 20 69 74 73 20 63 6f 6e | 74 72 69 62 75 74 6f 72 | its con|tributor|
|000019d0| 73 2e 0a 58 20 2a 20 34 | 2e 20 4e 65 69 74 68 65 |s..X * 4|. Neithe|
|000019e0| 72 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 74 68 |r the na|me of th|
|000019f0| 65 20 55 6e 69 76 65 72 | 73 69 74 79 20 6e 6f 72 |e Univer|sity nor|
|00001a00| 20 74 68 65 20 6e 61 6d | 65 73 20 6f 66 20 69 74 | the nam|es of it|
|00001a10| 73 20 63 6f 6e 74 72 69 | 62 75 74 6f 72 73 0a 58 |s contri|butors.X|
|00001a20| 20 2a 20 20 20 20 6d 61 | 79 20 62 65 20 75 73 65 | * ma|y be use|
|00001a30| 64 20 74 6f 20 65 6e 64 | 6f 72 73 65 20 6f 72 20 |d to end|orse or |
|00001a40| 70 72 6f 6d 6f 74 65 20 | 70 72 6f 64 75 63 74 73 |promote |products|
|00001a50| 20 64 65 72 69 76 65 64 | 20 66 72 6f 6d 20 74 68 | derived| from th|
|00001a60| 69 73 20 73 6f 66 74 77 | 61 72 65 0a 58 20 2a 20 |is softw|are.X * |
|00001a70| 20 20 20 77 69 74 68 6f | 75 74 20 73 70 65 63 69 | witho|ut speci|
|00001a80| 66 69 63 20 70 72 69 6f | 72 20 77 72 69 74 74 65 |fic prio|r writte|
|00001a90| 6e 20 70 65 72 6d 69 73 | 73 69 6f 6e 2e 0a 58 20 |n permis|sion..X |
|00001aa0| 2a 0a 58 20 2a 20 54 48 | 49 53 20 53 4f 46 54 57 |*.X * TH|IS SOFTW|
|00001ab0| 41 52 45 20 49 53 20 50 | 52 4f 56 49 44 45 44 20 |ARE IS P|ROVIDED |
|00001ac0| 42 59 20 54 48 45 20 52 | 45 47 45 4e 54 53 20 41 |BY THE R|EGENTS A|
|00001ad0| 4e 44 20 43 4f 4e 54 52 | 49 42 55 54 4f 52 53 20 |ND CONTR|IBUTORS |
|00001ae0| 60 60 41 53 20 49 53 27 | 27 20 41 4e 44 0a 58 20 |``AS IS'|' AND.X |
|00001af0| 2a 20 41 4e 59 20 45 58 | 50 52 45 53 53 20 4f 52 |* ANY EX|PRESS OR|
|00001b00| 20 49 4d 50 4c 49 45 44 | 20 57 41 52 52 41 4e 54 | IMPLIED| WARRANT|
|00001b10| 49 45 53 2c 20 49 4e 43 | 4c 55 44 49 4e 47 2c 20 |IES, INC|LUDING, |
|00001b20| 42 55 54 20 4e 4f 54 20 | 4c 49 4d 49 54 45 44 20 |BUT NOT |LIMITED |
|00001b30| 54 4f 2c 20 54 48 45 0a | 58 20 2a 20 49 4d 50 4c |TO, THE.|X * IMPL|
|00001b40| 49 45 44 20 57 41 52 52 | 41 4e 54 49 45 53 20 4f |IED WARR|ANTIES O|
|00001b50| 46 20 4d 45 52 43 48 41 | 4e 54 41 42 49 4c 49 54 |F MERCHA|NTABILIT|
|00001b60| 59 20 41 4e 44 20 46 49 | 54 4e 45 53 53 20 46 4f |Y AND FI|TNESS FO|
|00001b70| 52 20 41 20 50 41 52 54 | 49 43 55 4c 41 52 20 50 |R A PART|ICULAR P|
|00001b80| 55 52 50 4f 53 45 0a 58 | 20 2a 20 41 52 45 20 44 |URPOSE.X| * ARE D|
|00001b90| 49 53 43 4c 41 49 4d 45 | 44 2e 20 20 49 4e 20 4e |ISCLAIME|D. IN N|
|00001ba0| 4f 20 45 56 45 4e 54 20 | 53 48 41 4c 4c 20 54 48 |O EVENT |SHALL TH|
|00001bb0| 45 20 52 45 47 45 4e 54 | 53 20 4f 52 20 43 4f 4e |E REGENT|S OR CON|
|00001bc0| 54 52 49 42 55 54 4f 52 | 53 20 42 45 20 4c 49 41 |TRIBUTOR|S BE LIA|
|00001bd0| 42 4c 45 0a 58 20 2a 20 | 46 4f 52 20 41 4e 59 20 |BLE.X * |FOR ANY |
|00001be0| 44 49 52 45 43 54 2c 20 | 49 4e 44 49 52 45 43 54 |DIRECT, |INDIRECT|
|00001bf0| 2c 20 49 4e 43 49 44 45 | 4e 54 41 4c 2c 20 53 50 |, INCIDE|NTAL, SP|
|00001c00| 45 43 49 41 4c 2c 20 45 | 58 45 4d 50 4c 41 52 59 |ECIAL, E|XEMPLARY|
|00001c10| 2c 20 4f 52 20 43 4f 4e | 53 45 51 55 45 4e 54 49 |, OR CON|SEQUENTI|
|00001c20| 41 4c 0a 58 20 2a 20 44 | 41 4d 41 47 45 53 20 28 |AL.X * D|AMAGES (|
|00001c30| 49 4e 43 4c 55 44 49 4e | 47 2c 20 42 55 54 20 4e |INCLUDIN|G, BUT N|
|00001c40| 4f 54 20 4c 49 4d 49 54 | 45 44 20 54 4f 2c 20 50 |OT LIMIT|ED TO, P|
|00001c50| 52 4f 43 55 52 45 4d 45 | 4e 54 20 4f 46 20 53 55 |ROCUREME|NT OF SU|
|00001c60| 42 53 54 49 54 55 54 45 | 20 47 4f 4f 44 53 0a 58 |BSTITUTE| GOODS.X|
|00001c70| 20 2a 20 4f 52 20 53 45 | 52 56 49 43 45 53 3b 20 | * OR SE|RVICES; |
|00001c80| 4c 4f 53 53 20 4f 46 20 | 55 53 45 2c 20 44 41 54 |LOSS OF |USE, DAT|
|00001c90| 41 2c 20 4f 52 20 50 52 | 4f 46 49 54 53 3b 20 4f |A, OR PR|OFITS; O|
|00001ca0| 52 20 42 55 53 49 4e 45 | 53 53 20 49 4e 54 45 52 |R BUSINE|SS INTER|
|00001cb0| 52 55 50 54 49 4f 4e 29 | 0a 58 20 2a 20 48 4f 57 |RUPTION)|.X * HOW|
|00001cc0| 45 56 45 52 20 43 41 55 | 53 45 44 20 41 4e 44 20 |EVER CAU|SED AND |
|00001cd0| 4f 4e 20 41 4e 59 20 54 | 48 45 4f 52 59 20 4f 46 |ON ANY T|HEORY OF|
|00001ce0| 20 4c 49 41 42 49 4c 49 | 54 59 2c 20 57 48 45 54 | LIABILI|TY, WHET|
|00001cf0| 48 45 52 20 49 4e 20 43 | 4f 4e 54 52 41 43 54 2c |HER IN C|ONTRACT,|
|00001d00| 20 53 54 52 49 43 54 0a | 58 20 2a 20 4c 49 41 42 | STRICT.|X * LIAB|
|00001d10| 49 4c 49 54 59 2c 20 4f | 52 20 54 4f 52 54 20 28 |ILITY, O|R TORT (|
|00001d20| 49 4e 43 4c 55 44 49 4e | 47 20 4e 45 47 4c 49 47 |INCLUDIN|G NEGLIG|
|00001d30| 45 4e 43 45 20 4f 52 20 | 4f 54 48 45 52 57 49 53 |ENCE OR |OTHERWIS|
|00001d40| 45 29 20 41 52 49 53 49 | 4e 47 20 49 4e 20 41 4e |E) ARISI|NG IN AN|
|00001d50| 59 20 57 41 59 0a 58 20 | 2a 20 4f 55 54 20 4f 46 |Y WAY.X |* OUT OF|
|00001d60| 20 54 48 45 20 55 53 45 | 20 4f 46 20 54 48 49 53 | THE USE| OF THIS|
|00001d70| 20 53 4f 46 54 57 41 52 | 45 2c 20 45 56 45 4e 20 | SOFTWAR|E, EVEN |
|00001d80| 49 46 20 41 44 56 49 53 | 45 44 20 4f 46 20 54 48 |IF ADVIS|ED OF TH|
|00001d90| 45 20 50 4f 53 53 49 42 | 49 4c 49 54 59 20 4f 46 |E POSSIB|ILITY OF|
|00001da0| 0a 58 20 2a 20 53 55 43 | 48 20 44 41 4d 41 47 45 |.X * SUC|H DAMAGE|
|00001db0| 2e 0a 58 20 2a 2f 0a 58 | 0a 58 23 69 66 20 64 65 |..X */.X|.X#if de|
|00001dc0| 66 69 6e 65 64 28 4c 49 | 42 43 5f 53 43 43 53 29 |fined(LI|BC_SCCS)|
|00001dd0| 20 26 26 20 21 64 65 66 | 69 6e 65 64 28 6c 69 6e | && !def|ined(lin|
|00001de0| 74 29 0a 58 73 74 61 74 | 69 63 20 63 68 61 72 20 |t).Xstat|ic char |
|00001df0| 73 63 63 73 69 64 5b 5d | 20 3d 20 22 40 28 23 29 |sccsid[]| = "@(#)|
|00001e00| 73 74 72 74 6f 6b 2e 63 | 09 35 2e 38 20 28 42 65 |strtok.c|.5.8 (Be|
|00001e10| 72 6b 65 6c 65 79 29 20 | 32 2f 32 34 2f 39 31 22 |rkeley) |2/24/91"|
|00001e20| 3b 0a 58 23 65 6e 64 69 | 66 20 2f 2a 20 4c 49 42 |;.X#endi|f /* LIB|
|00001e30| 43 5f 53 43 43 53 20 61 | 6e 64 20 6e 6f 74 20 6c |C_SCCS a|nd not l|
|00001e40| 69 6e 74 20 2a 2f 0a 58 | 0a 58 23 69 66 64 65 66 |int */.X|.X#ifdef|
|00001e50| 20 5f 5f 53 54 44 43 5f | 5f 09 2f 2a 20 41 64 64 | __STDC_|_./* Add|
|00001e60| 65 64 20 66 6f 72 20 62 | 61 63 6b 77 61 72 64 73 |ed for b|ackwards|
|00001e70| 20 63 6f 6d 70 61 74 69 | 62 69 6c 69 74 79 20 2d | compati|bility -|
|00001e80| 2d 20 57 5a 56 20 39 33 | 30 31 32 32 20 2a 2f 0a |- WZV 93|0122 */.|
|00001e90| 58 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 64 65 |X#includ|e <stdde|
|00001ea0| 66 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |f.h>.X#i|nclude <|
|00001eb0| 73 74 72 69 6e 67 2e 68 | 3e 0a 58 23 65 6c 73 65 |string.h|>.X#else|
|00001ec0| 0a 58 23 64 65 66 69 6e | 65 20 63 6f 6e 73 74 0a |.X#defin|e const.|
|00001ed0| 58 23 64 65 66 69 6e 65 | 20 4e 55 4c 4c 20 30 0a |X#define| NULL 0.|
|00001ee0| 58 23 65 6e 64 69 66 0a | 58 0a 58 63 68 61 72 20 |X#endif.|X.Xchar |
|00001ef0| 2a 0a 58 73 74 72 74 6f | 6b 28 73 2c 20 64 65 6c |*.Xstrto|k(s, del|
|00001f00| 69 6d 29 0a 58 09 72 65 | 67 69 73 74 65 72 20 63 |im).X.re|gister c|
|00001f10| 68 61 72 20 2a 73 3b 0a | 58 09 72 65 67 69 73 74 |har *s;.|X.regist|
|00001f20| 65 72 20 63 6f 6e 73 74 | 20 63 68 61 72 20 2a 64 |er const| char *d|
|00001f30| 65 6c 69 6d 3b 0a 58 7b | 0a 58 09 72 65 67 69 73 |elim;.X{|.X.regis|
|00001f40| 74 65 72 20 63 68 61 72 | 20 2a 73 70 61 6e 70 3b |ter char| *spanp;|
|00001f50| 0a 58 09 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 |.X.regis|ter int |
|00001f60| 63 2c 20 73 63 3b 0a 58 | 09 63 68 61 72 20 2a 74 |c, sc;.X|.char *t|
|00001f70| 6f 6b 3b 0a 58 09 73 74 | 61 74 69 63 20 63 68 61 |ok;.X.st|atic cha|
|00001f80| 72 20 2a 6c 61 73 74 3b | 0a 58 0a 58 0a 58 09 69 |r *last;|.X.X.X.i|
|00001f90| 66 20 28 73 20 3d 3d 20 | 4e 55 4c 4c 20 26 26 20 |f (s == |NULL && |
|00001fa0| 28 73 20 3d 20 6c 61 73 | 74 29 20 3d 3d 20 4e 55 |(s = las|t) == NU|
|00001fb0| 4c 4c 29 0a 58 09 09 72 | 65 74 75 72 6e 20 28 4e |LL).X..r|eturn (N|
|00001fc0| 55 4c 4c 29 3b 0a 58 0a | 58 09 2f 2a 0a 58 09 20 |ULL);.X.|X./*.X. |
|00001fd0| 2a 20 53 6b 69 70 20 28 | 73 70 61 6e 29 20 6c 65 |* Skip (|span) le|
|00001fe0| 61 64 69 6e 67 20 64 65 | 6c 69 6d 69 74 65 72 73 |ading de|limiters|
|00001ff0| 20 28 73 20 2b 3d 20 73 | 74 72 73 70 6e 28 73 2c | (s += s|trspn(s,|
|00002000| 20 64 65 6c 69 6d 29 2c | 20 73 6f 72 74 20 6f 66 | delim),| sort of|
|00002010| 29 2e 0a 58 09 20 2a 2f | 0a 58 63 6f 6e 74 3a 0a |)..X. */|.Xcont:.|
|00002020| 58 09 63 20 3d 20 2a 73 | 2b 2b 3b 0a 58 09 66 6f |X.c = *s|++;.X.fo|
|00002030| 72 20 28 73 70 61 6e 70 | 20 3d 20 28 63 68 61 72 |r (spanp| = (char|
|00002040| 20 2a 29 64 65 6c 69 6d | 3b 20 28 73 63 20 3d 20 | *)delim|; (sc = |
|00002050| 2a 73 70 61 6e 70 2b 2b | 29 20 21 3d 20 30 3b 29 |*spanp++|) != 0;)|
|00002060| 20 7b 0a 58 09 09 69 66 | 20 28 63 20 3d 3d 20 73 | {.X..if| (c == s|
|00002070| 63 29 0a 58 09 09 09 67 | 6f 74 6f 20 63 6f 6e 74 |c).X...g|oto cont|
|00002080| 3b 0a 58 09 7d 0a 58 0a | 58 09 69 66 20 28 63 20 |;.X.}.X.|X.if (c |
|00002090| 3d 3d 20 30 29 20 7b 09 | 09 2f 2a 20 6e 6f 20 6e |== 0) {.|./* no n|
|000020a0| 6f 6e 2d 64 65 6c 69 6d | 69 74 65 72 20 63 68 61 |on-delim|iter cha|
|000020b0| 72 61 63 74 65 72 73 20 | 2a 2f 0a 58 09 09 6c 61 |racters |*/.X..la|
|000020c0| 73 74 20 3d 20 4e 55 4c | 4c 3b 0a 58 09 09 72 65 |st = NUL|L;.X..re|
|000020d0| 74 75 72 6e 20 28 4e 55 | 4c 4c 29 3b 0a 58 09 7d |turn (NU|LL);.X.}|
|000020e0| 0a 58 09 74 6f 6b 20 3d | 20 73 20 2d 20 31 3b 0a |.X.tok =| s - 1;.|
|000020f0| 58 0a 58 09 2f 2a 0a 58 | 09 20 2a 20 53 63 61 6e |X.X./*.X|. * Scan|
|00002100| 20 74 6f 6b 65 6e 20 28 | 73 63 61 6e 20 66 6f 72 | token (|scan for|
|00002110| 20 64 65 6c 69 6d 69 74 | 65 72 73 3a 20 73 20 2b | delimit|ers: s +|
|00002120| 3d 20 73 74 72 63 73 70 | 6e 28 73 2c 20 64 65 6c |= strcsp|n(s, del|
|00002130| 69 6d 29 2c 20 73 6f 72 | 74 20 6f 66 29 2e 0a 58 |im), sor|t of)..X|
|00002140| 09 20 2a 20 4e 6f 74 65 | 20 74 68 61 74 20 64 65 |. * Note| that de|
|00002150| 6c 69 6d 20 6d 75 73 74 | 20 68 61 76 65 20 6f 6e |lim must| have on|
|00002160| 65 20 4e 55 4c 3b 20 77 | 65 20 73 74 6f 70 20 69 |e NUL; w|e stop i|
|00002170| 66 20 77 65 20 73 65 65 | 20 74 68 61 74 2c 20 74 |f we see| that, t|
|00002180| 6f 6f 2e 0a 58 09 20 2a | 2f 0a 58 09 66 6f 72 20 |oo..X. *|/.X.for |
|00002190| 28 3b 3b 29 20 7b 0a 58 | 09 09 63 20 3d 20 2a 73 |(;;) {.X|..c = *s|
|000021a0| 2b 2b 3b 0a 58 09 09 73 | 70 61 6e 70 20 3d 20 28 |++;.X..s|panp = (|
|000021b0| 63 68 61 72 20 2a 29 64 | 65 6c 69 6d 3b 0a 58 09 |char *)d|elim;.X.|
|000021c0| 09 64 6f 20 7b 0a 58 09 | 09 09 69 66 20 28 28 73 |.do {.X.|..if ((s|
|000021d0| 63 20 3d 20 2a 73 70 61 | 6e 70 2b 2b 29 20 3d 3d |c = *spa|np++) ==|
|000021e0| 20 63 29 20 7b 0a 58 09 | 09 09 09 69 66 20 28 63 | c) {.X.|...if (c|
|000021f0| 20 3d 3d 20 30 29 0a 58 | 09 09 09 09 09 73 20 3d | == 0).X|.....s =|
|00002200| 20 4e 55 4c 4c 3b 0a 58 | 09 09 09 09 65 6c 73 65 | NULL;.X|....else|
|00002210| 0a 58 09 09 09 09 09 73 | 5b 2d 31 5d 20 3d 20 30 |.X.....s|[-1] = 0|
|00002220| 3b 0a 58 09 09 09 09 6c | 61 73 74 20 3d 20 73 3b |;.X....l|ast = s;|
|00002230| 0a 58 09 09 09 09 72 65 | 74 75 72 6e 20 28 74 6f |.X....re|turn (to|
|00002240| 6b 29 3b 0a 58 09 09 09 | 7d 0a 58 09 09 7d 20 77 |k);.X...|}.X..} w|
|00002250| 68 69 6c 65 20 28 73 63 | 20 21 3d 20 30 29 3b 0a |hile (sc| != 0);.|
|00002260| 58 09 7d 0a 58 09 2f 2a | 20 4e 4f 54 52 45 41 43 |X.}.X./*| NOTREAC|
|00002270| 48 45 44 20 2a 2f 0a 58 | 7d 0a 45 4e 44 5f 4f 46 |HED */.X|}.END_OF|
|00002280| 5f 73 74 72 74 6f 6b 2e | 63 0a 69 66 20 74 65 73 |_strtok.|c.if tes|
|00002290| 74 20 32 39 37 36 20 2d | 6e 65 20 60 77 63 20 2d |t 2976 -|ne `wc -|
|000022a0| 63 20 3c 73 74 72 74 6f | 6b 2e 63 60 3b 20 74 68 |c <strto|k.c`; th|
|000022b0| 65 6e 0a 20 20 20 20 65 | 63 68 6f 20 73 68 61 72 |en. e|cho shar|
|000022c0| 3a 20 5c 22 73 74 72 74 | 6f 6b 2e 63 5c 22 20 75 |: \"strt|ok.c\" u|
|000022d0| 6e 70 61 63 6b 65 64 20 | 77 69 74 68 20 77 72 6f |npacked |with wro|
|000022e0| 6e 67 20 73 69 7a 65 21 | 0a 66 69 0a 23 20 65 6e |ng size!|.fi.# en|
|000022f0| 64 20 6f 66 20 6f 76 65 | 72 77 72 69 74 69 6e 67 |d of ove|rwriting|
|00002300| 20 63 68 65 63 6b 0a 66 | 69 0a 69 66 20 74 65 73 | check.f|i.if tes|
|00002310| 74 20 2d 66 20 74 63 70 | 64 2e 38 20 2d 61 20 22 |t -f tcp|d.8 -a "|
|00002320| 24 7b 31 7d 22 20 21 3d | 20 22 2d 63 22 20 3b 20 |${1}" !=| "-c" ; |
|00002330| 74 68 65 6e 20 0a 20 20 | 65 63 68 6f 20 73 68 61 |then . |echo sha|
|00002340| 72 3a 20 57 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: Will |not over|
|00002350| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00002360| 66 69 6c 65 20 5c 22 74 | 63 70 64 2e 38 5c 22 0a |file \"t|cpd.8\".|
|00002370| 65 6c 73 65 0a 65 63 68 | 6f 20 73 68 61 72 3a 20 |else.ech|o shar: |
|00002380| 45 78 74 72 61 63 74 69 | 6e 67 20 5c 22 74 63 70 |Extracti|ng \"tcp|
|00002390| 64 2e 38 5c 22 20 5c 28 | 36 39 32 33 20 63 68 61 |d.8\" \(|6923 cha|
|000023a0| 72 61 63 74 65 72 73 5c | 29 0a 73 65 64 20 22 73 |racters\|).sed "s|
|000023b0| 2f 5e 58 2f 2f 22 20 3e | 74 63 70 64 2e 38 20 3c |/^X//" >|tcpd.8 <|
|000023c0| 3c 27 45 4e 44 5f 4f 46 | 5f 74 63 70 64 2e 38 27 |<'END_OF|_tcpd.8'|
|000023d0| 0a 58 2e 54 48 20 54 43 | 50 44 20 38 0a 58 2e 53 |.X.TH TC|PD 8.X.S|
|000023e0| 48 20 4e 41 4d 45 0a 58 | 74 63 70 64 20 5c 2d 20 |H NAME.X|tcpd \- |
|000023f0| 61 63 63 65 73 73 20 63 | 6f 6e 74 72 6f 6c 20 66 |access c|ontrol f|
|00002400| 61 63 69 6c 69 74 79 20 | 66 6f 72 20 69 6e 74 65 |acility |for inte|
|00002410| 72 6e 65 74 20 73 65 72 | 76 69 63 65 73 0a 58 2e |rnet ser|vices.X.|
|00002420| 53 48 20 44 45 53 43 52 | 49 50 54 49 4f 4e 0a 58 |SH DESCR|IPTION.X|
|00002430| 2e 50 50 0a 58 54 68 65 | 20 5c 66 49 74 63 70 64 |.PP.XThe| \fItcpd|
|00002440| 5c 66 52 20 70 72 6f 67 | 72 61 6d 20 63 61 6e 20 |\fR prog|ram can |
|00002450| 62 65 20 73 65 74 20 75 | 70 20 74 6f 20 6d 6f 6e |be set u|p to mon|
|00002460| 69 74 6f 72 20 69 6e 63 | 6f 6d 69 6e 67 20 72 65 |itor inc|oming re|
|00002470| 71 75 65 73 74 73 20 66 | 6f 72 0a 58 5c 66 49 74 |quests f|or.X\fIt|
|00002480| 65 6c 6e 65 74 5c 66 52 | 2c 20 5c 66 49 66 69 6e |elnet\fR|, \fIfin|
|00002490| 67 65 72 5c 66 52 2c 20 | 5c 66 49 66 74 70 5c 66 |ger\fR, |\fIftp\f|
|000024a0| 52 2c 20 5c 66 49 65 78 | 65 63 5c 66 52 2c 20 5c |R, \fIex|ec\fR, \|
|000024b0| 66 49 72 73 68 5c 66 52 | 2c 0a 58 5c 66 49 72 6c |fIrsh\fR|,.X\fIrl|
|000024c0| 6f 67 69 6e 5c 66 52 2c | 20 5c 66 49 74 66 74 70 |ogin\fR,| \fItftp|
|000024d0| 5c 66 52 2c 20 5c 66 49 | 74 61 6c 6b 5c 66 52 2c |\fR, \fI|talk\fR,|
|000024e0| 20 5c 66 49 63 6f 6d 73 | 61 74 5c 66 52 20 61 6e | \fIcoms|at\fR an|
|000024f0| 64 20 6f 74 68 65 72 20 | 73 65 72 76 69 63 65 73 |d other |services|
|00002500| 0a 58 74 68 61 74 20 68 | 61 76 65 20 61 20 6f 6e |.Xthat h|ave a on|
|00002510| 65 2d 74 6f 2d 6f 6e 65 | 20 6d 61 70 70 69 6e 67 |e-to-one| mapping|
|00002520| 20 6f 6e 74 6f 20 65 78 | 65 63 75 74 61 62 6c 65 | onto ex|ecutable|
|00002530| 20 66 69 6c 65 73 2e 0a | 58 2e 50 50 0a 58 54 68 | files..|X.PP.XTh|
|00002540| 65 20 70 72 6f 67 72 61 | 6d 20 73 75 70 70 6f 72 |e progra|m suppor|
|00002550| 74 73 20 62 6f 74 68 20 | 34 2e 33 42 53 44 2d 73 |ts both |4.3BSD-s|
|00002560| 74 79 6c 65 20 73 6f 63 | 6b 65 74 73 20 61 6e 64 |tyle soc|kets and|
|00002570| 20 53 79 73 74 65 6d 20 | 56 2e 34 2d 73 74 79 6c | System |V.4-styl|
|00002580| 65 0a 58 54 4c 49 2e 20 | 20 46 75 6e 63 74 69 6f |e.XTLI. | Functio|
|00002590| 6e 61 6c 69 74 79 20 6d | 61 79 20 62 65 20 6c 69 |nality m|ay be li|
|000025a0| 6d 69 74 65 64 20 77 68 | 65 6e 20 74 68 65 20 70 |mited wh|en the p|
|000025b0| 72 6f 74 6f 63 6f 6c 20 | 75 6e 64 65 72 6e 65 61 |rotocol |undernea|
|000025c0| 74 68 20 54 4c 49 20 69 | 73 0a 58 6e 6f 74 20 61 |th TLI i|s.Xnot a|
|000025d0| 6e 20 69 6e 74 65 72 6e | 65 74 20 70 72 6f 74 6f |n intern|et proto|
|000025e0| 63 6f 6c 2e 0a 58 2e 50 | 50 0a 58 4f 70 65 72 61 |col..X.P|P.XOpera|
|000025f0| 74 69 6f 6e 20 69 73 20 | 61 73 20 66 6f 6c 6c 6f |tion is |as follo|
|00002600| 77 73 3a 20 77 68 65 6e | 65 76 65 72 20 61 20 72 |ws: when|ever a r|
|00002610| 65 71 75 65 73 74 20 66 | 6f 72 20 69 6e 74 65 72 |equest f|or inter|
|00002620| 6e 65 74 20 73 65 72 76 | 69 63 65 0a 58 61 72 72 |net serv|ice.Xarr|
|00002630| 69 76 65 73 2c 20 74 68 | 65 20 5c 66 49 69 6e 65 |ives, th|e \fIine|
|00002640| 74 64 5c 66 50 20 64 61 | 65 6d 6f 6e 20 69 73 20 |td\fP da|emon is |
|00002650| 74 72 69 63 6b 65 64 20 | 69 6e 74 6f 20 72 75 6e |tricked |into run|
|00002660| 6e 69 6e 67 20 74 68 65 | 20 5c 66 49 74 63 70 64 |ning the| \fItcpd|
|00002670| 5c 66 50 0a 58 70 72 6f | 67 72 61 6d 20 69 6e 73 |\fP.Xpro|gram ins|
|00002680| 74 65 61 64 20 6f 66 20 | 74 68 65 20 64 65 73 69 |tead of |the desi|
|00002690| 72 65 64 20 73 65 72 76 | 65 72 2e 20 5c 66 49 74 |red serv|er. \fIt|
|000026a0| 63 70 64 5c 66 50 20 6c | 6f 67 73 20 74 68 65 20 |cpd\fP l|ogs the |
|000026b0| 72 65 71 75 65 73 74 20 | 61 6e 64 0a 58 64 6f 65 |request |and.Xdoe|
|000026c0| 73 20 73 6f 6d 65 20 61 | 64 64 69 74 69 6f 6e 61 |s some a|dditiona|
|000026d0| 6c 20 63 68 65 63 6b 73 | 2e 20 57 68 65 6e 20 61 |l checks|. When a|
|000026e0| 6c 6c 20 69 73 20 77 65 | 6c 6c 2c 20 5c 66 49 74 |ll is we|ll, \fIt|
|000026f0| 63 70 64 5c 66 50 20 72 | 75 6e 73 20 74 68 65 0a |cpd\fP r|uns the.|
|00002700| 58 61 70 70 72 6f 70 72 | 69 61 74 65 20 73 65 72 |Xappropr|iate ser|
|00002710| 76 65 72 20 70 72 6f 67 | 72 61 6d 20 61 6e 64 20 |ver prog|ram and |
|00002720| 67 6f 65 73 20 61 77 61 | 79 2e 0a 58 2e 50 50 0a |goes awa|y..X.PP.|
|00002730| 58 4f 70 74 69 6f 6e 61 | 6c 20 66 65 61 74 75 72 |XOptiona|l featur|
|00002740| 65 73 20 61 72 65 3a 20 | 70 61 74 74 65 72 6e 2d |es are: |pattern-|
|00002750| 62 61 73 65 64 20 61 63 | 63 65 73 73 20 63 6f 6e |based ac|cess con|
|00002760| 74 72 6f 6c 2c 20 70 61 | 74 74 65 72 6e 73 2c 20 |trol, pa|tterns, |
|00002770| 72 65 6d 6f 74 65 0a 58 | 75 73 65 72 6e 61 6d 65 |remote.X|username|
|00002780| 20 6c 6f 6f 6b 75 70 73 | 20 77 69 74 68 20 74 68 | lookups| with th|
|00002790| 65 20 52 46 43 20 39 33 | 31 20 70 72 6f 74 6f 63 |e RFC 93|1 protoc|
|000027a0| 6f 6c 2c 20 70 72 6f 74 | 65 63 74 69 6f 6e 20 61 |ol, prot|ection a|
|000027b0| 67 61 69 6e 73 74 20 68 | 6f 73 74 73 0a 58 74 68 |gainst h|osts.Xth|
|000027c0| 61 74 20 70 72 65 74 65 | 6e 64 20 74 6f 20 68 61 |at prete|nd to ha|
|000027d0| 76 65 20 73 6f 6d 65 6f | 6e 65 20 65 6c 73 65 73 |ve someo|ne elses|
|000027e0| 20 68 6f 73 74 20 6e 61 | 6d 65 2c 20 61 6e 64 20 | host na|me, and |
|000027f0| 70 72 6f 74 65 63 74 69 | 6f 6e 20 61 67 61 69 6e |protecti|on again|
|00002800| 73 74 0a 58 68 6f 73 74 | 73 20 74 68 61 74 20 70 |st.Xhost|s that p|
|00002810| 72 65 74 65 6e 64 20 74 | 6f 20 68 61 76 65 20 73 |retend t|o have s|
|00002820| 6f 6d 65 6f 6e 65 20 65 | 6c 73 65 73 20 6e 65 74 |omeone e|lses net|
|00002830| 77 6f 72 6b 20 61 64 64 | 72 65 73 73 2e 0a 58 2e |work add|ress..X.|
|00002840| 53 48 20 4c 4f 47 47 49 | 4e 47 0a 58 43 6f 6e 6e |SH LOGGI|NG.XConn|
|00002850| 65 63 74 69 6f 6e 73 20 | 74 68 61 74 20 61 72 65 |ections |that are|
|00002860| 20 6d 6f 6e 69 74 6f 72 | 65 64 20 62 79 0a 58 2e | monitor|ed by.X.|
|00002870| 49 20 74 63 70 64 0a 58 | 61 72 65 20 72 65 70 6f |I tcpd.X|are repo|
|00002880| 72 74 65 64 20 74 68 72 | 6f 75 67 68 20 74 68 65 |rted thr|ough the|
|00002890| 20 5c 66 49 73 79 73 6c | 6f 67 5c 66 52 28 33 29 | \fIsysl|og\fR(3)|
|000028a0| 20 66 61 63 69 6c 69 74 | 79 2e 20 45 61 63 68 20 | facilit|y. Each |
|000028b0| 72 65 63 6f 72 64 20 63 | 6f 6e 74 61 69 6e 73 0a |record c|ontains.|
|000028c0| 58 61 20 74 69 6d 65 20 | 73 74 61 6d 70 2c 20 74 |Xa time |stamp, t|
|000028d0| 68 65 20 72 65 6d 6f 74 | 65 20 68 6f 73 74 20 6e |he remot|e host n|
|000028e0| 61 6d 65 20 61 6e 64 20 | 74 68 65 20 6e 61 6d 65 |ame and |the name|
|000028f0| 20 6f 66 20 74 68 65 20 | 73 65 72 76 69 63 65 0a | of the |service.|
|00002900| 58 72 65 71 75 65 73 74 | 65 64 2e 20 54 68 65 20 |Xrequest|ed. The |
|00002910| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 63 61 6e 20 |informat|ion can |
|00002920| 62 65 20 75 73 65 66 75 | 6c 20 74 6f 20 64 65 74 |be usefu|l to det|
|00002930| 65 63 74 20 75 6e 77 61 | 6e 74 65 64 20 61 63 74 |ect unwa|nted act|
|00002940| 69 76 69 74 69 65 73 2c | 0a 58 65 73 70 65 63 69 |ivities,|.Xespeci|
|00002950| 61 6c 6c 79 20 77 68 65 | 6e 20 6c 6f 67 66 69 6c |ally whe|n logfil|
|00002960| 65 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 66 72 |e inform|ation fr|
|00002970| 6f 6d 20 73 65 76 65 72 | 61 6c 20 68 6f 73 74 73 |om sever|al hosts|
|00002980| 20 69 73 20 6d 65 72 67 | 65 64 2e 0a 58 2e 50 50 | is merg|ed..X.PP|
|00002990| 0a 58 49 6e 20 6f 72 64 | 65 72 20 74 6f 20 66 69 |.XIn ord|er to fi|
|000029a0| 6e 64 20 6f 75 74 20 77 | 68 65 72 65 20 79 6f 75 |nd out w|here you|
|000029b0| 72 20 6c 6f 67 73 20 61 | 72 65 20 67 6f 69 6e 67 |r logs a|re going|
|000029c0| 2c 20 65 78 61 6d 69 6e | 65 20 74 68 65 20 73 79 |, examin|e the sy|
|000029d0| 73 6c 6f 67 0a 58 63 6f | 6e 66 69 67 75 72 61 74 |slog.Xco|nfigurat|
|000029e0| 69 6f 6e 20 66 69 6c 65 | 2c 20 75 73 75 61 6c 6c |ion file|, usuall|
|000029f0| 79 20 2f 65 74 63 2f 73 | 79 73 6c 6f 67 2e 63 6f |y /etc/s|yslog.co|
|00002a00| 6e 66 2e 0a 58 2e 53 48 | 20 41 43 43 45 53 53 20 |nf..X.SH| ACCESS |
|00002a10| 43 4f 4e 54 52 4f 4c 0a | 58 4f 70 74 69 6f 6e 61 |CONTROL.|XOptiona|
|00002a20| 6c 6c 79 2c 0a 58 2e 49 | 20 74 63 70 64 0a 58 73 |lly,.X.I| tcpd.Xs|
|00002a30| 75 70 70 6f 72 74 73 20 | 61 20 73 69 6d 70 6c 65 |upports |a simple|
|00002a40| 20 66 6f 72 6d 20 6f 66 | 20 61 63 63 65 73 73 20 | form of| access |
|00002a50| 63 6f 6e 74 72 6f 6c 20 | 74 68 61 74 20 69 73 20 |control |that is |
|00002a60| 62 61 73 65 64 20 6f 6e | 20 70 61 74 74 65 72 6e |based on| pattern|
|00002a70| 0a 58 6d 61 74 63 68 69 | 6e 67 2e 20 20 54 68 65 |.Xmatchi|ng. The|
|00002a80| 20 61 63 63 65 73 73 2d | 63 6f 6e 74 72 6f 6c 20 | access-|control |
|00002a90| 73 6f 66 74 77 61 72 65 | 20 70 72 6f 76 69 64 65 |software| provide|
|00002aa0| 73 20 68 6f 6f 6b 73 20 | 66 6f 72 20 74 68 65 20 |s hooks |for the |
|00002ab0| 65 78 65 63 75 74 69 6f | 6e 0a 58 6f 66 20 73 68 |executio|n.Xof sh|
|00002ac0| 65 6c 6c 20 63 6f 6d 6d | 61 6e 64 73 20 77 68 65 |ell comm|ands whe|
|00002ad0| 6e 20 61 20 70 61 74 74 | 65 72 6e 20 66 69 72 65 |n a patt|ern fire|
|00002ae0| 73 2e 20 20 46 6f 72 20 | 64 65 74 61 69 6c 73 2c |s. For |details,|
|00002af0| 20 73 65 65 20 74 68 65 | 0a 58 5c 66 49 68 6f 73 | see the|.X\fIhos|
|00002b00| 74 73 5f 61 63 63 65 73 | 73 5c 66 52 28 35 29 20 |ts_acces|s\fR(5) |
|00002b10| 6d 61 6e 75 61 6c 20 70 | 61 67 65 2e 0a 58 2e 53 |manual p|age..X.S|
|00002b20| 48 20 48 4f 53 54 20 4e | 41 4d 45 20 56 45 52 49 |H HOST N|AME VERI|
|00002b30| 46 49 43 41 54 49 4f 4e | 0a 58 54 68 65 20 61 75 |FICATION|.XThe au|
|00002b40| 74 68 65 6e 74 69 63 61 | 74 69 6f 6e 20 73 63 68 |thentica|tion sch|
|00002b50| 65 6d 65 20 6f 66 20 73 | 6f 6d 65 20 70 72 6f 74 |eme of s|ome prot|
|00002b60| 6f 63 6f 6c 73 20 28 5c | 66 49 72 6c 6f 67 69 6e |ocols (\|fIrlogin|
|00002b70| 2c 20 72 73 68 5c 66 52 | 29 20 72 65 6c 69 65 73 |, rsh\fR|) relies|
|00002b80| 0a 58 6f 6e 20 68 6f 73 | 74 20 6e 61 6d 65 73 2e |.Xon hos|t names.|
|00002b90| 20 53 6f 6d 65 20 69 6d | 70 6c 65 6d 65 6e 74 61 | Some im|plementa|
|00002ba0| 74 69 6f 6e 73 20 62 65 | 6c 69 65 76 65 20 74 68 |tions be|lieve th|
|00002bb0| 65 20 68 6f 73 74 20 6e | 61 6d 65 20 74 68 61 74 |e host n|ame that|
|00002bc0| 20 74 68 65 79 20 67 65 | 74 0a 58 66 72 6f 6d 20 | they ge|t.Xfrom |
|00002bd0| 61 6e 79 20 72 61 6e 64 | 6f 6d 20 6e 61 6d 65 20 |any rand|om name |
|00002be0| 73 65 72 76 65 72 3b 20 | 6f 74 68 65 72 20 69 6d |server; |other im|
|00002bf0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 73 20 61 72 |plementa|tions ar|
|00002c00| 65 20 6d 6f 72 65 20 63 | 61 72 65 66 75 6c 20 62 |e more c|areful b|
|00002c10| 75 74 0a 58 75 73 65 20 | 61 20 66 6c 61 77 65 64 |ut.Xuse |a flawed|
|00002c20| 20 61 6c 67 6f 72 69 74 | 68 6d 2e 0a 58 2e 50 50 | algorit|hm..X.PP|
|00002c30| 0a 58 2e 49 20 74 63 70 | 64 0a 58 76 65 72 69 66 |.X.I tcp|d.Xverif|
|00002c40| 69 65 73 20 74 68 65 20 | 72 65 6d 6f 74 65 20 68 |ies the |remote h|
|00002c50| 6f 73 74 20 6e 61 6d 65 | 20 74 68 61 74 20 69 73 |ost name| that is|
|00002c60| 20 72 65 74 75 72 6e 65 | 64 20 62 79 20 74 68 65 | returne|d by the|
|00002c70| 20 61 64 64 72 65 73 73 | 2d 3e 6e 61 6d 65 20 44 | address|->name D|
|00002c80| 4e 53 0a 58 73 65 72 76 | 65 72 20 62 79 20 6c 6f |NS.Xserv|er by lo|
|00002c90| 6f 6b 69 6e 67 20 61 74 | 20 74 68 65 20 68 6f 73 |oking at| the hos|
|00002ca0| 74 20 6e 61 6d 65 20 61 | 6e 64 20 61 64 64 72 65 |t name a|nd addre|
|00002cb0| 73 73 20 74 68 61 74 20 | 61 72 65 20 72 65 74 75 |ss that |are retu|
|00002cc0| 72 6e 65 64 20 62 79 20 | 74 68 65 0a 58 6e 61 6d |rned by |the.Xnam|
|00002cd0| 65 2d 3e 61 64 64 72 65 | 73 73 20 44 4e 53 20 73 |e->addre|ss DNS s|
|00002ce0| 65 72 76 65 72 2e 20 20 | 49 66 20 61 6e 79 20 64 |erver. |If any d|
|00002cf0| 69 73 63 72 65 70 61 6e | 63 79 20 69 73 20 64 65 |iscrepan|cy is de|
|00002d00| 74 65 63 74 65 64 2c 0a | 58 2e 49 20 74 63 70 64 |tected,.|X.I tcpd|
|00002d10| 0a 58 63 6f 6e 63 6c 75 | 64 65 73 20 74 68 61 74 |.Xconclu|des that|
|00002d20| 20 69 74 20 69 73 20 64 | 65 61 6c 69 6e 67 20 77 | it is d|ealing w|
|00002d30| 69 74 68 20 61 20 68 6f | 73 74 20 74 68 61 74 20 |ith a ho|st that |
|00002d40| 70 72 65 74 65 6e 64 73 | 20 74 6f 20 68 61 76 65 |pretends| to have|
|00002d50| 20 73 6f 6d 65 6f 6e 65 | 0a 58 65 6c 73 65 73 20 | someone|.Xelses |
|00002d60| 68 6f 73 74 20 6e 61 6d | 65 2e 0a 58 2e 50 50 0a |host nam|e..X.PP.|
|00002d70| 58 49 66 20 74 68 65 20 | 73 6f 75 72 63 65 73 20 |XIf the |sources |
|00002d80| 61 72 65 20 63 6f 6d 70 | 69 6c 65 64 20 77 69 74 |are comp|iled wit|
|00002d90| 68 20 74 68 65 20 5c 2a | 51 50 41 52 41 4e 4f 49 |h the \*|QPARANOI|
|00002da0| 44 5c 2a 55 20 6f 70 74 | 69 6f 6e 2c 0a 58 2e 49 |D\*U opt|ion,.X.I|
|00002db0| 20 74 63 70 64 0a 58 77 | 69 6c 6c 20 64 72 6f 70 | tcpd.Xw|ill drop|
|00002dc0| 20 74 68 65 20 63 6f 6e | 6e 65 63 74 69 6f 6e 20 | the con|nection |
|00002dd0| 69 6e 20 63 61 73 65 20 | 6f 66 20 61 20 68 6f 73 |in case |of a hos|
|00002de0| 74 20 6e 61 6d 65 2f 61 | 64 64 72 65 73 73 20 6d |t name/a|ddress m|
|00002df0| 69 73 6d 61 74 63 68 2e | 0a 58 4f 74 68 65 72 77 |ismatch.|.XOtherw|
|00002e00| 69 73 65 2c 0a 58 2e 49 | 20 74 63 70 64 0a 58 6a |ise,.X.I| tcpd.Xj|
|00002e10| 75 73 74 20 70 72 65 74 | 65 6e 64 73 20 74 68 61 |ust pret|ends tha|
|00002e20| 74 20 68 6f 73 74 20 6e | 61 6d 65 20 6c 6f 6f 6b |t host n|ame look|
|00002e30| 75 70 20 66 61 69 6c 65 | 64 20 77 68 65 6e 20 6c |up faile|d when l|
|00002e40| 6f 67 67 69 6e 67 20 74 | 68 65 20 63 6f 6e 6e 65 |ogging t|he conne|
|00002e50| 63 74 69 6f 6e 0a 58 61 | 6e 64 20 63 6f 6e 73 75 |ction.Xa|nd consu|
|00002e60| 6c 74 69 6e 67 20 74 68 | 65 20 6f 70 74 69 6f 6e |lting th|e option|
|00002e70| 61 6c 20 61 63 63 65 73 | 73 20 63 6f 6e 74 72 6f |al acces|s contro|
|00002e80| 6c 20 74 61 62 6c 65 73 | 2e 0a 58 2e 53 48 20 48 |l tables|..X.SH H|
|00002e90| 4f 53 54 20 41 44 44 52 | 45 53 53 20 53 50 4f 4f |OST ADDR|ESS SPOO|
|00002ea0| 46 49 4e 47 0a 58 42 79 | 20 64 65 66 61 75 6c 74 |FING.XBy| default|
|00002eb0| 2c 0a 58 2e 49 20 74 63 | 70 64 0a 58 64 69 73 61 |,.X.I tc|pd.Xdisa|
|00002ec0| 62 6c 65 73 20 73 6f 75 | 72 63 65 2d 72 6f 75 74 |bles sou|rce-rout|
|00002ed0| 69 6e 67 20 73 6f 63 6b | 65 74 20 6f 70 74 69 6f |ing sock|et optio|
|00002ee0| 6e 73 20 6f 6e 20 65 76 | 65 72 79 20 63 6f 6e 6e |ns on ev|ery conn|
|00002ef0| 65 63 74 69 6f 6e 20 74 | 68 61 74 20 69 74 0a 58 |ection t|hat it.X|
|00002f00| 64 65 61 6c 73 20 77 69 | 74 68 2e 20 54 68 69 73 |deals wi|th. This|
|00002f10| 20 77 69 6c 6c 20 74 61 | 6b 65 20 63 61 72 65 20 | will ta|ke care |
|00002f20| 6f 66 20 6d 6f 73 74 20 | 61 74 74 61 63 6b 73 20 |of most |attacks |
|00002f30| 66 72 6f 6d 20 68 6f 73 | 74 73 20 74 68 61 74 20 |from hos|ts that |
|00002f40| 70 72 65 74 65 6e 64 0a | 58 74 6f 20 68 61 76 65 |pretend.|Xto have|
|00002f50| 20 61 6e 20 61 64 64 72 | 65 73 73 20 74 68 61 74 | an addr|ess that|
|00002f60| 20 62 65 6c 6f 6e 67 73 | 20 74 6f 20 73 6f 6d 65 | belongs| to some|
|00002f70| 6f 6e 65 20 65 6c 73 65 | 73 20 6e 65 74 77 6f 72 |one else|s networ|
|00002f80| 6b 2e 20 55 44 50 20 73 | 65 72 76 69 63 65 73 0a |k. UDP s|ervices.|
|00002f90| 58 64 6f 20 6e 6f 74 20 | 62 65 6e 65 66 69 74 20 |Xdo not |benefit |
|00002fa0| 66 72 6f 6d 20 74 68 69 | 73 20 70 72 6f 74 65 63 |from thi|s protec|
|00002fb0| 74 69 6f 6e 2e 0a 58 2e | 53 48 20 52 46 43 20 39 |tion..X.|SH RFC 9|
|00002fc0| 33 31 0a 58 57 68 65 6e | 20 52 46 43 20 39 33 31 |31.XWhen| RFC 931|
|00002fd0| 20 6c 6f 6f 6b 75 70 73 | 20 61 72 65 20 65 6e 61 | lookups| are ena|
|00002fe0| 62 6c 65 64 20 28 63 6f | 6d 70 69 6c 65 2d 74 69 |bled (co|mpile-ti|
|00002ff0| 6d 65 20 6f 70 74 69 6f | 6e 29 20 5c 66 49 74 63 |me optio|n) \fItc|
|00003000| 70 64 5c 66 52 20 77 69 | 6c 6c 0a 58 61 74 74 65 |pd\fR wi|ll.Xatte|
|00003010| 6d 70 74 20 74 6f 20 65 | 73 74 61 62 6c 69 73 68 |mpt to e|stablish|
|00003020| 20 74 68 65 20 6e 61 6d | 65 20 6f 66 20 74 68 65 | the nam|e of the|
|00003030| 20 72 65 6d 6f 74 65 20 | 75 73 65 72 2e 20 54 68 | remote |user. Th|
|00003040| 69 73 20 77 69 6c 6c 20 | 73 75 63 63 65 65 64 0a |is will |succeed.|
|00003050| 58 6f 6e 6c 79 20 69 66 | 20 74 68 65 20 63 6c 69 |Xonly if| the cli|
|00003060| 65 6e 74 20 68 6f 73 74 | 20 72 75 6e 73 20 61 6e |ent host| runs an|
|00003070| 20 52 46 43 20 39 33 31 | 2d 63 6f 6d 70 6c 69 61 | RFC 931|-complia|
|00003080| 6e 74 20 64 61 65 6d 6f | 6e 2e 20 20 52 65 6d 6f |nt daemo|n. Remo|
|00003090| 74 65 20 75 73 65 72 0a | 58 6e 61 6d 65 20 6c 6f |te user.|Xname lo|
|000030a0| 6f 6b 75 70 73 20 77 69 | 6c 6c 20 6e 6f 74 20 77 |okups wi|ll not w|
|000030b0| 6f 72 6b 20 66 6f 72 20 | 64 61 74 61 67 72 61 6d |ork for |datagram|
|000030c0| 2d 6f 72 69 65 6e 74 65 | 64 20 63 6f 6e 6e 65 63 |-oriente|d connec|
|000030d0| 74 69 6f 6e 73 2c 20 61 | 6e 64 20 6d 61 79 0a 58 |tions, a|nd may.X|
|000030e0| 63 61 75 73 65 20 6e 6f | 74 69 63 65 61 62 6c 65 |cause no|ticeable|
|000030f0| 20 64 65 6c 61 79 73 20 | 69 6e 20 74 68 65 20 63 | delays |in the c|
|00003100| 61 73 65 20 6f 66 20 63 | 6f 6e 6e 65 63 74 69 6f |ase of c|onnectio|
|00003110| 6e 73 20 66 72 6f 6d 20 | 50 43 73 2e 0a 58 2e 53 |ns from |PCs..X.S|
|00003120| 48 20 45 58 41 4d 50 4c | 45 53 0a 58 54 68 65 20 |H EXAMPL|ES.XThe |
|00003130| 64 65 74 61 69 6c 73 20 | 6f 66 20 75 73 69 6e 67 |details |of using|
|00003140| 20 5c 66 49 74 63 70 64 | 5c 66 52 20 64 65 70 65 | \fItcpd|\fR depe|
|00003150| 6e 64 20 6f 6e 20 70 61 | 74 68 6e 61 6d 65 20 69 |nd on pa|thname i|
|00003160| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 74 68 61 74 20 |nformati|on that |
|00003170| 77 61 73 0a 58 63 6f 6d | 70 69 6c 65 64 20 69 6e |was.Xcom|piled in|
|00003180| 74 6f 20 74 68 65 20 70 | 72 6f 67 72 61 6d 2e 0a |to the p|rogram..|
|00003190| 58 2e 53 48 20 45 58 41 | 4d 50 4c 45 20 31 0a 58 |X.SH EXA|MPLE 1.X|
|000031a0| 54 68 69 73 20 65 78 61 | 6d 70 6c 65 20 61 70 70 |This exa|mple app|
|000031b0| 6c 69 65 73 20 77 68 65 | 6e 20 5c 66 49 74 63 70 |lies whe|n \fItcp|
|000031c0| 64 5c 66 52 20 65 78 70 | 65 63 74 73 20 74 68 61 |d\fR exp|ects tha|
|000031d0| 74 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 6e |t the or|iginal n|
|000031e0| 65 74 77 6f 72 6b 0a 58 | 64 61 65 6d 6f 6e 73 20 |etwork.X|daemons |
|000031f0| 77 69 6c 6c 20 62 65 20 | 6d 6f 76 65 64 20 74 6f |will be |moved to|
|00003200| 20 61 6e 20 22 6f 74 68 | 65 72 22 20 70 6c 61 63 | an "oth|er" plac|
|00003210| 65 2e 0a 58 2e 50 50 0a | 58 49 6e 20 6f 72 64 65 |e..X.PP.|XIn orde|
|00003220| 72 20 74 6f 20 6d 6f 6e | 69 74 6f 72 20 61 63 63 |r to mon|itor acc|
|00003230| 65 73 73 20 74 6f 20 74 | 68 65 20 5c 66 49 66 69 |ess to t|he \fIfi|
|00003240| 6e 67 65 72 5c 66 52 20 | 73 65 72 76 69 63 65 2c |nger\fR |service,|
|00003250| 20 6d 6f 76 65 20 74 68 | 65 0a 58 6f 72 69 67 69 | move th|e.Xorigi|
|00003260| 6e 61 6c 20 66 69 6e 67 | 65 72 20 64 61 65 6d 6f |nal fing|er daemo|
|00003270| 6e 20 74 6f 20 74 68 65 | 20 22 6f 74 68 65 72 22 |n to the| "other"|
|00003280| 20 70 6c 61 63 65 20 61 | 6e 64 20 69 6e 73 74 61 | place a|nd insta|
|00003290| 6c 6c 20 74 63 70 64 20 | 69 6e 20 74 68 65 0a 58 |ll tcpd |in the.X|
|000032a0| 70 6c 61 63 65 20 6f 66 | 20 74 68 65 20 6f 72 69 |place of| the ori|
|000032b0| 67 69 6e 61 6c 20 66 69 | 6e 67 65 72 20 64 61 65 |ginal fi|nger dae|
|000032c0| 6d 6f 6e 2e 20 4e 6f 20 | 63 68 61 6e 67 65 73 20 |mon. No |changes |
|000032d0| 61 72 65 20 72 65 71 75 | 69 72 65 64 20 74 6f 0a |are requ|ired to.|
|000032e0| 58 63 6f 6e 66 69 67 75 | 72 61 74 69 6f 6e 20 66 |Xconfigu|ration f|
|000032f0| 69 6c 65 73 2e 0a 58 2e | 6e 66 0a 58 2e 73 70 0a |iles..X.|nf.X.sp.|
|00003300| 58 2e 69 6e 20 2b 35 0a | 58 23 20 6d 6b 64 69 72 |X.in +5.|X# mkdir|
|00003310| 20 2f 6f 74 68 65 72 2f | 70 6c 61 63 65 0a 58 23 | /other/|place.X#|
|00003320| 20 6d 76 20 2f 75 73 72 | 2f 65 74 63 2f 69 6e 2e | mv /usr|/etc/in.|
|00003330| 66 69 6e 67 65 72 64 20 | 2f 6f 74 68 65 72 2f 70 |fingerd |/other/p|
|00003340| 6c 61 63 65 0a 58 23 20 | 63 70 20 74 63 70 64 20 |lace.X# |cp tcpd |
|00003350| 2f 75 73 72 2f 65 74 63 | 2f 69 6e 2e 66 69 6e 67 |/usr/etc|/in.fing|
|00003360| 65 72 64 0a 58 2e 66 69 | 0a 58 2e 50 50 0a 58 54 |erd.X.fi|.X.PP.XT|
|00003370| 68 65 20 65 78 61 6d 70 | 6c 65 20 61 73 73 75 6d |he examp|le assum|
|00003380| 65 73 20 74 68 61 74 20 | 74 68 65 20 6e 65 74 77 |es that |the netw|
|00003390| 6f 72 6b 20 64 61 65 6d | 6f 6e 73 20 6c 69 76 65 |ork daem|ons live|
|000033a0| 20 69 6e 20 2f 75 73 72 | 2f 65 74 63 2e 20 4f 6e | in /usr|/etc. On|
|000033b0| 20 73 6f 6d 65 0a 58 73 | 79 73 74 65 6d 73 2c 20 | some.Xs|ystems, |
|000033c0| 6e 65 74 77 6f 72 6b 20 | 64 61 65 6d 6f 6e 73 20 |network |daemons |
|000033d0| 6c 69 76 65 20 69 6e 20 | 2f 75 73 72 2f 73 62 69 |live in |/usr/sbi|
|000033e0| 6e 20 6f 72 20 69 6e 20 | 2f 75 73 72 2f 6c 69 62 |n or in |/usr/lib|
|000033f0| 65 78 65 63 2c 20 6f 72 | 20 68 61 76 65 0a 58 6e |exec, or| have.Xn|
|00003400| 6f 20 60 69 6e 2e 5c 27 | 20 70 72 65 66 69 78 20 |o `in.\'| prefix |
|00003410| 74 6f 20 74 68 65 69 72 | 20 6e 61 6d 65 2e 0a 58 |to their| name..X|
|00003420| 2e 53 48 20 45 58 41 4d | 50 4c 45 20 32 0a 58 54 |.SH EXAM|PLE 2.XT|
|00003430| 68 69 73 20 65 78 61 6d | 70 6c 65 20 61 70 70 6c |his exam|ple appl|
|00003440| 69 65 73 20 77 68 65 6e | 20 5c 66 49 74 63 70 64 |ies when| \fItcpd|
|00003450| 5c 66 52 20 65 78 70 65 | 63 74 73 20 74 68 61 74 |\fR expe|cts that|
|00003460| 20 74 68 65 20 6e 65 74 | 77 6f 72 6b 20 64 61 65 | the net|work dae|
|00003470| 6d 6f 6e 73 0a 58 61 72 | 65 20 6c 65 66 74 20 69 |mons.Xar|e left i|
|00003480| 6e 20 74 68 65 69 72 20 | 6f 72 69 67 69 6e 61 6c |n their |original|
|00003490| 20 70 6c 61 63 65 2e 0a | 58 2e 50 50 0a 58 49 6e | place..|X.PP.XIn|
|000034a0| 20 6f 72 64 65 72 20 74 | 6f 20 6d 6f 6e 69 74 6f | order t|o monito|
|000034b0| 72 20 61 63 63 65 73 73 | 20 74 6f 20 74 68 65 20 |r access| to the |
|000034c0| 5c 66 49 66 69 6e 67 65 | 72 5c 66 52 20 73 65 72 |\fIfinge|r\fR ser|
|000034d0| 76 69 63 65 2c 20 70 65 | 72 66 6f 72 6d 20 74 68 |vice, pe|rform th|
|000034e0| 65 0a 58 66 6f 6c 6c 6f | 77 69 6e 67 20 65 64 69 |e.Xfollo|wing edi|
|000034f0| 74 73 20 6f 6e 20 74 68 | 65 20 5c 66 49 69 6e 65 |ts on th|e \fIine|
|00003500| 74 64 5c 66 52 20 63 6f | 6e 66 69 67 75 72 61 74 |td\fR co|nfigurat|
|00003510| 69 6f 6e 20 66 69 6c 65 | 20 28 75 73 75 61 6c 6c |ion file| (usuall|
|00003520| 79 20 0a 58 5c 66 49 2f | 65 74 63 2f 69 6e 65 74 |y .X\fI/|etc/inet|
|00003530| 64 2e 63 6f 6e 66 5c 66 | 52 20 6f 72 20 5c 66 49 |d.conf\f|R or \fI|
|00003540| 2f 65 74 63 2f 69 6e 65 | 74 2f 69 6e 65 74 64 2e |/etc/ine|t/inetd.|
|00003550| 63 6f 6e 66 5c 66 52 29 | 3a 0a 58 2e 6e 66 0a 58 |conf\fR)|:.X.nf.X|
|00003560| 2e 73 70 0a 58 2e 74 69 | 20 2b 35 0a 58 66 69 6e |.sp.X.ti| +5.Xfin|
|00003570| 67 65 72 20 20 73 74 72 | 65 61 6d 20 20 74 63 70 |ger str|eam tcp|
|00003580| 20 20 6e 6f 77 61 69 74 | 20 20 6e 6f 62 6f 64 79 | nowait| nobody|
|00003590| 20 20 2f 75 73 72 2f 65 | 74 63 2f 69 6e 2e 66 69 | /usr/e|tc/in.fi|
|000035a0| 6e 67 65 72 64 20 20 69 | 6e 2e 66 69 6e 67 65 72 |ngerd i|n.finger|
|000035b0| 64 0a 58 2e 73 70 0a 58 | 62 65 63 6f 6d 65 73 3a |d.X.sp.X|becomes:|
|000035c0| 0a 58 2e 73 70 0a 58 2e | 74 69 20 2b 35 0a 58 66 |.X.sp.X.|ti +5.Xf|
|000035d0| 69 6e 67 65 72 20 20 73 | 74 72 65 61 6d 20 20 74 |inger s|tream t|
|000035e0| 63 70 20 20 6e 6f 77 61 | 69 74 20 20 6e 6f 62 6f |cp nowa|it nobo|
|000035f0| 64 79 20 20 2f 73 6f 6d | 65 2f 77 68 65 72 65 2f |dy /som|e/where/|
|00003600| 74 63 70 64 20 20 20 20 | 20 69 6e 2e 66 69 6e 67 |tcpd | in.fing|
|00003610| 65 72 64 0a 58 2e 73 70 | 0a 58 2e 66 69 0a 58 2e |erd.X.sp|.X.fi.X.|
|00003620| 50 50 0a 58 54 68 65 20 | 65 78 61 6d 70 6c 65 20 |PP.XThe |example |
|00003630| 61 73 73 75 6d 65 73 20 | 74 68 61 74 20 74 68 65 |assumes |that the|
|00003640| 20 6e 65 74 77 6f 72 6b | 20 64 61 65 6d 6f 6e 73 | network| daemons|
|00003650| 20 6c 69 76 65 20 69 6e | 20 2f 75 73 72 2f 65 74 | live in| /usr/et|
|00003660| 63 2e 20 4f 6e 20 73 6f | 6d 65 0a 58 73 79 73 74 |c. On so|me.Xsyst|
|00003670| 65 6d 73 2c 20 6e 65 74 | 77 6f 72 6b 20 64 61 65 |ems, net|work dae|
|00003680| 6d 6f 6e 73 20 6c 69 76 | 65 20 69 6e 20 2f 75 73 |mons liv|e in /us|
|00003690| 72 2f 73 62 69 6e 20 6f | 72 20 69 6e 20 2f 75 73 |r/sbin o|r in /us|
|000036a0| 72 2f 6c 69 62 65 78 65 | 63 2c 20 74 68 65 0a 58 |r/libexe|c, the.X|
|000036b0| 64 61 65 6d 6f 6e 73 20 | 68 61 76 65 20 6e 6f 20 |daemons |have no |
|000036c0| 60 69 6e 2e 5c 27 20 70 | 72 65 66 69 78 20 74 6f |`in.\' p|refix to|
|000036d0| 20 74 68 65 69 72 20 6e | 61 6d 65 2c 20 6f 72 20 | their n|ame, or |
|000036e0| 74 68 65 72 65 20 69 73 | 20 6e 6f 20 75 73 65 72 |there is| no user|
|000036f0| 69 64 0a 58 66 69 65 6c | 64 20 69 6e 20 74 68 65 |id.Xfiel|d in the|
|00003700| 20 69 6e 65 74 64 20 63 | 6f 6e 66 69 67 75 72 61 | inetd c|onfigura|
|00003710| 74 69 6f 6e 20 66 69 6c | 65 2e 0a 58 2e 50 50 0a |tion fil|e..X.PP.|
|00003720| 58 53 69 6d 69 6c 61 72 | 20 63 68 61 6e 67 65 73 |XSimilar| changes|
|00003730| 20 77 69 6c 6c 20 62 65 | 20 6e 65 65 64 65 64 20 | will be| needed |
|00003740| 66 6f 72 20 74 68 65 20 | 6f 74 68 65 72 20 73 65 |for the |other se|
|00003750| 72 76 69 63 65 73 20 74 | 68 61 74 20 61 72 65 20 |rvices t|hat are |
|00003760| 74 6f 20 62 65 0a 58 63 | 6f 76 65 72 65 64 20 62 |to be.Xc|overed b|
|00003770| 79 20 5c 66 49 74 63 70 | 64 5c 66 52 2e 20 20 53 |y \fItcp|d\fR. S|
|00003780| 65 6e 64 20 61 20 60 6b | 69 6c 6c 20 2d 48 55 50 |end a `k|ill -HUP|
|00003790| 5c 27 20 74 6f 20 74 68 | 65 20 5c 66 49 69 6e 65 |\' to th|e \fIine|
|000037a0| 74 64 5c 66 52 28 38 29 | 0a 58 70 72 6f 63 65 73 |td\fR(8)|.Xproces|
|000037b0| 73 20 74 6f 20 6d 61 6b | 65 20 74 68 65 20 63 68 |s to mak|e the ch|
|000037c0| 61 6e 67 65 73 20 65 66 | 66 65 63 74 69 76 65 2e |anges ef|fective.|
|000037d0| 0a 58 2e 53 48 20 45 58 | 41 4d 50 4c 45 20 33 0a |.X.SH EX|AMPLE 3.|
|000037e0| 58 49 6e 20 74 68 65 20 | 63 61 73 65 20 6f 66 20 |XIn the |case of |
|000037f0| 64 61 65 6d 6f 6e 73 20 | 74 68 61 74 20 64 6f 20 |daemons |that do |
|00003800| 6e 6f 74 20 6c 69 76 65 | 20 69 6e 20 61 20 63 6f |not live| in a co|
|00003810| 6d 6d 6f 6e 20 64 69 72 | 65 63 74 6f 72 79 20 28 |mmon dir|ectory (|
|00003820| 22 73 65 63 72 65 74 22 | 0a 58 6f 72 20 6f 74 68 |"secret"|.Xor oth|
|00003830| 65 72 77 69 73 65 29 2c | 20 65 64 69 74 20 74 68 |erwise),| edit th|
|00003840| 65 20 5c 66 49 69 6e 65 | 74 64 5c 66 52 20 63 6f |e \fIine|td\fR co|
|00003850| 6e 66 69 67 75 72 61 74 | 69 6f 6e 20 66 69 6c 65 |nfigurat|ion file|
|00003860| 20 73 6f 20 74 68 61 74 | 20 69 74 0a 58 73 70 65 | so that| it.Xspe|
|00003870| 63 69 66 69 65 73 20 61 | 6e 20 61 62 73 6f 6c 75 |cifies a|n absolu|
|00003880| 74 65 20 70 61 74 68 20 | 6e 61 6d 65 20 66 6f 72 |te path |name for|
|00003890| 20 74 68 65 20 70 72 6f | 63 65 73 73 20 6e 61 6d | the pro|cess nam|
|000038a0| 65 20 66 69 65 6c 64 2e | 20 46 6f 72 20 65 78 61 |e field.| For exa|
|000038b0| 6d 70 6c 65 3a 0a 58 2e | 6e 66 0a 58 2e 73 70 0a |mple:.X.|nf.X.sp.|
|000038c0| 58 20 20 20 20 6e 74 61 | 6c 6b 20 20 64 67 72 61 |X nta|lk dgra|
|000038d0| 6d 20 20 75 64 70 20 20 | 77 61 69 74 20 20 72 6f |m udp |wait ro|
|000038e0| 6f 74 20 20 2f 73 6f 6d | 65 2f 77 68 65 72 65 2f |ot /som|e/where/|
|000038f0| 74 63 70 64 20 20 2f 75 | 73 72 2f 6c 6f 63 61 6c |tcpd /u|sr/local|
|00003900| 2f 6c 69 62 2f 6e 74 61 | 6c 6b 64 0a 58 2e 73 70 |/lib/nta|lkd.X.sp|
|00003910| 0a 58 2e 66 69 0a 58 2e | 50 50 0a 58 4f 6e 6c 79 |.X.fi.X.|PP.XOnly|
|00003920| 20 74 68 65 20 6c 61 73 | 74 20 63 6f 6d 70 6f 6e | the las|t compon|
|00003930| 65 6e 74 20 28 6e 74 61 | 6c 6b 64 29 20 6f 66 20 |ent (nta|lkd) of |
|00003940| 74 68 65 20 70 72 6f 63 | 65 73 73 20 6e 61 6d 65 |the proc|ess name|
|00003950| 20 77 69 6c 6c 20 62 65 | 20 75 73 65 64 20 66 6f | will be| used fo|
|00003960| 72 0a 58 61 63 63 65 73 | 73 20 63 6f 6e 74 72 6f |r.Xacces|s contro|
|00003970| 6c 20 61 6e 64 20 6c 6f | 67 67 69 6e 67 2e 0a 58 |l and lo|gging..X|
|00003980| 2e 53 48 20 42 55 47 53 | 0a 58 53 6f 6d 65 20 55 |.SH BUGS|.XSome U|
|00003990| 44 50 20 28 61 6e 64 20 | 52 50 43 29 20 64 61 65 |DP (and |RPC) dae|
|000039a0| 6d 6f 6e 73 20 6c 69 6e | 67 65 72 20 61 72 6f 75 |mons lin|ger arou|
|000039b0| 6e 64 20 66 6f 72 20 61 | 20 77 68 69 6c 65 20 61 |nd for a| while a|
|000039c0| 66 74 65 72 20 74 68 65 | 79 20 68 61 76 65 0a 58 |fter the|y have.X|
|000039d0| 66 69 6e 69 73 68 65 64 | 20 74 68 65 69 72 20 77 |finished| their w|
|000039e0| 6f 72 6b 2c 20 69 6e 20 | 63 61 73 65 20 61 6e 6f |ork, in |case ano|
|000039f0| 74 68 65 72 20 72 65 71 | 75 65 73 74 20 63 6f 6d |ther req|uest com|
|00003a00| 65 73 20 69 6e 2e 20 20 | 49 6e 20 74 68 65 20 69 |es in. |In the i|
|00003a10| 6e 65 74 64 0a 58 63 6f | 6e 66 69 67 75 72 61 74 |netd.Xco|nfigurat|
|00003a20| 69 6f 6e 20 66 69 6c 65 | 20 74 68 65 73 65 20 73 |ion file| these s|
|00003a30| 65 72 76 69 63 65 73 20 | 61 72 65 20 72 65 67 69 |ervices |are regi|
|00003a40| 73 74 65 72 65 64 20 77 | 69 74 68 20 74 68 65 20 |stered w|ith the |
|00003a50| 5c 66 49 77 61 69 74 5c | 66 52 0a 58 6f 70 74 69 |\fIwait\|fR.Xopti|
|00003a60| 6f 6e 2e 20 4f 6e 6c 79 | 20 74 68 65 20 72 65 71 |on. Only| the req|
|00003a70| 75 65 73 74 20 74 68 61 | 74 20 73 74 61 72 74 65 |uest tha|t starte|
|00003a80| 64 20 73 75 63 68 20 61 | 20 64 61 65 6d 6f 6e 20 |d such a| daemon |
|00003a90| 77 69 6c 6c 20 62 65 20 | 6c 6f 67 67 65 64 2e 0a |will be |logged..|
|00003aa0| 58 2e 50 50 0a 58 54 68 | 65 20 70 72 6f 67 72 61 |X.PP.XTh|e progra|
|00003ab0| 6d 20 64 6f 65 73 20 6e | 6f 74 20 77 6f 72 6b 20 |m does n|ot work |
|00003ac0| 77 69 74 68 20 52 50 43 | 20 73 65 72 76 69 63 65 |with RPC| service|
|00003ad0| 73 20 6f 76 65 72 20 54 | 43 50 2e 20 54 68 65 73 |s over T|CP. Thes|
|00003ae0| 65 20 73 65 72 76 69 63 | 65 73 0a 58 61 72 65 20 |e servic|es.Xare |
|00003af0| 72 65 67 69 73 74 65 72 | 65 64 20 61 73 20 5c 66 |register|ed as \f|
|00003b00| 49 72 70 63 2f 74 63 70 | 5c 66 52 20 69 6e 20 74 |Irpc/tcp|\fR in t|
|00003b10| 68 65 20 69 6e 65 74 64 | 20 63 6f 6e 66 69 67 75 |he inetd| configu|
|00003b20| 72 61 74 69 6f 6e 20 66 | 69 6c 65 2e 20 54 68 65 |ration f|ile. The|
|00003b30| 0a 58 6f 6e 6c 79 20 6e | 6f 6e 2d 74 72 69 76 69 |.Xonly n|on-trivi|
|00003b40| 61 6c 20 73 65 72 76 69 | 63 65 20 74 68 61 74 20 |al servi|ce that |
|00003b50| 69 73 20 61 66 66 65 63 | 74 65 64 20 62 79 20 74 |is affec|ted by t|
|00003b60| 68 69 73 20 6c 69 6d 69 | 74 61 74 69 6f 6e 20 69 |his limi|tation i|
|00003b70| 73 0a 58 5c 66 49 72 65 | 78 64 5c 66 52 2c 20 77 |s.X\fIre|xd\fR, w|
|00003b80| 68 69 63 68 20 69 73 20 | 75 73 65 64 20 62 79 20 |hich is |used by |
|00003b90| 74 68 65 20 5c 66 49 6f | 6e 28 31 29 5c 66 52 20 |the \fIo|n(1)\fR |
|00003ba0| 63 6f 6d 6d 61 6e 64 2e | 20 54 68 69 73 20 69 73 |command.| This is|
|00003bb0| 20 6e 6f 20 67 72 65 61 | 74 0a 58 6c 6f 73 73 2e | no grea|t.Xloss.|
|00003bc0| 20 20 4f 6e 20 6d 6f 73 | 74 20 73 79 73 74 65 6d | On mos|t system|
|00003bd0| 73 2c 20 5c 66 49 72 65 | 78 64 5c 66 52 20 69 73 |s, \fIre|xd\fR is|
|00003be0| 20 6c 65 73 73 20 73 65 | 63 75 72 65 20 74 68 61 | less se|cure tha|
|00003bf0| 6e 20 61 20 77 69 6c 64 | 63 61 72 64 20 69 6e 0a |n a wild|card in.|
|00003c00| 58 2f 65 74 63 2f 68 6f | 73 74 73 2e 65 71 75 69 |X/etc/ho|sts.equi|
|00003c10| 76 2e 0a 58 2e 50 50 0a | 58 52 50 43 20 62 72 6f |v..X.PP.|XRPC bro|
|00003c20| 61 64 63 61 73 74 20 72 | 65 71 75 65 73 74 73 20 |adcast r|equests |
|00003c30| 28 66 6f 72 20 65 78 61 | 6d 70 6c 65 3a 20 5c 66 |(for exa|mple: \f|
|00003c40| 49 72 77 61 6c 6c 2c 20 | 72 75 70 2c 20 72 75 73 |Irwall, |rup, rus|
|00003c50| 65 72 73 5c 66 52 29 20 | 61 6c 77 61 79 73 0a 58 |ers\fR) |always.X|
|00003c60| 61 70 70 65 61 72 20 74 | 6f 20 63 6f 6d 65 20 66 |appear t|o come f|
|00003c70| 72 6f 6d 20 74 68 65 20 | 72 65 73 70 6f 6e 64 69 |rom the |respondi|
|00003c80| 6e 67 20 68 6f 73 74 2e | 20 57 68 61 74 20 68 61 |ng host.| What ha|
|00003c90| 70 70 65 6e 73 20 69 73 | 20 74 68 61 74 20 74 68 |ppens is| that th|
|00003ca0| 65 0a 58 63 6c 69 65 6e | 74 20 62 72 6f 61 64 63 |e.Xclien|t broadc|
|00003cb0| 61 73 74 73 20 74 68 65 | 20 72 65 71 75 65 73 74 |asts the| request|
|00003cc0| 20 74 6f 20 61 6c 6c 20 | 5c 66 49 70 6f 72 74 6d | to all |\fIportm|
|00003cd0| 61 70 5c 66 52 20 64 61 | 65 6d 6f 6e 73 20 6f 6e |ap\fR da|emons on|
|00003ce0| 20 69 74 73 0a 58 6e 65 | 74 77 6f 72 6b 3b 20 65 | its.Xne|twork; e|
|00003cf0| 61 63 68 20 5c 66 49 70 | 6f 72 74 6d 61 70 5c 66 |ach \fIp|ortmap\f|
|00003d00| 52 20 64 61 65 6d 6f 6e | 20 66 6f 72 77 61 72 64 |R daemon| forward|
|00003d10| 73 20 74 68 65 20 72 65 | 71 75 65 73 74 20 74 6f |s the re|quest to|
|00003d20| 20 61 20 6c 6f 63 61 6c | 0a 58 64 61 65 6d 6f 6e | a local|.Xdaemon|
|00003d30| 2e 20 41 73 20 66 61 72 | 20 61 73 20 74 68 65 20 |. As far| as the |
|00003d40| 5c 66 49 72 77 61 6c 6c | 5c 66 52 20 65 74 63 2e |\fIrwall|\fR etc.|
|00003d50| 20 20 64 61 65 6d 6f 6e | 73 20 6b 6e 6f 77 2c 20 | daemon|s know, |
|00003d60| 74 68 65 20 72 65 71 75 | 65 73 74 20 63 6f 6d 65 |the requ|est come|
|00003d70| 73 0a 58 66 72 6f 6d 20 | 74 68 65 20 6c 6f 63 61 |s.Xfrom |the loca|
|00003d80| 6c 20 68 6f 73 74 2e 0a | 58 2e 53 48 20 46 49 4c |l host..|X.SH FIL|
|00003d90| 45 53 0a 58 2e 50 50 0a | 58 54 68 65 20 64 65 66 |ES.X.PP.|XThe def|
|00003da0| 61 75 6c 74 20 6c 6f 63 | 61 74 69 6f 6e 73 20 6f |ault loc|ations o|
|00003db0| 66 20 74 68 65 20 68 6f | 73 74 20 61 63 63 65 73 |f the ho|st acces|
|00003dc0| 73 20 63 6f 6e 74 72 6f | 6c 20 74 61 62 6c 65 73 |s contro|l tables|
|00003dd0| 20 61 72 65 3a 0a 58 2e | 50 50 0a 58 2f 65 74 63 | are:.X.|PP.X/etc|
|00003de0| 2f 68 6f 73 74 73 2e 61 | 6c 6c 6f 77 0a 58 2e 62 |/hosts.a|llow.X.b|
|00003df0| 72 0a 58 2f 65 74 63 2f | 68 6f 73 74 73 2e 64 65 |r.X/etc/|hosts.de|
|00003e00| 6e 79 0a 58 2e 53 48 20 | 53 45 45 20 41 4c 53 4f |ny.X.SH |SEE ALSO|
|00003e10| 0a 58 2e 6e 61 0a 58 2e | 6e 66 0a 58 68 6f 73 74 |.X.na.X.|nf.Xhost|
|00003e20| 73 5f 61 63 63 65 73 73 | 28 35 29 2c 20 66 6f 72 |s_access|(5), for|
|00003e30| 6d 61 74 20 6f 66 20 74 | 68 65 20 74 63 70 64 20 |mat of t|he tcpd |
|00003e40| 61 63 63 65 73 73 20 63 | 6f 6e 74 72 6f 6c 20 74 |access c|ontrol t|
|00003e50| 61 62 6c 65 73 2e 0a 58 | 73 79 73 6c 6f 67 2e 63 |ables..X|syslog.c|
|00003e60| 6f 6e 66 28 35 29 2c 20 | 66 6f 72 6d 61 74 20 6f |onf(5), |format o|
|00003e70| 66 20 74 68 65 20 73 79 | 73 6c 6f 67 64 20 63 6f |f the sy|slogd co|
|00003e80| 6e 74 72 6f 6c 20 66 69 | 6c 65 2e 0a 58 69 6e 65 |ntrol fi|le..Xine|
|00003e90| 74 64 2e 63 6f 6e 66 28 | 35 29 2c 20 66 6f 72 6d |td.conf(|5), form|
|00003ea0| 61 74 20 6f 66 20 74 68 | 65 20 69 6e 65 74 64 20 |at of th|e inetd |
|00003eb0| 63 6f 6e 74 72 6f 6c 20 | 66 69 6c 65 2e 0a 58 2e |control |file..X.|
|00003ec0| 53 48 20 41 55 54 48 4f | 52 53 0a 58 2e 6e 61 0a |SH AUTHO|RS.X.na.|
|00003ed0| 58 2e 6e 66 0a 58 57 69 | 65 74 73 65 20 56 65 6e |X.nf.XWi|etse Ven|
|00003ee0| 65 6d 61 20 28 77 69 65 | 74 73 65 40 77 7a 76 2e |ema (wie|tse@wzv.|
|00003ef0| 77 69 6e 2e 74 75 65 2e | 6e 6c 29 2c 0a 58 44 65 |win.tue.|nl),.XDe|
|00003f00| 70 61 72 74 6d 65 6e 74 | 20 6f 66 20 4d 61 74 68 |partment| of Math|
|00003f10| 65 6d 61 74 69 63 73 20 | 61 6e 64 20 43 6f 6d 70 |ematics |and Comp|
|00003f20| 75 74 69 6e 67 20 53 63 | 69 65 6e 63 65 2c 0a 58 |uting Sc|ience,.X|
|00003f30| 45 69 6e 64 68 6f 76 65 | 6e 20 55 6e 69 76 65 72 |Eindhove|n Univer|
|00003f40| 73 69 74 79 20 6f 66 20 | 54 65 63 68 6e 6f 6c 6f |sity of |Technolo|
|00003f50| 67 79 2c 0a 58 54 68 65 | 20 4e 65 74 68 65 72 6c |gy,.XThe| Netherl|
|00003f60| 61 6e 64 73 2e 0a 58 5c | 22 20 40 28 23 29 20 74 |ands..X\|" @(#) t|
|00003f70| 63 70 64 2e 38 20 31 2e | 33 20 39 33 2f 30 37 2f |cpd.8 1.|3 93/07/|
|00003f80| 30 32 20 31 36 3a 33 33 | 3a 33 38 0a 45 4e 44 5f |02 16:33|:38.END_|
|00003f90| 4f 46 5f 74 63 70 64 2e | 38 0a 69 66 20 74 65 73 |OF_tcpd.|8.if tes|
|00003fa0| 74 20 36 39 32 33 20 2d | 6e 65 20 60 77 63 20 2d |t 6923 -|ne `wc -|
|00003fb0| 63 20 3c 74 63 70 64 2e | 38 60 3b 20 74 68 65 6e |c <tcpd.|8`; then|
|00003fc0| 0a 20 20 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |. ech|o shar: |
|00003fd0| 5c 22 74 63 70 64 2e 38 | 5c 22 20 75 6e 70 61 63 |\"tcpd.8|\" unpac|
|00003fe0| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|00003ff0| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|00004000| 20 6f 76 65 72 77 72 69 | 74 69 6e 67 20 63 68 65 | overwri|ting che|
|00004010| 63 6b 0a 66 69 0a 69 66 | 20 74 65 73 74 20 2d 66 |ck.fi.if| test -f|
|00004020| 20 74 63 70 64 2e 63 20 | 2d 61 20 22 24 7b 31 7d | tcpd.c |-a "${1}|
|00004030| 22 20 21 3d 20 22 2d 63 | 22 20 3b 20 74 68 65 6e |" != "-c|" ; then|
|00004040| 20 0a 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 57 | . echo| shar: W|
|00004050| 69 6c 6c 20 6e 6f 74 20 | 6f 76 65 72 2d 77 72 69 |ill not |over-wri|
|00004060| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|00004070| 20 5c 22 74 63 70 64 2e | 63 5c 22 0a 65 6c 73 65 | \"tcpd.|c\".else|
|00004080| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 45 78 74 72 |.echo sh|ar: Extr|
|00004090| 61 63 74 69 6e 67 20 5c | 22 74 63 70 64 2e 63 5c |acting \|"tcpd.c\|
|000040a0| 22 20 5c 28 33 31 30 34 | 20 63 68 61 72 61 63 74 |" \(3104| charact|
|000040b0| 65 72 73 5c 29 0a 73 65 | 64 20 22 73 2f 5e 58 2f |ers\).se|d "s/^X/|
|000040c0| 2f 22 20 3e 74 63 70 64 | 2e 63 20 3c 3c 27 45 4e |/" >tcpd|.c <<'EN|
|000040d0| 44 5f 4f 46 5f 74 63 70 | 64 2e 63 27 0a 58 20 2f |D_OF_tcp|d.c'.X /|
|000040e0| 2a 0a 58 20 20 2a 20 47 | 65 6e 65 72 61 6c 20 66 |*.X * G|eneral f|
|000040f0| 72 6f 6e 74 20 65 6e 64 | 20 66 6f 72 20 73 74 72 |ront end| for str|
|00004100| 65 61 6d 20 61 6e 64 20 | 64 61 74 61 67 72 61 6d |eam and |datagram|
|00004110| 20 49 50 20 73 65 72 76 | 69 63 65 73 2e 20 54 68 | IP serv|ices. Th|
|00004120| 69 73 20 70 72 6f 67 72 | 61 6d 20 6c 6f 67 73 0a |is progr|am logs.|
|00004130| 58 20 20 2a 20 74 68 65 | 20 72 65 6d 6f 74 65 20 |X * the| remote |
|00004140| 68 6f 73 74 20 6e 61 6d | 65 20 61 6e 64 20 74 68 |host nam|e and th|
|00004150| 65 6e 20 69 6e 76 6f 6b | 65 73 20 74 68 65 20 72 |en invok|es the r|
|00004160| 65 61 6c 20 64 61 65 6d | 6f 6e 2e 20 46 6f 72 20 |eal daem|on. For |
|00004170| 65 78 61 6d 70 6c 65 2c | 0a 58 20 20 2a 20 69 6e |example,|.X * in|
|00004180| 73 74 61 6c 6c 20 61 73 | 20 2f 75 73 72 2f 65 74 |stall as| /usr/et|
|00004190| 63 2f 7b 74 66 74 70 64 | 2c 66 69 6e 67 65 72 64 |c/{tftpd|,fingerd|
|000041a0| 2c 74 65 6c 6e 65 74 64 | 2c 66 74 70 64 2c 72 6c |,telnetd|,ftpd,rl|
|000041b0| 6f 67 69 6e 64 2c 72 73 | 68 64 2c 72 65 78 65 63 |ogind,rs|hd,rexec|
|000041c0| 64 7d 2c 0a 58 20 20 2a | 20 61 66 74 65 72 20 73 |d},.X *| after s|
|000041d0| 61 76 69 6e 67 20 74 68 | 65 20 72 65 61 6c 20 64 |aving th|e real d|
|000041e0| 61 65 6d 6f 6e 73 20 69 | 6e 20 74 68 65 20 64 69 |aemons i|n the di|
|000041f0| 72 65 63 74 6f 72 79 20 | 73 70 65 63 69 66 69 65 |rectory |specifie|
|00004200| 64 20 77 69 74 68 20 74 | 68 65 0a 58 20 20 2a 20 |d with t|he.X * |
|00004210| 52 45 41 4c 5f 44 41 45 | 4d 4f 4e 5f 44 49 52 20 |REAL_DAE|MON_DIR |
|00004220| 6d 61 63 72 6f 2e 20 54 | 68 69 73 20 61 72 72 61 |macro. T|his arra|
|00004230| 6e 67 65 6d 65 6e 74 20 | 72 65 71 75 69 72 65 73 |ngement |requires|
|00004240| 20 74 68 61 74 20 74 68 | 65 20 6e 65 74 77 6f 72 | that th|e networ|
|00004250| 6b 20 64 61 65 6d 6f 6e | 73 0a 58 20 20 2a 20 61 |k daemon|s.X * a|
|00004260| 72 65 20 73 74 61 72 74 | 65 64 20 62 79 20 69 6e |re start|ed by in|
|00004270| 65 74 64 20 6f 72 20 73 | 6f 6d 65 74 68 69 6e 67 |etd or s|omething|
|00004280| 20 73 69 6d 69 6c 61 72 | 2e 20 43 6f 6e 6e 65 63 | similar|. Connec|
|00004290| 74 69 6f 6e 73 20 61 6e | 64 20 64 69 61 67 6e 6f |tions an|d diagno|
|000042a0| 73 74 69 63 73 0a 58 20 | 20 2a 20 61 72 65 20 6c |stics.X | * are l|
|000042b0| 6f 67 67 65 64 20 74 68 | 72 6f 75 67 68 20 73 79 |ogged th|rough sy|
|000042c0| 73 6c 6f 67 28 33 29 2e | 0a 58 20 20 2a 20 0a 58 |slog(3).|.X * .X|
|000042d0| 20 20 2a 20 41 75 74 68 | 6f 72 3a 20 57 69 65 74 | * Auth|or: Wiet|
|000042e0| 73 65 20 56 65 6e 65 6d | 61 2c 20 45 69 6e 64 68 |se Venem|a, Eindh|
|000042f0| 6f 76 65 6e 20 55 6e 69 | 76 65 72 73 69 74 79 20 |oven Uni|versity |
|00004300| 6f 66 20 54 65 63 68 6e | 6f 6c 6f 67 79 2c 20 54 |of Techn|ology, T|
|00004310| 68 65 20 4e 65 74 68 65 | 72 6c 61 6e 64 73 2e 0a |he Nethe|rlands..|
|00004320| 58 20 20 2a 2f 0a 58 0a | 58 23 69 66 6e 64 65 66 |X */.X.|X#ifndef|
|00004330| 20 6c 69 6e 74 0a 58 73 | 74 61 74 69 63 20 63 68 | lint.Xs|tatic ch|
|00004340| 61 72 20 73 63 63 73 69 | 64 5b 5d 20 3d 20 22 40 |ar sccsi|d[] = "@|
|00004350| 28 23 29 20 74 63 70 64 | 2e 63 20 31 2e 38 20 39 |(#) tcpd|.c 1.8 9|
|00004360| 33 2f 30 39 2f 32 37 20 | 31 38 3a 35 39 3a 32 32 |3/09/27 |18:59:22|
|00004370| 22 3b 0a 58 23 65 6e 64 | 69 66 0a 58 0a 58 2f 2a |";.X#end|if.X.X/*|
|00004380| 20 53 79 73 74 65 6d 20 | 6c 69 62 72 61 72 69 65 | System |librarie|
|00004390| 73 2e 20 2a 2f 0a 58 0a | 58 23 69 6e 63 6c 75 64 |s. */.X.|X#includ|
|000043a0| 65 20 3c 73 79 73 2f 74 | 79 70 65 73 2e 68 3e 0a |e <sys/t|ypes.h>.|
|000043b0| 58 23 69 6e 63 6c 75 64 | 65 20 3c 73 79 73 2f 70 |X#includ|e <sys/p|
|000043c0| 61 72 61 6d 2e 68 3e 0a | 58 23 69 6e 63 6c 75 64 |aram.h>.|X#includ|
|000043d0| 65 20 3c 73 79 73 2f 73 | 74 61 74 2e 68 3e 0a 58 |e <sys/s|tat.h>.X|
|000043e0| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 73 6f |#include| <sys/so|
|000043f0| 63 6b 65 74 2e 68 3e 0a | 58 23 69 6e 63 6c 75 64 |cket.h>.|X#includ|
|00004400| 65 20 3c 6e 65 74 69 6e | 65 74 2f 69 6e 2e 68 3e |e <netin|et/in.h>|
|00004410| 0a 58 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 64 69 |.X#inclu|de <stdi|
|00004420| 6f 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |o.h>.X#i|nclude <|
|00004430| 73 79 73 6c 6f 67 2e 68 | 3e 0a 58 0a 58 65 78 74 |syslog.h|>.X.Xext|
|00004440| 65 72 6e 20 63 68 61 72 | 20 2a 73 74 72 72 63 68 |ern char| *strrch|
|00004450| 72 28 29 3b 0a 58 65 78 | 74 65 72 6e 20 63 68 61 |r();.Xex|tern cha|
|00004460| 72 20 2a 73 74 72 63 70 | 79 28 29 3b 0a 58 0a 58 |r *strcp|y();.X.X|
|00004470| 23 69 66 6e 64 65 66 20 | 4d 41 58 50 41 54 48 4e |#ifndef |MAXPATHN|
|00004480| 41 4d 45 4c 45 4e 0a 58 | 23 64 65 66 69 6e 65 20 |AMELEN.X|#define |
|00004490| 4d 41 58 50 41 54 48 4e | 41 4d 45 4c 45 4e 09 42 |MAXPATHN|AMELEN.B|
|000044a0| 55 46 53 49 5a 0a 58 23 | 65 6e 64 69 66 0a 58 0a |UFSIZ.X#|endif.X.|
|000044b0| 58 2f 2a 20 4c 6f 63 61 | 6c 20 73 74 75 66 66 2e |X/* Loca|l stuff.|
|000044c0| 20 2a 2f 0a 58 0a 58 23 | 69 6e 63 6c 75 64 65 20 | */.X.X#|include |
|000044d0| 22 70 61 74 63 68 6c 65 | 76 65 6c 2e 68 22 0a 58 |"patchle|vel.h".X|
|000044e0| 23 69 6e 63 6c 75 64 65 | 20 22 6c 6f 67 5f 74 63 |#include| "log_tc|
|000044f0| 70 2e 68 22 0a 58 0a 58 | 69 6e 74 20 20 20 20 20 |p.h".X.X|int |
|00004500| 61 6c 6c 6f 77 5f 73 65 | 76 65 72 69 74 79 20 3d |allow_se|verity =|
|00004510| 20 53 45 56 45 52 49 54 | 59 3b 09 2f 2a 20 72 75 | SEVERIT|Y;./* ru|
|00004520| 6e 2d 74 69 6d 65 20 61 | 64 6a 75 73 74 61 62 6c |n-time a|djustabl|
|00004530| 65 20 2a 2f 0a 58 69 6e | 74 20 20 20 20 20 64 65 |e */.Xin|t de|
|00004540| 6e 79 5f 73 65 76 65 72 | 69 74 79 20 3d 20 4c 4f |ny_sever|ity = LO|
|00004550| 47 5f 57 41 52 4e 49 4e | 47 3b 09 2f 2a 20 64 69 |G_WARNIN|G;./* di|
|00004560| 74 74 6f 20 2a 2f 0a 58 | 0a 58 6d 61 69 6e 28 61 |tto */.X|.Xmain(a|
|00004570| 72 67 63 2c 20 61 72 67 | 76 29 0a 58 69 6e 74 20 |rgc, arg|v).Xint |
|00004580| 20 20 20 20 61 72 67 63 | 3b 0a 58 63 68 61 72 20 | argc|;.Xchar |
|00004590| 20 2a 2a 61 72 67 76 3b | 0a 58 7b 0a 58 20 20 20 | **argv;|.X{.X |
|000045a0| 20 73 74 72 75 63 74 20 | 63 6c 69 65 6e 74 5f 69 | struct |client_i|
|000045b0| 6e 66 6f 20 63 6c 69 65 | 6e 74 3b 0a 58 20 20 20 |nfo clie|nt;.X |
|000045c0| 20 69 6e 74 20 20 20 20 | 20 66 72 6f 6d 5f 73 74 | int | from_st|
|000045d0| 61 74 3b 0a 58 20 20 20 | 20 63 68 61 72 20 20 20 |at;.X | char |
|000045e0| 20 70 61 74 68 5b 4d 41 | 58 50 41 54 48 4e 41 4d | path[MA|XPATHNAM|
|000045f0| 45 4c 45 4e 5d 3b 0a 58 | 0a 58 20 20 20 20 2f 2a |ELEN];.X|.X /*|
|00004600| 20 41 74 74 65 6d 70 74 | 20 74 6f 20 70 72 65 76 | Attempt| to prev|
|00004610| 65 6e 74 20 74 68 65 20 | 63 72 65 61 74 69 6f 6e |ent the |creation|
|00004620| 20 6f 66 20 77 6f 72 6c | 64 2d 77 72 69 74 61 62 | of worl|d-writab|
|00004630| 6c 65 20 66 69 6c 65 73 | 2e 20 2a 2f 0a 58 0a 58 |le files|. */.X.X|
|00004640| 23 69 66 64 65 66 20 44 | 41 45 4d 4f 4e 5f 55 4d |#ifdef D|AEMON_UM|
|00004650| 41 53 4b 0a 58 20 20 20 | 20 75 6d 61 73 6b 28 44 |ASK.X | umask(D|
|00004660| 41 45 4d 4f 4e 5f 55 4d | 41 53 4b 29 3b 0a 58 23 |AEMON_UM|ASK);.X#|
|00004670| 65 6e 64 69 66 0a 58 0a | 58 20 20 20 20 2f 2a 0a |endif.X.|X /*.|
|00004680| 58 20 20 20 20 20 2a 20 | 49 66 20 61 72 67 76 5b |X * |If argv[|
|00004690| 30 5d 20 69 73 20 61 6e | 20 61 62 73 6f 6c 75 74 |0] is an| absolut|
|000046a0| 65 20 70 61 74 68 20 6e | 61 6d 65 2c 20 69 67 6e |e path n|ame, ign|
|000046b0| 6f 72 65 20 52 45 41 4c | 5f 44 41 45 4d 4f 4e 5f |ore REAL|_DAEMON_|
|000046c0| 44 49 52 2c 20 61 6e 64 | 20 73 74 72 69 70 0a 58 |DIR, and| strip.X|
|000046d0| 20 20 20 20 20 2a 20 61 | 72 67 76 5b 30 5d 20 74 | * a|rgv[0] t|
|000046e0| 6f 20 69 74 73 20 62 61 | 73 65 6e 61 6d 65 2e 0a |o its ba|sename..|
|000046f0| 58 20 20 20 20 20 2a 2f | 0a 58 0a 58 20 20 20 20 |X */|.X.X |
|00004700| 69 66 20 28 61 72 67 76 | 5b 30 5d 5b 30 5d 20 3d |if (argv|[0][0] =|
|00004710| 3d 20 27 2f 27 29 20 7b | 0a 58 09 73 74 72 63 70 |= '/') {|.X.strcp|
|00004720| 79 28 70 61 74 68 2c 20 | 61 72 67 76 5b 30 5d 29 |y(path, |argv[0])|
|00004730| 3b 0a 58 09 61 72 67 76 | 5b 30 5d 20 3d 20 73 74 |;.X.argv|[0] = st|
|00004740| 72 72 63 68 72 28 61 72 | 67 76 5b 30 5d 2c 20 27 |rrchr(ar|gv[0], '|
|00004750| 2f 27 29 20 2b 20 31 3b | 0a 58 20 20 20 20 7d 20 |/') + 1;|.X } |
|00004760| 65 6c 73 65 20 7b 0a 58 | 09 73 70 72 69 6e 74 66 |else {.X|.sprintf|
|00004770| 28 70 61 74 68 2c 20 22 | 25 73 2f 25 73 22 2c 20 |(path, "|%s/%s", |
|00004780| 52 45 41 4c 5f 44 41 45 | 4d 4f 4e 5f 44 49 52 2c |REAL_DAE|MON_DIR,|
|00004790| 20 61 72 67 76 5b 30 5d | 29 3b 0a 58 20 20 20 20 | argv[0]|);.X |
|000047a0| 7d 0a 58 0a 58 20 20 20 | 20 2f 2a 0a 58 20 20 20 |}.X.X | /*.X |
|000047b0| 20 20 2a 20 4f 70 65 6e | 20 61 20 63 68 61 6e 6e | * Open| a chann|
|000047c0| 65 6c 20 74 6f 20 74 68 | 65 20 73 79 73 6c 6f 67 |el to th|e syslog|
|000047d0| 20 64 61 65 6d 6f 6e 2e | 20 4f 6c 64 65 72 20 76 | daemon.| Older v|
|000047e0| 65 72 73 69 6f 6e 73 20 | 6f 66 20 6f 70 65 6e 6c |ersions |of openl|
|000047f0| 6f 67 28 29 0a 58 20 20 | 20 20 20 2a 20 72 65 71 |og().X | * req|
|00004800| 75 69 72 65 20 6f 6e 6c | 79 20 74 77 6f 20 61 72 |uire onl|y two ar|
|00004810| 67 75 6d 65 6e 74 73 2e | 0a 58 20 20 20 20 20 2a |guments.|.X *|
|00004820| 2f 0a 58 0a 58 23 69 66 | 64 65 66 20 4c 4f 47 5f |/.X.X#if|def LOG_|
|00004830| 4d 41 49 4c 0a 58 20 20 | 20 20 28 76 6f 69 64 29 |MAIL.X | (void)|
|00004840| 20 6f 70 65 6e 6c 6f 67 | 28 61 72 67 76 5b 30 5d | openlog|(argv[0]|
|00004850| 2c 20 4c 4f 47 5f 50 49 | 44 2c 20 46 41 43 49 4c |, LOG_PI|D, FACIL|
|00004860| 49 54 59 29 3b 0a 58 23 | 65 6c 73 65 0a 58 20 20 |ITY);.X#|else.X |
|00004870| 20 20 28 76 6f 69 64 29 | 20 6f 70 65 6e 6c 6f 67 | (void)| openlog|
|00004880| 28 61 72 67 76 5b 30 5d | 2c 20 4c 4f 47 5f 50 49 |(argv[0]|, LOG_PI|
|00004890| 44 29 3b 0a 58 23 65 6e | 64 69 66 0a 58 0a 58 20 |D);.X#en|dif.X.X |
|000048a0| 20 20 20 2f 2a 0a 58 20 | 20 20 20 20 2a 20 46 69 | /*.X | * Fi|
|000048b0| 6e 64 20 6f 75 74 20 61 | 6e 64 20 76 65 72 69 66 |nd out a|nd verif|
|000048c0| 79 20 74 68 65 20 72 65 | 6d 6f 74 65 20 68 6f 73 |y the re|mote hos|
|000048d0| 74 20 6e 61 6d 65 2e 20 | 53 69 74 65 73 20 63 6f |t name. |Sites co|
|000048e0| 6e 63 65 72 6e 65 64 20 | 77 69 74 68 0a 58 20 20 |ncerned |with.X |
|000048f0| 20 20 20 2a 20 73 65 63 | 75 72 69 74 79 20 6d 61 | * sec|urity ma|
|00004900| 79 20 63 68 6f 6f 73 65 | 20 74 6f 20 72 65 66 75 |y choose| to refu|
|00004910| 73 65 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 73 20 66 |se conne|ctions f|
|00004920| 72 6f 6d 20 68 6f 73 74 | 73 20 74 68 61 74 20 70 |rom host|s that p|
|00004930| 72 65 74 65 6e 64 20 74 | 6f 0a 58 20 20 20 20 20 |retend t|o.X |
|00004940| 2a 20 68 61 76 65 20 73 | 6f 6d 65 6f 6e 65 20 65 |* have s|omeone e|
|00004950| 6c 73 65 73 20 68 6f 73 | 74 20 6e 61 6d 65 2e 0a |lses hos|t name..|
|00004960| 58 20 20 20 20 20 2a 2f | 0a 58 0a 58 20 20 20 20 |X */|.X.X |
|00004970| 66 72 6f 6d 5f 73 74 61 | 74 20 3d 20 66 72 6f 6d |from_sta|t = from|
|00004980| 68 6f 73 74 28 26 63 6c | 69 65 6e 74 29 3b 0a 58 |host(&cl|ient);.X|
|00004990| 23 69 66 64 65 66 20 50 | 41 52 41 4e 4f 49 44 0a |#ifdef P|ARANOID.|
|000049a0| 58 20 20 20 20 69 66 20 | 28 66 72 6f 6d 5f 73 74 |X if |(from_st|
|000049b0| 61 74 20 3d 3d 20 2d 31 | 29 0a 58 09 72 65 66 75 |at == -1|).X.refu|
|000049c0| 73 65 28 26 63 6c 69 65 | 6e 74 29 3b 0a 58 23 65 |se(&clie|nt);.X#e|
|000049d0| 6e 64 69 66 0a 58 0a 58 | 20 20 20 20 2f 2a 0a 58 |ndif.X.X| /*.X|
|000049e0| 20 20 20 20 20 2a 20 54 | 68 65 20 42 53 44 20 72 | * T|he BSD r|
|000049f0| 6c 6f 67 69 6e 20 61 6e | 64 20 72 73 68 20 64 61 |login an|d rsh da|
|00004a00| 65 6d 6f 6e 73 20 74 68 | 61 74 20 63 61 6d 65 20 |emons th|at came |
|00004a10| 6f 75 74 20 61 66 74 65 | 72 20 34 2e 33 20 42 53 |out afte|r 4.3 BS|
|00004a20| 44 20 64 69 73 61 6c 6c | 6f 77 0a 58 20 20 20 20 |D disall|ow.X |
|00004a30| 20 2a 20 73 6f 63 6b 65 | 74 20 6f 70 74 69 6f 6e | * socke|t option|
|00004a40| 73 20 61 74 20 74 68 65 | 20 49 50 20 6c 65 76 65 |s at the| IP leve|
|00004a50| 6c 2e 20 54 68 65 79 20 | 64 6f 20 73 6f 20 66 6f |l. They |do so fo|
|00004a60| 72 20 61 20 67 6f 6f 64 | 20 72 65 61 73 6f 6e 2e |r a good| reason.|
|00004a70| 0a 58 20 20 20 20 20 2a | 20 55 6e 66 6f 72 74 75 |.X *| Unfortu|
|00004a80| 6e 61 74 65 6c 79 2c 20 | 77 65 20 63 61 6e 6e 6f |nately, |we canno|
|00004a90| 74 20 75 73 65 20 74 68 | 69 73 20 77 69 74 68 20 |t use th|is with |
|00004aa0| 53 75 6e 4f 53 20 34 2e | 31 2e 78 20 62 65 63 61 |SunOS 4.|1.x beca|
|00004ab0| 75 73 65 20 74 68 65 0a | 58 20 20 20 20 20 2a 20 |use the.|X * |
|00004ac0| 67 65 74 73 6f 63 6b 6f | 70 74 28 29 20 73 79 73 |getsocko|pt() sys|
|00004ad0| 74 65 6d 20 63 61 6c 6c | 20 63 61 6e 20 70 61 6e |tem call| can pan|
|00004ae0| 69 63 20 74 68 65 20 73 | 79 73 74 65 6d 2e 0a 58 |ic the s|ystem..X|
|00004af0| 20 20 20 20 20 2a 2f 0a | 58 0a 58 23 69 66 64 65 | */.|X.X#ifde|
|00004b00| 66 20 4b 49 4c 4c 5f 49 | 50 5f 4f 50 54 49 4f 4e |f KILL_I|P_OPTION|
|00004b10| 53 0a 58 20 20 20 20 66 | 69 78 5f 6f 70 74 69 6f |S.X f|ix_optio|
|00004b20| 6e 73 28 26 63 6c 69 65 | 6e 74 29 3b 0a 58 23 65 |ns(&clie|nt);.X#e|
|00004b30| 6e 64 69 66 0a 58 0a 58 | 20 20 20 20 2f 2a 0a 58 |ndif.X.X| /*.X|
|00004b40| 20 20 20 20 20 2a 20 43 | 68 65 63 6b 20 77 68 65 | * C|heck whe|
|00004b50| 74 68 65 72 20 74 68 69 | 73 20 68 6f 73 74 20 63 |ther thi|s host c|
|00004b60| 61 6e 20 61 63 63 65 73 | 73 20 74 68 65 20 73 65 |an acces|s the se|
|00004b70| 72 76 69 63 65 20 69 6e | 20 61 72 67 76 5b 30 5d |rvice in| argv[0]|
|00004b80| 2e 20 54 68 65 0a 58 20 | 20 20 20 20 2a 20 61 63 |. The.X | * ac|
|00004b90| 63 65 73 73 2d 63 6f 6e | 74 72 6f 6c 20 63 6f 64 |cess-con|trol cod|
|00004ba0| 65 20 69 6e 76 6f 6b 65 | 73 20 6f 70 74 69 6f 6e |e invoke|s option|
|00004bb0| 61 6c 20 73 68 65 6c 6c | 20 63 6f 6d 6d 61 6e 64 |al shell| command|
|00004bc0| 73 20 61 73 20 73 70 65 | 63 69 66 69 65 64 20 69 |s as spe|cified i|
|00004bd0| 6e 0a 58 20 20 20 20 20 | 2a 20 74 68 65 20 61 63 |n.X |* the ac|
|00004be0| 63 65 73 73 2d 63 6f 6e | 74 72 6f 6c 20 74 61 62 |cess-con|trol tab|
|00004bf0| 6c 65 73 2e 0a 58 20 20 | 20 20 20 2a 2f 0a 58 0a |les..X | */.X.|
|00004c00| 58 23 69 66 64 65 66 20 | 48 4f 53 54 53 5f 41 43 |X#ifdef |HOSTS_AC|
|00004c10| 43 45 53 53 0a 58 20 20 | 20 20 69 66 20 28 21 68 |CESS.X | if (!h|
|00004c20| 6f 73 74 73 5f 61 63 63 | 65 73 73 28 61 72 67 76 |osts_acc|ess(argv|
|00004c30| 5b 30 5d 2c 20 26 63 6c | 69 65 6e 74 29 29 0a 58 |[0], &cl|ient)).X|
|00004c40| 09 72 65 66 75 73 65 28 | 26 63 6c 69 65 6e 74 29 |.refuse(|&client)|
|00004c50| 3b 0a 58 23 65 6e 64 69 | 66 0a 58 0a 58 20 20 20 |;.X#endi|f.X.X |
|00004c60| 20 2f 2a 20 52 65 70 6f | 72 74 20 72 65 6d 6f 74 | /* Repo|rt remot|
|00004c70| 65 20 63 6c 69 65 6e 74 | 20 61 6e 64 20 69 6e 76 |e client| and inv|
|00004c80| 6f 6b 65 20 74 68 65 20 | 72 65 61 6c 20 64 61 65 |oke the |real dae|
|00004c90| 6d 6f 6e 20 70 72 6f 67 | 72 61 6d 2e 20 2a 2f 0a |mon prog|ram. */.|
|00004ca0| 58 0a 58 20 20 20 20 73 | 79 73 6c 6f 67 28 61 6c |X.X s|yslog(al|
|00004cb0| 6c 6f 77 5f 73 65 76 65 | 72 69 74 79 2c 20 22 63 |low_seve|rity, "c|
|00004cc0| 6f 6e 6e 65 63 74 20 66 | 72 6f 6d 20 25 73 22 2c |onnect f|rom %s",|
|00004cd0| 20 68 6f 73 74 73 5f 69 | 6e 66 6f 28 26 63 6c 69 | hosts_i|nfo(&cli|
|00004ce0| 65 6e 74 29 29 3b 0a 58 | 20 20 20 20 28 76 6f 69 |ent));.X| (voi|
|00004cf0| 64 29 20 65 78 65 63 76 | 28 70 61 74 68 2c 20 61 |d) execv|(path, a|
|00004d00| 72 67 76 29 3b 0a 58 20 | 20 20 20 73 79 73 6c 6f |rgv);.X | syslo|
|00004d10| 67 28 4c 4f 47 5f 45 52 | 52 2c 20 22 65 72 72 6f |g(LOG_ER|R, "erro|
|00004d20| 72 3a 20 63 61 6e 6e 6f | 74 20 65 78 65 63 75 74 |r: canno|t execut|
|00004d30| 65 20 25 73 3a 20 25 6d | 22 2c 20 70 61 74 68 29 |e %s: %m|", path)|
|00004d40| 3b 0a 58 20 20 20 20 63 | 6c 65 61 6e 5f 65 78 69 |;.X c|lean_exi|
|00004d50| 74 28 26 63 6c 69 65 6e | 74 29 3b 0a 58 20 20 20 |t(&clien|t);.X |
|00004d60| 20 2f 2a 20 4e 4f 54 52 | 45 41 43 48 45 44 20 2a | /* NOTR|EACHED *|
|00004d70| 2f 0a 58 7d 0a 45 4e 44 | 5f 4f 46 5f 74 63 70 64 |/.X}.END|_OF_tcpd|
|00004d80| 2e 63 0a 69 66 20 74 65 | 73 74 20 33 31 30 34 20 |.c.if te|st 3104 |
|00004d90| 2d 6e 65 20 60 77 63 20 | 2d 63 20 3c 74 63 70 64 |-ne `wc |-c <tcpd|
|00004da0| 2e 63 60 3b 20 74 68 65 | 6e 0a 20 20 20 20 65 63 |.c`; the|n. ec|
|00004db0| 68 6f 20 73 68 61 72 3a | 20 5c 22 74 63 70 64 2e |ho shar:| \"tcpd.|
|00004dc0| 63 5c 22 20 75 6e 70 61 | 63 6b 65 64 20 77 69 74 |c\" unpa|cked wit|
|00004dd0| 68 20 77 72 6f 6e 67 20 | 73 69 7a 65 21 0a 66 69 |h wrong |size!.fi|
|00004de0| 0a 23 20 65 6e 64 20 6f | 66 20 6f 76 65 72 77 72 |.# end o|f overwr|
|00004df0| 69 74 69 6e 67 20 63 68 | 65 63 6b 0a 66 69 0a 69 |iting ch|eck.fi.i|
|00004e00| 66 20 74 65 73 74 20 2d | 66 20 74 6c 69 2e 63 20 |f test -|f tli.c |
|00004e10| 2d 61 20 22 24 7b 31 7d | 22 20 21 3d 20 22 2d 63 |-a "${1}|" != "-c|
|00004e20| 22 20 3b 20 74 68 65 6e | 20 0a 20 20 65 63 68 6f |" ; then| . echo|
|00004e30| 20 73 68 61 72 3a 20 57 | 69 6c 6c 20 6e 6f 74 20 | shar: W|ill not |
|00004e40| 6f 76 65 72 2d 77 72 69 | 74 65 20 65 78 69 73 74 |over-wri|te exist|
|00004e50| 69 6e 67 20 66 69 6c 65 | 20 5c 22 74 6c 69 2e 63 |ing file| \"tli.c|
|00004e60| 5c 22 0a 65 6c 73 65 0a | 65 63 68 6f 20 73 68 61 |\".else.|echo sha|
|00004e70| 72 3a 20 45 78 74 72 61 | 63 74 69 6e 67 20 5c 22 |r: Extra|cting \"|
|00004e80| 74 6c 69 2e 63 5c 22 20 | 5c 28 31 30 37 34 37 20 |tli.c\" |\(10747 |
|00004e90| 63 68 61 72 61 63 74 65 | 72 73 5c 29 0a 73 65 64 |characte|rs\).sed|
|00004ea0| 20 22 73 2f 5e 58 2f 2f | 22 20 3e 74 6c 69 2e 63 | "s/^X//|" >tli.c|
|00004eb0| 20 3c 3c 27 45 4e 44 5f | 4f 46 5f 74 6c 69 2e 63 | <<'END_|OF_tli.c|
|00004ec0| 27 0a 58 20 2f 2a 0a 58 | 20 20 2a 20 74 6c 69 5f |'.X /*.X| * tli_|
|00004ed0| 68 6f 73 74 28 29 20 64 | 65 74 65 72 6d 69 6e 65 |host() d|etermine|
|00004ee0| 73 20 74 68 65 20 74 79 | 70 65 20 6f 66 20 74 72 |s the ty|pe of tr|
|00004ef0| 61 6e 73 70 6f 72 74 20 | 28 63 6f 6e 6e 65 63 74 |ansport |(connect|
|00004f00| 65 64 2c 20 63 6f 6e 6e | 65 63 74 69 6f 6e 6c 65 |ed, conn|ectionle|
|00004f10| 73 73 29 2c 0a 58 20 20 | 2a 20 74 68 65 20 6e 61 |ss),.X |* the na|
|00004f20| 6d 65 20 61 6e 64 20 61 | 64 64 72 65 73 73 20 6f |me and a|ddress o|
|00004f30| 66 20 74 68 65 20 68 6f | 73 74 20 61 74 20 74 68 |f the ho|st at th|
|00004f40| 65 20 6f 74 68 65 72 20 | 65 6e 64 20 6f 66 20 61 |e other |end of a|
|00004f50| 20 6e 65 74 77 6f 72 6b | 20 6c 69 6e 6b 2e 20 49 | network| link. I|
|00004f60| 6e 0a 58 20 20 2a 20 63 | 61 73 65 20 6f 66 20 61 |n.X * c|ase of a|
|00004f70| 6e 20 49 50 20 73 65 72 | 76 69 63 65 2c 20 74 6c |n IP ser|vice, tl|
|00004f80| 69 5f 68 6f 73 74 28 29 | 20 61 6c 73 6f 20 64 65 |i_host()| also de|
|00004f90| 74 65 72 6d 69 6e 65 73 | 20 74 68 65 20 6c 6f 63 |termines| the loc|
|00004fa0| 61 6c 20 61 64 64 72 65 | 73 73 20 61 6e 64 0a 58 |al addre|ss and.X|
|00004fb0| 20 20 2a 20 70 6f 72 74 | 2c 20 61 6e 64 20 74 68 | * port|, and th|
|00004fc0| 65 20 72 65 6d 6f 74 65 | 20 75 73 65 72 6e 61 6d |e remote| usernam|
|00004fd0| 65 20 69 66 20 75 73 65 | 72 6e 61 6d 65 20 6c 6f |e if use|rname lo|
|00004fe0| 6f 6b 75 70 73 20 61 72 | 65 20 64 6f 6e 65 20 69 |okups ar|e done i|
|00004ff0| 72 72 65 73 70 65 63 74 | 69 76 65 0a 58 20 20 2a |rrespect|ive.X *|
|00005000| 20 6f 66 20 63 6c 69 65 | 6e 74 2e 20 41 6c 6c 20 | of clie|nt. All |
|00005010| 72 65 73 75 6c 74 73 20 | 61 72 65 20 69 6e 20 73 |results |are in s|
|00005020| 74 61 74 69 63 20 6d 65 | 6d 6f 72 79 2e 0a 58 20 |tatic me|mory..X |
|00005030| 20 2a 20 0a 58 20 20 2a | 20 54 68 65 20 72 65 74 | * .X *| The ret|
|00005040| 75 72 6e 20 73 74 61 74 | 75 73 20 69 73 20 28 2d |urn stat|us is (-|
|00005050| 31 29 20 69 66 20 74 68 | 65 20 72 65 6d 6f 74 65 |1) if th|e remote|
|00005060| 20 68 6f 73 74 20 70 72 | 65 74 65 6e 64 73 20 74 | host pr|etends t|
|00005070| 6f 20 68 61 76 65 20 73 | 6f 6d 65 6f 6e 65 20 65 |o have s|omeone e|
|00005080| 6c 73 65 73 0a 58 20 20 | 2a 20 6e 61 6d 65 2c 20 |lses.X |* name, |
|00005090| 6f 72 20 69 66 20 74 68 | 65 20 72 65 6d 6f 74 65 |or if th|e remote|
|000050a0| 20 68 6f 73 74 20 6e 61 | 6d 65 20 69 73 20 61 76 | host na|me is av|
|000050b0| 61 69 6c 61 62 6c 65 20 | 62 75 74 20 63 6f 75 6c |ailable |but coul|
|000050c0| 64 20 6e 6f 74 20 62 65 | 20 76 65 72 69 66 69 65 |d not be| verifie|
|000050d0| 64 3b 0a 58 20 20 2a 20 | 69 6e 20 65 69 74 68 65 |d;.X * |in eithe|
|000050e0| 72 20 63 61 73 65 20 74 | 68 65 20 68 6f 73 74 6e |r case t|he hostn|
|000050f0| 61 6d 65 20 77 69 6c 6c | 20 62 65 20 69 67 6e 6f |ame will| be igno|
|00005100| 72 65 64 2e 20 54 68 65 | 20 72 65 74 75 72 6e 20 |red. The| return |
|00005110| 73 74 61 74 75 73 20 69 | 73 20 7a 65 72 6f 20 69 |status i|s zero i|
|00005120| 6e 0a 58 20 20 2a 20 61 | 6c 6c 20 6f 74 68 65 72 |n.X * a|ll other|
|00005130| 20 63 61 73 65 73 20 28 | 74 68 65 20 68 6f 73 74 | cases (|the host|
|00005140| 6e 61 6d 65 20 69 73 20 | 75 6e 61 76 61 69 6c 61 |name is |unavaila|
|00005150| 62 6c 65 2c 20 6f 72 20 | 74 68 65 20 68 6f 73 74 |ble, or |the host|
|00005160| 20 6e 61 6d 65 20 64 6f | 75 62 6c 65 0a 58 20 20 | name do|uble.X |
|00005170| 2a 20 63 68 65 63 6b 20 | 73 75 63 63 65 65 64 73 |* check |succeeds|
|00005180| 29 2e 0a 58 20 20 2a 20 | 0a 58 20 20 2a 20 44 69 |)..X * |.X * Di|
|00005190| 61 67 6e 6f 73 74 69 63 | 73 20 61 72 65 20 72 65 |agnostic|s are re|
|000051a0| 70 6f 72 74 65 64 20 74 | 68 72 6f 75 67 68 20 73 |ported t|hrough s|
|000051b0| 79 73 6c 6f 67 28 33 29 | 2e 0a 58 20 20 2a 20 0a |yslog(3)|..X * .|
|000051c0| 58 20 20 2a 20 41 75 74 | 68 6f 72 3a 20 57 69 65 |X * Aut|hor: Wie|
|000051d0| 74 73 65 20 56 65 6e 65 | 6d 61 2c 20 45 69 6e 64 |tse Vene|ma, Eind|
|000051e0| 68 6f 76 65 6e 20 55 6e | 69 76 65 72 73 69 74 79 |hoven Un|iversity|
|000051f0| 20 6f 66 20 54 65 63 68 | 6e 6f 6c 6f 67 79 2c 20 | of Tech|nology, |
|00005200| 54 68 65 20 4e 65 74 68 | 65 72 6c 61 6e 64 73 2e |The Neth|erlands.|
|00005210| 0a 58 20 20 2a 2f 0a 58 | 0a 58 23 69 66 6e 64 65 |.X */.X|.X#ifnde|
|00005220| 66 20 6c 69 6e 74 0a 58 | 73 74 61 74 69 63 20 63 |f lint.X|static c|
|00005230| 68 61 72 20 73 63 63 73 | 69 64 5b 5d 20 3d 20 22 |har sccs|id[] = "|
|00005240| 40 28 23 29 20 74 6c 69 | 2e 63 20 31 2e 37 20 39 |@(#) tli|.c 1.7 9|
|00005250| 33 2f 30 39 2f 32 37 20 | 31 38 3a 35 39 3a 32 35 |3/09/27 |18:59:25|
|00005260| 22 3b 0a 58 23 65 6e 64 | 69 66 0a 58 0a 58 23 69 |";.X#end|if.X.X#i|
|00005270| 66 64 65 66 20 54 4c 49 | 0a 58 0a 58 2f 2a 20 53 |fdef TLI|.X.X/* S|
|00005280| 79 73 74 65 6d 20 6c 69 | 62 72 61 72 69 65 73 2e |ystem li|braries.|
|00005290| 20 2a 2f 0a 58 0a 58 23 | 69 6e 63 6c 75 64 65 20 | */.X.X#|include |
|000052a0| 3c 73 79 73 2f 74 79 70 | 65 73 2e 68 3e 0a 58 23 |<sys/typ|es.h>.X#|
|000052b0| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 70 61 72 |include |<sys/par|
|000052c0| 61 6d 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |am.h>.X#|include |
|000052d0| 3c 73 79 73 2f 73 74 61 | 74 2e 68 3e 0a 58 23 69 |<sys/sta|t.h>.X#i|
|000052e0| 6e 63 6c 75 64 65 20 3c | 73 79 73 2f 6d 6b 64 65 |nclude <|sys/mkde|
|000052f0| 76 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |v.h>.X#i|nclude <|
|00005300| 73 79 73 2f 74 69 75 73 | 65 72 2e 68 3e 0a 58 23 |sys/tius|er.h>.X#|
|00005310| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 74 69 6d |include |<sys/tim|
|00005320| 6f 64 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |od.h>.X#|include |
|00005330| 3c 73 79 73 2f 73 6f 63 | 6b 65 74 2e 68 3e 0a 58 |<sys/soc|ket.h>.X|
|00005340| 23 69 6e 63 6c 75 64 65 | 20 3c 6e 65 74 69 6e 65 |#include| <netine|
|00005350| 74 2f 69 6e 2e 68 3e 0a | 58 23 69 6e 63 6c 75 64 |t/in.h>.|X#includ|
|00005360| 65 20 3c 73 74 64 69 6f | 2e 68 3e 0a 58 23 69 6e |e <stdio|.h>.X#in|
|00005370| 63 6c 75 64 65 20 3c 73 | 79 73 6c 6f 67 2e 68 3e |clude <s|yslog.h>|
|00005380| 0a 58 23 69 6e 63 6c 75 | 64 65 20 3c 65 72 72 6e |.X#inclu|de <errn|
|00005390| 6f 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |o.h>.X#i|nclude <|
|000053a0| 6e 65 74 63 6f 6e 66 69 | 67 2e 68 3e 0a 58 23 69 |netconfi|g.h>.X#i|
|000053b0| 6e 63 6c 75 64 65 20 3c | 6e 65 74 64 69 72 2e 68 |nclude <|netdir.h|
|000053c0| 3e 0a 58 0a 58 65 78 74 | 65 72 6e 20 63 68 61 72 |>.X.Xext|ern char|
|000053d0| 20 2a 73 74 72 6e 63 70 | 79 28 29 3b 0a 58 0a 58 | *strncp|y();.X.X|
|000053e0| 20 2f 2a 20 53 6f 6d 65 | 20 73 79 73 74 65 6d 73 | /* Some| systems|
|000053f0| 20 76 65 72 73 69 6f 6e | 73 20 61 64 76 65 72 74 | version|s advert|
|00005400| 69 73 65 20 61 20 74 6f | 6f 20 73 6d 61 6c 6c 20 |ise a to|o small |
|00005410| 4d 41 58 48 4f 53 54 4e | 41 4d 45 4c 45 4e 20 76 |MAXHOSTN|AMELEN v|
|00005420| 61 6c 75 65 2e 20 2a 2f | 0a 58 0a 58 23 69 66 20 |alue. */|.X.X#if |
|00005430| 28 4d 41 58 48 4f 53 54 | 4e 41 4d 45 4c 45 4e 20 |(MAXHOST|NAMELEN |
|00005440| 3c 20 36 34 29 0a 58 23 | 75 6e 64 65 66 20 4d 41 |< 64).X#|undef MA|
|00005450| 58 48 4f 53 54 4e 41 4d | 45 4c 45 4e 0a 58 23 65 |XHOSTNAM|ELEN.X#e|
|00005460| 6e 64 69 66 0a 58 0a 58 | 20 2f 2a 20 49 6e 20 63 |ndif.X.X| /* In c|
|00005470| 61 73 65 20 6e 6f 74 20 | 64 65 66 69 6e 65 64 20 |ase not |defined |
|00005480| 69 6e 20 3c 73 79 73 2f | 70 61 72 61 6d 2e 68 3e |in <sys/|param.h>|
|00005490| 2e 20 2a 2f 0a 58 0a 58 | 23 69 66 6e 64 65 66 20 |. */.X.X|#ifndef |
|000054a0| 4d 41 58 48 4f 53 54 4e | 41 4d 45 4c 45 4e 0a 58 |MAXHOSTN|AMELEN.X|
|000054b0| 23 64 65 66 69 6e 65 20 | 4d 41 58 48 4f 53 54 4e |#define |MAXHOSTN|
|000054c0| 41 4d 45 4c 45 4e 09 32 | 35 36 09 09 2f 2a 20 73 |AMELEN.2|56../* s|
|000054d0| 74 6f 72 61 67 65 20 66 | 6f 72 20 68 6f 73 74 20 |torage f|or host |
|000054e0| 6e 61 6d 65 20 2a 2f 0a | 58 23 65 6e 64 69 66 0a |name */.|X#endif.|
|000054f0| 58 0a 58 65 78 74 65 72 | 6e 20 69 6e 74 20 65 72 |X.Xexter|n int er|
|00005500| 72 6e 6f 3b 0a 58 65 78 | 74 65 72 6e 20 63 68 61 |rno;.Xex|tern cha|
|00005510| 72 20 2a 73 79 73 5f 65 | 72 72 6c 69 73 74 5b 5d |r *sys_e|rrlist[]|
|00005520| 3b 0a 58 65 78 74 65 72 | 6e 20 69 6e 74 20 73 79 |;.Xexter|n int sy|
|00005530| 73 5f 6e 65 72 72 3b 0a | 58 65 78 74 65 72 6e 20 |s_nerr;.|Xextern |
|00005540| 69 6e 74 20 74 5f 65 72 | 72 6e 6f 3b 0a 58 65 78 |int t_er|rno;.Xex|
|00005550| 74 65 72 6e 20 63 68 61 | 72 20 2a 74 5f 65 72 72 |tern cha|r *t_err|
|00005560| 6c 69 73 74 5b 5d 3b 0a | 58 65 78 74 65 72 6e 20 |list[];.|Xextern |
|00005570| 69 6e 74 20 74 5f 6e 65 | 72 72 3b 0a 58 0a 58 2f |int t_ne|rr;.X.X/|
|00005580| 2a 20 4c 6f 63 61 6c 20 | 73 74 75 66 66 2e 20 2a |* Local |stuff. *|
|00005590| 2f 0a 58 0a 58 23 69 6e | 63 6c 75 64 65 20 22 6c |/.X.X#in|clude "l|
|000055a0| 6f 67 5f 74 63 70 2e 68 | 22 0a 58 0a 58 2f 2a 20 |og_tcp.h|".X.X/* |
|000055b0| 46 6f 72 77 61 72 64 20 | 64 65 63 6c 61 72 61 74 |Forward |declarat|
|000055c0| 69 6f 6e 73 2e 20 2a 2f | 0a 58 0a 58 73 74 61 74 |ions. */|.X.Xstat|
|000055d0| 69 63 20 73 74 72 75 63 | 74 20 74 5f 75 6e 69 74 |ic struc|t t_unit|
|000055e0| 64 61 74 61 20 2a 74 6c | 69 5f 72 65 6d 6f 74 65 |data *tl|i_remote|
|000055f0| 5f 61 64 64 72 28 29 3b | 0a 58 73 74 61 74 69 63 |_addr();|.Xstatic|
|00005600| 20 73 74 72 75 63 74 20 | 74 5f 75 6e 69 74 64 61 | struct |t_unitda|
|00005610| 74 61 20 2a 74 6c 69 5f | 6c 6f 63 61 6c 5f 61 64 |ta *tli_|local_ad|
|00005620| 64 72 28 29 3b 0a 58 73 | 74 61 74 69 63 20 73 74 |dr();.Xs|tatic st|
|00005630| 72 75 63 74 20 6e 65 74 | 63 6f 6e 66 69 67 20 2a |ruct net|config *|
|00005640| 74 6c 69 5f 74 72 61 6e | 73 70 6f 72 74 28 29 3b |tli_tran|sport();|
|00005650| 0a 58 73 74 61 74 69 63 | 20 69 6e 74 20 74 6c 69 |.Xstatic| int tli|
|00005660| 5f 6e 61 6d 65 73 28 29 | 3b 0a 58 73 74 61 74 69 |_names()|;.Xstati|
|00005670| 63 20 69 6e 74 20 74 6c | 69 5f 6d 61 74 63 68 5f |c int tl|i_match_|
|00005680| 68 6f 73 74 6e 61 6d 65 | 28 29 3b 0a 58 73 74 61 |hostname|();.Xsta|
|00005690| 74 69 63 20 63 68 61 72 | 20 2a 74 6c 69 5f 65 72 |tic char| *tli_er|
|000056a0| 72 6f 72 28 29 3b 0a 58 | 73 74 61 74 69 63 20 76 |ror();.X|static v|
|000056b0| 6f 69 64 20 74 6c 69 5f | 73 69 6e 6b 28 29 3b 0a |oid tli_|sink();.|
|000056c0| 58 0a 58 2f 2a 20 74 6c | 69 5f 68 6f 73 74 20 2d |X.X/* tl|i_host -|
|000056d0| 20 64 65 74 65 72 6d 69 | 6e 65 20 65 6e 64 70 6f | determi|ne endpo|
|000056e0| 69 6e 74 20 69 6e 66 6f | 20 2a 2f 0a 58 0a 58 69 |int info| */.X.Xi|
|000056f0| 6e 74 20 20 20 20 20 74 | 6c 69 5f 68 6f 73 74 28 |nt t|li_host(|
|00005700| 63 6c 69 65 6e 74 29 0a | 58 73 74 72 75 63 74 20 |client).|Xstruct |
|00005710| 63 6c 69 65 6e 74 5f 69 | 6e 66 6f 20 2a 63 6c 69 |client_i|nfo *cli|
|00005720| 65 6e 74 3b 0a 58 7b 0a | 58 20 20 20 20 73 74 72 |ent;.X{.|X str|
|00005730| 75 63 74 20 6e 65 74 63 | 6f 6e 66 69 67 20 2a 63 |uct netc|onfig *c|
|00005740| 6f 6e 66 69 67 3b 0a 58 | 20 20 20 20 73 74 72 75 |onfig;.X| stru|
|00005750| 63 74 20 74 5f 75 6e 69 | 74 64 61 74 61 20 2a 72 |ct t_uni|tdata *r|
|00005760| 6d 74 5f 75 6e 69 74 3b | 0a 58 20 20 20 20 73 74 |mt_unit;|.X st|
|00005770| 72 75 63 74 20 74 5f 75 | 6e 69 74 64 61 74 61 20 |ruct t_u|nitdata |
|00005780| 2a 6f 75 72 5f 75 6e 69 | 74 3b 0a 58 20 20 20 20 |*our_uni|t;.X |
|00005790| 73 74 61 74 69 63 20 73 | 74 72 75 63 74 20 73 6f |static s|truct so|
|000057a0| 63 6b 61 64 64 72 5f 69 | 6e 20 72 6d 74 5f 73 69 |ckaddr_i|n rmt_si|
|000057b0| 6e 3b 0a 58 20 20 20 20 | 73 74 61 74 69 63 20 73 |n;.X |static s|
|000057c0| 74 72 75 63 74 20 73 6f | 63 6b 61 64 64 72 5f 69 |truct so|ckaddr_i|
|000057d0| 6e 20 6f 75 72 5f 73 69 | 6e 3b 0a 58 20 20 20 20 |n our_si|n;.X |
|000057e0| 69 6e 74 20 20 20 20 20 | 72 65 74 20 3d 20 30 3b |int |ret = 0;|
|000057f0| 09 09 09 2f 2a 20 68 6f | 73 74 20 6e 61 6d 65 2f |.../* ho|st name/|
|00005800| 61 64 64 72 20 75 6e 6b | 6e 6f 77 6e 20 2a 2f 0a |addr unk|nown */.|
|00005810| 58 0a 58 20 20 20 20 2f | 2a 0a 58 20 20 20 20 20 |X.X /|*.X |
|00005820| 2a 20 49 6e 69 74 69 61 | 6c 69 7a 65 20 74 68 65 |* Initia|lize the|
|00005830| 20 72 65 73 75 6c 74 20 | 77 69 74 68 20 73 75 69 | result |with sui|
|00005840| 74 61 62 6c 65 20 64 65 | 66 61 75 6c 74 73 2e 0a |table de|faults..|
|00005850| 58 20 20 20 20 20 2a 2f | 0a 58 0a 58 20 20 20 20 |X */|.X.X |
|00005860| 69 6e 69 74 5f 63 6c 69 | 65 6e 74 28 63 6c 69 65 |init_cli|ent(clie|
|00005870| 6e 74 29 3b 0a 58 0a 58 | 20 20 20 20 2f 2a 0a 58 |nt);.X.X| /*.X|
|00005880| 20 20 20 20 20 2a 20 46 | 69 6e 64 20 6f 75 74 20 | * F|ind out |
|00005890| 74 68 65 20 63 6c 69 65 | 6e 74 20 61 64 64 72 65 |the clie|nt addre|
|000058a0| 73 73 2c 20 66 69 6e 64 | 20 6f 75 74 20 77 68 61 |ss, find| out wha|
|000058b0| 74 20 74 79 70 65 20 6f | 66 20 74 72 61 6e 73 70 |t type o|f transp|
|000058c0| 6f 72 74 20 69 73 20 68 | 69 64 64 65 6e 0a 58 20 |ort is h|idden.X |
|000058d0| 20 20 20 20 2a 20 75 6e | 64 65 72 6e 65 61 74 68 | * un|derneath|
|000058e0| 20 74 68 65 20 54 4c 49 | 20 70 72 6f 67 72 61 6d | the TLI| program|
|000058f0| 6d 61 74 69 63 20 69 6e | 74 65 72 66 61 63 65 2c |matic in|terface,|
|00005900| 20 6d 61 70 20 74 68 65 | 20 74 72 61 6e 73 70 6f | map the| transpo|
|00005910| 72 74 20 61 64 64 72 65 | 73 73 0a 58 20 20 20 20 |rt addre|ss.X |
|00005920| 20 2a 20 74 6f 20 61 20 | 68 75 6d 61 6e 2d 72 65 | * to a |human-re|
|00005930| 61 64 61 62 6c 65 20 66 | 6f 72 6d 2c 20 61 6e 64 |adable f|orm, and|
|00005940| 20 64 65 74 65 72 6d 69 | 6e 65 20 74 68 65 20 68 | determi|ne the h|
|00005950| 6f 73 74 20 6e 61 6d 65 | 2e 20 44 6f 75 62 6c 65 |ost name|. Double|
|00005960| 20 63 68 65 63 6b 0a 58 | 20 20 20 20 20 2a 20 74 | check.X| * t|
|00005970| 68 65 20 68 6f 73 74 6e | 61 6d 65 2e 0a 58 20 20 |he hostn|ame..X |
|00005980| 20 20 20 2a 20 0a 58 20 | 20 20 20 20 2a 20 49 66 | * .X | * If|
|00005990| 20 77 65 20 64 69 73 63 | 6f 76 65 72 20 74 68 61 | we disc|over tha|
|000059a0| 74 20 77 65 20 61 72 65 | 20 75 73 69 6e 67 20 61 |t we are| using a|
|000059b0| 6e 20 49 50 20 74 72 61 | 6e 73 70 6f 72 74 2c 20 |n IP tra|nsport, |
|000059c0| 64 6f 20 44 4e 53 20 6c | 6f 6f 6b 75 70 73 20 61 |do DNS l|ookups a|
|000059d0| 6e 64 0a 58 20 20 20 20 | 20 2a 20 64 65 74 65 72 |nd.X | * deter|
|000059e0| 6d 69 6e 65 20 74 68 65 | 20 6c 6f 63 61 6c 20 62 |mine the| local b|
|000059f0| 69 6e 64 69 6e 67 2e 20 | 4f 74 68 65 72 77 69 73 |inding. |Otherwis|
|00005a00| 65 2c 20 75 73 65 20 74 | 68 65 20 74 72 61 6e 73 |e, use t|he trans|
|00005a10| 70 6f 72 74 2d 69 6e 64 | 65 70 65 6e 64 65 6e 74 |port-ind|ependent|
|00005a20| 0a 58 20 20 20 20 20 2a | 20 6d 65 74 68 6f 64 20 |.X *| method |
|00005a30| 61 6e 64 20 73 74 69 63 | 6b 20 74 6f 20 67 65 6e |and stic|k to gen|
|00005a40| 65 72 69 63 20 6e 65 74 | 77 6f 72 6b 20 61 64 64 |eric net|work add|
|00005a50| 72 65 73 73 65 73 2e 20 | 58 58 58 20 68 61 72 64 |resses. |XXX hard|
|00005a60| 2d 63 6f 64 65 64 20 70 | 72 6f 74 6f 63 6f 6c 0a |-coded p|rotocol.|
|00005a70| 58 20 20 20 20 20 2a 20 | 66 61 6d 69 6c 79 20 6e |X * |family n|
|00005a80| 61 6d 65 2e 0a 58 20 20 | 20 20 20 2a 2f 0a 58 0a |ame..X | */.X.|
|00005a90| 58 23 64 65 66 69 6e 65 | 20 53 49 4e 43 50 28 64 |X#define| SINCP(d|
|00005aa0| 2c 73 29 20 28 28 28 64 | 29 20 3d 20 2a 28 73 74 |,s) (((d|) = *(st|
|00005ab0| 72 75 63 74 20 73 6f 63 | 6b 61 64 64 72 5f 69 6e |ruct soc|kaddr_in|
|00005ac0| 20 2a 29 20 28 73 29 29 | 2c 20 26 28 64 29 29 0a | *) (s))|, &(d)).|
|00005ad0| 58 0a 58 20 20 20 20 69 | 66 20 28 28 72 6d 74 5f |X.X i|f ((rmt_|
|00005ae0| 75 6e 69 74 20 3d 20 74 | 6c 69 5f 72 65 6d 6f 74 |unit = t|li_remot|
|00005af0| 65 5f 61 64 64 72 28 63 | 6c 69 65 6e 74 29 29 20 |e_addr(c|lient)) |
|00005b00| 21 3d 20 30 29 20 7b 0a | 58 09 69 66 20 28 28 63 |!= 0) {.|X.if ((c|
|00005b10| 6f 6e 66 69 67 20 3d 20 | 74 6c 69 5f 74 72 61 6e |onfig = |tli_tran|
|00005b20| 73 70 6f 72 74 28 63 6c | 69 65 6e 74 2d 3e 66 64 |sport(cl|ient->fd|
|00005b30| 29 29 20 21 3d 20 30 29 | 20 7b 0a 58 09 20 20 20 |)) != 0)| {.X. |
|00005b40| 20 69 66 20 28 73 74 72 | 63 61 73 65 63 6d 70 28 | if (str|casecmp(|
|00005b50| 63 6f 6e 66 69 67 2d 3e | 6e 63 5f 70 72 6f 74 6f |config->|nc_proto|
|00005b60| 66 6d 6c 79 2c 20 22 69 | 6e 65 74 22 29 20 3d 3d |fmly, "i|net") ==|
|00005b70| 20 30 29 20 7b 0a 58 09 | 09 69 66 20 28 28 6f 75 | 0) {.X.|.if ((ou|
|00005b80| 72 5f 75 6e 69 74 20 3d | 20 74 6c 69 5f 6c 6f 63 |r_unit =| tli_loc|
|00005b90| 61 6c 5f 61 64 64 72 28 | 63 6c 69 65 6e 74 29 29 |al_addr(|client))|
|00005ba0| 20 21 3d 20 30 29 20 7b | 0a 58 09 09 20 20 20 20 | != 0) {|.X.. |
|00005bb0| 63 6c 69 65 6e 74 2d 3e | 6f 75 72 5f 73 69 6e 20 |client->|our_sin |
|00005bc0| 3d 20 53 49 4e 43 50 28 | 6f 75 72 5f 73 69 6e 2c |= SINCP(|our_sin,|
|00005bd0| 20 6f 75 72 5f 75 6e 69 | 74 2d 3e 61 64 64 72 2e | our_uni|t->addr.|
|00005be0| 62 75 66 29 3b 0a 58 09 | 09 20 20 20 20 74 5f 66 |buf);.X.|. t_f|
|00005bf0| 72 65 65 28 28 63 68 61 | 72 20 2a 29 20 6f 75 72 |ree((cha|r *) our|
|00005c00| 5f 75 6e 69 74 2c 20 54 | 5f 55 4e 49 54 44 41 54 |_unit, T|_UNITDAT|
|00005c10| 41 29 3b 0a 58 09 09 7d | 0a 58 09 09 63 6c 69 65 |A);.X..}|.X..clie|
|00005c20| 6e 74 2d 3e 72 6d 74 5f | 73 69 6e 20 3d 20 53 49 |nt->rmt_|sin = SI|
|00005c30| 4e 43 50 28 72 6d 74 5f | 73 69 6e 2c 20 72 6d 74 |NCP(rmt_|sin, rmt|
|00005c40| 5f 75 6e 69 74 2d 3e 61 | 64 64 72 2e 62 75 66 29 |_unit->a|ddr.buf)|
|00005c50| 3b 0a 58 09 09 72 65 74 | 20 3d 20 73 6f 63 6b 5f |;.X..ret| = sock_|
|00005c60| 6e 61 6d 65 73 28 63 6c | 69 65 6e 74 29 3b 0a 58 |names(cl|ient);.X|
|00005c70| 09 20 20 20 20 7d 20 65 | 6c 73 65 20 7b 0a 58 09 |. } e|lse {.X.|
|00005c80| 09 72 65 74 20 3d 20 74 | 6c 69 5f 6e 61 6d 65 73 |.ret = t|li_names|
|00005c90| 28 63 6c 69 65 6e 74 2c | 20 26 28 72 6d 74 5f 75 |(client,| &(rmt_u|
|00005ca0| 6e 69 74 2d 3e 61 64 64 | 72 29 2c 20 63 6f 6e 66 |nit->add|r), conf|
|00005cb0| 69 67 29 3b 0a 58 09 20 | 20 20 20 7d 0a 58 09 20 |ig);.X. | }.X. |
|00005cc0| 20 20 20 66 72 65 65 6e | 65 74 63 6f 6e 66 69 67 | freen|etconfig|
|00005cd0| 65 6e 74 28 63 6f 6e 66 | 69 67 29 3b 0a 58 09 7d |ent(conf|ig);.X.}|
|00005ce0| 0a 58 09 74 5f 66 72 65 | 65 28 28 63 68 61 72 20 |.X.t_fre|e((char |
|00005cf0| 2a 29 20 72 6d 74 5f 75 | 6e 69 74 2c 20 54 5f 55 |*) rmt_u|nit, T_U|
|00005d00| 4e 49 54 44 41 54 41 29 | 3b 0a 58 20 20 20 20 7d |NITDATA)|;.X }|
|00005d10| 0a 58 20 20 20 20 72 65 | 74 75 72 6e 20 28 72 65 |.X re|turn (re|
|00005d20| 74 29 3b 0a 58 7d 0a 58 | 0a 58 2f 2a 20 74 6c 69 |t);.X}.X|.X/* tli|
|00005d30| 5f 72 65 6d 6f 74 65 5f | 61 64 64 72 20 2d 20 64 |_remote_|addr - d|
|00005d40| 65 74 65 72 6d 69 6e 65 | 20 54 4c 49 20 63 6c 69 |etermine| TLI cli|
|00005d50| 65 6e 74 20 61 64 64 72 | 65 73 73 20 2a 2f 0a 58 |ent addr|ess */.X|
|00005d60| 0a 58 73 74 61 74 69 63 | 20 73 74 72 75 63 74 20 |.Xstatic| struct |
|00005d70| 74 5f 75 6e 69 74 64 61 | 74 61 20 2a 74 6c 69 5f |t_unitda|ta *tli_|
|00005d80| 72 65 6d 6f 74 65 5f 61 | 64 64 72 28 63 6c 69 65 |remote_a|ddr(clie|
|00005d90| 6e 74 29 0a 58 73 74 72 | 75 63 74 20 63 6c 69 65 |nt).Xstr|uct clie|
|00005da0| 6e 74 5f 69 6e 66 6f 20 | 2a 63 6c 69 65 6e 74 3b |nt_info |*client;|
|00005db0| 0a 58 7b 0a 58 20 20 20 | 20 73 74 72 75 63 74 20 |.X{.X | struct |
|00005dc0| 74 5f 75 6e 69 74 64 61 | 74 61 20 2a 75 6e 69 74 |t_unitda|ta *unit|
|00005dd0| 3b 0a 58 20 20 20 20 69 | 6e 74 20 20 20 20 20 66 |;.X i|nt f|
|00005de0| 6c 61 67 73 3b 0a 58 0a | 58 20 20 20 20 2f 2a 0a |lags;.X.|X /*.|
|00005df0| 58 20 20 20 20 20 2a 20 | 41 6c 6c 6f 63 61 74 65 |X * |Allocate|
|00005e00| 20 73 74 6f 72 61 67 65 | 20 66 6f 72 20 74 68 65 | storage| for the|
|00005e10| 20 65 6e 64 70 6f 69 6e | 74 20 61 64 64 72 65 73 | endpoin|t addres|
|00005e20| 73 2e 20 74 5f 61 6c 6c | 6f 63 28 29 20 66 69 6e |s. t_all|oc() fin|
|00005e30| 64 73 20 6f 75 74 20 66 | 6f 72 20 75 73 0a 58 20 |ds out f|or us.X |
|00005e40| 20 20 20 20 2a 20 68 6f | 77 20 6c 61 72 67 65 20 | * ho|w large |
|00005e50| 74 68 65 20 61 64 64 72 | 65 73 73 20 63 61 6e 20 |the addr|ess can |
|00005e60| 62 65 2e 20 41 64 64 72 | 65 73 73 20 73 69 7a 65 |be. Addr|ess size|
|00005e70| 73 20 64 65 70 65 6e 64 | 20 6f 6e 20 74 68 65 20 |s depend| on the |
|00005e80| 75 6e 64 65 72 6c 79 69 | 6e 67 0a 58 20 20 20 20 |underlyi|ng.X |
|00005e90| 20 2a 20 74 72 61 6e 73 | 70 6f 72 74 20 70 72 6f | * trans|port pro|
|00005ea0| 74 6f 63 6f 6c 2e 0a 58 | 20 20 20 20 20 2a 20 0a |tocol..X| * .|
|00005eb0| 58 20 20 20 20 20 2a 20 | 44 65 74 65 72 6d 69 6e |X * |Determin|
|00005ec0| 65 20 74 68 65 20 74 72 | 61 6e 73 70 6f 72 74 2d |e the tr|ansport-|
|00005ed0| 69 6e 64 65 70 65 6e 64 | 65 6e 74 20 63 6c 69 65 |independ|ent clie|
|00005ee0| 6e 74 20 61 64 64 72 65 | 73 73 2e 20 57 69 74 68 |nt addre|ss. With|
|00005ef0| 20 63 6f 6e 6e 65 63 74 | 69 6f 6e 6c 65 73 73 0a | connect|ionless.|
|00005f00| 58 20 20 20 20 20 2a 20 | 73 65 72 76 69 63 65 73 |X * |services|
|00005f10| 2c 20 70 65 65 6b 20 61 | 74 20 74 68 65 20 73 65 |, peek a|t the se|
|00005f20| 6e 64 65 72 20 61 64 64 | 72 65 73 73 20 6f 66 20 |nder add|ress of |
|00005f30| 74 68 65 20 70 65 6e 64 | 69 6e 67 20 64 61 74 61 |the pend|ing data|
|00005f40| 67 72 61 6d 20 77 69 74 | 68 6f 75 74 0a 58 20 20 |gram wit|hout.X |
|00005f50| 20 20 20 2a 20 70 6f 70 | 70 69 6e 67 20 69 74 20 | * pop|ping it |
|00005f60| 6f 66 66 20 74 68 65 20 | 72 65 63 65 69 76 65 20 |off the |receive |
|00005f70| 71 75 65 75 65 2e 20 54 | 68 69 73 20 74 72 69 63 |queue. T|his tric|
|00005f80| 6b 20 77 6f 72 6b 73 20 | 62 65 63 61 75 73 65 20 |k works |because |
|00005f90| 6f 6e 6c 79 20 74 68 65 | 0a 58 20 20 20 20 20 2a |only the|.X *|
|00005fa0| 20 61 64 64 72 65 73 73 | 20 6d 65 6d 62 65 72 20 | address| member |
|00005fb0| 6f 66 20 74 68 65 20 75 | 6e 69 74 64 61 74 61 20 |of the u|nitdata |
|00005fc0| 73 74 72 75 63 74 75 72 | 65 20 68 61 73 20 62 65 |structur|e has be|
|00005fd0| 65 6e 20 61 6c 6c 6f 63 | 61 74 65 64 2e 0a 58 20 |en alloc|ated..X |
|00005fe0| 20 20 20 20 2a 2f 0a 58 | 0a 58 20 20 20 20 69 66 | */.X|.X if|
|00005ff0| 20 28 28 75 6e 69 74 20 | 3d 20 28 73 74 72 75 63 | ((unit |= (struc|
|00006000| 74 20 74 5f 75 6e 69 74 | 64 61 74 61 20 2a 29 20 |t t_unit|data *) |
|00006010| 74 5f 61 6c 6c 6f 63 28 | 63 6c 69 65 6e 74 2d 3e |t_alloc(|client->|
|00006020| 66 64 2c 20 54 5f 55 4e | 49 54 44 41 54 41 2c 20 |fd, T_UN|ITDATA, |
|00006030| 54 5f 41 44 44 52 29 29 | 20 3d 3d 20 30 29 20 7b |T_ADDR))| == 0) {|
|00006040| 0a 58 09 73 79 73 6c 6f | 67 28 4c 4f 47 5f 45 52 |.X.syslo|g(LOG_ER|
|00006050| 52 2c 20 22 65 72 72 6f | 72 3a 20 74 5f 61 6c 6c |R, "erro|r: t_all|
|00006060| 6f 63 3a 20 25 73 22 2c | 20 74 6c 69 5f 65 72 72 |oc: %s",| tli_err|
|00006070| 6f 72 28 29 29 3b 0a 58 | 20 20 20 20 7d 20 65 6c |or());.X| } el|
|00006080| 73 65 20 7b 0a 58 09 69 | 66 20 28 69 6f 63 74 6c |se {.X.i|f (ioctl|
|00006090| 28 63 6c 69 65 6e 74 2d | 3e 66 64 2c 20 54 49 5f |(client-|>fd, TI_|
|000060a0| 47 45 54 50 45 45 52 4e | 41 4d 45 2c 20 26 28 75 |GETPEERN|AME, &(u|
|000060b0| 6e 69 74 2d 3e 61 64 64 | 72 29 29 20 3c 20 30 29 |nit->add|r)) < 0)|
|000060c0| 20 7b 0a 58 09 20 20 20 | 20 69 66 20 28 74 5f 72 | {.X. | if (t_r|
|000060d0| 63 76 75 64 61 74 61 28 | 63 6c 69 65 6e 74 2d 3e |cvudata(|client->|
|000060e0| 66 64 2c 20 75 6e 69 74 | 2c 20 26 66 6c 61 67 73 |fd, unit|, &flags|
|000060f0| 29 20 3c 20 30 29 20 7b | 0a 58 09 09 73 79 73 6c |) < 0) {|.X..sysl|
|00006100| 6f 67 28 4c 4f 47 5f 45 | 52 52 2c 20 22 65 72 72 |og(LOG_E|RR, "err|
|00006110| 6f 72 3a 20 63 61 6e 27 | 74 20 67 65 74 20 63 6c |or: can'|t get cl|
|00006120| 69 65 6e 74 20 61 64 64 | 72 65 73 73 3a 20 25 73 |ient add|ress: %s|
|00006130| 22 2c 20 74 6c 69 5f 65 | 72 72 6f 72 28 29 29 3b |", tli_e|rror());|
|00006140| 0a 58 09 09 74 5f 66 72 | 65 65 28 28 76 6f 69 64 |.X..t_fr|ee((void|
|00006150| 20 2a 29 20 75 6e 69 74 | 2c 20 54 5f 55 4e 49 54 | *) unit|, T_UNIT|
|00006160| 44 41 54 41 29 3b 0a 58 | 09 09 75 6e 69 74 20 3d |DATA);.X|..unit =|
|00006170| 20 30 3b 0a 58 09 20 20 | 20 20 7d 20 65 6c 73 65 | 0;.X. | } else|
|00006180| 20 7b 0a 58 09 09 63 6c | 69 65 6e 74 2d 3e 73 69 | {.X..cl|ient->si|
|00006190| 6e 6b 20 3d 20 74 6c 69 | 5f 73 69 6e 6b 3b 0a 58 |nk = tli|_sink;.X|
|000061a0| 09 20 20 20 20 7d 0a 58 | 09 20 20 20 20 2f 2a 20 |. }.X|. /* |
|000061b0| 62 65 77 61 72 65 3a 20 | 61 74 20 74 68 69 73 20 |beware: |at this |
|000061c0| 70 6f 69 6e 74 2c 20 75 | 6e 69 74 20 6d 61 79 20 |point, u|nit may |
|000061d0| 62 65 20 6e 75 6c 6c 20 | 2a 2f 0a 58 09 7d 0a 58 |be null |*/.X.}.X|
|000061e0| 20 20 20 20 7d 0a 58 20 | 20 20 20 72 65 74 75 72 | }.X | retur|
|000061f0| 6e 20 28 75 6e 69 74 29 | 3b 0a 58 7d 0a 58 0a 58 |n (unit)|;.X}.X.X|
|00006200| 2f 2a 20 74 6c 69 5f 6c | 6f 63 61 6c 5f 61 64 64 |/* tli_l|ocal_add|
|00006210| 72 20 2d 20 64 65 74 65 | 72 6d 69 6e 65 20 54 4c |r - dete|rmine TL|
|00006220| 49 20 6c 6f 63 61 6c 20 | 61 64 64 72 65 73 73 20 |I local |address |
|00006230| 2a 2f 0a 58 0a 58 73 74 | 72 75 63 74 20 74 5f 75 |*/.X.Xst|ruct t_u|
|00006240| 6e 69 74 64 61 74 61 20 | 2a 74 6c 69 5f 6c 6f 63 |nitdata |*tli_loc|
|00006250| 61 6c 5f 61 64 64 72 28 | 63 6c 69 65 6e 74 29 0a |al_addr(|client).|
|00006260| 58 73 74 72 75 63 74 20 | 63 6c 69 65 6e 74 5f 69 |Xstruct |client_i|
|00006270| 6e 66 6f 20 2a 63 6c 69 | 65 6e 74 3b 0a 58 7b 0a |nfo *cli|ent;.X{.|
|00006280| 58 20 20 20 20 73 74 72 | 75 63 74 20 74 5f 75 6e |X str|uct t_un|
|00006290| 69 74 64 61 74 61 20 2a | 75 6e 69 74 3b 0a 58 0a |itdata *|unit;.X.|
|000062a0| 58 20 20 20 20 69 66 20 | 28 28 75 6e 69 74 20 3d |X if |((unit =|
|000062b0| 20 28 73 74 72 75 63 74 | 20 74 5f 75 6e 69 74 64 | (struct| t_unitd|
|000062c0| 61 74 61 20 2a 29 20 74 | 5f 61 6c 6c 6f 63 28 63 |ata *) t|_alloc(c|
|000062d0| 6c 69 65 6e 74 2d 3e 66 | 64 2c 20 54 5f 55 4e 49 |lient->f|d, T_UNI|
|000062e0| 54 44 41 54 41 2c 20 54 | 5f 41 44 44 52 29 29 20 |TDATA, T|_ADDR)) |
|000062f0| 3d 3d 20 30 29 20 7b 0a | 58 09 73 79 73 6c 6f 67 |== 0) {.|X.syslog|
|00006300| 28 4c 4f 47 5f 45 52 52 | 2c 20 22 65 72 72 6f 72 |(LOG_ERR|, "error|
|00006310| 3a 20 74 5f 61 6c 6c 6f | 63 3a 20 25 73 22 2c 20 |: t_allo|c: %s", |
|00006320| 74 6c 69 5f 65 72 72 6f | 72 28 29 29 3b 0a 58 20 |tli_erro|r());.X |
|00006330| 20 20 20 7d 20 65 6c 73 | 65 20 7b 0a 58 09 69 66 | } els|e {.X.if|
|00006340| 20 28 69 6f 63 74 6c 28 | 63 6c 69 65 6e 74 2d 3e | (ioctl(|client->|
|00006350| 66 64 2c 20 54 49 5f 47 | 45 54 4d 59 4e 41 4d 45 |fd, TI_G|ETMYNAME|
|00006360| 2c 20 26 28 75 6e 69 74 | 2d 3e 61 64 64 72 29 29 |, &(unit|->addr))|
|00006370| 20 3c 20 30 29 20 7b 0a | 58 09 20 20 20 20 73 79 | < 0) {.|X. sy|
|00006380| 73 6c 6f 67 28 4c 4f 47 | 5f 45 52 52 2c 20 22 65 |slog(LOG|_ERR, "e|
|00006390| 72 72 6f 72 3a 20 54 49 | 5f 47 45 54 4d 59 4e 41 |rror: TI|_GETMYNA|
|000063a0| 4d 45 3a 20 25 6d 22 29 | 3b 0a 58 09 20 20 20 20 |ME: %m")|;.X. |
|000063b0| 74 5f 66 72 65 65 28 28 | 76 6f 69 64 20 2a 29 20 |t_free((|void *) |
|000063c0| 75 6e 69 74 2c 20 54 5f | 55 4e 49 54 44 41 54 41 |unit, T_|UNITDATA|
|000063d0| 29 3b 0a 58 09 20 20 20 | 20 75 6e 69 74 20 3d 20 |);.X. | unit = |
|000063e0| 30 3b 0a 58 09 7d 0a 58 | 09 2f 2a 20 62 65 77 61 |0;.X.}.X|./* bewa|
|000063f0| 72 65 3a 20 61 74 20 74 | 68 69 73 20 70 6f 69 6e |re: at t|his poin|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.