home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume16 / log_tcp / part01 next >
SHell self-extracting ARchive  |  1991-01-10  |  28.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


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

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail, ASCII text default
100% TrID E-Mail message (Var. 2) 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)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 77 69 | 65 74 73 65 40 77 7a 76 |From: wi|etse@wzv|
|00000010| 2e 77 69 6e 2e 74 75 65 | 2e 6e 6c 20 28 57 69 65 |.win.tue|.nl (Wie|
|00000020| 74 73 65 20 56 65 6e 65 | 6d 61 29 0a 4e 65 77 73 |tse Vene|ma).News|
|00000030| 67 72 6f 75 70 73 3a 20 | 63 6f 6d 70 2e 73 6f 75 |groups: |comp.sou|
|00000040| 72 63 65 73 2e 6d 69 73 | 63 0a 53 75 62 6a 65 63 |rces.mis|c.Subjec|
|00000050| 74 3a 20 76 31 36 69 30 | 36 32 3a 20 20 70 61 63 |t: v16i0|62: pac|
|00000060| 6b 61 67 65 20 74 6f 20 | 6d 6f 6e 69 74 6f 72 20 |kage to |monitor |
|00000070| 74 63 70 2f 69 70 20 63 | 6f 6e 6e 65 63 74 69 6f |tcp/ip c|onnectio|
|00000080| 6e 73 2c 20 50 61 72 74 | 30 31 2f 30 31 0a 4d 65 |ns, Part|01/01.Me|
|00000090| 73 73 61 67 65 2d 49 44 | 3a 20 3c 31 39 39 31 4a |ssage-ID|: <1991J|
|000000a0| 61 6e 39 2e 30 34 30 31 | 34 30 2e 32 35 32 31 37 |an9.0401|40.25217|
|000000b0| 40 73 70 61 72 6b 79 2e | 49 4d 44 2e 53 74 65 72 |@sparky.|IMD.Ster|
|000000c0| 6c 69 6e 67 2e 43 4f 4d | 3e 0a 44 61 74 65 3a 20 |ling.COM|>.Date: |
|000000d0| 39 20 4a 61 6e 20 39 31 | 20 30 34 3a 30 31 3a 34 |9 Jan 91| 04:01:4|
|000000e0| 30 20 47 4d 54 0a 41 70 | 70 72 6f 76 65 64 3a 20 |0 GMT.Ap|proved: |
|000000f0| 6b 65 6e 74 40 73 70 61 | 72 6b 79 2e 69 6d 64 2e |kent@spa|rky.imd.|
|00000100| 73 74 65 72 6c 69 6e 67 | 2e 63 6f 6d 0a 58 2d 43 |sterling|.com.X-C|
|00000110| 68 65 63 6b 73 75 6d 2d | 53 6e 65 66 72 75 3a 20 |hecksum-|Snefru: |
|00000120| 63 32 32 37 31 37 66 64 | 20 63 32 37 33 62 34 33 |c22717fd| c273b43|
|00000130| 30 20 32 31 39 64 61 32 | 34 34 20 39 32 32 64 35 |0 219da2|44 922d5|
|00000140| 61 34 36 0a 0a 53 75 62 | 6d 69 74 74 65 64 2d 62 |a46..Sub|mitted-b|
|00000150| 79 3a 20 77 69 65 74 73 | 65 40 77 7a 76 2e 77 69 |y: wiets|e@wzv.wi|
|00000160| 6e 2e 74 75 65 2e 6e 6c | 20 28 57 69 65 74 73 65 |n.tue.nl| (Wietse|
|00000170| 20 56 65 6e 65 6d 61 29 | 0a 50 6f 73 74 69 6e 67 | Venema)|.Posting|
|00000180| 2d 6e 75 6d 62 65 72 3a | 20 56 6f 6c 75 6d 65 20 |-number:| Volume |
|00000190| 31 36 2c 20 49 73 73 75 | 65 20 36 32 0a 41 72 63 |16, Issu|e 62.Arc|
|000001a0| 68 69 76 65 2d 6e 61 6d | 65 3a 20 6c 6f 67 5f 74 |hive-nam|e: log_t|
|000001b0| 63 70 2f 70 61 72 74 30 | 31 0a 0a 54 68 69 73 20 |cp/part0|1..This |
|000001c0| 70 61 63 6b 61 67 65 20 | 70 72 6f 76 69 64 65 73 |package |provides|
|000001d0| 20 61 20 63 6f 75 70 6c | 65 20 6f 66 20 74 69 6e | a coupl|e of tin|
|000001e0| 79 20 70 72 6f 67 72 61 | 6d 73 20 74 68 61 74 20 |y progra|ms that |
|000001f0| 6c 6f 67 20 61 6c 6c 20 | 72 65 71 75 65 73 74 73 |log all |requests|
|00000200| 0a 74 6f 20 63 6f 6e 6e | 65 63 74 69 6f 6e 2d 6f |.to conn|ection-o|
|00000210| 72 69 65 6e 74 65 64 20 | 74 63 70 2f 69 70 20 73 |riented |tcp/ip s|
|00000220| 65 72 76 69 63 65 73 20 | 28 65 78 61 6d 70 6c 65 |ervices |(example|
|00000230| 73 3a 20 46 49 4e 47 45 | 52 2c 20 53 59 53 54 41 |s: FINGE|R, SYSTA|
|00000240| 54 2c 20 46 54 50 2c 0a | 54 45 4c 4e 45 54 2c 20 |T, FTP,.|TELNET, |
|00000250| 52 4c 4f 47 49 4e 2c 20 | 52 53 48 2c 20 45 58 45 |RLOGIN, |RSH, EXE|
|00000260| 43 29 2c 20 77 69 74 68 | 20 6f 70 74 69 6f 6e 61 |C), with| optiona|
|00000270| 6c 20 61 63 63 65 73 73 | 20 63 6f 6e 74 72 6f 6c |l access| control|
|00000280| 20 6f 6e 20 74 68 65 20 | 62 61 73 69 73 0a 6f 66 | on the |basis.of|
|00000290| 20 68 6f 73 74 20 28 6f | 72 20 64 6f 6d 61 69 6e | host (o|r domain|
|000002a0| 29 20 6e 61 6d 65 73 20 | 61 6e 64 20 73 65 72 76 |) names |and serv|
|000002b0| 69 63 65 20 6e 61 6d 65 | 73 2e 0a 0a 54 68 65 20 |ice name|s...The |
|000002c0| 70 72 6f 67 72 61 6d 73 | 20 61 72 65 20 6e 6f 74 |programs| are not|
|000002d0| 68 69 6e 67 20 62 75 74 | 20 73 6d 61 6c 6c 20 66 |hing but| small f|
|000002e0| 72 6f 6e 74 20 65 6e 64 | 73 2e 20 42 79 20 64 65 |ront end|s. By de|
|000002f0| 66 61 75 6c 74 2c 20 74 | 68 65 79 20 6a 75 73 74 |fault, t|hey just|
|00000300| 0a 6c 6f 67 20 74 68 65 | 20 72 65 6d 6f 74 65 20 |.log the| remote |
|00000310| 68 6f 73 74 20 6e 61 6d | 65 20 61 6e 64 20 74 68 |host nam|e and th|
|00000320| 65 6e 20 69 6e 76 6f 6b | 65 20 74 68 65 20 72 65 |en invok|e the re|
|00000330| 61 6c 20 64 61 65 6d 6f | 6e 2e 20 54 68 65 20 70 |al daemo|n. The p|
|00000340| 72 6f 67 72 61 6d 73 0a | 73 68 6f 75 6c 64 20 6e |rograms.|should n|
|00000350| 6f 74 20 72 65 71 75 69 | 72 65 20 61 6e 79 20 63 |ot requi|re any c|
|00000360| 68 61 6e 67 65 73 20 74 | 6f 20 65 78 69 73 74 69 |hanges t|o existi|
|00000370| 6e 67 20 73 6f 66 74 77 | 61 72 65 20 6f 72 20 63 |ng softw|are or c|
|00000380| 6f 6e 66 69 67 75 72 61 | 74 69 6f 6e 0a 66 69 6c |onfigura|tion.fil|
|00000390| 65 73 2e 0a 0a 43 6f 6e | 6e 65 63 74 69 6f 6e 73 |es...Con|nections|
|000003a0| 20 61 72 65 20 72 65 70 | 6f 72 74 65 64 20 74 68 | are rep|orted th|
|000003b0| 72 6f 75 67 68 20 74 68 | 65 20 73 79 73 6c 6f 67 |rough th|e syslog|
|000003c0| 28 33 29 20 66 61 63 69 | 6c 69 74 79 2e 20 45 61 |(3) faci|lity. Ea|
|000003d0| 63 68 20 72 65 63 6f 72 | 64 0a 63 6f 6e 74 61 69 |ch recor|d.contai|
|000003e0| 6e 73 20 61 20 74 69 6d | 65 20 73 74 61 6d 70 2c |ns a tim|e stamp,|
|000003f0| 20 74 68 65 20 72 65 6d | 6f 74 65 20 68 6f 73 74 | the rem|ote host|
|00000400| 20 6e 61 6d 65 20 61 6e | 64 20 74 68 65 20 6e 61 | name an|d the na|
|00000410| 6d 65 20 6f 66 20 74 68 | 65 20 73 65 72 76 69 63 |me of th|e servic|
|00000420| 65 0a 72 65 71 75 65 73 | 74 65 64 2e 20 53 75 63 |e.reques|ted. Suc|
|00000430| 68 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 63 61 |h inform|ation ca|
|00000440| 6e 20 62 65 20 75 73 65 | 66 75 6c 20 74 6f 20 64 |n be use|ful to d|
|00000450| 65 74 65 63 74 20 62 72 | 65 61 6b 2d 69 6e 20 61 |etect br|eak-in a|
|00000460| 74 74 65 6d 70 74 73 0a | 6f 72 20 6f 74 68 65 72 |ttempts.|or other|
|00000470| 20 75 6e 64 65 73 69 72 | 61 62 6c 65 20 61 63 74 | undesir|able act|
|00000480| 69 76 69 74 69 65 73 2c | 20 65 73 70 65 63 69 61 |ivities,| especia|
|00000490| 6c 6c 79 20 77 68 65 6e | 20 6c 6f 67 66 69 6c 65 |lly when| logfile|
|000004a0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 0a 66 72 6f | informa|tion.fro|
|000004b0| 6d 20 73 65 76 65 72 61 | 6c 20 68 6f 73 74 73 20 |m severa|l hosts |
|000004c0| 69 73 20 6d 65 72 67 65 | 64 2e 0a 0a 54 68 65 20 |is merge|d...The |
|000004d0| 6f 70 74 69 6f 6e 61 6c | 20 61 63 63 65 73 73 2d |optional| access-|
|000004e0| 63 6f 6e 74 72 6f 6c 20 | 66 61 63 69 6c 69 74 79 |control |facility|
|000004f0| 20 6d 61 79 20 62 65 20 | 75 73 65 66 75 6c 20 77 | may be |useful w|
|00000500| 68 65 6e 2c 20 66 6f 72 | 20 77 68 61 74 65 76 65 |hen, for| whateve|
|00000510| 72 0a 72 65 61 73 6f 6e | 2c 20 69 74 20 69 73 20 |r.reason|, it is |
|00000520| 6e 6f 74 20 70 6f 73 73 | 69 62 6c 65 20 74 6f 20 |not poss|ible to |
|00000530| 68 61 6e 64 6c 65 20 61 | 63 63 65 73 73 20 63 6f |handle a|ccess co|
|00000540| 6e 74 72 6f 6c 20 61 74 | 20 61 20 6d 6f 72 65 20 |ntrol at| a more |
|00000550| 73 75 69 74 61 62 6c 65 | 0a 6c 65 76 65 6c 20 28 |suitable|.level (|
|00000560| 73 75 63 68 20 61 73 20 | 61 6e 20 69 6e 74 65 72 |such as |an inter|
|00000570| 6e 65 74 20 72 6f 75 74 | 65 72 29 2e 0a 0a 09 57 |net rout|er)....W|
|00000580| 69 65 74 73 65 20 56 65 | 6e 65 6d 61 2c 0a 09 45 |ietse Ve|nema,..E|
|00000590| 69 6e 64 68 6f 76 65 6e | 20 55 6e 69 76 65 72 73 |indhoven| Univers|
|000005a0| 69 74 79 20 6f 66 20 54 | 65 63 68 6e 6f 6c 6f 67 |ity of T|echnolog|
|000005b0| 79 2c 0a 09 54 68 65 20 | 4e 65 74 68 65 72 6c 61 |y,..The |Netherla|
|000005c0| 6e 64 73 2e 0a 0a 23 21 | 20 2f 62 69 6e 2f 73 68 |nds...#!| /bin/sh|
|000005d0| 0a 23 20 54 68 69 73 20 | 69 73 20 61 20 73 68 65 |.# This |is a she|
|000005e0| 6c 6c 20 61 72 63 68 69 | 76 65 2e 20 20 52 65 6d |ll archi|ve. Rem|
|000005f0| 6f 76 65 20 61 6e 79 74 | 68 69 6e 67 20 62 65 66 |ove anyt|hing bef|
|00000600| 6f 72 65 20 74 68 69 73 | 20 6c 69 6e 65 2c 20 74 |ore this| line, t|
|00000610| 68 65 6e 20 75 6e 70 61 | 63 6b 0a 23 20 69 74 20 |hen unpa|ck.# it |
|00000620| 62 79 20 73 61 76 69 6e | 67 20 69 74 20 69 6e 74 |by savin|g it int|
|00000630| 6f 20 61 20 66 69 6c 65 | 20 61 6e 64 20 74 79 70 |o a file| and typ|
|00000640| 69 6e 67 20 22 73 68 20 | 66 69 6c 65 22 2e 20 20 |ing "sh |file". |
|00000650| 54 6f 20 6f 76 65 72 77 | 72 69 74 65 20 65 78 69 |To overw|rite exi|
|00000660| 73 74 69 6e 67 0a 23 20 | 66 69 6c 65 73 2c 20 74 |sting.# |files, t|
|00000670| 79 70 65 20 22 73 68 20 | 66 69 6c 65 20 2d 63 22 |ype "sh |file -c"|
|00000680| 2e 20 20 59 6f 75 20 63 | 61 6e 20 61 6c 73 6f 20 |. You c|an also |
|00000690| 66 65 65 64 20 74 68 69 | 73 20 61 73 20 73 74 61 |feed thi|s as sta|
|000006a0| 6e 64 61 72 64 20 69 6e | 70 75 74 20 76 69 61 0a |ndard in|put via.|
|000006b0| 23 20 75 6e 73 68 61 72 | 2c 20 6f 72 20 62 79 20 |# unshar|, or by |
|000006c0| 74 79 70 69 6e 67 20 22 | 73 68 20 3c 66 69 6c 65 |typing "|sh <file|
|000006d0| 22 2c 20 65 2e 67 2e 2e | 20 20 49 66 20 74 68 69 |", e.g..| If thi|
|000006e0| 73 20 61 72 63 68 69 76 | 65 20 69 73 20 63 6f 6d |s archiv|e is com|
|000006f0| 70 6c 65 74 65 2c 20 79 | 6f 75 0a 23 20 77 69 6c |plete, y|ou.# wil|
|00000700| 6c 20 73 65 65 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |l see th|e follow|
|00000710| 69 6e 67 20 6d 65 73 73 | 61 67 65 20 61 74 20 74 |ing mess|age at t|
|00000720| 68 65 20 65 6e 64 3a 0a | 23 09 09 22 45 6e 64 20 |he end:.|#.."End |
|00000730| 6f 66 20 73 68 65 6c 6c | 20 61 72 63 68 69 76 65 |of shell| archive|
|00000740| 2e 22 0a 23 20 43 6f 6e | 74 65 6e 74 73 3a 20 20 |.".# Con|tents: |
|00000750| 52 45 41 44 4d 45 20 6d | 69 73 63 64 2e 63 20 74 |README m|iscd.c t|
|00000760| 63 70 64 2e 63 20 66 72 | 6f 6d 68 6f 73 74 2e 63 |cpd.c fr|omhost.c|
|00000770| 20 68 6f 73 74 73 5f 61 | 63 63 65 73 73 2e 63 20 | hosts_a|ccess.c |
|00000780| 4d 61 6b 65 66 69 6c 65 | 0a 23 20 20 20 68 6f 73 |Makefile|.# hos|
|00000790| 74 73 5f 61 63 63 65 73 | 73 2e 35 20 73 74 72 63 |ts_acces|s.5 strc|
|000007a0| 61 73 65 63 6d 70 2e 63 | 20 42 4c 55 52 42 0a 23 |asecmp.c| BLURB.#|
|000007b0| 20 57 72 61 70 70 65 64 | 20 62 79 20 77 69 65 74 | Wrapped| by wiet|
|000007c0| 73 65 40 77 7a 76 20 6f | 6e 20 53 75 6e 20 4a 61 |se@wzv o|n Sun Ja|
|000007d0| 6e 20 20 36 20 32 32 3a | 33 31 3a 34 31 20 31 39 |n 6 22:|31:41 19|
|000007e0| 39 31 0a 50 41 54 48 3d | 2f 62 69 6e 3a 2f 75 73 |91.PATH=|/bin:/us|
|000007f0| 72 2f 62 69 6e 3a 2f 75 | 73 72 2f 75 63 62 20 3b |r/bin:/u|sr/ucb ;|
|00000800| 20 65 78 70 6f 72 74 20 | 50 41 54 48 0a 69 66 20 | export |PATH.if |
|00000810| 74 65 73 74 20 2d 66 20 | 52 45 41 44 4d 45 20 2d |test -f |README -|
|00000820| 61 20 22 24 7b 31 7d 22 | 20 21 3d 20 22 2d 63 22 |a "${1}"| != "-c"|
|00000830| 20 3b 20 74 68 65 6e 20 | 0a 20 20 65 63 68 6f 20 | ; then |. echo |
|00000840| 73 68 61 72 3a 20 57 69 | 6c 6c 20 6e 6f 74 20 6f |shar: Wi|ll not o|
|00000850| 76 65 72 2d 77 72 69 74 | 65 20 65 78 69 73 74 69 |ver-writ|e existi|
|00000860| 6e 67 20 66 69 6c 65 20 | 5c 22 52 45 41 44 4d 45 |ng file |\"README|
|00000870| 5c 22 0a 65 6c 73 65 0a | 65 63 68 6f 20 73 68 61 |\".else.|echo sha|
|00000880| 72 3a 20 45 78 74 72 61 | 63 74 69 6e 67 20 5c 22 |r: Extra|cting \"|
|00000890| 52 45 41 44 4d 45 5c 22 | 20 5c 28 34 37 37 39 20 |README\"| \(4779 |
|000008a0| 63 68 61 72 61 63 74 65 | 72 73 5c 29 0a 73 65 64 |characte|rs\).sed|
|000008b0| 20 22 73 2f 5e 58 2f 2f | 22 20 3e 52 45 41 44 4d | "s/^X//|" >READM|
|000008c0| 45 20 3c 3c 27 45 4e 44 | 5f 4f 46 5f 52 45 41 44 |E <<'END|_OF_READ|
|000008d0| 4d 45 27 0a 58 40 28 23 | 29 20 52 45 41 44 4d 45 |ME'.X@(#|) README|
|000008e0| 20 31 2e 31 20 39 31 2f | 30 31 2f 30 36 20 32 32 | 1.1 91/|01/06 22|
|000008f0| 3a 33 30 3a 32 33 0a 58 | 0a 58 47 65 6e 65 72 61 |:30:23.X|.XGenera|
|00000900| 6c 20 64 65 73 63 72 69 | 70 74 69 6f 6e 3a 0a 58 |l descri|ption:.X|
|00000910| 0a 58 57 69 74 68 20 74 | 68 69 73 20 70 61 63 6b |.XWith t|his pack|
|00000920| 61 67 65 20 79 6f 75 20 | 63 61 6e 20 6d 6f 6e 69 |age you |can moni|
|00000930| 74 6f 72 20 63 6f 6e 6e | 65 63 74 69 6f 6e 73 20 |tor conn|ections |
|00000940| 74 6f 20 74 68 65 20 53 | 59 53 54 41 54 2c 20 46 |to the S|YSTAT, F|
|00000950| 49 4e 47 45 52 2c 0a 58 | 46 54 50 2c 20 54 45 4c |INGER,.X|FTP, TEL|
|00000960| 4e 45 54 2c 20 52 4c 4f | 47 49 4e 2c 20 52 53 48 |NET, RLO|GIN, RSH|
|00000970| 20 61 6e 64 20 45 58 45 | 43 20 6e 65 74 77 6f 72 | and EXE|C networ|
|00000980| 6b 20 73 65 72 76 69 63 | 65 73 2e 20 20 43 6f 6e |k servic|es. Con|
|00000990| 6e 65 63 74 69 6f 6e 73 | 20 61 72 65 0a 58 6c 6f |nections| are.Xlo|
|000009a0| 67 67 65 64 20 74 68 72 | 6f 75 67 68 20 74 68 65 |gged thr|ough the|
|000009b0| 20 73 79 73 6c 6f 67 28 | 33 29 20 66 61 63 69 6c | syslog(|3) facil|
|000009c0| 69 74 79 2e 20 41 20 72 | 65 71 75 69 72 65 6d 65 |ity. A r|equireme|
|000009d0| 6e 74 20 69 73 20 74 68 | 61 74 20 64 61 65 6d 6f |nt is th|at daemo|
|000009e0| 6e 73 0a 58 61 72 65 20 | 73 74 61 72 74 65 64 20 |ns.Xare |started |
|000009f0| 62 79 20 74 68 65 20 69 | 6e 65 74 64 20 70 72 6f |by the i|netd pro|
|00000a00| 67 72 61 6d 20 6f 72 20 | 73 6f 6d 65 74 68 69 6e |gram or |somethin|
|00000a10| 67 20 73 69 6d 69 6c 61 | 72 2e 0a 58 0a 58 54 68 |g simila|r..X.XTh|
|00000a20| 65 20 70 72 6f 67 72 61 | 6d 73 20 61 72 65 20 74 |e progra|ms are t|
|00000a30| 69 6e 79 20 66 72 6f 6e | 74 20 65 6e 64 73 20 74 |iny fron|t ends t|
|00000a40| 68 61 74 20 6a 75 73 74 | 20 72 65 70 6f 72 74 20 |hat just| report |
|00000a50| 74 68 65 20 72 65 6d 6f | 74 65 20 68 6f 73 74 20 |the remo|te host |
|00000a60| 6e 61 6d 65 0a 58 61 6e | 64 20 74 68 65 6e 20 69 |name.Xan|d then i|
|00000a70| 6e 76 6f 6b 65 20 74 68 | 65 20 72 65 61 6c 20 6e |nvoke th|e real n|
|00000a80| 65 74 77 6f 72 6b 20 64 | 61 65 6d 6f 6e 2e 20 20 |etwork d|aemon. |
|00000a90| 49 6e 20 74 68 65 20 6d | 6f 73 74 20 63 6f 6d 6d |In the m|ost comm|
|00000aa0| 6f 6e 20 63 61 73 65 2c | 20 6e 6f 0a 58 63 68 61 |on case,| no.Xcha|
|00000ab0| 6e 67 65 73 20 73 68 6f | 75 6c 64 20 62 65 20 72 |nges sho|uld be r|
|00000ac0| 65 71 75 69 72 65 64 20 | 74 6f 20 65 78 69 73 74 |equired |to exist|
|00000ad0| 69 6e 67 20 73 6f 66 74 | 77 61 72 65 20 6f 72 20 |ing soft|ware or |
|00000ae0| 74 6f 20 63 6f 6e 66 69 | 67 75 72 61 74 69 6f 6e |to confi|guration|
|00000af0| 0a 58 66 69 6c 65 73 2e | 20 20 4a 75 73 74 20 6d |.Xfiles.| Just m|
|00000b00| 6f 76 65 20 74 68 65 20 | 76 65 6e 64 6f 72 2d 70 |ove the |vendor-p|
|00000b10| 72 6f 76 69 64 65 64 20 | 64 61 65 6d 6f 6e 73 20 |rovided |daemons |
|00000b20| 74 6f 20 61 6e 6f 74 68 | 65 72 20 70 6c 61 63 65 |to anoth|er place|
|00000b30| 20 61 6e 64 0a 58 69 6e | 73 74 61 6c 6c 20 74 68 | and.Xin|stall th|
|00000b40| 65 20 66 72 6f 6e 74 20 | 65 6e 64 73 20 69 6e 74 |e front |ends int|
|00000b50| 6f 20 74 68 65 69 72 20 | 6f 72 69 67 69 6e 61 6c |o their |original|
|00000b60| 20 70 6c 61 63 65 73 2e | 20 49 6e 73 74 61 6c 6c | places.| Install|
|00000b70| 61 74 69 6f 6e 20 64 65 | 74 61 69 6c 73 0a 58 61 |ation de|tails.Xa|
|00000b80| 72 65 20 67 69 76 65 6e | 20 62 65 6c 6f 77 2e 0a |re given| below..|
|00000b90| 58 0a 58 45 61 72 6c 69 | 65 72 20 76 65 72 73 69 |X.XEarli|er versi|
|00000ba0| 6f 6e 73 20 6f 66 20 74 | 68 65 20 70 72 6f 67 72 |ons of t|he progr|
|00000bb0| 61 6d 73 20 77 65 72 65 | 20 74 65 73 74 65 64 20 |ams were| tested |
|00000bc0| 77 69 74 68 20 55 6c 74 | 72 69 78 20 3e 3d 20 32 |with Ult|rix >= 2|
|00000bd0| 2e 32 2c 20 77 69 74 68 | 0a 58 53 75 6e 4f 53 20 |.2, with|.XSunOS |
|00000be0| 3e 3d 20 33 2e 34 20 61 | 6e 64 20 49 53 43 20 32 |>= 3.4 a|nd ISC 2|
|00000bf0| 2e 32 2e 20 54 68 65 20 | 70 72 65 73 65 6e 74 20 |.2. The |present |
|00000c00| 76 65 72 73 69 6f 6e 20 | 69 73 20 61 20 62 69 74 |version |is a bit|
|00000c10| 20 63 6c 65 61 6e 65 64 | 20 75 70 2c 20 62 75 74 | cleaned| up, but|
|00000c20| 0a 58 73 68 6f 75 6c 64 | 20 73 74 69 6c 6c 20 72 |.Xshould| still r|
|00000c30| 75 6e 20 77 69 74 68 6f | 75 74 20 6d 6f 64 69 66 |un witho|ut modif|
|00000c40| 69 63 61 74 69 6f 6e 20 | 6f 6e 20 74 6f 70 20 6f |ication |on top o|
|00000c50| 66 20 6d 6f 73 74 20 42 | 53 44 2d 73 74 79 6c 65 |f most B|SD-style|
|00000c60| 20 54 43 50 2f 49 50 0a | 58 69 6d 70 6c 65 6d 65 | TCP/IP.|Ximpleme|
|00000c70| 6e 74 61 74 69 6f 6e 73 | 2e 0a 58 0a 58 4f 70 74 |ntations|..X.XOpt|
|00000c80| 69 6f 6e 61 6c 20 66 65 | 61 74 75 72 65 3a 0a 58 |ional fe|ature:.X|
|00000c90| 0a 58 57 68 65 6e 20 63 | 6f 6d 70 69 6c 65 64 20 |.XWhen c|ompiled |
|00000ca0| 77 69 74 68 20 2d 44 48 | 4f 53 54 53 5f 41 43 43 |with -DH|OSTS_ACC|
|00000cb0| 45 53 53 2c 20 74 68 65 | 20 66 72 6f 6e 74 2d 65 |ESS, the| front-e|
|00000cc0| 6e 64 20 70 72 6f 67 72 | 61 6d 73 20 73 75 70 70 |nd progr|ams supp|
|00000cd0| 6f 72 74 20 61 0a 58 73 | 69 6d 70 6c 65 20 66 6f |ort a.Xs|imple fo|
|00000ce0| 72 6d 20 6f 66 20 61 63 | 63 65 73 73 20 63 6f 6e |rm of ac|cess con|
|00000cf0| 74 72 6f 6c 20 74 68 61 | 74 20 69 73 20 62 61 73 |trol tha|t is bas|
|00000d00| 65 64 20 6f 6e 20 68 6f | 73 74 20 28 6f 72 20 64 |ed on ho|st (or d|
|00000d10| 6f 6d 61 69 6e 29 20 6e | 61 6d 65 73 0a 58 61 6e |omain) n|ames.Xan|
|00000d20| 64 20 73 65 72 76 69 63 | 65 20 6e 61 6d 65 73 2e |d servic|e names.|
|00000d30| 20 20 57 69 6c 64 20 63 | 61 72 64 73 20 61 72 65 | Wild c|ards are|
|00000d40| 20 73 75 70 70 6f 72 74 | 65 64 2e 20 20 49 66 20 | support|ed. If |
|00000d50| 61 20 68 6f 73 74 20 72 | 65 71 75 65 73 74 73 20 |a host r|equests |
|00000d60| 61 0a 58 73 65 72 76 69 | 63 65 2c 20 61 6e 64 20 |a.Xservi|ce, and |
|00000d70| 69 66 20 74 68 65 20 28 | 73 65 72 76 69 63 65 2c |if the (|service,|
|00000d80| 20 68 6f 73 74 29 20 70 | 61 69 72 20 69 73 20 6d | host) p|air is m|
|00000d90| 61 74 63 68 65 64 20 62 | 79 20 61 6e 20 65 6e 74 |atched b|y an ent|
|00000da0| 72 79 20 69 6e 20 74 68 | 65 0a 58 2f 65 74 63 2f |ry in th|e.X/etc/|
|00000db0| 68 6f 73 74 73 2e 61 6c | 6c 6f 77 20 66 69 6c 65 |hosts.al|low file|
|00000dc0| 2c 20 61 63 63 65 73 73 | 20 69 73 20 67 72 61 6e |, access| is gran|
|00000dd0| 74 65 64 2e 20 20 4f 74 | 68 65 72 77 69 73 65 2c |ted. Ot|herwise,|
|00000de0| 20 69 66 20 74 68 65 20 | 28 73 65 72 76 69 63 65 | if the |(service|
|00000df0| 2c 0a 58 68 6f 73 74 29 | 20 70 61 69 72 20 69 73 |,.Xhost)| pair is|
|00000e00| 20 6d 61 74 63 68 65 64 | 20 62 79 20 61 6e 20 65 | matched| by an e|
|00000e10| 6e 74 72 79 20 69 6e 20 | 74 68 65 20 2f 65 74 63 |ntry in |the /etc|
|00000e20| 2f 68 6f 73 74 73 2e 64 | 65 6e 79 20 66 69 6c 65 |/hosts.d|eny file|
|00000e30| 2c 20 61 63 63 65 73 73 | 0a 58 69 73 20 64 65 6e |, access|.Xis den|
|00000e40| 69 65 64 2e 20 20 4f 74 | 68 65 72 77 69 73 65 2c |ied. Ot|herwise,|
|00000e50| 20 61 63 63 65 73 73 20 | 69 73 20 67 72 61 6e 74 | access |is grant|
|00000e60| 65 64 2e 20 20 46 6f 72 | 20 6d 6f 72 65 20 64 65 |ed. For| more de|
|00000e70| 74 61 69 6c 73 2c 20 73 | 65 65 20 74 68 65 0a 58 |tails, s|ee the.X|
|00000e80| 68 6f 73 74 73 5f 61 63 | 63 65 73 73 28 35 29 20 |hosts_ac|cess(5) |
|00000e90| 6d 61 6e 75 61 6c 20 70 | 61 67 65 2e 20 54 68 69 |manual p|age. Thi|
|00000ea0| 73 20 66 6f 72 6d 20 6f | 66 20 61 63 63 65 73 73 |s form o|f access|
|00000eb0| 20 63 6f 6e 74 72 6f 6c | 20 6d 61 79 20 62 65 20 | control| may be |
|00000ec0| 75 73 65 66 75 6c 0a 58 | 69 66 20 69 74 20 63 61 |useful.X|if it ca|
|00000ed0| 6e 20 6e 6f 74 20 62 65 | 20 69 6d 70 6c 65 6d 65 |n not be| impleme|
|00000ee0| 6e 74 65 64 20 61 74 20 | 61 20 6d 6f 72 65 20 73 |nted at |a more s|
|00000ef0| 75 69 74 61 62 6c 65 20 | 6c 65 76 65 6c 20 28 73 |uitable |level (s|
|00000f00| 75 63 68 20 61 73 20 61 | 6e 0a 58 69 6e 74 65 72 |uch as a|n.Xinter|
|00000f10| 6e 65 74 20 72 6f 75 74 | 65 72 29 2e 0a 58 0a 58 |net rout|er)..X.X|
|00000f20| 52 65 6c 61 74 65 64 20 | 73 6f 66 74 77 61 72 65 |Related |software|
|00000f30| 3a 0a 58 0a 58 56 65 72 | 73 69 6f 6e 73 20 6f 66 |:.X.XVer|sions of|
|00000f40| 20 72 73 68 64 20 61 6e | 64 20 72 6c 6f 67 69 6e | rshd an|d rlogin|
|00000f50| 64 2c 20 68 61 63 6b 65 | 64 20 74 6f 20 72 65 70 |d, hacke|d to rep|
|00000f60| 6f 72 74 20 74 68 65 20 | 72 65 6d 6f 74 65 20 75 |ort the |remote u|
|00000f70| 73 65 72 20 6e 61 6d 65 | 20 61 73 0a 58 77 65 6c |ser name| as.Xwel|
|00000f80| 6c 2c 20 61 72 65 20 61 | 76 61 69 6c 61 62 6c 65 |l, are a|vailable|
|00000f90| 20 66 6f 72 20 61 6e 6f | 6e 20 66 74 70 20 28 66 | for ano|n ftp (f|
|00000fa0| 74 70 2e 77 69 6e 2e 74 | 75 65 2e 6e 6c 3a 2f 70 |tp.win.t|ue.nl:/p|
|00000fb0| 75 62 2f 6c 6f 67 64 61 | 65 6d 6f 6e 2e 74 61 72 |ub/logda|emon.tar|
|00000fc0| 2e 5a 29 2e 0a 58 54 68 | 6f 73 65 20 70 72 6f 67 |.Z)..XTh|ose prog|
|00000fd0| 72 61 6d 73 20 68 61 76 | 65 20 62 65 65 6e 20 74 |rams hav|e been t|
|00000fe0| 65 73 74 65 64 20 6f 6e | 6c 79 20 77 69 74 68 20 |ested on|ly with |
|00000ff0| 53 75 6e 4f 53 20 3e 3d | 20 34 2e 30 2e 0a 58 0a |SunOS >=| 4.0..X.|
|00001000| 58 41 6e 6f 74 68 65 72 | 20 77 61 79 20 74 6f 20 |XAnother| way to |
|00001010| 6d 61 6e 61 67 65 20 61 | 63 63 65 73 73 20 74 6f |manage a|ccess to|
|00001020| 20 74 63 70 2f 69 70 20 | 73 65 72 76 69 63 65 73 | tcp/ip |services|
|00001030| 20 69 73 20 69 6c 6c 75 | 73 74 72 61 74 65 64 20 | is illu|strated |
|00001040| 62 79 20 74 68 65 0a 58 | 73 65 72 76 65 72 73 20 |by the.X|servers |
|00001050| 70 72 6f 76 69 64 65 64 | 20 77 69 74 68 20 74 68 |provided| with th|
|00001060| 65 20 61 75 74 68 75 74 | 69 6c 20 70 61 63 6b 61 |e authut|il packa|
|00001070| 67 65 20 28 63 6f 6d 70 | 2e 73 6f 75 72 63 65 73 |ge (comp|.sources|
|00001080| 2e 75 6e 69 78 20 76 6f | 6c 75 6d 65 0a 58 32 32 |.unix vo|lume.X22|
|00001090| 29 2e 20 54 68 69 73 20 | 68 61 73 20 74 68 65 20 |). This |has the |
|000010a0| 61 64 76 61 6e 74 61 67 | 65 20 74 68 61 74 20 6f |advantag|e that o|
|000010b0| 6e 65 20 77 69 6c 6c 20 | 67 65 74 20 74 68 65 20 |ne will |get the |
|000010c0| 72 65 6d 6f 74 65 20 75 | 73 65 72 6e 61 6d 65 20 |remote u|sername |
|000010d0| 66 72 6f 6d 0a 58 61 6e | 79 20 68 6f 73 74 20 73 |from.Xan|y host s|
|000010e0| 75 70 70 6f 72 74 69 6e | 67 20 52 46 43 20 39 33 |upportin|g RFC 93|
|000010f0| 31 20 73 65 63 75 72 69 | 74 79 2e 20 20 42 79 20 |1 securi|ty. By |
|00001100| 69 6e 73 74 61 6c 6c 69 | 6e 67 20 74 68 65 20 61 |installi|ng the a|
|00001110| 75 74 68 20 70 61 63 6b | 61 67 65 0a 58 28 73 61 |uth pack|age.X(sa|
|00001120| 6d 65 20 76 6f 6c 75 6d | 65 29 20 6f 6e 65 20 73 |me volum|e) one s|
|00001130| 75 70 70 6f 72 74 73 20 | 52 46 43 20 39 33 31 20 |upports |RFC 931 |
|00001140| 73 65 63 75 72 69 74 79 | 20 74 6f 6f 2e 20 20 45 |security| too. E|
|00001150| 76 65 6e 74 75 61 6c 6c | 79 20 6f 6e 65 20 63 61 |ventuall|y one ca|
|00001160| 6e 0a 58 73 74 61 72 74 | 20 63 75 74 74 69 6e 67 |n.Xstart| cutting|
|00001170| 20 6f 66 66 20 75 6e 61 | 75 74 68 65 6e 74 69 63 | off una|uthentic|
|00001180| 61 74 65 64 20 63 6f 6e | 6e 65 63 74 69 6f 6e 73 |ated con|nections|
|00001190| 2e 20 54 68 69 73 20 69 | 73 20 6f 62 76 69 6f 75 |. This i|s obviou|
|000011a0| 73 6c 79 20 61 20 6d 75 | 63 68 0a 58 6d 6f 72 65 |sly a mu|ch.Xmore|
|000011b0| 20 61 64 76 61 6e 63 65 | 64 20 61 70 70 72 6f 61 | advance|d approa|
|000011c0| 63 68 20 74 68 61 6e 20 | 77 68 61 74 20 6d 79 20 |ch than |what my |
|000011d0| 66 72 6f 6e 74 2d 65 6e | 64 20 70 72 6f 67 72 61 |front-en|d progra|
|000011e0| 6d 73 20 70 72 6f 76 69 | 64 65 2e 20 54 68 65 0a |ms provi|de. The.|
|000011f0| 58 70 72 65 73 65 6e 74 | 20 70 61 63 6b 61 67 65 |Xpresent| package|
|00001200| 20 69 73 20 6d 6f 72 65 | 20 73 75 69 74 61 62 6c | is more| suitabl|
|00001210| 65 20 66 6f 72 20 74 68 | 6f 73 65 20 77 68 6f 20 |e for th|ose who |
|00001220| 6c 61 63 6b 20 74 68 65 | 20 72 65 73 6f 75 72 63 |lack the| resourc|
|00001230| 65 73 20 74 6f 0a 58 69 | 6e 73 74 61 6c 6c 20 61 |es to.Xi|nstall a|
|00001240| 6e 79 74 68 69 6e 67 20 | 74 68 61 74 20 72 65 71 |nything |that req|
|00001250| 75 69 72 65 73 20 6d 6f | 72 65 20 74 68 61 6e 20 |uires mo|re than |
|00001260| 6a 75 73 74 20 72 65 6e | 61 6d 69 6e 67 20 61 20 |just ren|aming a |
|00001270| 63 6f 75 70 6c 65 20 6f | 66 0a 58 65 78 65 63 75 |couple o|f.Xexecu|
|00001280| 74 61 62 6c 65 73 2e 0a | 58 0a 58 43 6f 6e 66 69 |tables..|X.XConfi|
|00001290| 67 75 72 61 74 69 6f 6e | 20 61 6e 64 20 69 6e 73 |guration| and ins|
|000012a0| 74 61 6c 6c 61 74 69 6f | 6e 3a 0a 58 0a 58 49 66 |tallatio|n:.X.XIf|
|000012b0| 20 79 6f 75 20 64 6f 6e | 27 74 20 72 75 6e 20 55 | you don|'t run U|
|000012c0| 6c 74 72 69 78 2c 20 79 | 6f 75 20 64 6f 6e 27 74 |ltrix, y|ou don't|
|000012d0| 20 6e 65 65 64 20 74 68 | 65 20 6d 69 73 63 64 20 | need th|e miscd |
|000012e0| 66 72 6f 6e 74 2d 65 6e | 64 20 70 72 6f 67 72 61 |front-en|d progra|
|000012f0| 6d 2e 0a 58 54 68 65 20 | 55 6c 74 72 69 78 20 6d |m..XThe |Ultrix m|
|00001300| 69 73 63 64 20 64 61 65 | 6d 6f 6e 20 69 6d 70 6c |iscd dae|mon impl|
|00001310| 65 6d 65 6e 74 73 20 61 | 6d 6f 6e 67 20 6f 74 68 |ements a|mong oth|
|00001320| 65 72 73 20 74 68 65 20 | 53 59 53 54 41 54 20 73 |ers the |SYSTAT s|
|00001330| 65 72 76 69 63 65 2c 0a | 58 77 68 69 63 68 20 70 |ervice,.|Xwhich p|
|00001340| 69 70 65 73 20 74 68 65 | 20 6f 75 74 70 75 74 20 |ipes the| output |
|00001350| 66 72 6f 6d 20 74 68 65 | 20 57 48 4f 20 63 6f 6d |from the| WHO com|
|00001360| 6d 61 6e 64 20 74 6f 20 | 73 74 61 6e 64 61 72 64 |mand to |standard|
|00001370| 20 6f 75 74 70 75 74 2e | 0a 58 0a 58 42 79 20 64 | output.|.X.XBy d|
|00001380| 65 66 61 75 6c 74 2c 20 | 74 68 65 20 66 72 6f 6e |efault, |the fron|
|00001390| 74 2d 65 6e 64 20 70 72 | 6f 67 72 61 6d 73 20 61 |t-end pr|ograms a|
|000013a0| 73 73 75 6d 65 20 74 68 | 61 74 20 74 68 65 20 76 |ssume th|at the v|
|000013b0| 65 6e 64 6f 72 2d 70 72 | 6f 76 69 64 65 64 0a 58 |endor-pr|ovided.X|
|000013c0| 64 61 65 6d 6f 6e 73 20 | 77 69 6c 6c 20 62 65 20 |daemons |will be |
|000013d0| 6d 6f 76 65 64 20 74 6f | 20 74 68 65 20 22 2f 75 |moved to| the "/u|
|000013e0| 73 72 2f 65 74 63 2f 2e | 2e 2e 22 20 64 69 72 65 |sr/etc/.|.." dire|
|000013f0| 63 74 6f 72 79 2e 20 20 | 49 66 20 79 6f 75 20 77 |ctory. |If you w|
|00001400| 61 6e 74 0a 58 73 6f 6d | 65 74 68 69 6e 67 20 65 |ant.Xsom|ething e|
|00001410| 6c 73 65 2c 20 61 64 6a | 75 73 74 20 74 68 65 20 |lse, adj|ust the |
|00001420| 52 45 41 4c 5f 44 41 45 | 4d 4f 4e 20 61 6e 64 20 |REAL_DAE|MON and |
|00001430| 74 68 65 20 52 45 41 4c | 5f 44 41 45 4d 4f 4e 5f |the REAL|_DAEMON_|
|00001440| 44 49 52 20 6d 61 63 72 | 6f 73 0a 58 69 6e 20 74 |DIR macr|os.Xin t|
|00001450| 68 65 20 66 69 6c 65 73 | 20 6d 69 73 63 64 2e 63 |he files| miscd.c|
|00001460| 20 61 6e 64 20 74 63 70 | 64 2e 63 2e 0a 58 0a 58 | and tcp|d.c..X.X|
|00001470| 42 79 20 64 65 66 61 75 | 6c 74 2c 20 63 6f 6e 6e |By defau|lt, conn|
|00001480| 65 63 74 69 6f 6e 73 20 | 61 72 65 20 6c 6f 67 67 |ections |are logg|
|00001490| 65 64 20 74 6f 20 74 68 | 65 20 73 61 6d 65 20 70 |ed to th|e same p|
|000014a0| 6c 61 63 65 20 77 68 65 | 72 65 20 74 68 65 20 73 |lace whe|re the s|
|000014b0| 65 6e 64 6d 61 69 6c 0a | 58 6c 6f 67 20 65 6e 74 |endmail.|Xlog ent|
|000014c0| 72 69 65 73 20 67 6f 2e | 20 20 49 66 20 63 6f 6e |ries go.| If con|
|000014d0| 6e 65 63 74 69 6f 6e 73 | 20 73 68 6f 75 6c 64 20 |nections| should |
|000014e0| 62 65 20 6c 6f 67 67 65 | 64 20 65 6c 73 65 77 68 |be logge|d elsewh|
|000014f0| 65 72 65 2c 20 61 64 6a | 75 73 74 20 74 68 65 0a |ere, adj|ust the.|
|00001500| 58 4c 4f 47 5f 4d 41 49 | 4c 20 6d 61 63 72 6f 20 |XLOG_MAI|L macro |
|00001510| 69 6e 20 74 68 65 20 6d | 69 73 63 64 2e 63 20 61 |in the m|iscd.c a|
|00001520| 6e 64 20 74 63 70 64 2e | 63 20 66 69 6c 65 73 2c |nd tcpd.|c files,|
|00001530| 20 61 6e 64 20 75 70 64 | 61 74 65 20 79 6f 75 72 | and upd|ate your|
|00001540| 20 69 6e 65 74 64 0a 58 | 63 6f 6e 66 69 67 75 72 | inetd.X|configur|
|00001550| 61 74 69 6f 6e 20 66 69 | 6c 65 20 28 75 73 75 61 |ation fi|le (usua|
|00001560| 6c 6c 79 2c 20 2f 65 74 | 63 2f 73 79 73 6c 6f 67 |lly, /et|c/syslog|
|00001570| 2e 63 6f 6e 66 29 2e 20 | 20 4d 6f 73 74 20 55 6c |.conf). | Most Ul|
|00001580| 74 72 69 78 20 76 65 72 | 73 69 6f 6e 73 20 0a 58 |trix ver|sions .X|
|00001590| 64 6f 20 6e 6f 74 20 70 | 72 6f 76 69 64 65 20 74 |do not p|rovide t|
|000015a0| 68 69 73 20 66 6c 65 78 | 69 62 69 6c 69 74 79 2c |his flex|ibility,|
|000015b0| 20 74 68 6f 75 67 68 2e | 0a 58 0a 58 42 79 20 64 | though.|.X.XBy d|
|000015c0| 65 66 61 75 6c 74 2c 20 | 74 68 65 20 66 72 6f 6e |efault, |the fron|
|000015d0| 74 2d 65 6e 64 20 70 72 | 6f 67 72 61 6d 73 20 73 |t-end pr|ograms s|
|000015e0| 75 70 70 6f 72 74 20 68 | 6f 73 74 20 61 63 63 65 |upport h|ost acce|
|000015f0| 73 73 20 63 6f 6e 74 72 | 6f 6c 2e 20 20 41 63 63 |ss contr|ol. Acc|
|00001600| 65 73 73 0a 58 63 6f 6e | 74 72 6f 6c 20 69 73 20 |ess.Xcon|trol is |
|00001610| 74 75 72 6e 65 64 20 6f | 66 66 20 77 68 65 6e 20 |turned o|ff when |
|00001620| 74 68 65 20 2f 65 74 63 | 2f 68 6f 73 74 73 2e 7b |the /etc|/hosts.{|
|00001630| 61 6c 6c 6f 77 2c 64 65 | 6e 79 7d 20 66 69 6c 65 |allow,de|ny} file|
|00001640| 73 20 64 6f 20 6e 6f 74 | 0a 58 65 78 69 73 74 2e |s do not|.Xexist.|
|00001650| 20 49 66 20 79 6f 75 20 | 64 6f 20 6e 6f 74 20 6e | If you |do not n|
|00001660| 65 65 64 20 73 75 70 70 | 6f 72 74 20 66 6f 72 20 |eed supp|ort for |
|00001670| 68 6f 73 74 20 61 63 63 | 65 73 73 20 63 6f 6e 74 |host acc|ess cont|
|00001680| 72 6f 6c 2c 20 61 64 6a | 75 73 74 20 74 68 65 0a |rol, adj|ust the.|
|00001690| 58 6d 61 6b 65 66 69 6c | 65 20 73 6f 20 74 68 61 |Xmakefil|e so tha|
|000016a0| 74 20 74 68 65 20 70 72 | 6f 67 72 61 6d 73 20 61 |t the pr|ograms a|
|000016b0| 72 65 20 63 6f 6d 70 69 | 6c 65 64 20 77 69 74 68 |re compi|led with|
|000016c0| 6f 75 74 20 2d 44 48 4f | 53 54 53 5f 41 43 43 45 |out -DHO|STS_ACCE|
|000016d0| 53 53 2e 20 4e 6f 74 65 | 3a 0a 58 68 6f 73 74 20 |SS. Note|:.Xhost |
|000016e0| 61 63 63 65 73 73 20 63 | 6f 6e 74 72 6f 6c 20 73 |access c|ontrol s|
|000016f0| 75 70 70 6f 72 74 20 72 | 65 71 75 69 72 65 73 20 |upport r|equires |
|00001700| 74 68 65 20 73 74 72 63 | 68 72 28 29 20 61 6e 64 |the strc|hr() and|
|00001710| 20 73 74 72 74 6f 6b 28 | 29 20 72 6f 75 74 69 6e | strtok(|) routin|
|00001720| 65 73 2e 0a 58 0a 58 49 | 66 20 79 6f 75 72 20 43 |es..X.XI|f your C|
|00001730| 20 6c 69 62 72 61 72 79 | 20 64 6f 65 73 20 6e 6f | library| does no|
|00001740| 74 20 70 72 6f 76 69 64 | 65 20 74 68 65 20 73 74 |t provid|e the st|
|00001750| 72 63 61 73 65 63 6d 70 | 28 29 20 72 6f 75 74 69 |rcasecmp|() routi|
|00001760| 6e 65 2c 20 61 64 6a 75 | 73 74 20 74 68 65 0a 58 |ne, adju|st the.X|
|00001770| 41 55 58 5f 4f 42 4a 20 | 6d 61 63 72 6f 20 69 6e |AUX_OBJ |macro in|
|00001780| 20 74 68 65 20 6d 61 6b | 65 66 69 6c 65 20 73 6f | the mak|efile so|
|00001790| 20 74 68 61 74 20 69 74 | 20 75 73 65 73 20 74 68 | that it| uses th|
|000017a0| 65 20 73 74 72 63 61 73 | 65 63 6d 70 28 29 20 76 |e strcas|ecmp() v|
|000017b0| 65 72 73 69 6f 6e 0a 58 | 70 72 6f 76 69 64 65 64 |ersion.X|provided|
|000017c0| 20 77 69 74 68 20 74 68 | 69 73 20 70 61 63 6b 61 | with th|is packa|
|000017d0| 67 65 2e 0a 58 0a 58 54 | 68 65 20 74 63 70 64 20 |ge..X.XT|he tcpd |
|000017e0| 70 72 6f 67 72 61 6d 20 | 69 73 20 69 6e 74 65 6e |program |is inten|
|000017f0| 64 65 64 20 66 6f 72 20 | 6d 6f 6e 69 74 6f 72 69 |ded for |monitori|
|00001800| 6e 67 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 73 20 74 |ng conne|ctions t|
|00001810| 6f 20 74 68 65 20 74 65 | 6c 6e 65 74 2c 0a 58 66 |o the te|lnet,.Xf|
|00001820| 69 6e 67 65 72 2c 20 66 | 74 70 2c 20 65 78 65 63 |inger, f|tp, exec|
|00001830| 2c 20 72 73 68 20 61 6e | 64 20 72 6c 6f 67 69 6e |, rsh an|d rlogin|
|00001840| 20 73 65 72 76 69 63 65 | 73 2e 20 44 65 63 69 64 | service|s. Decid|
|00001850| 65 20 77 68 69 63 68 20 | 73 65 72 76 69 63 65 73 |e which |services|
|00001860| 20 79 6f 75 0a 58 77 61 | 6e 74 20 74 6f 20 62 65 | you.Xwa|nt to be|
|00001870| 20 6d 6f 6e 69 74 6f 72 | 65 64 2c 20 6d 6f 76 65 | monitor|ed, move|
|00001880| 20 74 68 65 20 76 65 6e | 64 6f 72 2d 70 72 6f 76 | the ven|dor-prov|
|00001890| 69 64 65 64 20 64 61 65 | 6d 6f 6e 20 70 72 6f 67 |ided dae|mon prog|
|000018a0| 72 61 6d 73 20 74 6f 20 | 74 68 65 0a 58 6c 6f 63 |rams to |the.Xloc|
|000018b0| 61 74 69 6f 6e 20 73 70 | 65 63 69 66 69 65 64 20 |ation sp|ecified |
|000018c0| 62 79 20 74 68 65 20 52 | 45 41 4c 5f 44 41 45 4d |by the R|EAL_DAEM|
|000018d0| 4f 4e 5f 44 49 52 20 6d | 61 63 72 6f 20 69 6e 20 |ON_DIR m|acro in |
|000018e0| 74 68 65 20 66 69 6c 65 | 20 74 63 70 64 2e 63 2c |the file| tcpd.c,|
|000018f0| 20 61 6e 64 0a 58 63 6f | 70 79 20 74 68 65 20 74 | and.Xco|py the t|
|00001900| 63 70 64 20 66 72 6f 6e | 74 20 65 6e 64 20 74 6f |cpd fron|t end to|
|00001910| 20 74 68 65 20 6c 6f 63 | 61 74 69 6f 6e 73 20 77 | the loc|ations w|
|00001920| 68 65 72 65 20 74 68 65 | 20 76 65 6e 64 6f 72 2d |here the| vendor-|
|00001930| 70 72 6f 76 69 64 65 64 | 0a 58 64 61 65 6d 6f 6e |provided|.Xdaemon|
|00001940| 73 20 75 73 65 64 20 74 | 6f 20 62 65 2e 20 54 68 |s used t|o be. Th|
|00001950| 61 74 20 69 73 2c 20 6f | 6e 65 20 63 6f 70 79 20 |at is, o|ne copy |
|00001960| 6f 66 20 74 68 65 20 74 | 63 70 64 20 66 72 6f 6e |of the t|cpd fron|
|00001970| 74 20 65 6e 64 20 66 6f | 72 20 65 61 63 68 0a 58 |t end fo|r each.X|
|00001980| 73 65 72 76 69 63 65 20 | 74 68 61 74 20 79 6f 75 |service |that you|
|00001990| 20 77 61 6e 74 20 74 6f | 20 6d 6f 6e 69 74 6f 72 | want to| monitor|
|000019a0| 2e 0a 58 0a 58 55 6c 74 | 72 69 78 20 6f 6e 6c 79 |..X.XUlt|rix only|
|000019b0| 3a 20 69 66 20 79 6f 75 | 20 77 61 6e 74 20 74 6f |: if you| want to|
|000019c0| 20 6d 6f 6e 69 74 6f 72 | 20 63 6f 6e 6e 65 63 74 | monitor| connect|
|000019d0| 69 6f 6e 73 20 74 6f 20 | 74 68 65 20 53 59 53 54 |ions to |the SYST|
|000019e0| 41 54 20 73 65 72 76 69 | 63 65 2c 0a 58 6d 6f 76 |AT servi|ce,.Xmov|
|000019f0| 65 20 74 68 65 20 76 65 | 6e 64 6f 72 2d 70 72 6f |e the ve|ndor-pro|
|00001a00| 76 69 64 65 64 20 6d 69 | 73 63 64 20 64 61 65 6d |vided mi|scd daem|
|00001a10| 6f 6e 20 74 6f 20 74 68 | 65 20 6c 6f 63 61 74 69 |on to th|e locati|
|00001a20| 6f 6e 20 73 70 65 63 69 | 66 69 65 64 20 62 79 20 |on speci|fied by |
|00001a30| 74 68 65 0a 58 52 45 41 | 4c 5f 44 41 45 4d 4f 4e |the.XREA|L_DAEMON|
|00001a40| 20 6d 61 63 72 6f 20 69 | 6e 20 74 68 65 20 6d 69 | macro i|n the mi|
|00001a50| 73 63 64 2e 63 20 66 69 | 6c 65 2c 20 61 6e 64 20 |scd.c fi|le, and |
|00001a60| 69 6e 73 74 61 6c 6c 20 | 74 68 65 20 6d 69 73 63 |install |the misc|
|00001a70| 64 20 66 72 6f 6e 74 20 | 65 6e 64 0a 58 69 6e 74 |d front |end.Xint|
|00001a80| 6f 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 6d |o the or|iginal m|
|00001a90| 69 73 63 64 20 6c 6f 63 | 61 74 69 6f 6e 2e 0a 58 |iscd loc|ation..X|
|00001aa0| 0a 58 41 63 6b 6e 6f 77 | 6c 65 64 67 65 6d 65 6e |.XAcknow|ledgemen|
|00001ab0| 74 73 3a 0a 58 0a 58 54 | 68 61 6e 6b 73 20 74 6f |ts:.X.XT|hanks to|
|00001ac0| 20 42 72 65 6e 64 61 6e | 20 4b 65 68 6f 65 20 28 | Brendan| Kehoe (|
|00001ad0| 62 72 65 6e 64 61 6e 40 | 63 73 2e 77 69 64 65 6e |brendan@|cs.widen|
|00001ae0| 65 72 2e 65 64 75 29 2c | 20 48 65 69 6d 69 72 20 |er.edu),| Heimir |
|00001af0| 53 76 65 72 72 69 73 73 | 6f 6e 0a 58 28 68 65 69 |Sverriss|on.X(hei|
|00001b00| 6d 69 72 40 68 61 66 72 | 6f 2e 69 73 29 20 61 6e |mir@hafr|o.is) an|
|00001b10| 64 20 44 61 6e 20 42 65 | 72 6e 73 74 65 69 6e 20 |d Dan Be|rnstein |
|00001b20| 28 62 72 6e 73 74 6e 64 | 40 6b 72 61 6d 64 65 6e |(brnstnd|@kramden|
|00001b30| 2e 61 63 66 2e 6e 79 75 | 2e 65 64 75 29 20 66 6f |.acf.nyu|.edu) fo|
|00001b40| 72 0a 58 66 65 65 64 62 | 61 63 6b 20 6f 6e 20 61 |r.Xfeedb|ack on a|
|00001b50| 6e 20 65 61 72 6c 69 65 | 72 20 72 65 6c 65 61 73 |n earlie|r releas|
|00001b60| 65 20 6f 66 20 74 68 69 | 73 20 70 72 6f 64 75 63 |e of thi|s produc|
|00001b70| 74 2e 0a 58 0a 58 09 57 | 69 65 74 73 65 20 56 65 |t..X.X.W|ietse Ve|
|00001b80| 6e 65 6d 61 2c 0a 58 09 | 4d 61 74 68 65 6d 61 74 |nema,.X.|Mathemat|
|00001b90| 69 63 73 20 61 6e 64 20 | 43 6f 6d 70 75 74 69 6e |ics and |Computin|
|00001ba0| 67 20 53 63 69 65 6e 63 | 65 2c 0a 58 09 45 69 6e |g Scienc|e,.X.Ein|
|00001bb0| 64 68 6f 76 65 6e 20 55 | 6e 69 76 65 72 73 69 74 |dhoven U|niversit|
|00001bc0| 79 20 6f 66 20 54 65 63 | 68 6e 6f 6c 6f 67 79 2c |y of Tec|hnology,|
|00001bd0| 0a 58 09 54 68 65 20 4e | 65 74 68 65 72 6c 61 6e |.X.The N|etherlan|
|00001be0| 64 73 2e 0a 45 4e 44 5f | 4f 46 5f 52 45 41 44 4d |ds..END_|OF_READM|
|00001bf0| 45 0a 69 66 20 74 65 73 | 74 20 34 37 37 39 20 2d |E.if tes|t 4779 -|
|00001c00| 6e 65 20 60 77 63 20 2d | 63 20 3c 52 45 41 44 4d |ne `wc -|c <READM|
|00001c10| 45 60 3b 20 74 68 65 6e | 0a 20 20 20 20 65 63 68 |E`; then|. ech|
|00001c20| 6f 20 73 68 61 72 3a 20 | 5c 22 52 45 41 44 4d 45 |o shar: |\"README|
|00001c30| 5c 22 20 75 6e 70 61 63 | 6b 65 64 20 77 69 74 68 |\" unpac|ked with|
|00001c40| 20 77 72 6f 6e 67 20 73 | 69 7a 65 21 0a 66 69 0a | wrong s|ize!.fi.|
|00001c50| 23 20 65 6e 64 20 6f 66 | 20 6f 76 65 72 77 72 69 |# end of| overwri|
|00001c60| 74 69 6e 67 20 63 68 65 | 63 6b 0a 66 69 0a 69 66 |ting che|ck.fi.if|
|00001c70| 20 74 65 73 74 20 2d 66 | 20 6d 69 73 63 64 2e 63 | test -f| miscd.c|
|00001c80| 20 2d 61 20 22 24 7b 31 | 7d 22 20 21 3d 20 22 2d | -a "${1|}" != "-|
|00001c90| 63 22 20 3b 20 74 68 65 | 6e 20 0a 20 20 65 63 68 |c" ; the|n . ech|
|00001ca0| 6f 20 73 68 61 72 3a 20 | 57 69 6c 6c 20 6e 6f 74 |o shar: |Will not|
|00001cb0| 20 6f 76 65 72 2d 77 72 | 69 74 65 20 65 78 69 73 | over-wr|ite exis|
|00001cc0| 74 69 6e 67 20 66 69 6c | 65 20 5c 22 6d 69 73 63 |ting fil|e \"misc|
|00001cd0| 64 2e 63 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |d.c\".el|se.echo |
|00001ce0| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00001cf0| 20 5c 22 6d 69 73 63 64 | 2e 63 5c 22 20 5c 28 31 | \"miscd|.c\" \(1|
|00001d00| 37 30 39 20 63 68 61 72 | 61 63 74 65 72 73 5c 29 |709 char|acters\)|
|00001d10| 0a 73 65 64 20 22 73 2f | 5e 58 2f 2f 22 20 3e 6d |.sed "s/|^X//" >m|
|00001d20| 69 73 63 64 2e 63 20 3c | 3c 27 45 4e 44 5f 4f 46 |iscd.c <|<'END_OF|
|00001d30| 5f 6d 69 73 63 64 2e 63 | 27 0a 58 20 2f 2a 0a 58 |_miscd.c|'.X /*.X|
|00001d40| 20 20 2a 20 46 72 6f 6e | 74 20 65 6e 64 20 74 6f | * Fron|t end to|
|00001d50| 20 74 68 65 20 55 4c 54 | 52 49 58 20 6d 69 73 63 | the ULT|RIX misc|
|00001d60| 64 20 73 65 72 76 69 63 | 65 2e 20 54 68 65 20 66 |d servic|e. The f|
|00001d70| 72 6f 6e 74 20 65 6e 64 | 20 6c 6f 67 73 20 74 68 |ront end| logs th|
|00001d80| 65 20 72 65 6d 6f 74 65 | 20 68 6f 73 74 0a 58 20 |e remote| host.X |
|00001d90| 20 2a 20 6e 61 6d 65 20 | 61 6e 64 20 74 68 65 6e | * name |and then|
|00001da0| 20 69 6e 76 6f 6b 65 73 | 20 74 68 65 20 72 65 61 | invokes| the rea|
|00001db0| 6c 20 6d 69 73 63 64 20 | 64 61 65 6d 6f 6e 2e 20 |l miscd |daemon. |
|00001dc0| 49 6e 73 74 61 6c 6c 20 | 61 73 20 22 2f 75 73 72 |Install |as "/usr|
|00001dd0| 2f 65 74 63 2f 6d 69 73 | 63 64 22 2c 0a 58 20 20 |/etc/mis|cd",.X |
|00001de0| 2a 20 61 66 74 65 72 20 | 6d 6f 76 69 6e 67 20 74 |* after |moving t|
|00001df0| 68 65 20 72 65 61 6c 20 | 6d 69 73 63 64 20 64 61 |he real |miscd da|
|00001e00| 65 6d 6f 6e 20 74 6f 20 | 74 68 65 20 22 2f 75 73 |emon to |the "/us|
|00001e10| 72 2f 65 74 63 2f 2e 2e | 2e 22 20 64 69 72 65 63 |r/etc/..|." direc|
|00001e20| 74 6f 72 79 2e 0a 58 20 | 20 2a 20 43 6f 6e 6e 65 |tory..X | * Conne|
|00001e30| 63 74 69 6f 6e 73 20 61 | 6e 64 20 64 69 61 67 6e |ctions a|nd diagn|
|00001e40| 6f 73 74 69 63 73 20 61 | 72 65 20 6c 6f 67 67 65 |ostics a|re logge|
|00001e50| 64 20 74 68 72 6f 75 67 | 68 20 73 79 73 6c 6f 67 |d throug|h syslog|
|00001e60| 28 33 29 2e 0a 58 20 20 | 2a 20 0a 58 20 20 2a 20 |(3)..X |* .X * |
|00001e70| 54 68 65 20 55 6c 74 72 | 69 78 20 6d 69 73 63 64 |The Ultr|ix miscd|
|00001e80| 20 70 72 6f 67 72 61 6d | 20 69 6d 70 6c 65 6d 65 | program| impleme|
|00001e90| 6e 74 73 20 74 68 65 20 | 73 79 73 74 61 74 20 73 |nts the |systat s|
|00001ea0| 65 72 76 69 63 65 2c 20 | 77 68 69 63 68 20 70 69 |ervice, |which pi|
|00001eb0| 70 65 73 20 74 68 65 0a | 58 20 20 2a 20 6f 75 74 |pes the.|X * out|
|00001ec0| 70 75 74 20 66 72 6f 6d | 20 77 68 6f 28 31 29 20 |put from| who(1) |
|00001ed0| 74 6f 20 73 74 64 6f 75 | 74 2e 20 54 68 69 73 20 |to stdou|t. This |
|00001ee0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 69 73 20 70 |informat|ion is p|
|00001ef0| 6f 74 65 6e 74 69 61 6c | 6c 79 20 75 73 65 66 75 |otential|ly usefu|
|00001f00| 6c 20 74 6f 0a 58 20 20 | 2a 20 73 79 73 74 65 6d |l to.X |* system|
|00001f10| 73 20 63 72 61 63 6b 65 | 72 73 2e 0a 58 20 20 2a |s cracke|rs..X *|
|00001f20| 20 0a 58 20 20 2a 20 43 | 6f 6d 70 69 6c 65 20 77 | .X * C|ompile w|
|00001f30| 69 74 68 20 2d 44 48 4f | 53 54 53 5f 41 43 43 45 |ith -DHO|STS_ACCE|
|00001f40| 53 53 20 69 6e 20 6f 72 | 64 65 72 20 74 6f 20 65 |SS in or|der to e|
|00001f50| 6e 61 62 6c 65 20 61 63 | 63 65 73 73 20 63 6f 6e |nable ac|cess con|
|00001f60| 74 72 6f 6c 2e 20 53 65 | 65 20 74 68 65 0a 58 20 |trol. Se|e the.X |
|00001f70| 20 2a 20 68 6f 73 74 73 | 5f 61 63 63 65 73 73 28 | * hosts|_access(|
|00001f80| 35 29 20 6d 61 6e 75 61 | 6c 20 70 61 67 65 20 66 |5) manua|l page f|
|00001f90| 6f 72 20 64 65 74 61 69 | 6c 73 2e 0a 58 20 20 2a |or detai|ls..X *|
|00001fa0| 20 0a 58 20 20 2a 20 41 | 75 74 68 6f 72 3a 20 57 | .X * A|uthor: W|
|00001fb0| 69 65 74 73 65 20 56 65 | 6e 65 6d 61 2c 20 45 69 |ietse Ve|nema, Ei|
|00001fc0| 6e 64 68 6f 76 65 6e 20 | 55 6e 69 76 65 72 73 69 |ndhoven |Universi|
|00001fd0| 74 79 20 6f 66 20 54 65 | 63 68 6e 6f 6c 6f 67 79 |ty of Te|chnology|
|00001fe0| 2c 20 54 68 65 20 4e 65 | 74 68 65 72 6c 61 6e 64 |, The Ne|therland|
|00001ff0| 73 2e 0a 58 20 20 2a 2f | 0a 58 0a 58 23 69 66 6e |s..X */|.X.X#ifn|
|00002000| 64 65 66 20 6c 69 6e 74 | 0a 58 73 74 61 74 69 63 |def lint|.Xstatic|
|00002010| 20 63 68 61 72 20 73 63 | 63 73 69 64 5b 5d 20 3d | char sc|csid[] =|
|00002020| 20 22 40 28 23 29 20 6d | 69 73 63 64 2e 63 20 31 | "@(#) m|iscd.c 1|
|00002030| 2e 31 20 39 31 2f 30 31 | 2f 30 36 20 32 32 3a 33 |.1 91/01|/06 22:3|
|00002040| 30 3a 33 32 22 3b 0a 58 | 23 65 6e 64 69 66 0a 58 |0:32";.X|#endif.X|
|00002050| 0a 58 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 64 69 |.X#inclu|de <stdi|
|00002060| 6f 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |o.h>.X#i|nclude <|
|00002070| 73 79 73 6c 6f 67 2e 68 | 3e 0a 58 0a 58 2f 2a 20 |syslog.h|>.X.X/* |
|00002080| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 73 70 |The foll|owing sp|
|00002090| 65 63 69 66 69 65 73 20 | 77 68 65 72 65 20 74 68 |ecifies |where th|
|000020a0| 65 20 76 65 6e 64 6f 72 | 2d 70 72 6f 76 69 64 65 |e vendor|-provide|
|000020b0| 64 20 64 61 65 6d 6f 6e | 20 73 68 6f 75 6c 64 20 |d daemon| should |
|000020c0| 67 6f 2e 20 2a 2f 0a 58 | 0a 58 23 64 65 66 69 6e |go. */.X|.X#defin|
|000020d0| 65 20 52 45 41 4c 5f 44 | 41 45 4d 4f 4e 09 22 2f |e REAL_D|AEMON."/|
|000020e0| 75 73 72 2f 65 74 63 2f | 2e 2e 2e 2f 6d 69 73 63 |usr/etc/|.../misc|
|000020f0| 64 22 0a 58 0a 58 6d 61 | 69 6e 28 61 72 67 63 2c |d".X.Xma|in(argc,|
|00002100| 20 61 72 67 76 29 0a 58 | 69 6e 74 20 20 20 20 20 | argv).X|int |
|00002110| 61 72 67 63 3b 0a 58 63 | 68 61 72 20 20 2a 2a 61 |argc;.Xc|har **a|
|00002120| 72 67 76 3b 0a 58 7b 0a | 58 20 20 20 20 63 68 61 |rgv;.X{.|X cha|
|00002130| 72 20 20 20 2a 66 72 6f | 6d 68 6f 73 74 28 29 3b |r *fro|mhost();|
|00002140| 0a 58 20 20 20 20 63 68 | 61 72 20 20 20 2a 68 6f |.X ch|ar *ho|
|00002150| 73 74 5f 6e 61 6d 65 3b | 0a 58 0a 58 20 20 20 20 |st_name;|.X.X |
|00002160| 2f 2a 0a 58 20 20 20 20 | 20 2a 20 4f 70 65 6e 20 |/*.X | * Open |
|00002170| 61 20 63 68 61 6e 6e 65 | 6c 20 74 6f 20 74 68 65 |a channe|l to the|
|00002180| 20 73 79 73 6c 6f 67 20 | 64 61 65 6d 6f 6e 2e 20 | syslog |daemon. |
|00002190| 4f 6c 64 65 72 20 76 65 | 72 73 69 6f 6e 73 20 6f |Older ve|rsions o|
|000021a0| 66 20 6f 70 65 6e 6c 6f | 67 28 29 0a 58 20 20 20 |f openlo|g().X |
|000021b0| 20 20 2a 20 72 65 71 75 | 69 72 65 20 6f 6e 6c 79 | * requ|ire only|
|000021c0| 20 74 77 6f 20 61 72 67 | 75 6d 65 6e 74 73 2e 0a | two arg|uments..|
|000021d0| 58 20 20 20 20 20 2a 2f | 0a 58 0a 58 23 69 66 64 |X */|.X.X#ifd|
|000021e0| 65 66 20 4c 4f 47 5f 4d | 41 49 4c 0a 58 20 20 20 |ef LOG_M|AIL.X |
|000021f0| 20 28 76 6f 69 64 29 20 | 6f 70 65 6e 6c 6f 67 28 | (void) |openlog(|
|00002200| 61 72 67 76 5b 30 5d 2c | 20 4c 4f 47 5f 50 49 44 |argv[0],| LOG_PID|
|00002210| 2c 20 4c 4f 47 5f 4d 41 | 49 4c 29 3b 0a 58 23 65 |, LOG_MA|IL);.X#e|
|00002220| 6c 73 65 0a 58 20 20 20 | 20 28 76 6f 69 64 29 20 |lse.X | (void) |
|00002230| 6f 70 65 6e 6c 6f 67 28 | 61 72 67 76 5b 30 5d 2c |openlog(|argv[0],|
|00002240| 20 4c 4f 47 5f 50 49 44 | 29 3b 0a 58 23 65 6e 64 | LOG_PID|);.X#end|
|00002250| 69 66 0a 58 0a 58 20 20 | 20 20 2f 2a 20 46 69 6e |if.X.X | /* Fin|
|00002260| 64 20 6f 75 74 20 61 6e | 64 20 72 65 70 6f 72 74 |d out an|d report|
|00002270| 20 74 68 65 20 72 65 6d | 6f 74 65 20 68 6f 73 74 | the rem|ote host|
|00002280| 20 6e 61 6d 65 2e 20 2a | 2f 0a 58 0a 58 20 20 20 | name. *|/.X.X |
|00002290| 20 69 66 20 28 28 68 6f | 73 74 5f 6e 61 6d 65 20 | if ((ho|st_name |
|000022a0| 3d 20 66 72 6f 6d 68 6f | 73 74 28 29 29 20 3d 3d |= fromho|st()) ==|
|000022b0| 20 30 29 0a 58 09 68 6f | 73 74 5f 6e 61 6d 65 20 | 0).X.ho|st_name |
|000022c0| 3d 20 22 75 6e 6b 6e 6f | 77 6e 22 3b 0a 58 20 20 |= "unkno|wn";.X |
|000022d0| 20 20 73 79 73 6c 6f 67 | 28 4c 4f 47 5f 49 4e 46 | syslog|(LOG_INF|
|000022e0| 4f 2c 20 22 63 6f 6e 6e | 65 63 74 20 66 72 6f 6d |O, "conn|ect from|
|000022f0| 20 25 73 22 2c 20 68 6f | 73 74 5f 6e 61 6d 65 29 | %s", ho|st_name)|
|00002300| 3b 0a 58 0a 58 20 20 20 | 20 2f 2a 20 43 68 65 63 |;.X.X | /* Chec|
|00002310| 6b 20 77 68 65 74 68 65 | 72 20 74 68 69 73 20 68 |k whethe|r this h|
|00002320| 6f 73 74 20 63 61 6e 20 | 61 63 63 65 73 73 20 74 |ost can |access t|
|00002330| 68 65 20 73 65 72 76 69 | 63 65 20 69 6e 20 61 72 |he servi|ce in ar|
|00002340| 67 76 5b 30 5d 2e 20 2a | 2f 0a 58 0a 58 23 69 66 |gv[0]. *|/.X.X#if|
|00002350| 64 65 66 20 48 4f 53 54 | 53 5f 41 43 43 45 53 53 |def HOST|S_ACCESS|
|00002360| 0a 58 20 20 20 20 68 6f | 73 74 73 5f 61 63 63 65 |.X ho|sts_acce|
|00002370| 73 73 28 61 72 67 76 5b | 30 5d 2c 20 68 6f 73 74 |ss(argv[|0], host|
|00002380| 5f 6e 61 6d 65 29 3b 0a | 58 23 65 6e 64 69 66 0a |_name);.|X#endif.|
|00002390| 58 0a 58 20 20 20 20 2f | 2a 20 49 6e 76 6f 6b 65 |X.X /|* Invoke|
|000023a0| 20 74 68 65 20 72 65 61 | 6c 20 64 61 65 6d 6f 6e | the rea|l daemon|
|000023b0| 20 70 72 6f 67 72 61 6d | 2e 20 2a 2f 0a 58 0a 58 | program|. */.X.X|
|000023c0| 20 20 20 20 28 76 6f 69 | 64 29 20 65 78 65 63 76 | (voi|d) execv|
|000023d0| 28 52 45 41 4c 5f 44 41 | 45 4d 4f 4e 2c 20 61 72 |(REAL_DA|EMON, ar|
|000023e0| 67 76 29 3b 0a 58 20 20 | 20 20 73 79 73 6c 6f 67 |gv);.X | syslog|
|000023f0| 28 4c 4f 47 5f 45 52 52 | 2c 20 22 25 73 3a 20 25 |(LOG_ERR|, "%s: %|
|00002400| 6d 22 2c 20 52 45 41 4c | 5f 44 41 45 4d 4f 4e 29 |m", REAL|_DAEMON)|
|00002410| 3b 0a 58 20 20 20 20 72 | 65 74 75 72 6e 20 28 31 |;.X r|eturn (1|
|00002420| 29 3b 0a 58 7d 0a 45 4e | 44 5f 4f 46 5f 6d 69 73 |);.X}.EN|D_OF_mis|
|00002430| 63 64 2e 63 0a 69 66 20 | 74 65 73 74 20 31 37 30 |cd.c.if |test 170|
|00002440| 39 20 2d 6e 65 20 60 77 | 63 20 2d 63 20 3c 6d 69 |9 -ne `w|c -c <mi|
|00002450| 73 63 64 2e 63 60 3b 20 | 74 68 65 6e 0a 20 20 20 |scd.c`; |then. |
|00002460| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 6d 69 | echo sh|ar: \"mi|
|00002470| 73 63 64 2e 63 5c 22 20 | 75 6e 70 61 63 6b 65 64 |scd.c\" |unpacked|
|00002480| 20 77 69 74 68 20 77 72 | 6f 6e 67 20 73 69 7a 65 | with wr|ong size|
|00002490| 21 0a 66 69 0a 23 20 65 | 6e 64 20 6f 66 20 6f 76 |!.fi.# e|nd of ov|
|000024a0| 65 72 77 72 69 74 69 6e | 67 20 63 68 65 63 6b 0a |erwritin|g check.|
|000024b0| 66 69 0a 69 66 20 74 65 | 73 74 20 2d 66 20 74 63 |fi.if te|st -f tc|
|000024c0| 70 64 2e 63 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |pd.c -a |"${1}" !|
|000024d0| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|000024e0| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|000024f0| 20 6e 6f 74 20 6f 76 65 | 72 2d 77 72 69 74 65 20 | not ove|r-write |
|00002500| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 5c 22 |existing| file \"|
|00002510| 74 63 70 64 2e 63 5c 22 | 0a 65 6c 73 65 0a 65 63 |tcpd.c\"|.else.ec|
|00002520| 68 6f 20 73 68 61 72 3a | 20 45 78 74 72 61 63 74 |ho shar:| Extract|
|00002530| 69 6e 67 20 5c 22 74 63 | 70 64 2e 63 5c 22 20 5c |ing \"tc|pd.c\" \|
|00002540| 28 31 38 37 33 20 63 68 | 61 72 61 63 74 65 72 73 |(1873 ch|aracters|
|00002550| 5c 29 0a 73 65 64 20 22 | 73 2f 5e 58 2f 2f 22 20 |\).sed "|s/^X//" |
|00002560| 3e 74 63 70 64 2e 63 20 | 3c 3c 27 45 4e 44 5f 4f |>tcpd.c |<<'END_O|
|00002570| 46 5f 74 63 70 64 2e 63 | 27 0a 58 20 2f 2a 0a 58 |F_tcpd.c|'.X /*.X|
|00002580| 20 20 2a 20 47 65 6e 65 | 72 61 6c 20 66 72 6f 6e | * Gene|ral fron|
|00002590| 74 20 65 6e 64 20 66 6f | 72 20 63 6f 6e 6e 65 63 |t end fo|r connec|
|000025a0| 74 69 6f 6e 2d 6f 72 69 | 65 6e 74 65 64 20 74 63 |tion-ori|ented tc|
|000025b0| 70 2f 69 70 20 73 65 72 | 76 69 63 65 73 2e 20 54 |p/ip ser|vices. T|
|000025c0| 68 69 73 20 70 72 6f 67 | 72 61 6d 0a 58 20 20 2a |his prog|ram.X *|
|000025d0| 20 6c 6f 67 73 20 74 68 | 65 20 72 65 6d 6f 74 65 | logs th|e remote|
|000025e0| 20 68 6f 73 74 20 6e 61 | 6d 65 20 61 6e 64 20 74 | host na|me and t|
|000025f0| 68 65 6e 20 69 6e 76 6f | 6b 65 73 20 74 68 65 20 |hen invo|kes the |
|00002600| 72 65 61 6c 20 64 61 65 | 6d 6f 6e 2e 20 46 6f 72 |real dae|mon. For|
|00002610| 20 65 78 61 6d 70 6c 65 | 2c 0a 58 20 20 2a 20 69 | example|,.X * i|
|00002620| 6e 73 74 61 6c 6c 20 61 | 73 20 2f 75 73 72 2f 65 |nstall a|s /usr/e|
|00002630| 74 63 2f 7b 66 69 6e 67 | 65 72 64 2c 74 65 6c 6e |tc/{fing|erd,teln|
|00002640| 65 74 64 2c 66 74 70 64 | 2c 72 6c 6f 67 69 6e 64 |etd,ftpd|,rlogind|
|00002650| 2c 72 73 68 64 2c 72 65 | 78 65 63 64 7d 2c 20 61 |,rshd,re|xecd}, a|
|00002660| 66 74 65 72 0a 58 20 20 | 2a 20 73 61 76 69 6e 67 |fter.X |* saving|
|00002670| 20 74 68 65 20 72 65 61 | 6c 20 64 61 65 6d 6f 6e | the rea|l daemon|
|00002680| 73 20 69 6e 20 74 68 65 | 20 64 69 72 65 63 74 6f |s in the| directo|
|00002690| 72 79 20 22 2f 75 73 72 | 2f 65 74 63 2f 2e 2e 2e |ry "/usr|/etc/...|
|000026a0| 22 2e 20 54 68 69 73 20 | 61 72 72 61 6e 67 65 6d |". This |arrangem|
|000026b0| 65 6e 74 0a 58 20 20 2a | 20 72 65 71 75 69 72 65 |ent.X *| require|
|000026c0| 73 20 74 68 61 74 20 74 | 68 65 20 6e 65 74 77 6f |s that t|he netwo|
|000026d0| 72 6b 20 64 61 65 6d 6f | 6e 73 20 61 72 65 20 73 |rk daemo|ns are s|
|000026e0| 74 61 72 74 65 64 20 62 | 79 20 69 6e 65 74 64 20 |tarted b|y inetd |
|000026f0| 6f 72 20 73 6f 6d 65 74 | 68 69 6e 67 0a 58 20 20 |or somet|hing.X |
|00002700| 2a 20 73 69 6d 69 6c 61 | 72 2e 20 43 6f 6e 6e 65 |* simila|r. Conne|
|00002710| 63 74 69 6f 6e 73 20 61 | 6e 64 20 64 69 61 67 6e |ctions a|nd diagn|
|00002720| 6f 73 74 69 63 73 20 61 | 72 65 20 6c 6f 67 67 65 |ostics a|re logge|
|00002730| 64 20 74 68 72 6f 75 67 | 68 20 73 79 73 6c 6f 67 |d throug|h syslog|
|00002740| 28 33 29 2e 0a 58 20 20 | 2a 20 0a 58 20 20 2a 20 |(3)..X |* .X * |
|00002750| 43 6f 6d 70 69 6c 65 20 | 77 69 74 68 20 2d 44 48 |Compile |with -DH|
|00002760| 4f 53 54 53 5f 41 43 43 | 45 53 53 20 69 6e 20 6f |OSTS_ACC|ESS in o|
|00002770| 72 64 65 72 20 74 6f 20 | 65 6e 61 62 6c 65 20 61 |rder to |enable a|
|00002780| 63 63 65 73 73 20 63 6f | 6e 74 72 6f 6c 2e 20 53 |ccess co|ntrol. S|
|00002790| 65 65 20 74 68 65 0a 58 | 20 20 2a 20 68 6f 73 74 |ee the.X| * host|
|000027a0| 73 5f 61 63 63 65 73 73 | 28 35 29 20 6d 61 6e 75 |s_access|(5) manu|
|000027b0| 61 6c 20 70 61 67 65 20 | 66 6f 72 20 64 65 74 61 |al page |for deta|
|000027c0| 69 6c 73 2e 0a 58 20 20 | 2a 20 0a 58 20 20 2a 20 |ils..X |* .X * |
|000027d0| 41 75 74 68 6f 72 3a 20 | 57 69 65 74 73 65 20 56 |Author: |Wietse V|
|000027e0| 65 6e 65 6d 61 2c 20 45 | 69 6e 64 68 6f 76 65 6e |enema, E|indhoven|
|000027f0| 20 55 6e 69 76 65 72 73 | 69 74 79 20 6f 66 20 54 | Univers|ity of T|
|00002800| 65 63 68 6e 6f 6c 6f 67 | 79 2c 20 54 68 65 20 4e |echnolog|y, The N|
|00002810| 65 74 68 65 72 6c 61 6e | 64 73 2e 0a 58 20 20 2a |etherlan|ds..X *|
|00002820| 2f 0a 58 0a 58 23 69 66 | 6e 64 65 66 20 6c 69 6e |/.X.X#if|ndef lin|
|00002830| 74 0a 58 73 74 61 74 69 | 63 20 63 68 61 72 20 73 |t.Xstati|c char s|
|00002840| 63 63 73 69 64 5b 5d 20 | 3d 20 22 40 28 23 29 20 |ccsid[] |= "@(#) |
|00002850| 74 63 70 64 2e 63 20 31 | 2e 31 20 39 31 2f 30 31 |tcpd.c 1|.1 91/01|
|00002860| 2f 30 36 20 32 32 3a 33 | 30 3a 33 36 22 3b 0a 58 |/06 22:3|0:36";.X|
|00002870| 23 65 6e 64 69 66 0a 58 | 0a 58 23 69 6e 63 6c 75 |#endif.X|.X#inclu|
|00002880| 64 65 20 3c 73 74 64 69 | 6f 2e 68 3e 0a 58 23 69 |de <stdi|o.h>.X#i|
|00002890| 6e 63 6c 75 64 65 20 3c | 73 79 73 6c 6f 67 2e 68 |nclude <|syslog.h|
|000028a0| 3e 0a 58 23 69 6e 63 6c | 75 64 65 20 3c 73 79 73 |>.X#incl|ude <sys|
|000028b0| 2f 74 79 70 65 73 2e 68 | 3e 0a 58 23 69 6e 63 6c |/types.h|>.X#incl|
|000028c0| 75 64 65 20 3c 73 79 73 | 2f 70 61 72 61 6d 2e 68 |ude <sys|/param.h|
|000028d0| 3e 0a 58 23 69 66 6e 64 | 65 66 20 4d 41 58 50 41 |>.X#ifnd|ef MAXPA|
|000028e0| 54 48 4e 41 4d 45 4c 45 | 4e 0a 58 23 64 65 66 69 |THNAMELE|N.X#defi|
|000028f0| 6e 65 20 4d 41 58 50 41 | 54 48 4e 41 4d 45 4c 45 |ne MAXPA|THNAMELE|
|00002900| 4e 09 42 55 46 53 49 5a | 0a 58 23 65 6e 64 69 66 |N.BUFSIZ|.X#endif|
|00002910| 0a 58 0a 58 2f 2a 20 54 | 68 65 20 66 6f 6c 6c 6f |.X.X/* T|he follo|
|00002920| 77 69 6e 67 20 73 70 65 | 63 69 66 69 65 73 20 77 |wing spe|cifies w|
|00002930| 68 65 72 65 20 74 68 65 | 20 76 65 6e 64 6f 72 2d |here the| vendor-|
|00002940| 70 72 6f 76 69 64 65 64 | 20 64 61 65 6d 6f 6e 73 |provided| daemons|
|00002950| 20 73 68 6f 75 6c 64 20 | 67 6f 2e 20 2a 2f 0a 58 | should |go. */.X|
|00002960| 0a 58 23 64 65 66 69 6e | 65 20 52 45 41 4c 5f 44 |.X#defin|e REAL_D|
|00002970| 41 45 4d 4f 4e 5f 44 49 | 52 09 22 2f 75 73 72 2f |AEMON_DI|R."/usr/|
|00002980| 65 74 63 2f 2e 2e 2e 22 | 0a 58 0a 58 6d 61 69 6e |etc/..."|.X.Xmain|
|00002990| 28 61 72 67 63 2c 20 61 | 72 67 76 29 0a 58 69 6e |(argc, a|rgv).Xin|
|000029a0| 74 20 20 20 20 20 61 72 | 67 63 3b 0a 58 63 68 61 |t ar|gc;.Xcha|
|000029b0| 72 20 20 2a 2a 61 72 67 | 76 3b 0a 58 7b 0a 58 20 |r **arg|v;.X{.X |
|000029c0| 20 20 20 63 68 61 72 20 | 20 20 2a 66 72 6f 6d 68 | char | *fromh|
|000029d0| 6f 73 74 28 29 3b 0a 58 | 20 20 20 20 63 68 61 72 |ost();.X| char|
|000029e0| 20 20 20 2a 68 6f 73 74 | 5f 6e 61 6d 65 3b 0a 58 | *host|_name;.X|
|000029f0| 20 20 20 20 63 68 61 72 | 20 20 20 20 70 61 74 68 | char| path|
|00002a00| 5b 4d 41 58 50 41 54 48 | 4e 41 4d 45 4c 45 4e 5d |[MAXPATH|NAMELEN]|
|00002a10| 3b 0a 58 0a 58 20 20 20 | 20 2f 2a 0a 58 20 20 20 |;.X.X | /*.X |
|00002a20| 20 20 2a 20 4f 70 65 6e | 20 61 20 63 68 61 6e 6e | * Open| a chann|
|00002a30| 65 6c 20 74 6f 20 74 68 | 65 20 73 79 73 6c 6f 67 |el to th|e syslog|
|00002a40| 20 64 61 65 6d 6f 6e 2e | 20 4f 6c 64 65 72 20 76 | daemon.| Older v|
|00002a50| 65 72 73 69 6f 6e 73 20 | 6f 66 20 6f 70 65 6e 6c |ersions |of openl|
|00002a60| 6f 67 28 29 0a 58 20 20 | 20 20 20 2a 20 72 65 71 |og().X | * req|
|00002a70| 75 69 72 65 20 6f 6e 6c | 79 20 74 77 6f 20 61 72 |uire onl|y two ar|
|00002a80| 67 75 6d 65 6e 74 73 2e | 0a 58 20 20 20 20 20 2a |guments.|.X *|
|00002a90| 2f 0a 58 0a 58 23 69 66 | 64 65 66 20 4c 4f 47 5f |/.X.X#if|def LOG_|
|00002aa0| 4d 41 49 4c 0a 58 20 20 | 20 20 28 76 6f 69 64 29 |MAIL.X | (void)|
|00002ab0| 20 6f 70 65 6e 6c 6f 67 | 28 61 72 67 76 5b 30 5d | openlog|(argv[0]|
|00002ac0| 2c 20 4c 4f 47 5f 50 49 | 44 2c 20 4c 4f 47 5f 4d |, LOG_PI|D, LOG_M|
|00002ad0| 41 49 4c 29 3b 0a 58 23 | 65 6c 73 65 0a 58 20 20 |AIL);.X#|else.X |
|00002ae0| 20 20 28 76 6f 69 64 29 | 20 6f 70 65 6e 6c 6f 67 | (void)| openlog|
|00002af0| 28 61 72 67 76 5b 30 5d | 2c 20 4c 4f 47 5f 50 49 |(argv[0]|, LOG_PI|
|00002b00| 44 29 3b 0a 58 23 65 6e | 64 69 66 0a 58 0a 58 20 |D);.X#en|dif.X.X |
|00002b10| 20 20 20 2f 2a 20 46 69 | 6e 64 20 6f 75 74 20 61 | /* Fi|nd out a|
|00002b20| 6e 64 20 72 65 70 6f 72 | 74 20 74 68 65 20 72 65 |nd repor|t the re|
|00002b30| 6d 6f 74 65 20 68 6f 73 | 74 20 6e 61 6d 65 2e 20 |mote hos|t name. |
|00002b40| 2a 2f 0a 58 0a 58 20 20 | 20 20 69 66 20 28 28 68 |*/.X.X | if ((h|
|00002b50| 6f 73 74 5f 6e 61 6d 65 | 20 3d 20 66 72 6f 6d 68 |ost_name| = fromh|
|00002b60| 6f 73 74 28 29 29 20 3d | 3d 20 30 29 0a 58 09 68 |ost()) =|= 0).X.h|
|00002b70| 6f 73 74 5f 6e 61 6d 65 | 20 3d 20 22 75 6e 6b 6e |ost_name| = "unkn|
|00002b80| 6f 77 6e 22 3b 0a 58 20 | 20 20 20 73 79 73 6c 6f |own";.X | syslo|
|00002b90| 67 28 4c 4f 47 5f 49 4e | 46 4f 2c 20 22 63 6f 6e |g(LOG_IN|FO, "con|
|00002ba0| 6e 65 63 74 20 66 72 6f | 6d 20 25 73 22 2c 20 68 |nect fro|m %s", h|
|00002bb0| 6f 73 74 5f 6e 61 6d 65 | 29 3b 0a 58 0a 58 20 20 |ost_name|);.X.X |
|00002bc0| 20 20 2f 2a 20 43 68 65 | 63 6b 20 77 68 65 74 68 | /* Che|ck wheth|
|00002bd0| 65 72 20 74 68 69 73 20 | 68 6f 73 74 20 63 61 6e |er this |host can|
|00002be0| 20 61 63 63 65 73 73 20 | 74 68 65 20 73 65 72 76 | access |the serv|
|00002bf0| 69 63 65 20 69 6e 20 61 | 72 67 76 5b 30 5d 2e 20 |ice in a|rgv[0]. |
|00002c00| 2a 2f 0a 58 0a 58 23 69 | 66 64 65 66 20 48 4f 53 |*/.X.X#i|fdef HOS|
|00002c10| 54 53 5f 41 43 43 45 53 | 53 0a 58 20 20 20 20 68 |TS_ACCES|S.X h|
|00002c20| 6f 73 74 73 5f 61 63 63 | 65 73 73 28 61 72 67 76 |osts_acc|ess(argv|
|00002c30| 5b 30 5d 2c 20 68 6f 73 | 74 5f 6e 61 6d 65 29 3b |[0], hos|t_name);|
|00002c40| 0a 58 23 65 6e 64 69 66 | 0a 58 0a 58 20 20 20 20 |.X#endif|.X.X |
|00002c50| 2f 2a 20 49 6e 76 6f 6b | 65 20 74 68 65 20 72 65 |/* Invok|e the re|
|00002c60| 61 6c 20 64 61 65 6d 6f | 6e 20 70 72 6f 67 72 61 |al daemo|n progra|
|00002c70| 6d 2e 20 2a 2f 0a 58 0a | 58 20 20 20 20 28 76 6f |m. */.X.|X (vo|
|00002c80| 69 64 29 20 73 70 72 69 | 6e 74 66 28 70 61 74 68 |id) spri|ntf(path|
|00002c90| 2c 20 22 25 73 2f 25 73 | 22 2c 20 52 45 41 4c 5f |, "%s/%s|", REAL_|
|00002ca0| 44 41 45 4d 4f 4e 5f 44 | 49 52 2c 20 61 72 67 76 |DAEMON_D|IR, argv|
|00002cb0| 5b 30 5d 29 3b 0a 58 20 | 20 20 20 28 76 6f 69 64 |[0]);.X | (void|
|00002cc0| 29 20 65 78 65 63 76 28 | 70 61 74 68 2c 20 61 72 |) execv(|path, ar|
|00002cd0| 67 76 29 3b 0a 58 20 20 | 20 20 73 79 73 6c 6f 67 |gv);.X | syslog|
|00002ce0| 28 4c 4f 47 5f 45 52 52 | 2c 20 22 25 73 3a 20 25 |(LOG_ERR|, "%s: %|
|00002cf0| 6d 22 2c 20 70 61 74 68 | 29 3b 0a 58 20 20 20 20 |m", path|);.X |
|00002d00| 72 65 74 75 72 6e 20 28 | 31 29 3b 0a 58 7d 0a 45 |return (|1);.X}.E|
|00002d10| 4e 44 5f 4f 46 5f 74 63 | 70 64 2e 63 0a 69 66 20 |ND_OF_tc|pd.c.if |
|00002d20| 74 65 73 74 20 31 38 37 | 33 20 2d 6e 65 20 60 77 |test 187|3 -ne `w|
|00002d30| 63 20 2d 63 20 3c 74 63 | 70 64 2e 63 60 3b 20 74 |c -c <tc|pd.c`; t|
|00002d40| 68 65 6e 0a 20 20 20 20 | 65 63 68 6f 20 73 68 61 |hen. |echo sha|
|00002d50| 72 3a 20 5c 22 74 63 70 | 64 2e 63 5c 22 20 75 6e |r: \"tcp|d.c\" un|
|00002d60| 70 61 63 6b 65 64 20 77 | 69 74 68 20 77 72 6f 6e |packed w|ith wron|
|00002d70| 67 20 73 69 7a 65 21 0a | 66 69 0a 23 20 65 6e 64 |g size!.|fi.# end|
|00002d80| 20 6f 66 20 6f 76 65 72 | 77 72 69 74 69 6e 67 20 | of over|writing |
|00002d90| 63 68 65 63 6b 0a 66 69 | 0a 69 66 20 74 65 73 74 |check.fi|.if test|
|00002da0| 20 2d 66 20 66 72 6f 6d | 68 6f 73 74 2e 63 20 2d | -f from|host.c -|
|00002db0| 61 20 22 24 7b 31 7d 22 | 20 21 3d 20 22 2d 63 22 |a "${1}"| != "-c"|
|00002dc0| 20 3b 20 74 68 65 6e 20 | 0a 20 20 65 63 68 6f 20 | ; then |. echo |
|00002dd0| 73 68 61 72 3a 20 57 69 | 6c 6c 20 6e 6f 74 20 6f |shar: Wi|ll not o|
|00002de0| 76 65 72 2d 77 72 69 74 | 65 20 65 78 69 73 74 69 |ver-writ|e existi|
|00002df0| 6e 67 20 66 69 6c 65 20 | 5c 22 66 72 6f 6d 68 6f |ng file |\"fromho|
|00002e00| 73 74 2e 63 5c 22 0a 65 | 6c 73 65 0a 65 63 68 6f |st.c\".e|lse.echo|
|00002e10| 20 73 68 61 72 3a 20 45 | 78 74 72 61 63 74 69 6e | shar: E|xtractin|
|00002e20| 67 20 5c 22 66 72 6f 6d | 68 6f 73 74 2e 63 5c 22 |g \"from|host.c\"|
|00002e30| 20 5c 28 31 33 32 35 20 | 63 68 61 72 61 63 74 65 | \(1325 |characte|
|00002e40| 72 73 5c 29 0a 73 65 64 | 20 22 73 2f 5e 58 2f 2f |rs\).sed| "s/^X//|
|00002e50| 22 20 3e 66 72 6f 6d 68 | 6f 73 74 2e 63 20 3c 3c |" >fromh|ost.c <<|
|00002e60| 27 45 4e 44 5f 4f 46 5f | 66 72 6f 6d 68 6f 73 74 |'END_OF_|fromhost|
|00002e70| 2e 63 27 0a 58 20 2f 2a | 0a 58 20 20 2a 20 66 72 |.c'.X /*|.X * fr|
|00002e80| 6f 6d 68 6f 73 74 28 29 | 20 72 65 74 75 72 6e 73 |omhost()| returns|
|00002e90| 20 74 68 65 20 6e 61 6d | 65 20 6f 72 20 61 64 64 | the nam|e or add|
|00002ea0| 72 65 73 73 20 6f 66 20 | 74 68 65 20 68 6f 73 74 |ress of |the host|
|00002eb0| 20 61 74 20 74 68 65 20 | 6f 74 68 65 72 20 65 6e | at the |other en|
|00002ec0| 64 20 6f 66 0a 58 20 20 | 2a 20 73 74 61 6e 64 61 |d of.X |* standa|
|00002ed0| 72 64 20 69 6e 70 75 74 | 2c 20 22 73 74 64 69 6e |rd input|, "stdin|
|00002ee0| 22 20 69 66 20 69 74 20 | 69 73 20 63 6f 6e 6e 65 |" if it |is conne|
|00002ef0| 63 74 65 64 20 74 6f 20 | 61 20 74 65 72 6d 69 6e |cted to |a termin|
|00002f00| 61 6c 2c 20 6f 72 20 61 | 20 6e 75 6c 6c 0a 58 20 |al, or a| null.X |
|00002f10| 20 2a 20 70 6f 69 6e 74 | 65 72 20 69 66 20 69 74 | * point|er if it|
|00002f20| 20 66 61 69 6c 73 2e 20 | 44 69 61 67 6e 6f 73 74 | fails. |Diagnost|
|00002f30| 69 63 73 20 61 72 65 20 | 6c 6f 67 67 65 64 20 74 |ics are |logged t|
|00002f40| 68 72 6f 75 67 68 20 73 | 79 73 6c 6f 67 28 33 29 |hrough s|yslog(3)|
|00002f50| 2e 0a 58 20 20 2a 20 0a | 58 20 20 2a 20 41 75 74 |..X * .|X * Aut|
|00002f60| 68 6f 72 3a 20 57 69 65 | 74 73 65 20 56 65 6e 65 |hor: Wie|tse Vene|
|00002f70| 6d 61 2c 20 45 69 6e 64 | 68 6f 76 65 6e 20 55 6e |ma, Eind|hoven Un|
|00002f80| 69 76 65 72 73 69 74 79 | 20 6f 66 20 54 65 63 68 |iversity| of Tech|
|00002f90| 6e 6f 6c 6f 67 79 2c 20 | 54 68 65 20 4e 65 74 68 |nology, |The Neth|
|00002fa0| 65 72 6c 61 6e 64 73 2e | 0a 58 20 20 2a 2f 0a 58 |erlands.|.X */.X|
|00002fb0| 0a 58 23 69 66 6e 64 65 | 66 20 6c 69 6e 74 0a 58 |.X#ifnde|f lint.X|
|00002fc0| 73 74 61 74 69 63 20 63 | 68 61 72 20 73 63 63 73 |static c|har sccs|
|00002fd0| 69 64 5b 5d 20 3d 20 22 | 40 28 23 29 20 66 72 6f |id[] = "|@(#) fro|
|00002fe0| 6d 68 6f 73 74 2e 63 20 | 31 2e 31 20 39 31 2f 30 |mhost.c |1.1 91/0|
|00002ff0| 31 2f 30 36 20 32 32 3a | 33 30 3a 32 34 22 3b 0a |1/06 22:|30:24";.|
|00003000| 58 23 65 6e 64 69 66 0a | 58 0a 58 23 69 6e 63 6c |X#endif.|X.X#incl|
|00003010| 75 64 65 20 3c 73 74 64 | 69 6f 2e 68 3e 0a 58 23 |ude <std|io.h>.X#|
|00003020| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 74 79 70 |include |<sys/typ|
|00003030| 65 73 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |es.h>.X#|include |
|00003040| 3c 73 79 73 2f 70 61 72 | 61 6d 2e 68 3e 0a 58 23 |<sys/par|am.h>.X#|
|00003050| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 73 6f 63 |include |<sys/soc|
|00003060| 6b 65 74 2e 68 3e 0a 58 | 23 69 6e 63 6c 75 64 65 |ket.h>.X|#include|
|00003070| 20 3c 73 79 73 6c 6f 67 | 2e 68 3e 0a 58 23 69 6e | <syslog|.h>.X#in|
|00003080| 63 6c 75 64 65 20 3c 6e | 65 74 69 6e 65 74 2f 69 |clude <n|etinet/i|
|00003090| 6e 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |n.h>.X#i|nclude <|
|000030a0| 6e 65 74 64 62 2e 68 3e | 0a 58 0a 58 2f 2a 20 66 |netdb.h>|.X.X/* f|
|000030b0| 72 6f 6d 68 6f 73 74 20 | 2d 20 66 69 6e 64 20 6f |romhost |- find o|
|000030c0| 75 74 20 77 68 61 74 20 | 69 73 20 61 74 20 74 68 |ut what |is at th|
|000030d0| 65 20 6f 74 68 65 72 20 | 65 6e 64 20 6f 66 20 73 |e other |end of s|
|000030e0| 74 61 6e 64 61 72 64 20 | 69 6e 70 75 74 20 2a 2f |tandard |input */|
|000030f0| 0a 58 0a 58 63 68 61 72 | 20 20 20 2a 66 72 6f 6d |.X.Xchar| *from|
|00003100| 68 6f 73 74 28 29 0a 58 | 7b 0a 58 20 20 20 20 73 |host().X|{.X s|
|00003110| 74 72 75 63 74 20 73 6f | 63 6b 61 64 64 72 20 73 |truct so|ckaddr s|
|00003120| 61 3b 0a 58 20 20 20 20 | 73 74 72 75 63 74 20 73 |a;.X |struct s|
|00003130| 6f 63 6b 61 64 64 72 5f | 69 6e 20 2a 73 69 6e 20 |ockaddr_|in *sin |
|00003140| 3d 20 28 73 74 72 75 63 | 74 20 73 6f 63 6b 61 64 |= (struc|t sockad|
|00003150| 64 72 5f 69 6e 20 2a 29 | 20 28 26 73 61 29 3b 0a |dr_in *)| (&sa);.|
|00003160| 58 20 20 20 20 73 74 72 | 75 63 74 20 68 6f 73 74 |X str|uct host|
|00003170| 65 6e 74 20 2a 68 70 3b | 0a 58 20 20 20 20 69 6e |ent *hp;|.X in|
|00003180| 74 20 20 20 20 20 73 6f | 63 6b 74 20 3d 20 66 69 |t so|ckt = fi|
|00003190| 6c 65 6e 6f 28 73 74 64 | 69 6e 29 3b 0a 58 20 20 |leno(std|in);.X |
|000031a0| 20 20 69 6e 74 20 20 20 | 20 20 6c 65 6e 67 74 68 | int | length|
|000031b0| 20 3d 20 73 69 7a 65 6f | 66 28 73 61 29 3b 0a 58 | = sizeo|f(sa);.X|
|000031c0| 20 20 20 20 63 68 61 72 | 20 20 20 2a 69 6e 65 74 | char| *inet|
|000031d0| 5f 6e 74 6f 61 28 29 3b | 0a 58 0a 58 20 20 20 20 |_ntoa();|.X.X |
|000031e0| 69 66 20 28 67 65 74 70 | 65 65 72 6e 61 6d 65 28 |if (getp|eername(|
|000031f0| 73 6f 63 6b 74 2c 20 26 | 73 61 2c 20 26 6c 65 6e |sockt, &|sa, &len|
|00003200| 67 74 68 29 20 3c 20 30 | 29 20 7b 0a 58 09 69 66 |gth) < 0|) {.X.if|
|00003210| 20 28 69 73 61 74 74 79 | 28 73 6f 63 6b 74 29 29 | (isatty|(sockt))|
|00003220| 20 7b 0a 58 09 20 20 20 | 20 72 65 74 75 72 6e 20 | {.X. | return |
|00003230| 28 22 73 74 64 69 6e 22 | 29 3b 0a 58 09 7d 20 65 |("stdin"|);.X.} e|
|00003240| 6c 73 65 20 7b 0a 58 09 | 20 20 20 20 73 79 73 6c |lse {.X.| sysl|
|00003250| 6f 67 28 4c 4f 47 5f 45 | 52 52 2c 20 22 67 65 74 |og(LOG_E|RR, "get|
|00003260| 70 65 65 72 6e 61 6d 65 | 3a 20 25 6d 22 29 3b 0a |peername|: %m");.|
|00003270| 58 09 20 20 20 20 72 65 | 74 75 72 6e 20 28 30 29 |X. re|turn (0)|
|00003280| 3b 0a 58 09 7d 0a 58 20 | 20 20 20 7d 20 65 6c 73 |;.X.}.X | } els|
|00003290| 65 20 7b 0a 58 09 73 77 | 69 74 63 68 20 28 73 61 |e {.X.sw|itch (sa|
|000032a0| 2e 73 61 5f 66 61 6d 69 | 6c 79 29 20 7b 0a 58 09 |.sa_fami|ly) {.X.|
|000032b0| 63 61 73 65 20 41 46 5f | 49 4e 45 54 3a 0a 58 09 |case AF_|INET:.X.|
|000032c0| 20 20 20 20 68 70 20 3d | 20 67 65 74 68 6f 73 74 | hp =| gethost|
|000032d0| 62 79 61 64 64 72 28 28 | 63 68 61 72 20 2a 29 20 |byaddr((|char *) |
|000032e0| 26 73 69 6e 2d 3e 73 69 | 6e 5f 61 64 64 72 2e 73 |&sin->si|n_addr.s|
|000032f0| 5f 61 64 64 72 2c 0a 58 | 09 09 09 20 20 20 20 20 |_addr,.X|... |
|00003300| 20 20 73 69 7a 65 6f 66 | 28 73 69 6e 2d 3e 73 69 | sizeof|(sin->si|
|00003310| 6e 5f 61 64 64 72 2e 73 | 5f 61 64 64 72 29 2c 20 |n_addr.s|_addr), |
|00003320| 41 46 5f 49 4e 45 54 29 | 3b 0a 58 09 20 20 20 20 |AF_INET)|;.X. |
|00003330| 72 65 74 75 72 6e 20 28 | 68 70 20 3f 20 68 70 2d |return (|hp ? hp-|
|00003340| 3e 68 5f 6e 61 6d 65 20 | 3a 20 69 6e 65 74 5f 6e |>h_name |: inet_n|
|00003350| 74 6f 61 28 73 69 6e 2d | 3e 73 69 6e 5f 61 64 64 |toa(sin-|>sin_add|
|00003360| 72 29 29 3b 0a 58 09 64 | 65 66 61 75 6c 74 3a 0a |r));.X.d|efault:.|
|00003370| 58 09 20 20 20 20 73 79 | 73 6c 6f 67 28 4c 4f 47 |X. sy|slog(LOG|
|00003380| 5f 45 52 52 2c 20 22 75 | 6e 6b 6e 6f 77 6e 20 61 |_ERR, "u|nknown a|
|00003390| 64 64 72 65 73 73 20 66 | 61 6d 69 6c 79 20 25 6c |ddress f|amily %l|
|000033a0| 64 22 2c 20 73 61 2e 73 | 61 5f 66 61 6d 69 6c 79 |d", sa.s|a_family|
|000033b0| 29 3b 0a 58 09 20 20 20 | 20 72 65 74 75 72 6e 20 |);.X. | return |
|000033c0| 28 30 29 3b 0a 58 09 7d | 0a 58 20 20 20 20 7d 0a |(0);.X.}|.X }.|
|000033d0| 58 7d 0a 45 4e 44 5f 4f | 46 5f 66 72 6f 6d 68 6f |X}.END_O|F_fromho|
|000033e0| 73 74 2e 63 0a 69 66 20 | 74 65 73 74 20 31 33 32 |st.c.if |test 132|
|000033f0| 35 20 2d 6e 65 20 60 77 | 63 20 2d 63 20 3c 66 72 |5 -ne `w|c -c <fr|
|00003400| 6f 6d 68 6f 73 74 2e 63 | 60 3b 20 74 68 65 6e 0a |omhost.c|`; then.|
|00003410| 20 20 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 5c | echo| shar: \|
|00003420| 22 66 72 6f 6d 68 6f 73 | 74 2e 63 5c 22 20 75 6e |"fromhos|t.c\" un|
|00003430| 70 61 63 6b 65 64 20 77 | 69 74 68 20 77 72 6f 6e |packed w|ith wron|
|00003440| 67 20 73 69 7a 65 21 0a | 66 69 0a 23 20 65 6e 64 |g size!.|fi.# end|
|00003450| 20 6f 66 20 6f 76 65 72 | 77 72 69 74 69 6e 67 20 | of over|writing |
|00003460| 63 68 65 63 6b 0a 66 69 | 0a 69 66 20 74 65 73 74 |check.fi|.if test|
|00003470| 20 2d 66 20 68 6f 73 74 | 73 5f 61 63 63 65 73 73 | -f host|s_access|
|00003480| 2e 63 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |.c -a "$|{1}" != |
|00003490| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|000034a0| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|000034b0| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|000034c0| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 5c 22 68 6f |isting f|ile \"ho|
|000034d0| 73 74 73 5f 61 63 63 65 | 73 73 2e 63 5c 22 0a 65 |sts_acce|ss.c\".e|
|000034e0| 6c 73 65 0a 65 63 68 6f | 20 73 68 61 72 3a 20 45 |lse.echo| shar: E|
|000034f0| 78 74 72 61 63 74 69 6e | 67 20 5c 22 68 6f 73 74 |xtractin|g \"host|
|00003500| 73 5f 61 63 63 65 73 73 | 2e 63 5c 22 20 5c 28 34 |s_access|.c\" \(4|
|00003510| 30 35 35 20 63 68 61 72 | 61 63 74 65 72 73 5c 29 |055 char|acters\)|
|00003520| 0a 73 65 64 20 22 73 2f | 5e 58 2f 2f 22 20 3e 68 |.sed "s/|^X//" >h|
|00003530| 6f 73 74 73 5f 61 63 63 | 65 73 73 2e 63 20 3c 3c |osts_acc|ess.c <<|
|00003540| 27 45 4e 44 5f 4f 46 5f | 68 6f 73 74 73 5f 61 63 |'END_OF_|hosts_ac|
|00003550| 63 65 73 73 2e 63 27 0a | 58 23 69 66 64 65 66 20 |cess.c'.|X#ifdef |
|00003560| 48 4f 53 54 53 5f 41 43 | 43 45 53 53 0a 58 0a 58 |HOSTS_AC|CESS.X.X|
|00003570| 20 2f 2a 0a 58 20 20 2a | 20 54 68 69 73 20 6d 6f | /*.X *| This mo|
|00003580| 64 75 6c 65 20 69 6d 70 | 6c 65 6d 65 6e 74 73 20 |dule imp|lements |
|00003590| 61 20 73 69 6d 70 6c 65 | 20 62 75 74 20 65 66 66 |a simple| but eff|
|000035a0| 65 63 74 69 76 65 20 66 | 6f 72 6d 20 6f 66 20 61 |ective f|orm of a|
|000035b0| 63 63 65 73 73 20 63 6f | 6e 74 72 6f 6c 0a 58 20 |ccess co|ntrol.X |
|000035c0| 20 2a 20 62 61 73 65 64 | 20 6f 6e 20 68 6f 73 74 | * based| on host|
|000035d0| 20 28 6f 72 20 64 6f 6d | 61 69 6e 29 20 6e 61 6d | (or dom|ain) nam|
|000035e0| 65 73 20 61 6e 64 20 73 | 65 72 76 69 63 65 20 6e |es and s|ervice n|
|000035f0| 61 6d 65 73 2c 20 77 69 | 74 68 20 77 69 6c 64 20 |ames, wi|th wild |
|00003600| 63 61 72 64 0a 58 20 20 | 2a 20 73 75 70 70 6f 72 |card.X |* suppor|
|00003610| 74 2e 20 44 69 61 67 6e | 6f 73 74 69 63 73 20 61 |t. Diagn|ostics a|
|00003620| 72 65 20 6c 6f 67 67 65 | 64 20 74 68 72 6f 75 67 |re logge|d throug|
|00003630| 68 20 73 79 73 6c 6f 67 | 28 33 29 2e 0a 58 20 20 |h syslog|(3)..X |
|00003640| 2a 20 0a 58 20 20 2a 20 | 43 6f 6d 70 69 6c 65 20 |* .X * |Compile |
|00003650| 77 69 74 68 20 2d 44 48 | 4f 53 54 53 5f 41 43 43 |with -DH|OSTS_ACC|
|00003660| 45 53 53 20 69 6e 20 6f | 72 64 65 72 20 74 6f 20 |ESS in o|rder to |
|00003670| 65 6e 61 62 6c 65 20 61 | 63 63 65 73 73 20 63 6f |enable a|ccess co|
|00003680| 6e 74 72 6f 6c 2e 20 53 | 65 65 20 74 68 65 0a 58 |ntrol. S|ee the.X|
|00003690| 20 20 2a 20 68 6f 73 74 | 73 5f 61 63 63 65 73 73 | * host|s_access|
|000036a0| 28 35 29 20 6d 61 6e 75 | 61 6c 20 70 61 67 65 20 |(5) manu|al page |
|000036b0| 66 6f 72 20 64 65 74 61 | 69 6c 73 2e 0a 58 20 20 |for deta|ils..X |
|000036c0| 2a 20 0a 58 20 20 2a 20 | 41 75 74 68 6f 72 3a 20 |* .X * |Author: |
|000036d0| 57 69 65 74 73 65 20 56 | 65 6e 65 6d 61 2c 20 45 |Wietse V|enema, E|
|000036e0| 69 6e 64 68 6f 76 65 6e | 20 55 6e 69 76 65 72 73 |indhoven| Univers|
|000036f0| 69 74 79 20 6f 66 20 54 | 65 63 68 6e 6f 6c 6f 67 |ity of T|echnolog|
|00003700| 79 2c 20 54 68 65 20 4e | 65 74 68 65 72 6c 61 6e |y, The N|etherlan|
|00003710| 64 73 2e 0a 58 20 20 2a | 2f 0a 58 0a 58 23 69 66 |ds..X *|/.X.X#if|
|00003720| 6e 64 65 66 20 6c 69 6e | 74 0a 58 73 74 61 74 69 |ndef lin|t.Xstati|
|00003730| 63 20 63 68 61 72 20 73 | 63 63 73 69 64 5b 5d 20 |c char s|ccsid[] |
|00003740| 3d 20 22 40 28 23 29 20 | 68 6f 73 74 73 5f 61 63 |= "@(#) |hosts_ac|
|00003750| 63 65 73 73 2e 63 20 31 | 2e 31 20 39 31 2f 30 31 |cess.c 1|.1 91/01|
|00003760| 2f 30 36 20 32 32 3a 33 | 30 3a 32 38 22 3b 0a 58 |/06 22:3|0:28";.X|
|00003770| 23 65 6e 64 69 66 0a 58 | 0a 58 23 69 6e 63 6c 75 |#endif.X|.X#inclu|
|00003780| 64 65 20 3c 73 74 64 69 | 6f 2e 68 3e 0a 58 23 69 |de <stdi|o.h>.X#i|
|00003790| 6e 63 6c 75 64 65 20 3c | 73 79 73 6c 6f 67 2e 68 |nclude <|syslog.h|
|000037a0| 3e 0a 58 0a 58 65 78 74 | 65 72 6e 20 63 68 61 72 |>.X.Xext|ern char|
|000037b0| 20 2a 66 67 65 74 73 28 | 29 3b 0a 58 65 78 74 65 | *fgets(|);.Xexte|
|000037c0| 72 6e 20 63 68 61 72 20 | 2a 73 74 72 63 68 72 28 |rn char |*strchr(|
|000037d0| 29 3b 0a 58 65 78 74 65 | 72 6e 20 63 68 61 72 20 |);.Xexte|rn char |
|000037e0| 2a 73 74 72 74 6f 6b 28 | 29 3b 0a 58 65 78 74 65 |*strtok(|);.Xexte|
|000037f0| 72 6e 20 76 6f 69 64 20 | 65 78 69 74 28 29 3b 0a |rn void |exit();.|
|00003800| 58 0a 58 20 2f 2a 20 50 | 61 74 68 20 6e 61 6d 65 |X.X /* P|ath name|
|00003810| 73 20 6f 66 20 74 68 65 | 20 61 63 63 65 73 73 20 |s of the| access |
|00003820| 63 6f 6e 74 72 6f 6c 20 | 66 69 6c 65 73 2e 20 2a |control |files. *|
|00003830| 2f 0a 58 0a 58 23 64 65 | 66 69 6e 65 20 48 4f 53 |/.X.X#de|fine HOS|
|00003840| 54 53 5f 41 4c 4c 4f 57 | 09 22 2f 65 74 63 2f 68 |TS_ALLOW|."/etc/h|
|00003850| 6f 73 74 73 2e 61 6c 6c | 6f 77 22 0a 58 23 64 65 |osts.all|ow".X#de|
|00003860| 66 69 6e 65 20 48 4f 53 | 54 53 5f 44 45 4e 59 09 |fine HOS|TS_DENY.|
|00003870| 22 2f 65 74 63 2f 68 6f | 73 74 73 2e 64 65 6e 79 |"/etc/ho|sts.deny|
|00003880| 22 0a 58 0a 58 20 2f 2a | 20 44 65 6c 69 6d 69 74 |".X.X /*| Delimit|
|00003890| 65 72 73 20 66 6f 72 20 | 6c 69 73 74 73 20 6f 66 |ers for |lists of|
|000038a0| 20 73 65 72 76 69 63 65 | 73 20 6f 72 20 68 6f 73 | service|s or hos|
|000038b0| 74 73 20 6f 72 20 64 6f | 6d 61 69 6e 73 2e 20 2a |ts or do|mains. *|
|000038c0| 2f 0a 58 0a 58 73 74 61 | 74 69 63 20 63 68 61 72 |/.X.Xsta|tic char|
|000038d0| 20 73 65 70 5b 5d 20 3d | 20 22 2c 20 5c 74 22 3b | sep[] =| ", \t";|
|000038e0| 0a 58 0a 58 20 2f 2a 20 | 43 6f 6e 73 74 61 6e 74 |.X.X /* |Constant|
|000038f0| 73 20 74 6f 20 62 65 20 | 75 73 65 64 20 69 6e 20 |s to be |used in |
|00003900| 61 73 73 69 67 6e 6d 65 | 6e 74 73 20 6f 6e 6c 79 |assignme|nts only|
|00003910| 2c 20 6e 6f 74 20 69 6e | 20 63 6f 6d 70 61 72 69 |, not in| compari|
|00003920| 73 6f 6e 73 2e 2e 2e 20 | 2a 2f 0a 58 0a 58 23 64 |sons... |*/.X.X#d|
|00003930| 65 66 69 6e 65 09 59 45 | 53 09 09 31 0a 58 23 64 |efine.YE|S..1.X#d|
|00003940| 65 66 69 6e 65 09 4e 4f | 09 09 30 0a 58 0a 58 2f |efine.NO|..0.X.X/|
|00003950| 2a 20 68 6f 73 74 73 5f | 61 63 63 65 73 73 20 2d |* hosts_|access -|
|00003960| 20 68 6f 73 74 20 61 63 | 63 65 73 73 20 63 6f 6e | host ac|cess con|
|00003970| 74 72 6f 6c 20 66 61 63 | 69 6c 69 74 79 20 2a 2f |trol fac|ility */|
|00003980| 0a 58 0a 58 68 6f 73 74 | 73 5f 61 63 63 65 73 73 |.X.Xhost|s_access|
|00003990| 28 73 65 72 76 69 63 65 | 2c 20 68 6f 73 74 29 0a |(service|, host).|
|000039a0| 58 63 68 61 72 20 20 20 | 2a 73 65 72 76 69 63 65 |Xchar |*service|
|000039b0| 3b 0a 58 63 68 61 72 20 | 20 20 2a 68 6f 73 74 3b |;.Xchar | *host;|
|000039c0| 0a 58 7b 0a 58 0a 58 20 | 20 20 20 2f 2a 0a 58 20 |.X{.X.X | /*.X |
|000039d0| 20 20 20 20 2a 20 49 66 | 20 74 68 65 20 28 73 65 | * If| the (se|
|000039e0| 72 76 69 63 65 2c 68 6f | 73 74 29 20 70 61 69 72 |rvice,ho|st) pair|
|000039f0| 20 69 73 20 66 6f 75 6e | 64 20 69 6e 20 74 68 65 | is foun|d in the|
|00003a00| 20 2f 65 74 63 2f 68 6f | 73 74 73 2e 61 6c 6c 6f | /etc/ho|sts.allo|
|00003a10| 77 20 66 69 6c 65 2c 0a | 58 20 20 20 20 20 2a 20 |w file,.|X * |
|00003a20| 61 63 63 65 73 73 20 69 | 73 20 67 72 61 6e 74 65 |access i|s grante|
|00003a30| 64 2e 20 4f 74 68 65 72 | 77 69 73 65 2c 20 69 66 |d. Other|wise, if|
|00003a40| 20 74 68 65 20 28 73 65 | 72 76 69 63 65 2c 68 6f | the (se|rvice,ho|
|00003a50| 73 74 29 20 70 61 69 72 | 20 69 73 20 66 6f 75 6e |st) pair| is foun|
|00003a60| 64 20 69 6e 0a 58 20 20 | 20 20 20 2a 20 74 68 65 |d in.X | * the|
|00003a70| 20 2f 65 74 63 2f 68 6f | 73 74 73 2e 64 65 6e 79 | /etc/ho|sts.deny|
|00003a80| 20 66 69 6c 65 2c 20 61 | 63 63 65 73 73 20 69 73 | file, a|ccess is|
|00003a90| 20 64 65 6e 69 65 64 2e | 20 4f 74 68 65 72 77 69 | denied.| Otherwi|
|00003aa0| 73 65 2c 20 61 63 63 65 | 73 73 20 69 73 0a 58 20 |se, acce|ss is.X |
|00003ab0| 20 20 20 20 2a 20 67 72 | 61 6e 74 65 64 2e 20 0a | * gr|anted. .|
|00003ac0| 58 20 20 20 20 20 2a 20 | 0a 58 20 20 20 20 20 2a |X * |.X *|
|00003ad0| 20 49 66 20 61 20 63 6f | 6e 6e 65 63 74 69 6f 6e | If a co|nnection|
|00003ae0| 20 69 73 20 72 65 66 75 | 73 65 64 2c 20 77 65 20 | is refu|sed, we |
|00003af0| 77 72 69 74 65 20 61 20 | 73 79 73 6c 6f 67 20 72 |write a |syslog r|
|00003b00| 65 63 6f 72 64 2c 20 62 | 75 74 20 64 6f 20 6e 6f |ecord, b|ut do no|
|00003b10| 74 20 6e 6f 74 69 66 79 | 0a 58 20 20 20 20 20 2a |t notify|.X *|
|00003b20| 20 74 68 65 20 63 6c 69 | 65 6e 74 2e 0a 58 20 20 | the cli|ent..X |
|00003b30| 20 20 20 2a 2f 0a 58 0a | 58 20 20 20 20 69 66 20 | */.X.|X if |
|00003b40| 28 74 61 62 6c 65 5f 6d | 61 74 63 68 28 48 4f 53 |(table_m|atch(HOS|
|00003b50| 54 53 5f 41 4c 4c 4f 57 | 2c 20 73 65 72 76 69 63 |TS_ALLOW|, servic|
|00003b60| 65 2c 20 68 6f 73 74 29 | 29 0a 58 09 72 65 74 75 |e, host)|).X.retu|
|00003b70| 72 6e 3b 0a 58 20 20 20 | 20 69 66 20 28 74 61 62 |rn;.X | if (tab|
|00003b80| 6c 65 5f 6d 61 74 63 68 | 28 48 4f 53 54 53 5f 44 |le_match|(HOSTS_D|
|00003b90| 45 4e 59 2c 20 73 65 72 | 76 69 63 65 2c 20 68 6f |ENY, ser|vice, ho|
|00003ba0| 73 74 29 29 20 7b 0a 58 | 09 73 79 73 6c 6f 67 28 |st)) {.X|.syslog(|
|00003bb0| 4c 4f 47 5f 57 41 52 4e | 49 4e 47 2c 20 22 72 65 |LOG_WARN|ING, "re|
|00003bc0| 66 75 73 65 64 20 63 6f | 6e 6e 65 63 74 20 66 72 |fused co|nnect fr|
|00003bd0| 6f 6d 20 25 73 22 2c 20 | 68 6f 73 74 29 3b 0a 58 |om %s", |host);.X|
|00003be0| 09 65 78 69 74 28 30 29 | 3b 0a 58 20 20 20 20 7d |.exit(0)|;.X }|
|00003bf0| 0a 58 7d 0a 58 0a 58 2f | 2a 20 74 61 62 6c 65 5f |.X}.X.X/|* table_|
|00003c00| 6d 61 74 63 68 20 2d 20 | 6d 61 74 63 68 20 74 61 |match - |match ta|
|00003c10| 62 6c 65 20 65 6e 74 72 | 69 65 73 20 77 69 74 68 |ble entr|ies with|
|00003c20| 20 28 73 65 72 76 69 63 | 65 2c 20 68 6f 73 74 29 | (servic|e, host)|
|00003c30| 20 70 61 69 72 20 2a 2f | 0a 58 0a 58 74 61 62 6c | pair */|.X.Xtabl|
|00003c40| 65 5f 6d 61 74 63 68 28 | 74 61 62 6c 65 2c 20 73 |e_match(|table, s|
|00003c50| 65 72 76 69 63 65 2c 20 | 68 6f 73 74 29 0a 58 63 |ervice, |host).Xc|
|00003c60| 68 61 72 20 20 20 2a 74 | 61 62 6c 65 3b 0a 58 63 |har *t|able;.Xc|
|00003c70| 68 61 72 20 20 20 2a 73 | 65 72 76 69 63 65 3b 0a |har *s|ervice;.|
|00003c80| 58 63 68 61 72 20 20 20 | 2a 68 6f 73 74 3b 0a 58 |Xchar |*host;.X|
|00003c90| 7b 0a 58 20 20 20 20 46 | 49 4c 45 20 20 20 2a 66 |{.X F|ILE *f|
|00003ca0| 70 3b 0a 58 20 20 20 20 | 63 68 61 72 20 20 20 20 |p;.X |char |
|00003cb0| 73 76 5f 6c 69 73 74 5b | 42 55 46 53 49 5a 5d 3b |sv_list[|BUFSIZ];|
|00003cc0| 09 09 2f 2a 20 62 65 63 | 6f 6d 65 73 20 6c 69 73 |../* bec|omes lis|
|00003cd0| 74 20 6f 66 20 73 65 72 | 76 69 63 65 73 20 2a 2f |t of ser|vices */|
|00003ce0| 0a 58 20 20 20 20 63 68 | 61 72 20 20 20 2a 63 6c |.X ch|ar *cl|
|00003cf0| 5f 6c 69 73 74 3b 09 09 | 09 2f 2a 20 62 65 63 6f |_list;..|./* beco|
|00003d00| 6d 65 73 20 6c 69 73 74 | 20 6f 66 20 63 6c 69 65 |mes list| of clie|
|00003d10| 6e 74 73 20 2a 2f 0a 58 | 20 20 20 20 69 6e 74 20 |nts */.X| int |
|00003d20| 20 20 20 20 6d 61 74 63 | 68 20 3d 20 4e 4f 3b 0a | matc|h = NO;.|
|00003d30| 58 20 20 20 20 69 6e 74 | 20 20 20 20 20 65 6e 64 |X int| end|
|00003d40| 3b 0a 58 0a 58 20 20 20 | 20 2f 2a 0a 58 20 20 20 |;.X.X | /*.X |
|00003d50| 20 20 2a 20 50 72 6f 63 | 65 73 73 20 74 68 65 20 | * Proc|ess the |
|00003d60| 74 61 62 6c 65 20 6f 6e | 65 20 6c 69 6e 65 20 61 |table on|e line a|
|00003d70| 74 20 61 20 74 69 6d 65 | 2e 20 4c 69 6e 65 73 20 |t a time|. Lines |
|00003d80| 74 68 61 74 20 62 65 67 | 69 6e 20 77 69 74 68 20 |that beg|in with |
|00003d90| 61 20 27 23 27 0a 58 20 | 20 20 20 20 2a 20 63 68 |a '#'.X | * ch|
|00003da0| 61 72 61 63 74 65 72 20 | 61 72 65 20 69 67 6e 6f |aracter |are igno|
|00003db0| 72 65 64 2e 20 4e 6f 6e | 2d 63 6f 6d 6d 65 6e 74 |red. Non|-comment|
|00003dc0| 20 6c 69 6e 65 73 20 61 | 72 65 20 62 72 6f 6b 65 | lines a|re broke|
|00003dd0| 6e 20 61 74 20 74 68 65 | 20 27 3a 27 0a 58 20 20 |n at the| ':'.X |
|00003de0| 20 20 20 2a 20 63 68 61 | 72 61 63 74 65 72 20 28 | * cha|racter (|
|00003df0| 77 65 20 63 6f 6d 70 6c | 61 69 6e 20 69 66 20 74 |we compl|ain if t|
|00003e00| 68 65 72 65 20 69 73 20 | 6e 6f 6e 65 29 2e 20 54 |here is |none). T|
|00003e10| 68 65 20 6c 65 66 74 20 | 70 61 72 74 20 69 73 20 |he left |part is |
|00003e20| 6d 61 74 63 68 65 64 0a | 58 20 20 20 20 20 2a 20 |matched.|X * |
|00003e30| 61 67 61 69 6e 73 74 20 | 74 68 65 20 73 65 72 76 |against |the serv|
|00003e40| 69 63 65 20 6e 61 6d 65 | 20 28 61 72 67 76 5b 30 |ice name| (argv[0|
|00003e50| 5d 29 2c 20 74 68 65 20 | 72 69 67 68 74 20 70 61 |]), the |right pa|
|00003e60| 72 74 20 61 67 61 69 6e | 73 74 20 74 68 65 20 68 |rt again|st the h|
|00003e70| 6f 73 74 0a 58 20 20 20 | 20 20 2a 20 6e 61 6d 65 |ost.X | * name|
|00003e80| 2e 20 41 20 6e 6f 6e 2d | 65 78 69 73 74 69 6e 67 |. A non-|existing|
|00003e90| 20 74 61 62 6c 65 20 69 | 73 20 74 72 65 61 74 65 | table i|s treate|
|00003ea0| 64 20 61 73 20 69 66 20 | 69 74 20 77 65 72 65 20 |d as if |it were |
|00003eb0| 61 6e 20 65 6d 70 74 79 | 20 74 61 62 6c 65 2e 0a |an empty| table..|
|00003ec0| 58 20 20 20 20 20 2a 2f | 0a 58 0a 58 20 20 20 20 |X */|.X.X |
|00003ed0| 69 66 20 28 66 70 20 3d | 20 66 6f 70 65 6e 28 74 |if (fp =| fopen(t|
|00003ee0| 61 62 6c 65 2c 20 22 72 | 22 29 29 20 7b 0a 58 09 |able, "r|")) {.X.|
|00003ef0| 77 68 69 6c 65 20 28 21 | 6d 61 74 63 68 20 26 26 |while (!|match &&|
|00003f00| 20 66 67 65 74 73 28 73 | 76 5f 6c 69 73 74 2c 20 | fgets(s|v_list, |
|00003f10| 73 69 7a 65 6f 66 28 73 | 76 5f 6c 69 73 74 29 2c |sizeof(s|v_list),|
|00003f20| 20 66 70 29 29 20 7b 0a | 58 09 20 20 20 20 69 66 | fp)) {.|X. if|
|00003f30| 20 28 73 76 5f 6c 69 73 | 74 5b 65 6e 64 20 3d 20 | (sv_lis|t[end = |
|00003f40| 73 74 72 6c 65 6e 28 73 | 76 5f 6c 69 73 74 29 20 |strlen(s|v_list) |
|00003f50| 2d 20 31 5d 20 21 3d 20 | 27 5c 6e 27 29 20 7b 0a |- 1] != |'\n') {.|
|00003f60| 58 09 09 73 79 73 6c 6f | 67 28 4c 4f 47 5f 45 52 |X..syslo|g(LOG_ER|
|00003f70| 52 2c 20 22 25 73 3a 20 | 6c 69 6e 65 20 65 78 63 |R, "%s: |line exc|
|00003f80| 65 65 64 73 20 53 54 44 | 49 4f 20 62 75 66 66 65 |eeds STD|IO buffe|
|00003f90| 72 20 73 69 7a 65 22 2c | 20 74 61 62 6c 65 29 3b |r size",| table);|
|00003fa0| 0a 58 09 20 20 20 20 7d | 20 65 6c 73 65 20 7b 0a |.X. }| else {.|
|00003fb0| 58 09 09 73 76 5f 6c 69 | 73 74 5b 65 6e 64 5d 20 |X..sv_li|st[end] |
|00003fc0| 3d 20 27 5c 30 27 3b 09 | 09 2f 2a 20 73 74 72 69 |= '\0';.|./* stri|
|00003fd0| 70 20 74 72 61 69 6c 69 | 6e 67 20 6e 65 77 6c 69 |p traili|ng newli|
|00003fe0| 6e 65 20 2a 2f 0a 58 09 | 20 20 20 20 7d 0a 58 09 |ne */.X.| }.X.|
|00003ff0| 20 20 20 20 69 66 20 28 | 73 76 5f 6c 69 73 74 5b | if (|sv_list[|
|00004000| 30 5d 20 3d 3d 20 27 23 | 27 29 20 7b 09 09 2f 2a |0] == '#|') {../*|
|00004010| 20 73 6b 69 70 20 63 6f | 6d 6d 65 6e 74 73 20 2a | skip co|mments *|
|00004020| 2f 0a 58 09 09 63 6f 6e | 74 69 6e 75 65 3b 0a 58 |/.X..con|tinue;.X|
|00004030| 09 20 20 20 20 7d 20 65 | 6c 73 65 20 69 66 20 28 |. } e|lse if (|
|00004040| 28 63 6c 5f 6c 69 73 74 | 20 3d 20 73 74 72 63 68 |(cl_list| = strch|
|00004050| 72 28 73 76 5f 6c 69 73 | 74 2c 20 27 3a 27 29 29 |r(sv_lis|t, ':'))|
|00004060| 20 3d 3d 20 30 29 20 7b | 0a 58 09 09 73 79 73 6c | == 0) {|.X..sysl|
|00004070| 6f 67 28 4c 4f 47 5f 45 | 52 52 2c 20 22 25 73 3a |og(LOG_E|RR, "%s:|
|00004080| 20 6d 61 6c 66 6f 72 6d | 65 64 20 65 6e 74 72 79 | malform|ed entry|
|00004090| 3a 20 5c 22 25 73 5c 22 | 22 2c 20 74 61 62 6c 65 |: \"%s\"|", table|
|000040a0| 2c 20 73 76 5f 6c 69 73 | 74 29 3b 0a 58 09 09 63 |, sv_lis|t);.X..c|
|000040b0| 6f 6e 74 69 6e 75 65 3b | 0a 58 09 20 20 20 20 7d |ontinue;|.X. }|
|000040c0| 20 65 6c 73 65 20 7b 0a | 58 09 09 2a 63 6c 5f 6c | else {.|X..*cl_l|
|000040d0| 69 73 74 2b 2b 20 3d 20 | 27 5c 30 27 3b 09 09 2f |ist++ = |'\0';../|
|000040e0| 2a 20 62 72 65 61 6b 20 | 6c 69 6e 65 20 61 74 20 |* break |line at |
|000040f0| 22 3a 22 20 2a 2f 0a 58 | 09 09 6d 61 74 63 68 20 |":" */.X|..match |
|00004100| 3d 20 28 6c 69 73 74 5f | 6d 61 74 63 68 28 73 76 |= (list_|match(sv|
|00004110| 5f 6c 69 73 74 2c 20 73 | 65 72 76 69 63 65 29 0a |_list, s|ervice).|
|00004120| 58 09 09 09 20 26 26 20 | 6c 69 73 74 5f 6d 61 74 |X... && |list_mat|
|00004130| 63 68 28 63 6c 5f 6c 69 | 73 74 2c 20 68 6f 73 74 |ch(cl_li|st, host|
|00004140| 29 29 3b 0a 58 09 20 20 | 20 20 7d 0a 58 09 7d 0a |));.X. | }.X.}.|
|00004150| 58 09 28 76 6f 69 64 29 | 20 66 63 6c 6f 73 65 28 |X.(void)| fclose(|
|00004160| 66 70 29 3b 0a 58 20 20 | 20 20 7d 0a 58 20 20 20 |fp);.X | }.X |
|00004170| 20 72 65 74 75 72 6e 20 | 28 6d 61 74 63 68 29 3b | return |(match);|
|00004180| 0a 58 7d 0a 58 0a 58 2f | 2a 20 6c 69 73 74 5f 6d |.X}.X.X/|* list_m|
|00004190| 61 74 63 68 20 2d 20 6d | 61 74 63 68 20 61 20 73 |atch - m|atch a s|
|000041a0| 74 72 69 6e 67 20 61 67 | 61 69 6e 73 74 20 61 20 |tring ag|ainst a |
|000041b0| 6c 69 73 74 20 6f 66 20 | 74 6f 6b 65 6e 73 20 2a |list of |tokens *|
|000041c0| 2f 0a 58 0a 58 6c 69 73 | 74 5f 6d 61 74 63 68 28 |/.X.Xlis|t_match(|
|000041d0| 6c 69 73 74 2c 20 73 74 | 72 69 6e 67 29 0a 58 63 |list, st|ring).Xc|
|000041e0| 68 61 72 20 20 20 2a 6c | 69 73 74 3b 0a 58 63 68 |har *l|ist;.Xch|
|000041f0| 61 72 20 20 20 2a 73 74 | 72 69 6e 67 3b 0a 58 7b |ar *st|ring;.X{|
|00004200| 0a 58 20 20 20 20 63 68 | 61 72 20 20 20 2a 74 6f |.X ch|ar *to|
|00004210| 6b 65 6e 3b 0a 58 20 20 | 20 20 69 6e 74 20 20 20 |ken;.X | int |
|00004220| 20 20 74 6f 6b 5f 6c 65 | 6e 3b 0a 58 20 20 20 20 | tok_le|n;.X |
|00004230| 69 6e 74 20 20 20 20 20 | 73 74 72 5f 6c 65 6e 3b |int |str_len;|
|00004240| 0a 58 0a 58 20 20 20 20 | 2f 2a 0a 58 20 20 20 20 |.X.X |/*.X |
|00004250| 20 2a 20 50 72 6f 63 65 | 73 73 20 74 6f 6b 65 6e | * Proce|ss token|
|00004260| 73 20 6f 6e 65 20 61 74 | 20 61 20 74 69 6d 65 2e |s one at| a time.|
|00004270| 20 49 66 20 61 20 74 6f | 6b 65 6e 20 68 61 73 20 | If a to|ken has |
|00004280| 74 68 65 20 6d 61 67 69 | 63 20 76 61 6c 75 65 20 |the magi|c value |
|00004290| 22 41 4c 4c 22 20 74 68 | 65 0a 58 20 20 20 20 20 |"ALL" th|e.X |
|000042a0| 2a 20 6d 61 74 63 68 20 | 61 6c 77 61 79 73 20 73 |* match |always s|
|000042b0| 75 63 63 65 65 64 73 2e | 20 49 66 20 74 68 65 20 |ucceeds.| If the |
|000042c0| 74 6f 6b 65 6e 20 69 73 | 20 61 20 64 6f 6d 61 69 |token is| a domai|
|000042d0| 6e 20 6e 61 6d 65 2c 20 | 72 65 74 75 72 6e 20 59 |n name, |return Y|
|000042e0| 45 53 20 69 66 20 69 74 | 0a 58 20 20 20 20 20 2a |ES if it|.X *|
|000042f0| 20 6d 61 74 63 68 65 73 | 20 74 68 65 20 6c 61 73 | matches| the las|
|00004300| 74 20 66 69 65 6c 64 73 | 20 6f 66 20 74 68 65 20 |t fields| of the |
|00004310| 73 74 72 69 6e 67 2e 20 | 4f 74 68 65 72 77 69 73 |string. |Otherwis|
|00004320| 65 2c 20 72 65 74 75 72 | 6e 20 59 45 53 20 69 66 |e, retur|n YES if|
|00004330| 20 74 68 65 0a 58 20 20 | 20 20 20 2a 20 74 6f 6b | the.X | * tok|
|00004340| 65 6e 20 66 75 6c 6c 79 | 20 6d 61 74 63 68 65 73 |en fully| matches|
|00004350| 20 74 68 65 20 73 74 72 | 69 6e 67 2e 20 4e 6f 74 | the str|ing. Not|
|00004360| 65 3a 20 77 65 20 61 73 | 73 75 6d 65 20 74 68 61 |e: we as|sume tha|
|00004370| 74 20 61 20 73 65 72 76 | 69 63 65 20 6e 61 6d 65 |t a serv|ice name|
|00004380| 0a 58 20 20 20 20 20 2a | 20 6e 65 76 65 72 20 62 |.X *| never b|
|00004390| 65 67 69 6e 73 20 77 69 | 74 68 20 61 20 22 2e 22 |egins wi|th a "."|
|000043a0| 20 63 68 61 72 61 63 74 | 65 72 2e 0a 58 20 20 20 | charact|er..X |
|000043b0| 20 20 2a 2f 0a 58 0a 58 | 20 20 20 20 66 6f 72 20 | */.X.X| for |
|000043c0| 28 74 6f 6b 65 6e 20 3d | 20 73 74 72 74 6f 6b 28 |(token =| strtok(|
|000043d0| 6c 69 73 74 2c 20 73 65 | 70 29 3b 20 74 6f 6b 65 |list, se|p); toke|
|000043e0| 6e 3b 20 74 6f 6b 65 6e | 20 3d 20 73 74 72 74 6f |n; token| = strto|
|000043f0| 6b 28 28 63 68 61 72 20 | 2a 29 20 30 2c 20 73 65 |k((char |*) 0, se|
|00004400| 70 29 29 20 7b 0a 58 09 | 69 66 20 28 73 74 72 63 |p)) {.X.|if (strc|
|00004410| 61 73 65 63 6d 70 28 74 | 6f 6b 65 6e 2c 20 22 41 |asecmp(t|oken, "A|
|00004420| 4c 4c 22 29 20 3d 3d 20 | 30 29 20 7b 09 2f 2a 20 |LL") == |0) {./* |
|00004430| 6d 61 67 69 63 3a 20 61 | 6c 77 61 79 73 20 6d 61 |magic: a|lways ma|
|00004440| 74 63 68 65 73 20 2a 2f | 0a 58 09 20 20 20 20 72 |tches */|.X. r|
|00004450| 65 74 75 72 6e 20 28 59 | 45 53 29 3b 0a 58 09 7d |eturn (Y|ES);.X.}|
|00004460| 20 65 6c 73 65 20 69 66 | 20 28 74 6f 6b 65 6e 5b | else if| (token[|
|00004470| 30 5d 20 3d 3d 20 27 2e | 27 29 20 7b 09 09 2f 2a |0] == '.|') {../*|
|00004480| 20 64 6f 6d 61 69 6e 3a | 20 6d 61 74 63 68 20 6c | domain:| match l|
|00004490| 61 73 74 20 66 69 65 6c | 64 73 20 2a 2f 0a 58 09 |ast fiel|ds */.X.|
|000044a0| 20 20 20 20 69 66 20 28 | 28 73 74 72 5f 6c 65 6e | if (|(str_len|
|000044b0| 20 3d 20 73 74 72 6c 65 | 6e 28 73 74 72 69 6e 67 | = strle|n(string|
|000044c0| 29 29 20 3e 3d 20 28 74 | 6f 6b 5f 6c 65 6e 20 3d |)) >= (t|ok_len =|
|000044d0| 20 73 74 72 6c 65 6e 28 | 74 6f 6b 65 6e 29 29 0a | strlen(|token)).|
|000044e0| 58 09 09 26 26 20 73 74 | 72 63 61 73 65 63 6d 70 |X..&& st|rcasecmp|
|000044f0| 28 74 6f 6b 65 6e 2c 20 | 73 74 72 69 6e 67 20 2b |(token, |string +|
|00004500| 20 73 74 72 5f 6c 65 6e | 20 2d 20 74 6f 6b 5f 6c | str_len| - tok_l|
|00004510| 65 6e 29 20 3d 3d 20 30 | 29 0a 58 09 09 72 65 74 |en) == 0|).X..ret|
|00004520| 75 72 6e 20 28 59 45 53 | 29 3b 0a 58 09 7d 20 65 |urn (YES|);.X.} e|
|00004530| 6c 73 65 20 7b 09 09 09 | 09 2f 2a 20 6f 74 68 65 |lse {...|./* othe|
|00004540| 72 3a 20 6d 61 74 63 68 | 20 66 75 6c 6c 20 73 74 |r: match| full st|
|00004550| 72 69 6e 67 20 2a 2f 0a | 58 09 20 20 20 20 69 66 |ring */.|X. if|
|00004560| 20 28 73 74 72 63 61 73 | 65 63 6d 70 28 74 6f 6b | (strcas|ecmp(tok|
|00004570| 65 6e 2c 20 73 74 72 69 | 6e 67 29 20 3d 3d 20 30 |en, stri|ng) == 0|
|00004580| 29 0a 58 09 09 72 65 74 | 75 72 6e 20 28 59 45 53 |).X..ret|urn (YES|
|00004590| 29 3b 0a 58 09 7d 0a 58 | 20 20 20 20 7d 0a 58 20 |);.X.}.X| }.X |
|000045a0| 20 20 20 72 65 74 75 72 | 6e 20 28 4e 4f 29 3b 0a | retur|n (NO);.|
|000045b0| 58 7d 0a 58 0a 58 23 65 | 6e 64 69 66 0a 45 4e 44 |X}.X.X#e|ndif.END|
|000045c0| 5f 4f 46 5f 68 6f 73 74 | 73 5f 61 63 63 65 73 73 |_OF_host|s_access|
|000045d0| 2e 63 0a 69 66 20 74 65 | 73 74 20 34 30 35 35 20 |.c.if te|st 4055 |
|000045e0| 2d 6e 65 20 60 77 63 20 | 2d 63 20 3c 68 6f 73 74 |-ne `wc |-c <host|
|000045f0| 73 5f 61 63 63 65 73 73 | 2e 63 60 3b 20 74 68 65 |s_access|.c`; the|
|00004600| 6e 0a 20 20 20 20 65 63 | 68 6f 20 73 68 61 72 3a |n. ec|ho shar:|
|00004610| 20 5c 22 68 6f 73 74 73 | 5f 61 63 63 65 73 73 2e | \"hosts|_access.|
|00004620| 63 5c 22 20 75 6e 70 61 | 63 6b 65 64 20 77 69 74 |c\" unpa|cked wit|
|00004630| 68 20 77 72 6f 6e 67 20 | 73 69 7a 65 21 0a 66 69 |h wrong |size!.fi|
|00004640| 0a 23 20 65 6e 64 20 6f | 66 20 6f 76 65 72 77 72 |.# end o|f overwr|
|00004650| 69 74 69 6e 67 20 63 68 | 65 63 6b 0a 66 69 0a 69 |iting ch|eck.fi.i|
|00004660| 66 20 74 65 73 74 20 2d | 66 20 4d 61 6b 65 66 69 |f test -|f Makefi|
|00004670| 6c 65 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |le -a "$|{1}" != |
|00004680| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|00004690| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|000046a0| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|000046b0| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 5c 22 4d 61 |isting f|ile \"Ma|
|000046c0| 6b 65 66 69 6c 65 5c 22 | 0a 65 6c 73 65 0a 65 63 |kefile\"|.else.ec|
|000046d0| 68 6f 20 73 68 61 72 3a | 20 45 78 74 72 61 63 74 |ho shar:| Extract|
|000046e0| 69 6e 67 20 5c 22 4d 61 | 6b 65 66 69 6c 65 5c 22 |ing \"Ma|kefile\"|
|000046f0| 20 5c 28 31 30 37 37 20 | 63 68 61 72 61 63 74 65 | \(1077 |characte|
|00004700| 72 73 5c 29 0a 73 65 64 | 20 22 73 2f 5e 58 2f 2f |rs\).sed| "s/^X//|
|00004710| 22 20 3e 4d 61 6b 65 66 | 69 6c 65 20 3c 3c 27 45 |" >Makef|ile <<'E|
|00004720| 4e 44 5f 4f 46 5f 4d 61 | 6b 65 66 69 6c 65 27 0a |ND_OF_Ma|kefile'.|
|00004730| 58 23 20 40 28 23 29 20 | 4d 61 6b 65 66 69 6c 65 |X# @(#) |Makefile|
|00004740| 20 31 2e 31 20 39 31 2f | 30 31 2f 30 36 20 32 32 | 1.1 91/|01/06 22|
|00004750| 3a 33 30 3a 32 31 0a 58 | 0a 58 23 23 20 42 65 67 |:30:21.X|.X## Beg|
|00004760| 69 6e 20 63 6f 6e 66 69 | 67 75 72 61 74 69 6f 6e |in confi|guration|
|00004770| 20 6f 70 74 69 6f 6e 73 | 0a 58 0a 58 23 20 49 66 | options|.X.X# If|
|00004780| 20 79 6f 75 20 77 61 6e | 74 20 74 6f 20 65 6e 61 | you wan|t to ena|
|00004790| 62 6c 65 20 68 6f 73 74 | 20 61 63 63 65 73 73 20 |ble host| access |
|000047a0| 63 6f 6e 74 72 6f 6c 2c | 20 64 65 66 69 6e 65 20 |control,| define |
|000047b0| 74 68 65 20 48 4f 53 54 | 5f 41 43 43 45 53 53 20 |the HOST|_ACCESS |
|000047c0| 6d 61 63 72 6f 0a 58 23 | 20 69 6e 20 74 68 65 20 |macro.X#| in the |
|000047d0| 20 43 46 4c 41 47 53 20 | 6c 69 6e 65 2e 20 46 6f | CFLAGS |line. Fo|
|000047e0| 72 20 65 78 61 6d 70 6c | 65 2c 0a 58 23 0a 58 23 |r exampl|e,.X#.X#|
|000047f0| 20 43 46 4c 41 47 53 20 | 3d 20 2d 4f 20 2d 44 48 | CFLAGS |= -O -DH|
|00004800| 4f 53 54 53 5f 41 43 43 | 45 53 53 0a 58 23 0a 58 |OSTS_ACC|ESS.X#.X|
|00004810| 23 20 4e 6f 74 65 3a 20 | 68 6f 73 74 20 61 63 63 |# Note: |host acc|
|00004820| 65 73 73 20 63 6f 6e 74 | 72 6f 6c 20 72 65 71 75 |ess cont|rol requ|
|00004830| 69 72 65 73 20 74 68 65 | 20 73 74 72 74 6f 6b 28 |ires the| strtok(|
|00004840| 29 20 61 6e 64 20 73 74 | 72 63 68 72 28 29 20 72 |) and st|rchr() r|
|00004850| 6f 75 74 69 6e 65 73 2e | 0a 58 0a 58 43 46 4c 41 |outines.|.X.XCFLA|
|00004860| 47 53 09 3d 20 2d 4f 20 | 2d 44 48 4f 53 54 53 5f |GS.= -O |-DHOSTS_|
|00004870| 41 43 43 45 53 53 0a 58 | 0a 58 23 20 49 6e 63 6c |ACCESS.X|.X# Incl|
|00004880| 75 64 65 20 74 68 65 20 | 66 69 6c 65 20 73 74 72 |ude the |file str|
|00004890| 63 61 73 65 63 6d 70 2e | 6f 20 69 66 20 69 74 20 |casecmp.|o if it |
|000048a0| 69 73 20 6e 6f 74 20 70 | 72 6f 76 69 64 65 64 20 |is not p|rovided |
|000048b0| 62 79 20 79 6f 75 72 20 | 43 20 6c 69 62 72 61 72 |by your |C librar|
|000048c0| 79 2e 0a 58 0a 58 41 55 | 58 5f 4f 42 4a 09 3d 20 |y..X.XAU|X_OBJ.= |
|000048d0| 23 20 73 74 72 63 61 73 | 65 63 6d 70 2e 6f 0a 58 |# strcas|ecmp.o.X|
|000048e0| 0a 58 23 20 53 6f 6d 65 | 20 53 79 73 74 65 6d 2d |.X# Some| System-|
|000048f0| 56 20 76 65 72 73 69 6f | 6e 73 20 72 65 71 75 69 |V versio|ns requi|
|00004900| 72 65 20 74 68 61 74 20 | 79 6f 75 20 65 78 70 6c |re that |you expl|
|00004910| 69 63 69 74 6c 79 20 73 | 70 65 63 69 66 79 20 74 |icitly s|pecify t|
|00004920| 68 65 20 6e 65 74 77 6f | 72 6b 69 6e 67 0a 58 23 |he netwo|rking.X#|
|00004930| 20 6c 69 62 72 61 72 69 | 65 73 2e 0a 58 0a 58 4c | librari|es..X.XL|
|00004940| 49 42 53 09 3d 0a 58 0a | 58 23 23 20 45 6e 64 20 |IBS.=.X.|X## End |
|00004950| 63 6f 6e 66 69 67 75 72 | 61 74 69 6f 6e 20 6f 70 |configur|ation op|
|00004960| 74 69 6f 6e 73 0a 58 0a | 58 54 43 50 44 5f 4f 42 |tions.X.|XTCPD_OB|
|00004970| 4a 3d 20 74 63 70 64 2e | 6f 20 66 72 6f 6d 68 6f |J= tcpd.|o fromho|
|00004980| 73 74 2e 6f 20 68 6f 73 | 74 73 5f 61 63 63 65 73 |st.o hos|ts_acces|
|00004990| 73 2e 6f 0a 58 4d 49 53 | 43 5f 4f 42 4a 3d 20 6d |s.o.XMIS|C_OBJ= m|
|000049a0| 69 73 63 64 2e 6f 20 66 | 72 6f 6d 68 6f 73 74 2e |iscd.o f|romhost.|
|000049b0| 6f 20 68 6f 73 74 73 5f | 61 63 63 65 73 73 2e 6f |o hosts_|access.o|
|000049c0| 0a 58 0a 58 61 6c 6c 3a | 09 74 63 70 64 20 6d 69 |.X.Xall:|.tcpd mi|
|000049d0| 73 63 64 0a 58 0a 58 74 | 63 70 64 3a 09 24 28 54 |scd.X.Xt|cpd:.$(T|
|000049e0| 43 50 44 5f 4f 42 4a 29 | 20 24 28 41 55 58 5f 4f |CPD_OBJ)| $(AUX_O|
|000049f0| 42 4a 29 0a 58 09 24 28 | 43 43 29 20 24 28 43 46 |BJ).X.$(|CC) $(CF|
|00004a00| 4c 41 47 53 29 20 2d 6f | 20 24 40 20 24 28 54 43 |LAGS) -o| $@ $(TC|
|00004a10| 50 44 5f 4f 42 4a 29 20 | 24 28 41 55 58 5f 4f 42 |PD_OBJ) |$(AUX_OB|
|00004a20| 4a 29 20 24 28 4c 49 42 | 53 29 0a 58 0a 58 6d 69 |J) $(LIB|S).X.Xmi|
|00004a30| 73 63 64 3a 09 24 28 4d | 49 53 43 5f 4f 42 4a 29 |scd:.$(M|ISC_OBJ)|
|00004a40| 20 24 28 41 55 58 5f 4f | 42 4a 29 0a 58 09 24 28 | $(AUX_O|BJ).X.$(|
|00004a50| 43 43 29 20 24 28 43 46 | 4c 41 47 53 29 20 2d 6f |CC) $(CF|LAGS) -o|
|00004a60| 20 24 40 20 24 28 4d 49 | 53 43 5f 4f 42 4a 29 20 | $@ $(MI|SC_OBJ) |
|00004a70| 24 28 41 55 58 5f 4f 42 | 4a 29 20 24 28 4c 49 42 |$(AUX_OB|J) $(LIB|
|00004a80| 53 29 0a 58 0a 58 73 68 | 61 72 3a 09 0a 58 09 40 |S).X.Xsh|ar:..X.@|
|00004a90| 73 68 61 72 20 52 45 41 | 44 4d 45 20 6d 69 73 63 |shar REA|DME misc|
|00004aa0| 64 2e 63 20 74 63 70 64 | 2e 63 20 66 72 6f 6d 68 |d.c tcpd|.c fromh|
|00004ab0| 6f 73 74 2e 63 20 68 6f | 73 74 73 5f 61 63 63 65 |ost.c ho|sts_acce|
|00004ac0| 73 73 2e 63 20 4d 61 6b | 65 66 69 6c 65 20 5c 0a |ss.c Mak|efile \.|
|00004ad0| 58 09 68 6f 73 74 73 5f | 61 63 63 65 73 73 2e 35 |X.hosts_|access.5|
|00004ae0| 20 73 74 72 63 61 73 65 | 63 6d 70 2e 63 20 42 4c | strcase|cmp.c BL|
|00004af0| 55 52 42 0a 58 0a 58 63 | 6c 65 61 6e 3a 0a 58 09 |URB.X.Xc|lean:.X.|
|00004b00| 72 6d 20 2d 66 20 74 63 | 70 64 20 6d 69 73 63 64 |rm -f tc|pd miscd|
|00004b10| 20 2a 2e 6f 20 63 6f 72 | 65 0a 58 0a 58 6c 69 6e | *.o cor|e.X.Xlin|
|00004b20| 74 3a 0a 58 09 6c 69 6e | 74 20 2d 44 48 4f 53 54 |t:.X.lin|t -DHOST|
|00004b30| 53 5f 41 43 43 45 53 53 | 20 74 63 70 64 2e 63 20 |S_ACCESS| tcpd.c |
|00004b40| 66 72 6f 6d 68 6f 73 74 | 2e 63 20 68 6f 73 74 73 |fromhost|.c hosts|
|00004b50| 5f 61 63 63 65 73 73 2e | 63 0a 58 09 6c 69 6e 74 |_access.|c.X.lint|
|00004b60| 20 2d 44 48 4f 53 54 53 | 5f 41 43 43 45 53 53 20 | -DHOSTS|_ACCESS |
|00004b70| 6d 69 73 63 64 2e 63 20 | 66 72 6f 6d 68 6f 73 74 |miscd.c |fromhost|
|00004b80| 2e 63 20 68 6f 73 74 73 | 5f 61 63 63 65 73 73 2e |.c hosts|_access.|
|00004b90| 63 0a 45 4e 44 5f 4f 46 | 5f 4d 61 6b 65 66 69 6c |c.END_OF|_Makefil|
|00004ba0| 65 0a 69 66 20 74 65 73 | 74 20 31 30 37 37 20 2d |e.if tes|t 1077 -|
|00004bb0| 6e 65 20 60 77 63 20 2d | 63 20 3c 4d 61 6b 65 66 |ne `wc -|c <Makef|
|00004bc0| 69 6c 65 60 3b 20 74 68 | 65 6e 0a 20 20 20 20 65 |ile`; th|en. e|
|00004bd0| 63 68 6f 20 73 68 61 72 | 3a 20 5c 22 4d 61 6b 65 |cho shar|: \"Make|
|00004be0| 66 69 6c 65 5c 22 20 75 | 6e 70 61 63 6b 65 64 20 |file\" u|npacked |
|00004bf0| 77 69 74 68 20 77 72 6f | 6e 67 20 73 69 7a 65 21 |with wro|ng size!|
|00004c00| 0a 66 69 0a 23 20 65 6e | 64 20 6f 66 20 6f 76 65 |.fi.# en|d of ove|
|00004c10| 72 77 72 69 74 69 6e 67 | 20 63 68 65 63 6b 0a 66 |rwriting| check.f|
|00004c20| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 68 6f 73 |i.if tes|t -f hos|
|00004c30| 74 73 5f 61 63 63 65 73 | 73 2e 35 20 2d 61 20 22 |ts_acces|s.5 -a "|
|00004c40| 24 7b 31 7d 22 20 21 3d | 20 22 2d 63 22 20 3b 20 |${1}" !=| "-c" ; |
|00004c50| 74 68 65 6e 20 0a 20 20 | 65 63 68 6f 20 73 68 61 |then . |echo sha|
|00004c60| 72 3a 20 57 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: Will |not over|
|00004c70| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00004c80| 66 69 6c 65 20 5c 22 68 | 6f 73 74 73 5f 61 63 63 |file \"h|osts_acc|
|00004c90| 65 73 73 2e 35 5c 22 0a | 65 6c 73 65 0a 65 63 68 |ess.5\".|else.ech|
|00004ca0| 6f 20 73 68 61 72 3a 20 | 45 78 74 72 61 63 74 69 |o shar: |Extracti|
|00004cb0| 6e 67 20 5c 22 68 6f 73 | 74 73 5f 61 63 63 65 73 |ng \"hos|ts_acces|
|00004cc0| 73 2e 35 5c 22 20 5c 28 | 33 30 38 38 20 63 68 61 |s.5\" \(|3088 cha|
|00004cd0| 72 61 63 74 65 72 73 5c | 29 0a 73 65 64 20 22 73 |racters\|).sed "s|
|00004ce0| 2f 5e 58 2f 2f 22 20 3e | 68 6f 73 74 73 5f 61 63 |/^X//" >|hosts_ac|
|00004cf0| 63 65 73 73 2e 35 20 3c | 3c 27 45 4e 44 5f 4f 46 |cess.5 <|<'END_OF|
|00004d00| 5f 68 6f 73 74 73 5f 61 | 63 63 65 73 73 2e 35 27 |_hosts_a|ccess.5'|
|00004d10| 0a 58 2e 54 48 20 48 4f | 53 54 53 5f 41 43 43 45 |.X.TH HO|STS_ACCE|
|00004d20| 53 53 20 35 0a 58 2e 61 | 64 0a 58 2e 66 69 0a 58 |SS 5.X.a|d.X.fi.X|
|00004d30| 2e 53 48 20 4e 41 4d 45 | 0a 58 68 6f 73 74 73 5f |.SH NAME|.Xhosts_|
|00004d40| 61 63 63 65 73 73 20 5c | 2d 20 68 6f 73 74 20 61 |access \|- host a|
|00004d50| 63 63 65 73 73 20 63 6f | 6e 74 72 6f 6c 20 66 69 |ccess co|ntrol fi|
|00004d60| 6c 65 73 0a 58 2e 53 48 | 20 44 45 53 43 52 49 50 |les.X.SH| DESCRIP|
|00004d70| 54 49 4f 4e 0a 58 2e 61 | 64 0a 58 2e 66 69 0a 58 |TION.X.a|d.X.fi.X|
|00004d80| 54 68 69 73 20 6d 61 6e | 75 61 6c 20 70 61 67 65 |This man|ual page|
|00004d90| 20 64 65 73 63 72 69 62 | 65 73 20 61 20 73 69 6d | describ|es a sim|
|00004da0| 70 6c 65 2c 20 62 75 74 | 20 65 66 66 65 63 74 69 |ple, but| effecti|
|00004db0| 76 65 2c 20 61 63 63 65 | 73 73 20 63 6f 6e 74 72 |ve, acce|ss contr|
|00004dc0| 6f 6c 0a 58 66 61 63 69 | 6c 69 74 79 20 74 68 61 |ol.Xfaci|lity tha|
|00004dd0| 74 20 69 73 20 62 61 73 | 65 64 20 6f 6e 20 68 6f |t is bas|ed on ho|
|00004de0| 73 74 20 28 6f 72 20 64 | 6f 6d 61 69 6e 29 20 6e |st (or d|omain) n|
|00004df0| 61 6d 65 73 20 61 6e 64 | 20 73 65 72 76 69 63 65 |ames and| service|
|00004e00| 20 6e 61 6d 65 73 2c 0a | 58 77 69 74 68 20 77 69 | names,.|Xwith wi|
|00004e10| 6c 64 2d 63 61 72 64 20 | 73 75 70 70 6f 72 74 2e |ld-card |support.|
|00004e20| 0a 58 2e 50 50 0a 58 49 | 6e 20 74 68 65 20 66 6f |.X.PP.XI|n the fo|
|00004e30| 6c 6c 6f 77 69 6e 67 20 | 74 65 78 74 2c 20 5c 66 |llowing |text, \f|
|00004e40| 49 73 65 72 76 69 63 65 | 5c 66 50 20 69 73 20 74 |Iservice|\fP is t|
|00004e50| 68 65 20 6e 61 6d 65 20 | 6f 66 20 61 20 72 65 71 |he name |of a req|
|00004e60| 75 65 73 74 65 64 20 73 | 65 72 76 69 63 65 0a 58 |uested s|ervice.X|
|00004e70| 28 74 68 65 20 61 72 67 | 76 5b 30 5d 20 76 61 6c |(the arg|v[0] val|
|00004e80| 75 65 20 6f 66 20 61 20 | 64 61 65 6d 6f 6e 20 70 |ue of a |daemon p|
|00004e90| 72 6f 63 65 73 73 29 2c | 20 61 6e 64 20 5c 66 49 |rocess),| and \fI|
|00004ea0| 68 6f 73 74 5c 66 50 20 | 69 73 20 74 68 65 20 6e |host\fP |is the n|
|00004eb0| 61 6d 65 20 6f 66 0a 58 | 74 68 65 20 68 6f 73 74 |ame of.X|the host|
|00004ec0| 20 72 65 71 75 65 73 74 | 69 6e 67 20 74 68 61 74 | request|ing that|
|00004ed0| 20 73 65 72 76 69 63 65 | 2e 0a 58 2e 49 50 20 6f | service|..X.IP o|
|00004ee0| 0a 58 41 63 63 65 73 73 | 20 77 69 6c 6c 20 62 65 |.XAccess| will be|
|00004ef0| 20 67 72 61 6e 74 65 64 | 20 69 66 20 74 68 65 20 | granted| if the |
|00004f00| 28 73 65 72 76 69 63 65 | 2c 68 6f 73 74 29 20 70 |(service|,host) p|
|00004f10| 61 69 72 20 69 73 20 6d | 61 74 63 68 65 64 20 62 |air is m|atched b|
|00004f20| 79 20 61 6e 0a 58 65 6e | 74 72 79 20 69 6e 20 74 |y an.Xen|try in t|
|00004f30| 68 65 20 5c 66 49 2f 65 | 74 63 2f 68 6f 73 74 73 |he \fI/e|tc/hosts|
|00004f40| 2e 61 6c 6c 6f 77 5c 66 | 50 20 66 69 6c 65 2e 0a |.allow\f|P file..|
|00004f50| 58 2e 49 50 20 6f 0a 58 | 49 66 20 74 68 65 20 70 |X.IP o.X|If the p|
|00004f60| 72 65 76 69 6f 75 73 20 | 74 65 73 74 20 66 61 69 |revious |test fai|
|00004f70| 6c 73 20 28 70 65 72 68 | 61 70 73 20 62 65 63 61 |ls (perh|aps beca|
|00004f80| 75 73 65 20 74 68 65 20 | 5c 66 49 68 6f 73 74 73 |use the |\fIhosts|
|00004f90| 2e 61 6c 6c 6f 77 5c 66 | 50 20 66 69 6c 65 0a 58 |.allow\f|P file.X|
|00004fa0| 64 6f 65 73 20 6e 6f 74 | 20 65 78 69 73 74 29 2c |does not| exist),|
|00004fb0| 20 61 63 63 65 73 73 20 | 77 69 6c 6c 20 62 65 20 | access |will be |
|00004fc0| 64 65 6e 69 65 64 20 69 | 66 20 74 68 65 20 28 73 |denied i|f the (s|
|00004fd0| 65 72 76 69 63 65 2c 68 | 6f 73 74 29 20 70 61 69 |ervice,h|ost) pai|
|00004fe0| 72 20 69 73 0a 58 6d 61 | 74 63 68 65 64 20 62 79 |r is.Xma|tched by|
|00004ff0| 20 61 6e 20 65 6e 74 72 | 79 20 69 6e 20 74 68 65 | an entr|y in the|
|00005000| 20 5c 66 49 2f 65 74 63 | 2f 68 6f 73 74 73 2e 64 | \fI/etc|/hosts.d|
|00005010| 65 6e 79 5c 66 50 20 66 | 69 6c 65 2e 0a 58 2e 49 |eny\fP f|ile..X.I|
|00005020| 50 20 6f 0a 58 49 66 20 | 74 68 65 20 70 72 65 76 |P o.XIf |the prev|
|00005030| 69 6f 75 73 20 74 65 73 | 74 20 66 61 69 6c 73 20 |ious tes|t fails |
|00005040| 28 70 65 72 68 61 70 73 | 20 62 65 63 61 75 73 65 |(perhaps| because|
|00005050| 20 74 68 65 20 5c 66 49 | 68 6f 73 74 73 2e 64 65 | the \fI|hosts.de|
|00005060| 6e 79 5c 66 50 20 66 69 | 6c 65 0a 58 64 6f 65 73 |ny\fP fi|le.Xdoes|
|00005070| 20 6e 6f 74 20 65 78 69 | 73 74 29 2c 20 61 63 63 | not exi|st), acc|
|00005080| 65 73 73 20 77 69 6c 6c | 20 62 65 20 67 72 61 6e |ess will| be gran|
|00005090| 74 65 64 2e 0a 58 2e 50 | 50 0a 58 41 20 6e 6f 6e |ted..X.P|P.XA non|
|000050a0| 2d 65 78 69 73 74 69 6e | 67 20 61 63 63 65 73 73 |-existin|g access|
|000050b0| 20 63 6f 6e 74 72 6f 6c | 20 66 69 6c 65 20 69 73 | control| file is|
|000050c0| 20 74 72 65 61 74 65 64 | 20 61 73 20 69 66 20 69 | treated| as if i|
|000050d0| 74 20 77 65 72 65 20 61 | 6e 20 65 6d 70 74 79 0a |t were a|n empty.|
|000050e0| 58 66 69 6c 65 2e 20 54 | 68 75 73 2c 20 61 63 63 |Xfile. T|hus, acc|
|000050f0| 65 73 73 20 63 6f 6e 74 | 72 6f 6c 20 63 61 6e 20 |ess cont|rol can |
|00005100| 62 65 20 74 75 72 6e 65 | 64 20 6f 66 66 20 62 79 |be turne|d off by|
|00005110| 20 70 72 6f 76 69 64 69 | 6e 67 20 6e 6f 20 61 63 | providi|ng no ac|
|00005120| 63 65 73 73 0a 58 63 6f | 6e 74 72 6f 6c 20 66 69 |cess.Xco|ntrol fi|
|00005130| 6c 65 73 2e 0a 58 2e 50 | 50 0a 58 54 68 65 20 66 |les..X.P|P.XThe f|
|00005140| 6f 72 6d 61 74 20 6f 66 | 20 74 68 65 20 61 63 63 |ormat of| the acc|
|00005150| 65 73 73 20 63 6f 6e 74 | 72 6f 6c 20 66 69 6c 65 |ess cont|rol file|
|00005160| 73 20 69 73 20 61 73 20 | 66 6f 6c 6c 6f 77 73 2e |s is as |follows.|
|00005170| 0a 58 2e 49 50 20 6f 0a | 58 4c 69 6e 65 73 20 74 |.X.IP o.|XLines t|
|00005180| 68 61 74 20 62 65 67 69 | 6e 20 77 69 74 68 20 61 |hat begi|n with a|
|00005190| 20 60 23 27 20 63 68 61 | 72 61 63 74 65 72 20 61 | `#' cha|racter a|
|000051a0| 72 65 20 69 67 6e 6f 72 | 65 64 2e 0a 58 2e 49 50 |re ignor|ed..X.IP|
|000051b0| 20 6f 0a 58 4f 74 68 65 | 72 20 6c 69 6e 65 73 20 | o.XOthe|r lines |
|000051c0| 73 68 6f 75 6c 64 20 68 | 61 76 65 20 74 68 65 20 |should h|ave the |
|000051d0| 66 6f 72 6d 61 74 3a 0a | 58 2e 73 70 0a 58 2e 74 |format:.|X.sp.X.t|
|000051e0| 69 20 2b 35 0a 58 73 65 | 72 76 69 63 65 73 20 3a |i +5.Xse|rvices :|
|000051f0| 20 68 6f 73 74 73 5f 6f | 72 5f 64 6f 6d 61 69 6e | hosts_o|r_domain|
|00005200| 73 0a 58 2e 4c 50 0a 58 | 5c 66 49 73 65 72 76 69 |s.X.LP.X|\fIservi|
|00005210| 63 65 73 5c 66 50 20 69 | 73 20 61 20 6c 69 73 74 |ces\fP i|s a list|
|00005220| 20 6f 66 20 6f 6e 65 20 | 6f 72 20 6d 6f 72 65 20 | of one |or more |
|00005230| 73 65 72 76 69 63 65 20 | 6e 61 6d 65 73 20 28 61 |service |names (a|
|00005240| 72 67 76 5b 30 5d 20 76 | 61 6c 75 65 73 29 2c 0a |rgv[0] v|alues),.|
|00005250| 58 61 6e 64 20 5c 66 49 | 68 6f 73 74 73 5f 6f 72 |Xand \fI|hosts_or|
|00005260| 5f 64 6f 6d 61 69 6e 73 | 5c 66 50 20 69 73 20 61 |_domains|\fP is a|
|00005270| 20 6c 69 73 74 20 6f 66 | 20 6f 6e 65 20 6f 72 20 | list of| one or |
|00005280| 6d 6f 72 65 20 68 6f 73 | 74 20 6f 72 20 64 6f 6d |more hos|t or dom|
|00005290| 61 69 6e 0a 58 6e 61 6d | 65 73 2e 20 20 4c 69 73 |ain.Xnam|es. Lis|
|000052a0| 74 20 65 6c 65 6d 65 6e | 74 73 20 61 72 65 20 73 |t elemen|ts are s|
|000052b0| 65 70 61 72 61 74 65 64 | 20 62 79 20 62 6c 61 6e |eparated| by blan|
|000052c0| 6b 73 20 6f 72 20 63 6f | 6d 6d 61 73 2e 20 20 54 |ks or co|mmas. T|
|000052d0| 68 65 20 73 6f 66 74 77 | 61 72 65 0a 58 64 6f 65 |he softw|are.Xdoe|
|000052e0| 73 20 6e 6f 74 20 64 69 | 73 74 69 6e 67 75 69 73 |s not di|stinguis|
|000052f0| 68 20 62 65 74 77 65 65 | 6e 20 6c 6f 77 65 72 20 |h betwee|n lower |
|00005300| 61 6e 64 20 75 70 70 65 | 72 20 63 61 73 65 2e 0a |and uppe|r case..|
|00005310| 58 2e 50 50 0a 58 45 6e | 74 72 69 65 73 20 74 68 |X.PP.XEn|tries th|
|00005320| 61 74 20 73 70 65 63 69 | 66 79 20 61 20 64 6f 6d |at speci|fy a dom|
|00005330| 61 69 6e 20 6e 61 6d 65 | 20 73 68 6f 75 6c 64 20 |ain name| should |
|00005340| 62 65 67 69 6e 20 77 69 | 74 68 20 61 20 60 2e 27 |begin wi|th a `.'|
|00005350| 20 63 68 61 72 61 63 74 | 65 72 0a 58 28 73 65 65 | charact|er.X(see|
|00005360| 20 65 78 61 6d 70 6c 65 | 20 62 65 6c 6f 77 29 2e | example| below).|
|00005370| 20 41 20 68 6f 73 74 20 | 6e 61 6d 65 20 63 61 6e | A host |name can|
|00005380| 20 62 65 20 61 20 66 75 | 6c 6c 79 2d 71 75 61 6c | be a fu|lly-qual|
|00005390| 69 66 69 65 64 20 68 6f | 73 74 20 6e 61 6d 65 2c |ified ho|st name,|
|000053a0| 0a 58 61 6e 20 75 6e 64 | 6f 6d 61 69 6e 65 64 20 |.Xan und|omained |
|000053b0| 68 6f 73 74 20 6e 61 6d | 65 20 28 6e 6f 20 60 2e |host nam|e (no `.|
|000053c0| 27 20 63 68 61 72 61 63 | 74 65 72 73 29 20 6f 72 |' charac|ters) or|
|000053d0| 20 61 6e 20 69 6e 74 65 | 72 6e 65 74 20 61 64 64 | an inte|rnet add|
|000053e0| 72 65 73 73 2e 0a 58 2e | 50 50 0a 58 53 70 65 63 |ress..X.|PP.XSpec|
|000053f0| 69 61 6c 20 6d 65 61 6e | 69 6e 67 20 69 73 20 67 |ial mean|ing is g|
|00005400| 69 76 65 6e 20 74 6f 20 | 74 68 65 20 6d 61 67 69 |iven to |the magi|
|00005410| 63 20 74 6f 6b 65 6e 20 | 5c 66 49 41 4c 4c 5c 66 |c token |\fIALL\f|
|00005420| 50 2e 20 20 49 66 20 69 | 74 20 61 70 70 65 61 72 |P. If i|t appear|
|00005430| 73 0a 58 69 6e 20 74 68 | 65 20 5c 66 49 73 65 72 |s.Xin th|e \fIser|
|00005440| 76 69 63 65 73 5c 66 50 | 20 70 61 72 74 20 6f 66 |vices\fP| part of|
|00005450| 20 61 20 6c 69 6e 65 2c | 20 74 68 69 73 20 74 6f | a line,| this to|
|00005460| 6b 65 6e 20 6d 61 74 63 | 68 65 73 20 61 6c 6c 20 |ken matc|hes all |
|00005470| 73 65 72 76 69 63 65 73 | 2e 0a 58 49 66 20 74 68 |services|..XIf th|
|00005480| 65 20 6d 61 67 69 63 20 | 74 6f 6b 65 6e 20 61 70 |e magic |token ap|
|00005490| 70 65 61 72 73 20 69 6e | 20 74 68 65 20 5c 66 49 |pears in| the \fI|
|000054a0| 68 6f 73 74 73 5f 6f 72 | 5f 64 6f 6d 61 69 6e 73 |hosts_or|_domains|
|000054b0| 5c 66 50 20 70 61 72 74 | 20 6f 66 20 61 0a 58 6c |\fP part| of a.Xl|
|000054c0| 69 6e 65 2c 20 69 74 20 | 6d 61 74 63 68 65 73 20 |ine, it |matches |
|000054d0| 61 6c 6c 20 68 6f 73 74 | 73 20 6f 72 20 64 6f 6d |all host|s or dom|
|000054e0| 61 69 6e 73 2e 0a 58 2e | 53 48 20 45 58 41 4d 50 |ains..X.|SH EXAMP|
|000054f0| 4c 45 53 0a 58 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |LES.XThe| followi|
|00005500| 6e 67 20 65 78 61 6d 70 | 6c 65 20 72 65 73 74 72 |ng examp|le restr|
|00005510| 69 63 74 73 20 61 6c 6c | 20 73 65 72 76 69 63 65 |icts all| service|
|00005520| 73 20 74 6f 20 5c 66 49 | 68 6f 73 74 61 2c 0a 58 |s to \fI|hosta,.X|
|00005530| 68 6f 73 74 62 5c 66 50 | 20 61 6e 64 20 68 6f 73 |hostb\fP| and hos|
|00005540| 74 73 20 62 65 6c 6f 77 | 20 74 68 65 20 5c 66 49 |ts below| the \fI|
|00005550| 2e 73 6f 6d 65 2e 64 6f | 6d 61 69 6e 5c 66 50 3a |.some.do|main\fP:|
|00005560| 0a 58 2e 50 50 0a 58 2f | 65 74 63 2f 68 6f 73 74 |.X.PP.X/|etc/host|
|00005570| 73 2e 61 6c 6c 6f 77 3a | 0a 58 2e 69 6e 20 2b 35 |s.allow:|.X.in +5|
|00005580| 0a 58 41 4c 4c 3a 20 68 | 6f 73 74 61 2c 20 68 6f |.XALL: h|osta, ho|
|00005590| 73 74 62 2c 20 2e 73 6f | 6d 65 2e 64 6f 6d 61 69 |stb, .so|me.domai|
|000055a0| 6e 0a 58 2e 50 50 0a 58 | 2f 65 74 63 2f 68 6f 73 |n.X.PP.X|/etc/hos|
|000055b0| 74 73 2e 64 65 6e 79 3a | 0a 58 2e 69 6e 20 2b 35 |ts.deny:|.X.in +5|
|000055c0| 0a 58 41 4c 4c 3a 20 41 | 4c 4c 0a 58 2e 50 50 0a |.XALL: A|LL.X.PP.|
|000055d0| 58 49 6e 20 6f 72 64 65 | 72 20 74 6f 20 64 65 6e |XIn orde|r to den|
|000055e0| 79 20 73 6f 6d 65 20 68 | 6f 73 74 73 20 61 6c 6c |y some h|osts all|
|000055f0| 20 73 65 72 76 69 63 65 | 73 2c 20 65 78 63 65 70 | service|s, excep|
|00005600| 74 20 66 74 70 3a 0a 58 | 2e 50 50 0a 58 2f 65 74 |t ftp:.X|.PP.X/et|
|00005610| 63 2f 68 6f 73 74 73 2e | 61 6c 6c 6f 77 3a 0a 58 |c/hosts.|allow:.X|
|00005620| 2e 69 6e 20 2b 35 0a 58 | 69 6e 2e 66 74 70 64 3a |.in +5.X|in.ftpd:|
|00005630| 20 41 4c 4c 0a 58 2e 50 | 50 0a 58 2f 65 74 63 2f | ALL.X.P|P.X/etc/|
|00005640| 68 6f 73 74 73 2e 64 65 | 6e 79 0a 58 2e 69 6e 20 |hosts.de|ny.X.in |
|00005650| 2b 35 0a 58 41 4c 4c 3a | 20 73 6f 6d 65 2e 68 6f |+5.XALL:| some.ho|
|00005660| 73 74 2e 6e 61 6d 65 2c | 20 2e 73 6f 6d 65 2e 64 |st.name,| .some.d|
|00005670| 6f 6d 61 69 6e 0a 58 2e | 53 48 20 44 49 41 47 4e |omain.X.|SH DIAGN|
|00005680| 4f 53 54 49 43 53 0a 58 | 2e 61 64 0a 58 2e 66 69 |OSTICS.X|.ad.X.fi|
|00005690| 0a 58 41 20 73 79 73 6c | 6f 67 20 72 65 63 6f 72 |.XA sysl|og recor|
|000056a0| 64 20 69 73 20 70 72 6f | 64 75 63 65 64 20 77 68 |d is pro|duced wh|
|000056b0| 65 6e 20 61 20 63 6f 6e | 6e 65 63 74 69 6f 6e 20 |en a con|nection |
|000056c0| 69 73 20 72 65 66 75 73 | 65 64 3b 20 77 68 65 6e |is refus|ed; when|
|000056d0| 20 61 20 73 79 6e 74 61 | 78 0a 58 65 72 72 6f 72 | a synta|x.Xerror|
|000056e0| 20 69 73 20 66 6f 75 6e | 64 20 69 6e 20 61 20 68 | is foun|d in a h|
|000056f0| 6f 73 74 20 61 63 63 65 | 73 73 20 63 6f 6e 74 72 |ost acce|ss contr|
|00005700| 6f 6c 20 66 69 6c 65 3b | 20 77 68 65 6e 20 74 68 |ol file;| when th|
|00005710| 65 20 6c 65 6e 67 74 68 | 20 6f 66 20 61 20 6c 69 |e length| of a li|
|00005720| 6e 65 0a 58 69 6e 20 61 | 20 68 6f 73 74 20 61 63 |ne.Xin a| host ac|
|00005730| 63 65 73 73 20 63 6f 6e | 74 72 6f 6c 20 66 69 6c |cess con|trol fil|
|00005740| 65 20 65 78 63 65 65 64 | 73 20 74 68 65 20 73 74 |e exceed|s the st|
|00005750| 64 69 6f 28 33 29 20 62 | 75 66 66 65 72 20 73 69 |dio(3) b|uffer si|
|00005760| 7a 65 2e 0a 58 2e 53 48 | 20 46 49 4c 45 53 0a 58 |ze..X.SH| FILES.X|
|00005770| 2e 6e 61 0a 58 2e 6e 66 | 0a 58 2f 65 74 63 2f 68 |.na.X.nf|.X/etc/h|
|00005780| 6f 73 74 73 2e 61 6c 6c | 6f 77 2c 20 28 73 65 72 |osts.all|ow, (ser|
|00005790| 76 69 63 65 2c 68 6f 73 | 74 29 20 70 61 69 72 73 |vice,hos|t) pairs|
|000057a0| 20 74 68 61 74 20 61 72 | 65 20 67 72 61 6e 74 65 | that ar|e grante|
|000057b0| 64 20 61 63 63 65 73 73 | 2e 0a 58 2f 65 74 63 2f |d access|..X/etc/|
|000057c0| 68 6f 73 74 73 2e 64 65 | 6e 79 2c 20 28 73 65 72 |hosts.de|ny, (ser|
|000057d0| 76 69 63 65 2c 68 6f 73 | 74 29 20 70 61 69 72 73 |vice,hos|t) pairs|
|000057e0| 20 74 68 61 74 20 61 72 | 65 20 64 65 6e 69 65 64 | that ar|e denied|
|000057f0| 20 61 63 63 65 73 73 2e | 0a 58 2e 53 48 20 42 55 | access.|.X.SH BU|
|00005800| 47 53 0a 58 2e 61 64 0a | 58 2e 66 69 0a 58 41 75 |GS.X.ad.|X.fi.XAu|
|00005810| 74 68 6f 72 69 7a 65 64 | 20 68 6f 73 74 73 20 6d |thorized| hosts m|
|00005820| 61 79 20 62 65 20 64 65 | 6e 69 65 64 20 61 63 63 |ay be de|nied acc|
|00005830| 65 73 73 20 69 66 20 74 | 68 65 20 6d 61 70 70 69 |ess if t|he mappi|
|00005840| 6e 67 20 6f 66 20 68 6f | 73 74 20 61 64 64 72 65 |ng of ho|st addre|
|00005850| 73 73 0a 58 74 6f 20 68 | 6f 73 74 20 6e 61 6d 65 |ss.Xto h|ost name|
|00005860| 20 66 61 69 6c 73 20 28 | 66 6f 72 20 65 78 61 6d | fails (|for exam|
|00005870| 70 6c 65 2c 20 64 75 65 | 20 74 6f 20 61 20 70 72 |ple, due| to a pr|
|00005880| 6f 62 6c 65 6d 20 69 6e | 20 74 68 65 20 6e 61 6d |oblem in| the nam|
|00005890| 65 20 73 65 72 76 65 72 | 29 2e 0a 58 2e 53 48 20 |e server|)..X.SH |
|000058a0| 41 55 54 48 4f 52 0a 58 | 2e 6e 61 0a 58 2e 6e 66 |AUTHOR.X|.na.X.nf|
|000058b0| 0a 58 57 69 65 74 73 65 | 20 56 65 6e 65 6d 61 0a |.XWietse| Venema.|
|000058c0| 58 45 69 6e 64 68 6f 76 | 65 6e 20 55 6e 69 76 65 |XEindhov|en Unive|
|000058d0| 72 73 69 74 79 20 6f 66 | 20 54 65 63 68 6e 6f 6c |rsity of| Technol|
|000058e0| 6f 67 79 0a 58 44 65 70 | 61 72 74 6d 65 6e 74 20 |ogy.XDep|artment |
|000058f0| 6f 66 20 4d 61 74 68 65 | 6d 61 74 69 63 73 20 61 |of Mathe|matics a|
|00005900| 6e 64 20 43 6f 6d 70 75 | 74 65 72 20 53 63 69 65 |nd Compu|ter Scie|
|00005910| 6e 63 65 0a 58 44 65 6e | 20 44 6f 6c 65 63 68 20 |nce.XDen| Dolech |
|00005920| 32 2c 20 50 2e 4f 2e 20 | 42 6f 78 20 35 31 33 2c |2, P.O. |Box 513,|
|00005930| 20 35 36 30 30 20 4d 42 | 20 45 69 6e 64 68 6f 76 | 5600 MB| Eindhov|
|00005940| 65 6e 2c 20 54 68 65 20 | 4e 65 74 68 65 72 6c 61 |en, The |Netherla|
|00005950| 6e 64 73 0a 58 5c 22 20 | 40 28 23 29 20 68 6f 73 |nds.X\" |@(#) hos|
|00005960| 74 73 5f 61 63 63 65 73 | 73 2e 35 20 31 2e 31 20 |ts_acces|s.5 1.1 |
|00005970| 39 31 2f 30 31 2f 30 36 | 20 32 32 3a 33 30 3a 32 |91/01/06| 22:30:2|
|00005980| 36 0a 45 4e 44 5f 4f 46 | 5f 68 6f 73 74 73 5f 61 |6.END_OF|_hosts_a|
|00005990| 63 63 65 73 73 2e 35 0a | 69 66 20 74 65 73 74 20 |ccess.5.|if test |
|000059a0| 33 30 38 38 20 2d 6e 65 | 20 60 77 63 20 2d 63 20 |3088 -ne| `wc -c |
|000059b0| 3c 68 6f 73 74 73 5f 61 | 63 63 65 73 73 2e 35 60 |<hosts_a|ccess.5`|
|000059c0| 3b 20 74 68 65 6e 0a 20 | 20 20 20 65 63 68 6f 20 |; then. | echo |
|000059d0| 73 68 61 72 3a 20 5c 22 | 68 6f 73 74 73 5f 61 63 |shar: \"|hosts_ac|
|000059e0| 63 65 73 73 2e 35 5c 22 | 20 75 6e 70 61 63 6b 65 |cess.5\"| unpacke|
|000059f0| 64 20 77 69 74 68 20 77 | 72 6f 6e 67 20 73 69 7a |d with w|rong siz|
|00005a00| 65 21 0a 66 69 0a 23 20 | 65 6e 64 20 6f 66 20 6f |e!.fi.# |end of o|
|00005a10| 76 65 72 77 72 69 74 69 | 6e 67 20 63 68 65 63 6b |verwriti|ng check|
|00005a20| 0a 66 69 0a 69 66 20 74 | 65 73 74 20 2d 66 20 73 |.fi.if t|est -f s|
|00005a30| 74 72 63 61 73 65 63 6d | 70 2e 63 20 2d 61 20 22 |trcasecm|p.c -a "|
|00005a40| 24 7b 31 7d 22 20 21 3d | 20 22 2d 63 22 20 3b 20 |${1}" !=| "-c" ; |
|00005a50| 74 68 65 6e 20 0a 20 20 | 65 63 68 6f 20 73 68 61 |then . |echo sha|
|00005a60| 72 3a 20 57 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: Will |not over|
|00005a70| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00005a80| 66 69 6c 65 20 5c 22 73 | 74 72 63 61 73 65 63 6d |file \"s|trcasecm|
|00005a90| 70 2e 63 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |p.c\".el|se.echo |
|00005aa0| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00005ab0| 20 5c 22 73 74 72 63 61 | 73 65 63 6d 70 2e 63 5c | \"strca|secmp.c\|
|00005ac0| 22 20 5c 28 33 37 36 37 | 20 63 68 61 72 61 63 74 |" \(3767| charact|
|00005ad0| 65 72 73 5c 29 0a 73 65 | 64 20 22 73 2f 5e 58 2f |ers\).se|d "s/^X/|
|00005ae0| 2f 22 20 3e 73 74 72 63 | 61 73 65 63 6d 70 2e 63 |/" >strc|asecmp.c|
|00005af0| 20 3c 3c 27 45 4e 44 5f | 4f 46 5f 73 74 72 63 61 | <<'END_|OF_strca|
|00005b00| 73 65 63 6d 70 2e 63 27 | 0a 58 2f 2a 0a 58 20 2a |secmp.c'|.X/*.X *|
|00005b10| 20 43 6f 70 79 72 69 67 | 68 74 20 28 63 29 20 31 | Copyrig|ht (c) 1|
|00005b20| 39 38 37 20 52 65 67 65 | 6e 74 73 20 6f 66 20 74 |987 Rege|nts of t|
|00005b30| 68 65 20 55 6e 69 76 65 | 72 73 69 74 79 20 6f 66 |he Unive|rsity of|
|00005b40| 20 43 61 6c 69 66 6f 72 | 6e 69 61 2e 0a 58 20 2a | Califor|nia..X *|
|00005b50| 20 41 6c 6c 20 72 69 67 | 68 74 73 20 72 65 73 65 | All rig|hts rese|
|00005b60| 72 76 65 64 2e 0a 58 20 | 2a 0a 58 20 2a 20 52 65 |rved..X |*.X * Re|
|00005b70| 64 69 73 74 72 69 62 75 | 74 69 6f 6e 20 61 6e 64 |distribu|tion and|
|00005b80| 20 75 73 65 20 69 6e 20 | 73 6f 75 72 63 65 20 61 | use in |source a|
|00005b90| 6e 64 20 62 69 6e 61 72 | 79 20 66 6f 72 6d 73 20 |nd binar|y forms |
|00005ba0| 61 72 65 20 70 65 72 6d | 69 74 74 65 64 0a 58 20 |are perm|itted.X |
|00005bb0| 2a 20 70 72 6f 76 69 64 | 65 64 20 74 68 61 74 20 |* provid|ed that |
|00005bc0| 74 68 65 20 61 62 6f 76 | 65 20 63 6f 70 79 72 69 |the abov|e copyri|
|00005bd0| 67 68 74 20 6e 6f 74 69 | 63 65 20 61 6e 64 20 74 |ght noti|ce and t|
|00005be0| 68 69 73 20 70 61 72 61 | 67 72 61 70 68 20 61 72 |his para|graph ar|
|00005bf0| 65 0a 58 20 2a 20 64 75 | 70 6c 69 63 61 74 65 64 |e.X * du|plicated|
|00005c00| 20 69 6e 20 61 6c 6c 20 | 73 75 63 68 20 66 6f 72 | in all |such for|
|00005c10| 6d 73 20 61 6e 64 20 74 | 68 61 74 20 61 6e 79 20 |ms and t|hat any |
|00005c20| 64 6f 63 75 6d 65 6e 74 | 61 74 69 6f 6e 2c 0a 58 |document|ation,.X|
|00005c30| 20 2a 20 61 64 76 65 72 | 74 69 73 69 6e 67 20 6d | * adver|tising m|
|00005c40| 61 74 65 72 69 61 6c 73 | 2c 20 61 6e 64 20 6f 74 |aterials|, and ot|
|00005c50| 68 65 72 20 6d 61 74 65 | 72 69 61 6c 73 20 72 65 |her mate|rials re|
|00005c60| 6c 61 74 65 64 20 74 6f | 20 73 75 63 68 0a 58 20 |lated to| such.X |
|00005c70| 2a 20 64 69 73 74 72 69 | 62 75 74 69 6f 6e 20 61 |* distri|bution a|
|00005c80| 6e 64 20 75 73 65 20 61 | 63 6b 6e 6f 77 6c 65 64 |nd use a|cknowled|
|00005c90| 67 65 20 74 68 61 74 20 | 74 68 65 20 73 6f 66 74 |ge that |the soft|
|00005ca0| 77 61 72 65 20 77 61 73 | 20 64 65 76 65 6c 6f 70 |ware was| develop|
|00005cb0| 65 64 0a 58 20 2a 20 62 | 79 20 74 68 65 20 55 6e |ed.X * b|y the Un|
|00005cc0| 69 76 65 72 73 69 74 79 | 20 6f 66 20 43 61 6c 69 |iversity| of Cali|
|00005cd0| 66 6f 72 6e 69 61 2c 20 | 42 65 72 6b 65 6c 65 79 |fornia, |Berkeley|
|00005ce0| 2e 20 20 54 68 65 20 6e | 61 6d 65 20 6f 66 20 74 |. The n|ame of t|
|00005cf0| 68 65 0a 58 20 2a 20 55 | 6e 69 76 65 72 73 69 74 |he.X * U|niversit|
|00005d00| 79 20 6d 61 79 20 6e 6f | 74 20 62 65 20 75 73 65 |y may no|t be use|
|00005d10| 64 20 74 6f 20 65 6e 64 | 6f 72 73 65 20 6f 72 20 |d to end|orse or |
|00005d20| 70 72 6f 6d 6f 74 65 20 | 70 72 6f 64 75 63 74 73 |promote |products|
|00005d30| 20 64 65 72 69 76 65 64 | 0a 58 20 2a 20 66 72 6f | derived|.X * fro|
|00005d40| 6d 20 74 68 69 73 20 73 | 6f 66 74 77 61 72 65 20 |m this s|oftware |
|00005d50| 77 69 74 68 6f 75 74 20 | 73 70 65 63 69 66 69 63 |without |specific|
|00005d60| 20 70 72 69 6f 72 20 77 | 72 69 74 74 65 6e 20 70 | prior w|ritten p|
|00005d70| 65 72 6d 69 73 73 69 6f | 6e 2e 0a 58 20 2a 20 54 |ermissio|n..X * T|
|00005d80| 48 49 53 20 53 4f 46 54 | 57 41 52 45 20 49 53 20 |HIS SOFT|WARE IS |
|00005d90| 50 52 4f 56 49 44 45 44 | 20 60 60 41 53 20 49 53 |PROVIDED| ``AS IS|
|00005da0| 27 27 20 41 4e 44 20 57 | 49 54 48 4f 55 54 20 41 |'' AND W|ITHOUT A|
|00005db0| 4e 59 20 45 58 50 52 45 | 53 53 20 4f 52 0a 58 20 |NY EXPRE|SS OR.X |
|00005dc0| 2a 20 49 4d 50 4c 49 45 | 44 20 57 41 52 52 41 4e |* IMPLIE|D WARRAN|
|00005dd0| 54 49 45 53 2c 20 49 4e | 43 4c 55 44 49 4e 47 2c |TIES, IN|CLUDING,|
|00005de0| 20 57 49 54 48 4f 55 54 | 20 4c 49 4d 49 54 41 54 | WITHOUT| LIMITAT|
|00005df0| 49 4f 4e 2c 20 54 48 45 | 20 49 4d 50 4c 49 45 44 |ION, THE| IMPLIED|
|00005e00| 0a 58 20 2a 20 57 41 52 | 52 41 4e 54 49 45 53 20 |.X * WAR|RANTIES |
|00005e10| 4f 46 20 4d 45 52 43 48 | 41 4e 54 49 42 49 4c 49 |OF MERCH|ANTIBILI|
|00005e20| 54 59 20 41 4e 44 20 46 | 49 54 4e 45 53 53 20 46 |TY AND F|ITNESS F|
|00005e30| 4f 52 20 41 20 50 41 52 | 54 49 43 55 4c 41 52 20 |OR A PAR|TICULAR |
|00005e40| 50 55 52 50 4f 53 45 2e | 0a 58 20 2a 2f 0a 58 0a |PURPOSE.|.X */.X.|
|00005e50| 58 23 69 66 20 64 65 66 | 69 6e 65 64 28 4c 49 42 |X#if def|ined(LIB|
|00005e60| 43 5f 53 43 43 53 29 20 | 26 26 20 21 64 65 66 69 |C_SCCS) |&& !defi|
|00005e70| 6e 65 64 28 6c 69 6e 74 | 29 0a 58 73 74 61 74 69 |ned(lint|).Xstati|
|00005e80| 63 20 63 68 61 72 20 73 | 63 63 73 69 64 5b 5d 20 |c char s|ccsid[] |
|00005e90| 3d 20 22 40 28 23 29 73 | 74 72 63 61 73 65 63 6d |= "@(#)s|trcasecm|
|00005ea0| 70 2e 63 09 35 2e 36 20 | 28 42 65 72 6b 65 6c 65 |p.c.5.6 |(Berkele|
|00005eb0| 79 29 20 36 2f 32 37 2f | 38 38 22 3b 0a 58 23 65 |y) 6/27/|88";.X#e|
|00005ec0| 6e 64 69 66 20 2f 2a 20 | 4c 49 42 43 5f 53 43 43 |ndif /* |LIBC_SCC|
|00005ed0| 53 20 61 6e 64 20 6e 6f | 74 20 6c 69 6e 74 20 2a |S and no|t lint *|
|00005ee0| 2f 0a 58 0a 58 23 69 6e | 63 6c 75 64 65 20 3c 73 |/.X.X#in|clude <s|
|00005ef0| 79 73 2f 74 79 70 65 73 | 2e 68 3e 0a 58 0a 58 2f |ys/types|.h>.X.X/|
|00005f00| 2a 0a 58 20 2a 20 54 68 | 69 73 20 61 72 72 61 79 |*.X * Th|is array|
|00005f10| 20 69 73 20 64 65 73 69 | 67 6e 65 64 20 66 6f 72 | is desi|gned for|
|00005f20| 20 6d 61 70 70 69 6e 67 | 20 75 70 70 65 72 20 61 | mapping| upper a|
|00005f30| 6e 64 20 6c 6f 77 65 72 | 20 63 61 73 65 20 6c 65 |nd lower| case le|
|00005f40| 74 74 65 72 0a 58 20 2a | 20 74 6f 67 65 74 68 65 |tter.X *| togethe|
|00005f50| 72 20 66 6f 72 20 61 20 | 63 61 73 65 20 69 6e 64 |r for a |case ind|
|00005f60| 65 70 65 6e 64 65 6e 74 | 20 63 6f 6d 70 61 72 69 |ependent| compari|
|00005f70| 73 6f 6e 2e 20 20 54 68 | 65 20 6d 61 70 70 69 6e |son. Th|e mappin|
|00005f80| 67 73 20 61 72 65 0a 58 | 20 2a 20 62 61 73 65 64 |gs are.X| * based|
|00005f90| 20 75 70 6f 6e 20 61 73 | 63 69 69 20 63 68 61 72 | upon as|cii char|
|00005fa0| 61 63 74 65 72 20 73 65 | 71 75 65 6e 63 65 73 2e |acter se|quences.|
|00005fb0| 0a 58 20 2a 2f 0a 58 73 | 74 61 74 69 63 20 75 5f |.X */.Xs|tatic u_|
|00005fc0| 63 68 61 72 20 63 68 61 | 72 6d 61 70 5b 5d 20 3d |char cha|rmap[] =|
|00005fd0| 20 7b 0a 58 09 27 5c 30 | 30 30 27 2c 20 27 5c 30 | {.X.'\0|00', '\0|
|00005fe0| 30 31 27 2c 20 27 5c 30 | 30 32 27 2c 20 27 5c 30 |01', '\0|02', '\0|
|00005ff0| 30 33 27 2c 20 27 5c 30 | 30 34 27 2c 20 27 5c 30 |03', '\0|04', '\0|
|00006000| 30 35 27 2c 20 27 5c 30 | 30 36 27 2c 20 27 5c 30 |05', '\0|06', '\0|
|00006010| 30 37 27 2c 0a 58 09 27 | 5c 30 31 30 27 2c 20 27 |07',.X.'|\010', '|
|00006020| 5c 30 31 31 27 2c 20 27 | 5c 30 31 32 27 2c 20 27 |\011', '|\012', '|
|00006030| 5c 30 31 33 27 2c 20 27 | 5c 30 31 34 27 2c 20 27 |\013', '|\014', '|
|00006040| 5c 30 31 35 27 2c 20 27 | 5c 30 31 36 27 2c 20 27 |\015', '|\016', '|
|00006050| 5c 30 31 37 27 2c 0a 58 | 09 27 5c 30 32 30 27 2c |\017',.X|.'\020',|
|00006060| 20 27 5c 30 32 31 27 2c | 20 27 5c 30 32 32 27 2c | '\021',| '\022',|
|00006070| 20 27 5c 30 32 33 27 2c | 20 27 5c 30 32 34 27 2c | '\023',| '\024',|
|00006080| 20 27 5c 30 32 35 27 2c | 20 27 5c 30 32 36 27 2c | '\025',| '\026',|
|00006090| 20 27 5c 30 32 37 27 2c | 0a 58 09 27 5c 30 33 30 | '\027',|.X.'\030|
|000060a0| 27 2c 20 27 5c 30 33 31 | 27 2c 20 27 5c 30 33 32 |', '\031|', '\032|
|000060b0| 27 2c 20 27 5c 30 33 33 | 27 2c 20 27 5c 30 33 34 |', '\033|', '\034|
|000060c0| 27 2c 20 27 5c 30 33 35 | 27 2c 20 27 5c 30 33 36 |', '\035|', '\036|
|000060d0| 27 2c 20 27 5c 30 33 37 | 27 2c 0a 58 09 27 5c 30 |', '\037|',.X.'\0|
|000060e0| 34 30 27 2c 20 27 5c 30 | 34 31 27 2c 20 27 5c 30 |40', '\0|41', '\0|
|000060f0| 34 32 27 2c 20 27 5c 30 | 34 33 27 2c 20 27 5c 30 |42', '\0|43', '\0|
|00006100| 34 34 27 2c 20 27 5c 30 | 34 35 27 2c 20 27 5c 30 |44', '\0|45', '\0|
|00006110| 34 36 27 2c 20 27 5c 30 | 34 37 27 2c 0a 58 09 27 |46', '\0|47',.X.'|
|00006120| 5c 30 35 30 27 2c 20 27 | 5c 30 35 31 27 2c 20 27 |\050', '|\051', '|
|00006130| 5c 30 35 32 27 2c 20 27 | 5c 30 35 33 27 2c 20 27 |\052', '|\053', '|
|00006140| 5c 30 35 34 27 2c 20 27 | 5c 30 35 35 27 2c 20 27 |\054', '|\055', '|
|00006150| 5c 30 35 36 27 2c 20 27 | 5c 30 35 37 27 2c 0a 58 |\056', '|\057',.X|
|00006160| 09 27 5c 30 36 30 27 2c | 20 27 5c 30 36 31 27 2c |.'\060',| '\061',|
|00006170| 20 27 5c 30 36 32 27 2c | 20 27 5c 30 36 33 27 2c | '\062',| '\063',|
|00006180| 20 27 5c 30 36 34 27 2c | 20 27 5c 30 36 35 27 2c | '\064',| '\065',|
|00006190| 20 27 5c 30 36 36 27 2c | 20 27 5c 30 36 37 27 2c | '\066',| '\067',|
|000061a0| 0a 58 09 27 5c 30 37 30 | 27 2c 20 27 5c 30 37 31 |.X.'\070|', '\071|
|000061b0| 27 2c 20 27 5c 30 37 32 | 27 2c 20 27 5c 30 37 33 |', '\072|', '\073|
|000061c0| 27 2c 20 27 5c 30 37 34 | 27 2c 20 27 5c 30 37 35 |', '\074|', '\075|
|000061d0| 27 2c 20 27 5c 30 37 36 | 27 2c 20 27 5c 30 37 37 |', '\076|', '\077|
|000061e0| 27 2c 0a 58 09 27 5c 31 | 30 30 27 2c 20 27 5c 31 |',.X.'\1|00', '\1|
|000061f0| 34 31 27 2c 20 27 5c 31 | 34 32 27 2c 20 27 5c 31 |41', '\1|42', '\1|
|00006200| 34 33 27 2c 20 27 5c 31 | 34 34 27 2c 20 27 5c 31 |43', '\1|44', '\1|
|00006210| 34 35 27 2c 20 27 5c 31 | 34 36 27 2c 20 27 5c 31 |45', '\1|46', '\1|
|00006220| 34 37 27 2c 0a 58 09 27 | 5c 31 35 30 27 2c 20 27 |47',.X.'|\150', '|
|00006230| 5c 31 35 31 27 2c 20 27 | 5c 31 35 32 27 2c 20 27 |\151', '|\152', '|
|00006240| 5c 31 35 33 27 2c 20 27 | 5c 31 35 34 27 2c 20 27 |\153', '|\154', '|
|00006250| 5c 31 35 35 27 2c 20 27 | 5c 31 35 36 27 2c 20 27 |\155', '|\156', '|
|00006260| 5c 31 35 37 27 2c 0a 58 | 09 27 5c 31 36 30 27 2c |\157',.X|.'\160',|
|00006270| 20 27 5c 31 36 31 27 2c | 20 27 5c 31 36 32 27 2c | '\161',| '\162',|
|00006280| 20 27 5c 31 36 33 27 2c | 20 27 5c 31 36 34 27 2c | '\163',| '\164',|
|00006290| 20 27 5c 31 36 35 27 2c | 20 27 5c 31 36 36 27 2c | '\165',| '\166',|
|000062a0| 20 27 5c 31 36 37 27 2c | 0a 58 09 27 5c 31 37 30 | '\167',|.X.'\170|
|000062b0| 27 2c 20 27 5c 31 37 31 | 27 2c 20 27 5c 31 37 32 |', '\171|', '\172|
|000062c0| 27 2c 20 27 5c 31 33 33 | 27 2c 20 27 5c 31 33 34 |', '\133|', '\134|
|000062d0| 27 2c 20 27 5c 31 33 35 | 27 2c 20 27 5c 31 33 36 |', '\135|', '\136|
|000062e0| 27 2c 20 27 5c 31 33 37 | 27 2c 0a 58 09 27 5c 31 |', '\137|',.X.'\1|
|000062f0| 34 30 27 2c 20 27 5c 31 | 34 31 27 2c 20 27 5c 31 |40', '\1|41', '\1|
|00006300| 34 32 27 2c 20 27 5c 31 | 34 33 27 2c 20 27 5c 31 |42', '\1|43', '\1|
|00006310| 34 34 27 2c 20 27 5c 31 | 34 35 27 2c 20 27 5c 31 |44', '\1|45', '\1|
|00006320| 34 36 27 2c 20 27 5c 31 | 34 37 27 2c 0a 58 09 27 |46', '\1|47',.X.'|
|00006330| 5c 31 35 30 27 2c 20 27 | 5c 31 35 31 27 2c 20 27 |\150', '|\151', '|
|00006340| 5c 31 35 32 27 2c 20 27 | 5c 31 35 33 27 2c 20 27 |\152', '|\153', '|
|00006350| 5c 31 35 34 27 2c 20 27 | 5c 31 35 35 27 2c 20 27 |\154', '|\155', '|
|00006360| 5c 31 35 36 27 2c 20 27 | 5c 31 35 37 27 2c 0a 58 |\156', '|\157',.X|
|00006370| 09 27 5c 31 36 30 27 2c | 20 27 5c 31 36 31 27 2c |.'\160',| '\161',|
|00006380| 20 27 5c 31 36 32 27 2c | 20 27 5c 31 36 33 27 2c | '\162',| '\163',|
|00006390| 20 27 5c 31 36 34 27 2c | 20 27 5c 31 36 35 27 2c | '\164',| '\165',|
|000063a0| 20 27 5c 31 36 36 27 2c | 20 27 5c 31 36 37 27 2c | '\166',| '\167',|
|000063b0| 0a 58 09 27 5c 31 37 30 | 27 2c 20 27 5c 31 37 31 |.X.'\170|', '\171|
|000063c0| 27 2c 20 27 5c 31 37 32 | 27 2c 20 27 5c 31 37 33 |', '\172|', '\173|
|000063d0| 27 2c 20 27 5c 31 37 34 | 27 2c 20 27 5c 31 37 35 |', '\174|', '\175|
|000063e0| 27 2c 20 27 5c 31 37 36 | 27 2c 20 27 5c 31 37 37 |', '\176|', '\177|
|000063f0| 27 2c 0a 58 09 27 5c 32 | 30 30 27 2c 20 27 5c 32 |',.X.'\2|00', '\2|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.