home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 0a 46 72 |.sources|.misc.Fr|
|00000020| 6f 6d 3a 20 57 69 65 74 | 73 65 20 56 65 6e 65 6d |om: Wiet|se Venem|
|00000030| 61 20 3c 77 69 65 74 73 | 65 40 77 7a 76 2e 77 69 |a <wiets|e@wzv.wi|
|00000040| 6e 2e 74 75 65 2e 6e 6c | 3e 0a 53 75 62 6a 65 63 |n.tue.nl|>.Subjec|
|00000050| 74 3a 20 20 76 32 30 69 | 30 30 38 3a 20 20 6c 6f |t: v20i|008: lo|
|00000060| 67 5f 74 63 70 20 2d 20 | 50 61 63 6b 61 67 65 20 |g_tcp - |Package |
|00000070| 74 6f 20 6d 6f 6e 69 74 | 6f 72 20 61 6e 64 20 63 |to monit|or and c|
|00000080| 6f 6e 74 72 6f 6c 20 54 | 43 50 2f 49 50 20 63 6f |ontrol T|CP/IP co|
|00000090| 6e 6e 65 63 74 69 6f 6e | 73 2c 20 50 61 72 74 30 |nnection|s, Part0|
|000000a0| 31 2f 30 31 0a 4d 65 73 | 73 61 67 65 2d 49 44 3a |1/01.Mes|sage-ID:|
|000000b0| 20 3c 31 39 39 31 4d 61 | 79 32 32 2e 30 34 31 31 | <1991Ma|y22.0411|
|000000c0| 34 32 2e 31 37 30 30 39 | 40 73 70 61 72 6b 79 2e |42.17009|@sparky.|
|000000d0| 49 4d 44 2e 53 74 65 72 | 6c 69 6e 67 2e 43 4f 4d |IMD.Ster|ling.COM|
|000000e0| 3e 0a 58 2d 4d 64 34 2d | 53 69 67 6e 61 74 75 72 |>.X-Md4-|Signatur|
|000000f0| 65 3a 20 38 63 61 33 38 | 33 61 32 65 36 34 33 37 |e: 8ca38|3a2e6437|
|00000100| 62 62 63 33 37 34 35 39 | 33 65 34 33 37 38 62 66 |bbc37459|3e4378bf|
|00000110| 30 66 31 0a 44 61 74 65 | 3a 20 57 65 64 2c 20 32 |0f1.Date|: Wed, 2|
|00000120| 32 20 4d 61 79 20 31 39 | 39 31 20 30 34 3a 31 31 |2 May 19|91 04:11|
|00000130| 3a 34 32 20 47 4d 54 0a | 41 70 70 72 6f 76 65 64 |:42 GMT.|Approved|
|00000140| 3a 20 6b 65 6e 74 40 73 | 70 61 72 6b 79 2e 69 6d |: kent@s|parky.im|
|00000150| 64 2e 73 74 65 72 6c 69 | 6e 67 2e 63 6f 6d 0a 0a |d.sterli|ng.com..|
|00000160| 53 75 62 6d 69 74 74 65 | 64 2d 62 79 3a 20 57 69 |Submitte|d-by: Wi|
|00000170| 65 74 73 65 20 56 65 6e | 65 6d 61 20 3c 77 69 65 |etse Ven|ema <wie|
|00000180| 74 73 65 40 77 7a 76 2e | 77 69 6e 2e 74 75 65 2e |tse@wzv.|win.tue.|
|00000190| 6e 6c 3e 0a 50 6f 73 74 | 69 6e 67 2d 6e 75 6d 62 |nl>.Post|ing-numb|
|000001a0| 65 72 3a 20 56 6f 6c 75 | 6d 65 20 32 30 2c 20 49 |er: Volu|me 20, I|
|000001b0| 73 73 75 65 20 38 0a 41 | 72 63 68 69 76 65 2d 6e |ssue 8.A|rchive-n|
|000001c0| 61 6d 65 3a 20 6c 6f 67 | 5f 74 63 70 2f 70 61 72 |ame: log|_tcp/par|
|000001d0| 74 30 31 0a 53 75 70 65 | 72 73 65 64 65 73 3a 20 |t01.Supe|rsedes: |
|000001e0| 6c 6f 67 5f 74 63 70 3a | 20 56 6f 6c 75 6d 65 20 |log_tcp:| Volume |
|000001f0| 31 36 2c 20 49 73 73 75 | 65 20 36 32 0a 0a 54 68 |16, Issu|e 62..Th|
|00000200| 69 73 20 70 61 63 6b 61 | 67 65 20 70 72 6f 76 69 |is packa|ge provi|
|00000210| 64 65 73 20 61 20 63 6f | 75 70 6c 65 20 6f 66 20 |des a co|uple of |
|00000220| 74 69 6e 79 20 70 72 6f | 67 72 61 6d 73 20 74 68 |tiny pro|grams th|
|00000230| 61 74 20 6c 6f 67 20 61 | 6c 6c 20 72 65 71 75 65 |at log a|ll reque|
|00000240| 73 74 73 0a 74 6f 20 63 | 6f 6e 6e 65 63 74 69 6f |sts.to c|onnectio|
|00000250| 6e 2d 6f 72 69 65 6e 74 | 65 64 20 74 63 70 2f 69 |n-orient|ed tcp/i|
|00000260| 70 20 73 65 72 76 69 63 | 65 73 20 28 65 78 61 6d |p servic|es (exam|
|00000270| 70 6c 65 73 3a 20 46 49 | 4e 47 45 52 2c 20 53 59 |ples: FI|NGER, SY|
|00000280| 53 54 41 54 2c 20 46 54 | 50 2c 0a 54 45 4c 4e 45 |STAT, FT|P,.TELNE|
|00000290| 54 2c 20 52 4c 4f 47 49 | 4e 2c 20 52 53 48 2c 20 |T, RLOGI|N, RSH, |
|000002a0| 45 58 45 43 29 2c 20 77 | 69 74 68 20 6f 70 74 69 |EXEC), w|ith opti|
|000002b0| 6f 6e 61 6c 20 61 63 63 | 65 73 73 20 63 6f 6e 74 |onal acc|ess cont|
|000002c0| 72 6f 6c 20 6f 6e 20 74 | 68 65 20 62 61 73 69 73 |rol on t|he basis|
|000002d0| 0a 6f 66 20 68 6f 73 74 | 20 28 6f 72 20 64 6f 6d |.of host| (or dom|
|000002e0| 61 69 6e 29 20 6e 61 6d | 65 73 2c 20 69 6e 74 65 |ain) nam|es, inte|
|000002f0| 72 6e 65 74 20 61 64 64 | 72 65 73 73 65 73 20 28 |rnet add|resses (|
|00000300| 6f 72 20 6e 65 74 77 6f | 72 6b 20 6e 75 6d 62 65 |or netwo|rk numbe|
|00000310| 72 73 29 20 61 6e 64 0a | 64 61 65 6d 6f 6e 20 70 |rs) and.|daemon p|
|00000320| 72 6f 63 65 73 73 20 6e | 61 6d 65 73 2e 0a 0a 54 |rocess n|ames...T|
|00000330| 68 65 20 70 72 6f 67 72 | 61 6d 73 20 61 72 65 20 |he progr|ams are |
|00000340| 6e 6f 74 68 69 6e 67 20 | 62 75 74 20 73 6d 61 6c |nothing |but smal|
|00000350| 6c 20 66 72 6f 6e 74 20 | 65 6e 64 73 2e 20 42 79 |l front |ends. By|
|00000360| 20 64 65 66 61 75 6c 74 | 2c 20 74 68 65 79 20 6a | default|, they j|
|00000370| 75 73 74 0a 6c 6f 67 20 | 74 68 65 20 72 65 6d 6f |ust.log |the remo|
|00000380| 74 65 20 68 6f 73 74 20 | 6e 61 6d 65 20 61 6e 64 |te host |name and|
|00000390| 20 74 68 65 6e 20 69 6e | 76 6f 6b 65 20 74 68 65 | then in|voke the|
|000003a0| 20 72 65 61 6c 20 64 61 | 65 6d 6f 6e 2e 20 54 68 | real da|emon. Th|
|000003b0| 65 20 70 72 6f 67 72 61 | 6d 73 0a 73 68 6f 75 6c |e progra|ms.shoul|
|000003c0| 64 20 6e 6f 74 20 72 65 | 71 75 69 72 65 20 61 6e |d not re|quire an|
|000003d0| 79 20 63 68 61 6e 67 65 | 73 20 74 6f 20 65 78 69 |y change|s to exi|
|000003e0| 73 74 69 6e 67 20 73 6f | 66 74 77 61 72 65 20 6f |sting so|ftware o|
|000003f0| 72 20 63 6f 6e 66 69 67 | 75 72 61 74 69 6f 6e 0a |r config|uration.|
|00000400| 66 69 6c 65 73 2e 0a 0a | 45 6e 68 61 6e 63 65 6d |files...|Enhancem|
|00000410| 65 6e 74 73 20 6f 76 65 | 72 20 74 68 65 20 70 72 |ents ove|r the pr|
|00000420| 65 76 69 6f 75 73 20 72 | 65 6c 65 61 73 65 20 61 |evious r|elease a|
|00000430| 72 65 3a 20 70 72 6f 74 | 65 63 74 69 6f 6e 20 61 |re: prot|ection a|
|00000440| 67 61 69 6e 73 74 20 72 | 6c 6f 67 69 6e 0a 61 6e |gainst r|login.an|
|00000450| 64 20 72 73 68 20 61 74 | 74 61 63 6b 73 20 74 68 |d rsh at|tacks th|
|00000460| 72 6f 75 67 68 20 63 6f | 6d 70 72 6f 6d 69 73 65 |rough co|mpromise|
|00000470| 64 20 64 6f 6d 61 69 6e | 20 6e 61 6d 65 20 73 65 |d domain| name se|
|00000480| 72 76 65 72 73 2c 20 6f | 70 74 69 6f 6e 61 6c 0a |rvers, o|ptional.|
|00000490| 6e 65 74 67 72 6f 75 70 | 20 73 75 70 70 6f 72 74 |netgroup| support|
|000004a0| 20 66 6f 72 20 73 79 73 | 74 65 6d 73 20 77 69 74 | for sys|tems wit|
|000004b0| 68 20 4e 49 53 20 28 66 | 6f 72 6d 65 72 6c 79 20 |h NIS (f|ormerly |
|000004c0| 59 50 29 2c 20 61 6e 64 | 20 61 6e 20 65 78 74 65 |YP), and| an exte|
|000004d0| 6e 73 69 6f 6e 0a 6f 66 | 20 74 68 65 20 77 69 6c |nsion.of| the wil|
|000004e0| 64 20 63 61 72 64 20 70 | 61 74 74 65 72 6e 73 20 |d card p|atterns |
|000004f0| 73 75 70 70 6f 72 74 65 | 64 20 62 79 20 74 68 65 |supporte|d by the|
|00000500| 20 61 63 63 65 73 73 20 | 63 6f 6e 74 72 6f 6c 20 | access |control |
|00000510| 66 69 6c 65 73 2e 0a 0a | 09 57 69 65 74 73 65 20 |files...|.Wietse |
|00000520| 56 65 6e 65 6d 61 20 28 | 77 69 65 74 73 65 40 77 |Venema (|wietse@w|
|00000530| 7a 76 2e 77 69 6e 2e 74 | 75 65 2e 6e 6c 29 2c 0a |zv.win.t|ue.nl),.|
|00000540| 09 45 69 6e 64 68 6f 76 | 65 6e 20 55 6e 69 76 65 |.Eindhov|en Unive|
|00000550| 72 73 69 74 79 20 6f 66 | 20 54 65 63 68 6e 6f 6c |rsity of| Technol|
|00000560| 6f 67 79 2c 0a 09 54 68 | 65 20 4e 65 74 68 65 72 |ogy,..Th|e Nether|
|00000570| 6c 61 6e 64 73 2e 0a 2d | 2d 2d 2d 2d 2d 2d 2d 2d |lands..-|--------|
|00000580| 0a 23 21 20 2f 62 69 6e | 2f 73 68 0a 23 20 54 68 |.#! /bin|/sh.# Th|
|00000590| 69 73 20 69 73 20 61 20 | 73 68 65 6c 6c 20 61 72 |is is a |shell ar|
|000005a0| 63 68 69 76 65 2e 20 20 | 52 65 6d 6f 76 65 20 61 |chive. |Remove a|
|000005b0| 6e 79 74 68 69 6e 67 20 | 62 65 66 6f 72 65 20 74 |nything |before t|
|000005c0| 68 69 73 20 6c 69 6e 65 | 2c 20 74 68 65 6e 20 75 |his line|, then u|
|000005d0| 6e 70 61 63 6b 0a 23 20 | 69 74 20 62 79 20 73 61 |npack.# |it by sa|
|000005e0| 76 69 6e 67 20 69 74 20 | 69 6e 74 6f 20 61 20 66 |ving it |into a f|
|000005f0| 69 6c 65 20 61 6e 64 20 | 74 79 70 69 6e 67 20 22 |ile and |typing "|
|00000600| 73 68 20 66 69 6c 65 22 | 2e 20 20 54 6f 20 6f 76 |sh file"|. To ov|
|00000610| 65 72 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |erwrite |existing|
|00000620| 0a 23 20 66 69 6c 65 73 | 2c 20 74 79 70 65 20 22 |.# files|, type "|
|00000630| 73 68 20 66 69 6c 65 20 | 2d 63 22 2e 20 20 59 6f |sh file |-c". Yo|
|00000640| 75 20 63 61 6e 20 61 6c | 73 6f 20 66 65 65 64 20 |u can al|so feed |
|00000650| 74 68 69 73 20 61 73 20 | 73 74 61 6e 64 61 72 64 |this as |standard|
|00000660| 20 69 6e 70 75 74 20 76 | 69 61 0a 23 20 75 6e 73 | input v|ia.# uns|
|00000670| 68 61 72 2c 20 6f 72 20 | 62 79 20 74 79 70 69 6e |har, or |by typin|
|00000680| 67 20 22 73 68 20 3c 66 | 69 6c 65 22 2c 20 65 2e |g "sh <f|ile", e.|
|00000690| 67 2e 2e 20 20 49 66 20 | 74 68 69 73 20 61 72 63 |g.. If |this arc|
|000006a0| 68 69 76 65 20 69 73 20 | 63 6f 6d 70 6c 65 74 65 |hive is |complete|
|000006b0| 2c 20 79 6f 75 0a 23 20 | 77 69 6c 6c 20 73 65 65 |, you.# |will see|
|000006c0| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 6d | the fol|lowing m|
|000006d0| 65 73 73 61 67 65 20 61 | 74 20 74 68 65 20 65 6e |essage a|t the en|
|000006e0| 64 3a 0a 23 09 09 22 45 | 6e 64 20 6f 66 20 73 68 |d:.#.."E|nd of sh|
|000006f0| 65 6c 6c 20 61 72 63 68 | 69 76 65 2e 22 0a 23 20 |ell arch|ive.".# |
|00000700| 43 6f 6e 74 65 6e 74 73 | 3a 20 20 52 45 41 44 4d |Contents|: READM|
|00000710| 45 20 6d 69 73 63 64 2e | 63 20 74 63 70 64 2e 63 |E miscd.|c tcpd.c|
|00000720| 20 66 72 6f 6d 68 6f 73 | 74 2e 63 20 68 6f 73 74 | fromhos|t.c host|
|00000730| 73 5f 61 63 63 65 73 73 | 2e 63 20 4d 61 6b 65 66 |s_access|.c Makef|
|00000740| 69 6c 65 0a 23 20 20 20 | 68 6f 73 74 73 5f 61 63 |ile.# |hosts_ac|
|00000750| 63 65 73 73 2e 35 20 73 | 74 72 63 61 73 65 63 6d |cess.5 s|trcasecm|
|00000760| 70 2e 63 20 42 4c 55 52 | 42 0a 23 20 57 72 61 70 |p.c BLUR|B.# Wrap|
|00000770| 70 65 64 20 62 79 20 77 | 69 65 74 73 65 40 77 7a |ped by w|ietse@wz|
|00000780| 76 20 6f 6e 20 4d 6f 6e | 20 4d 61 79 20 32 30 20 |v on Mon| May 20 |
|00000790| 31 33 3a 33 35 3a 33 39 | 20 31 39 39 31 0a 50 41 |13:35:39| 1991.PA|
|000007a0| 54 48 3d 2f 62 69 6e 3a | 2f 75 73 72 2f 62 69 6e |TH=/bin:|/usr/bin|
|000007b0| 3a 2f 75 73 72 2f 75 63 | 62 20 3b 20 65 78 70 6f |:/usr/uc|b ; expo|
|000007c0| 72 74 20 50 41 54 48 0a | 69 66 20 74 65 73 74 20 |rt PATH.|if test |
|000007d0| 2d 66 20 52 45 41 44 4d | 45 20 2d 61 20 22 24 7b |-f READM|E -a "${|
|000007e0| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|000007f0| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|00000800| 20 57 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | Will no|t over-w|
|00000810| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|00000820| 6c 65 20 5c 22 52 45 41 | 44 4d 45 5c 22 0a 65 6c |le \"REA|DME\".el|
|00000830| 73 65 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 45 78 |se.echo |shar: Ex|
|00000840| 74 72 61 63 74 69 6e 67 | 20 5c 22 52 45 41 44 4d |tracting| \"READM|
|00000850| 45 5c 22 20 5c 28 38 35 | 35 33 20 63 68 61 72 61 |E\" \(85|53 chara|
|00000860| 63 74 65 72 73 5c 29 0a | 73 65 64 20 22 73 2f 5e |cters\).|sed "s/^|
|00000870| 58 2f 2f 22 20 3e 52 45 | 41 44 4d 45 20 3c 3c 27 |X//" >RE|ADME <<'|
|00000880| 45 4e 44 5f 4f 46 5f 52 | 45 41 44 4d 45 27 0a 58 |END_OF_R|EADME'.X|
|00000890| 40 28 23 29 20 52 45 41 | 44 4d 45 20 31 2e 34 20 |@(#) REA|DME 1.4 |
|000008a0| 39 31 2f 30 35 2f 32 30 | 20 31 33 3a 33 30 3a 31 |91/05/20| 13:30:1|
|000008b0| 37 0a 58 0a 58 47 65 6e | 65 72 61 6c 20 64 65 73 |7.X.XGen|eral des|
|000008c0| 63 72 69 70 74 69 6f 6e | 3a 0a 58 2d 2d 2d 2d 2d |cription|:.X-----|
|000008d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0a |--------|-------.|
|000008e0| 58 0a 58 57 69 74 68 20 | 74 68 69 73 20 70 61 63 |X.XWith |this pac|
|000008f0| 6b 61 67 65 20 79 6f 75 | 20 63 61 6e 20 6d 6f 6e |kage you| can mon|
|00000900| 69 74 6f 72 20 63 6f 6e | 6e 65 63 74 69 6f 6e 73 |itor con|nections|
|00000910| 20 74 6f 20 74 68 65 20 | 53 59 53 54 41 54 2c 20 | to the |SYSTAT, |
|00000920| 46 49 4e 47 45 52 2c 0a | 58 46 54 50 2c 20 54 45 |FINGER,.|XFTP, TE|
|00000930| 4c 4e 45 54 2c 20 52 4c | 4f 47 49 4e 2c 20 52 53 |LNET, RL|OGIN, RS|
|00000940| 48 20 61 6e 64 20 45 58 | 45 43 20 6e 65 74 77 6f |H and EX|EC netwo|
|00000950| 72 6b 20 73 65 72 76 69 | 63 65 73 2e 20 20 43 6f |rk servi|ces. Co|
|00000960| 6e 6e 65 63 74 69 6f 6e | 73 20 61 72 65 0a 58 6c |nnection|s are.Xl|
|00000970| 6f 67 67 65 64 20 74 68 | 72 6f 75 67 68 20 74 68 |ogged th|rough th|
|00000980| 65 20 73 79 73 6c 6f 67 | 28 33 29 20 66 61 63 69 |e syslog|(3) faci|
|00000990| 6c 69 74 79 2e 20 41 20 | 72 65 71 75 69 72 65 6d |lity. A |requirem|
|000009a0| 65 6e 74 20 69 73 20 74 | 68 61 74 20 64 61 65 6d |ent is t|hat daem|
|000009b0| 6f 6e 73 0a 58 61 72 65 | 20 73 74 61 72 74 65 64 |ons.Xare| started|
|000009c0| 20 62 79 20 74 68 65 20 | 69 6e 65 74 64 20 70 72 | by the |inetd pr|
|000009d0| 6f 67 72 61 6d 20 6f 72 | 20 73 6f 6d 65 74 68 69 |ogram or| somethi|
|000009e0| 6e 67 20 73 69 6d 69 6c | 61 72 2e 0a 58 0a 58 54 |ng simil|ar..X.XT|
|000009f0| 68 65 20 70 72 6f 67 72 | 61 6d 73 20 61 72 65 20 |he progr|ams are |
|00000a00| 74 69 6e 79 20 66 72 6f | 6e 74 20 65 6e 64 73 20 |tiny fro|nt ends |
|00000a10| 74 68 61 74 20 6a 75 73 | 74 20 72 65 70 6f 72 74 |that jus|t report|
|00000a20| 20 74 68 65 20 72 65 6d | 6f 74 65 20 68 6f 73 74 | the rem|ote host|
|00000a30| 20 6e 61 6d 65 0a 58 61 | 6e 64 20 74 68 65 6e 20 | name.Xa|nd then |
|00000a40| 69 6e 76 6f 6b 65 20 74 | 68 65 20 72 65 61 6c 20 |invoke t|he real |
|00000a50| 6e 65 74 77 6f 72 6b 20 | 64 61 65 6d 6f 6e 2e 20 |network |daemon. |
|00000a60| 20 49 6e 20 74 68 65 20 | 6d 6f 73 74 20 63 6f 6d | In the |most com|
|00000a70| 6d 6f 6e 20 63 61 73 65 | 2c 20 6e 6f 0a 58 63 68 |mon case|, no.Xch|
|00000a80| 61 6e 67 65 73 20 73 68 | 6f 75 6c 64 20 62 65 20 |anges sh|ould be |
|00000a90| 72 65 71 75 69 72 65 64 | 20 74 6f 20 65 78 69 73 |required| to exis|
|00000aa0| 74 69 6e 67 20 73 6f 66 | 74 77 61 72 65 20 6f 72 |ting sof|tware or|
|00000ab0| 20 74 6f 20 63 6f 6e 66 | 69 67 75 72 61 74 69 6f | to conf|iguratio|
|00000ac0| 6e 0a 58 66 69 6c 65 73 | 2e 20 20 4a 75 73 74 20 |n.Xfiles|. Just |
|00000ad0| 6d 6f 76 65 20 74 68 65 | 20 76 65 6e 64 6f 72 2d |move the| vendor-|
|00000ae0| 70 72 6f 76 69 64 65 64 | 20 64 61 65 6d 6f 6e 73 |provided| daemons|
|00000af0| 20 74 6f 20 61 6e 6f 74 | 68 65 72 20 70 6c 61 63 | to anot|her plac|
|00000b00| 65 20 61 6e 64 0a 58 69 | 6e 73 74 61 6c 6c 20 74 |e and.Xi|nstall t|
|00000b10| 68 65 20 66 72 6f 6e 74 | 20 65 6e 64 73 20 69 6e |he front| ends in|
|00000b20| 74 6f 20 74 68 65 69 72 | 20 6f 72 69 67 69 6e 61 |to their| origina|
|00000b30| 6c 20 70 6c 61 63 65 73 | 2e 20 49 6e 73 74 61 6c |l places|. Instal|
|00000b40| 6c 61 74 69 6f 6e 20 64 | 65 74 61 69 6c 73 0a 58 |lation d|etails.X|
|00000b50| 61 72 65 20 67 69 76 65 | 6e 20 62 65 6c 6f 77 2e |are give|n below.|
|00000b60| 0a 58 0a 58 45 61 72 6c | 79 20 76 65 72 73 69 6f |.X.XEarl|y versio|
|00000b70| 6e 73 20 6f 66 20 74 68 | 65 20 70 72 6f 67 72 61 |ns of th|e progra|
|00000b80| 6d 73 20 77 65 72 65 20 | 74 65 73 74 65 64 20 77 |ms were |tested w|
|00000b90| 69 74 68 20 55 6c 74 72 | 69 78 20 3e 3d 20 32 2e |ith Ultr|ix >= 2.|
|00000ba0| 32 2c 20 77 69 74 68 0a | 58 53 75 6e 4f 53 20 3e |2, with.|XSunOS >|
|00000bb0| 3d 20 33 2e 34 20 61 6e | 64 20 49 53 43 20 32 2e |= 3.4 an|d ISC 2.|
|00000bc0| 32 2e 20 54 68 65 20 66 | 69 72 73 74 20 6f 66 66 |2. The f|irst off|
|00000bd0| 69 63 69 61 6c 20 72 65 | 6c 65 61 73 65 20 68 61 |icial re|lease ha|
|00000be0| 73 20 62 65 65 6e 20 69 | 6e 73 74 61 6c 6c 65 64 |s been i|nstalled|
|00000bf0| 0a 58 6f 6e 20 61 20 77 | 69 64 65 20 76 61 72 69 |.Xon a w|ide vari|
|00000c00| 65 74 79 20 6f 66 20 73 | 79 73 74 65 6d 73 20 28 |ety of s|ystems (|
|00000c10| 42 53 44 2c 20 53 59 53 | 56 2c 20 41 70 6f 6c 6c |BSD, SYS|V, Apoll|
|00000c20| 6f 29 20 77 69 74 68 6f | 75 74 20 6d 6f 64 69 66 |o) witho|ut modif|
|00000c30| 69 63 61 74 69 6f 6e 2e | 0a 58 54 68 65 20 70 72 |ication.|.XThe pr|
|00000c40| 65 73 65 6e 74 20 72 65 | 6c 65 61 73 65 20 73 68 |esent re|lease sh|
|00000c50| 6f 75 6c 64 20 73 74 69 | 6c 6c 20 72 75 6e 20 6f |ould sti|ll run o|
|00000c60| 6e 20 74 6f 70 20 6f 66 | 20 6d 6f 73 74 20 42 53 |n top of| most BS|
|00000c70| 44 2d 73 74 79 6c 65 20 | 54 43 50 2f 49 50 0a 58 |D-style |TCP/IP.X|
|00000c80| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 73 2e |implemen|tations.|
|00000c90| 0a 58 0a 58 4f 70 74 69 | 6f 6e 61 6c 20 66 65 61 |.X.XOpti|onal fea|
|00000ca0| 74 75 72 65 3a 0a 58 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ture:.X-|--------|
|00000cb0| 2d 2d 2d 2d 2d 2d 2d 2d | 0a 58 0a 58 57 68 65 6e |--------|.X.XWhen|
|00000cc0| 20 63 6f 6d 70 69 6c 65 | 64 20 77 69 74 68 20 2d | compile|d with -|
|00000cd0| 44 48 4f 53 54 53 5f 41 | 43 43 45 53 53 2c 20 74 |DHOSTS_A|CCESS, t|
|00000ce0| 68 65 20 66 72 6f 6e 74 | 2d 65 6e 64 20 70 72 6f |he front|-end pro|
|00000cf0| 67 72 61 6d 73 20 73 75 | 70 70 6f 72 74 20 61 0a |grams su|pport a.|
|00000d00| 58 73 69 6d 70 6c 65 20 | 66 6f 72 6d 20 6f 66 20 |Xsimple |form of |
|00000d10| 61 63 63 65 73 73 20 63 | 6f 6e 74 72 6f 6c 20 74 |access c|ontrol t|
|00000d20| 68 61 74 20 69 73 20 62 | 61 73 65 64 20 6f 6e 20 |hat is b|ased on |
|00000d30| 68 6f 73 74 20 28 6f 72 | 20 64 6f 6d 61 69 6e 29 |host (or| domain)|
|00000d40| 20 6e 61 6d 65 73 2c 0a | 58 69 6e 74 65 72 6e 65 | names,.|Xinterne|
|00000d50| 74 20 61 64 64 72 65 73 | 73 65 73 20 6f 72 20 6e |t addres|ses or n|
|00000d60| 65 74 77 6f 72 6b 20 6e | 75 6d 62 65 72 73 2c 20 |etwork n|umbers, |
|00000d70| 6e 65 74 77 6f 72 6b 20 | 64 61 65 6d 6f 6e 20 70 |network |daemon p|
|00000d80| 72 6f 63 65 73 73 20 6e | 61 6d 65 73 20 61 6e 64 |rocess n|ames and|
|00000d90| 0a 58 28 6f 70 74 69 6f | 6e 61 6c 6c 79 29 20 6e |.X(optio|nally) n|
|00000da0| 65 74 67 72 6f 75 70 73 | 20 28 61 20 4e 49 53 2c |etgroups| (a NIS,|
|00000db0| 20 66 6f 72 6d 65 72 6c | 79 20 59 50 2c 20 66 65 | formerl|y YP, fe|
|00000dc0| 61 74 75 72 65 29 2e 20 | 20 57 69 6c 64 20 63 61 |ature). | Wild ca|
|00000dd0| 72 64 73 20 61 72 65 0a | 58 73 75 70 70 6f 72 74 |rds are.|Xsupport|
|00000de0| 65 64 2e 20 20 49 66 20 | 61 20 68 6f 73 74 20 72 |ed. If |a host r|
|00000df0| 65 71 75 65 73 74 73 20 | 63 6f 6e 6e 65 63 74 69 |equests |connecti|
|00000e00| 6f 6e 20 74 6f 20 61 20 | 6e 65 74 77 6f 72 6b 20 |on to a |network |
|00000e10| 64 61 65 6d 6f 6e 2c 20 | 61 6e 64 20 69 66 0a 58 |daemon, |and if.X|
|00000e20| 74 68 65 20 28 64 61 65 | 6d 6f 6e 2c 20 68 6f 73 |the (dae|mon, hos|
|00000e30| 74 29 20 70 61 69 72 20 | 69 73 20 6d 61 74 63 68 |t) pair |is match|
|00000e40| 65 64 20 62 79 20 61 6e | 20 65 6e 74 72 79 20 69 |ed by an| entry i|
|00000e50| 6e 20 74 68 65 20 2f 65 | 74 63 2f 68 6f 73 74 73 |n the /e|tc/hosts|
|00000e60| 2e 61 6c 6c 6f 77 0a 58 | 66 69 6c 65 2c 20 61 63 |.allow.X|file, ac|
|00000e70| 63 65 73 73 20 69 73 20 | 67 72 61 6e 74 65 64 2e |cess is |granted.|
|00000e80| 20 20 4f 74 68 65 72 77 | 69 73 65 2c 20 69 66 20 | Otherw|ise, if |
|00000e90| 74 68 65 20 28 64 61 65 | 6d 6f 6e 2c 20 68 6f 73 |the (dae|mon, hos|
|00000ea0| 74 29 20 70 61 69 72 20 | 69 73 0a 58 6d 61 74 63 |t) pair |is.Xmatc|
|00000eb0| 68 65 64 20 62 79 20 61 | 6e 20 65 6e 74 72 79 20 |hed by a|n entry |
|00000ec0| 69 6e 20 74 68 65 20 2f | 65 74 63 2f 68 6f 73 74 |in the /|etc/host|
|00000ed0| 73 2e 64 65 6e 79 20 66 | 69 6c 65 2c 20 61 63 63 |s.deny f|ile, acc|
|00000ee0| 65 73 73 20 69 73 20 64 | 65 6e 69 65 64 2e 0a 58 |ess is d|enied..X|
|00000ef0| 4f 74 68 65 72 77 69 73 | 65 2c 20 61 63 63 65 73 |Otherwis|e, acces|
|00000f00| 73 20 69 73 20 67 72 61 | 6e 74 65 64 2e 20 20 4d |s is gra|nted. M|
|00000f10| 6f 72 65 20 64 65 74 61 | 69 6c 73 20 61 72 65 20 |ore deta|ils are |
|00000f20| 70 72 6f 76 69 64 65 64 | 20 69 6e 20 74 68 65 0a |provided| in the.|
|00000f30| 58 68 6f 73 74 73 5f 61 | 63 63 65 73 73 28 35 29 |Xhosts_a|ccess(5)|
|00000f40| 20 6d 61 6e 75 61 6c 20 | 70 61 67 65 2e 20 20 54 | manual |page. T|
|00000f50| 68 69 73 20 66 6f 72 6d | 20 6f 66 20 61 63 63 65 |his form| of acce|
|00000f60| 73 73 20 63 6f 6e 74 72 | 6f 6c 20 6d 61 79 20 62 |ss contr|ol may b|
|00000f70| 65 20 75 73 65 66 75 6c | 0a 58 69 66 20 69 74 20 |e useful|.Xif it |
|00000f80| 63 61 6e 20 6e 6f 74 20 | 62 65 20 69 6d 70 6c 65 |can not |be imple|
|00000f90| 6d 65 6e 74 65 64 20 61 | 74 20 61 20 6d 6f 72 65 |mented a|t a more|
|00000fa0| 20 73 75 69 74 61 62 6c | 65 20 6c 65 76 65 6c 20 | suitabl|e level |
|00000fb0| 28 73 75 63 68 20 61 73 | 20 61 6e 0a 58 69 6e 74 |(such as| an.Xint|
|00000fc0| 65 72 6e 65 74 20 72 6f | 75 74 65 72 29 2e 0a 58 |ernet ro|uter)..X|
|00000fd0| 0a 58 4d 61 6a 6f 72 20 | 65 6e 68 61 6e 63 65 6d |.XMajor |enhancem|
|00000fe0| 65 6e 74 3a 0a 58 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ent:.X--|--------|
|00000ff0| 2d 2d 2d 2d 2d 2d 2d 2d | 0a 58 0a 58 49 74 20 68 |--------|.X.XIt h|
|00001000| 61 73 20 62 65 65 6e 20 | 62 72 6f 75 67 68 74 20 |as been |brought |
|00001010| 74 6f 20 6d 79 20 61 74 | 74 65 6e 74 69 6f 6e 20 |to my at|tention |
|00001020| 74 68 61 74 20 61 75 74 | 68 65 6e 74 69 63 61 74 |that aut|henticat|
|00001030| 69 6f 6e 20 62 61 73 65 | 64 20 6f 6e 20 68 6f 73 |ion base|d on hos|
|00001040| 74 0a 58 61 64 64 72 65 | 73 73 20 74 6f 20 68 6f |t.Xaddre|ss to ho|
|00001050| 73 74 20 6e 61 6d 65 20 | 6d 61 70 70 69 6e 67 20 |st name |mapping |
|00001060| 63 61 6e 20 65 61 73 69 | 6c 79 20 62 65 20 73 70 |can easi|ly be sp|
|00001070| 6f 6f 66 65 64 20 62 79 | 20 70 6c 61 79 69 6e 67 |oofed by| playing|
|00001080| 20 67 61 6d 65 73 0a 58 | 77 69 74 68 20 73 6f 6d | games.X|with som|
|00001090| 65 20 64 6f 6d 61 69 6e | 20 6e 61 6d 65 20 73 65 |e domain| name se|
|000010a0| 72 76 65 72 2e 20 20 41 | 20 6c 69 74 74 6c 65 20 |rver. A| little |
|000010b0| 72 65 73 65 61 72 63 68 | 20 6c 65 64 20 6d 65 20 |research| led me |
|000010c0| 74 6f 20 74 68 65 20 63 | 6f 6e 63 6c 75 73 69 6f |to the c|onclusio|
|000010d0| 6e 0a 58 74 68 61 74 20 | 6d 61 6e 79 20 65 78 69 |n.Xthat |many exi|
|000010e0| 73 74 69 6e 67 20 72 73 | 68 64 20 61 6e 64 20 72 |sting rs|hd and r|
|000010f0| 6c 6f 67 69 6e 64 20 69 | 6d 70 6c 65 6d 65 6e 74 |logind i|mplement|
|00001100| 61 74 69 6f 6e 73 20 64 | 6f 20 6e 6f 74 20 61 63 |ations d|o not ac|
|00001110| 63 6f 75 6e 74 20 66 6f | 72 0a 58 74 68 69 73 20 |count fo|r.Xthis |
|00001120| 70 6f 74 65 6e 74 69 61 | 6c 20 70 72 6f 62 6c 65 |potentia|l proble|
|00001130| 6d 2e 0a 58 0a 58 54 68 | 65 20 70 72 65 73 65 6e |m..X.XTh|e presen|
|00001140| 74 20 76 65 72 73 69 6f | 6e 73 20 6f 66 20 74 68 |t versio|ns of th|
|00001150| 65 20 66 72 6f 6e 74 2d | 65 6e 64 20 70 72 6f 67 |e front-|end prog|
|00001160| 72 61 6d 73 20 70 72 6f | 76 69 64 65 20 61 20 77 |rams pro|vide a w|
|00001170| 61 79 20 74 6f 20 74 61 | 6b 65 0a 58 63 61 72 65 |ay to ta|ke.Xcare|
|00001180| 20 6f 66 20 74 68 65 20 | 70 72 6f 62 6c 65 6d 2e | of the |problem.|
|00001190| 20 20 41 66 74 65 72 20 | 6d 61 70 70 69 6e 67 20 | After |mapping |
|000011a0| 61 20 63 6c 69 65 6e 74 | 20 68 6f 73 74 20 61 64 |a client| host ad|
|000011b0| 64 72 65 73 73 20 74 6f | 20 61 20 68 6f 73 74 0a |dress to| a host.|
|000011c0| 58 6e 61 6d 65 2c 20 74 | 68 65 20 66 72 6f 6e 74 |Xname, t|he front|
|000011d0| 2d 65 6e 64 20 70 72 6f | 67 72 61 6d 73 20 6e 6f |-end pro|grams no|
|000011e0| 77 20 76 65 72 69 66 79 | 20 74 68 61 74 20 74 68 |w verify| that th|
|000011f0| 65 20 68 6f 73 74 20 6e | 61 6d 65 20 6d 61 70 73 |e host n|ame maps|
|00001200| 20 74 6f 20 74 68 65 0a | 58 73 61 6d 65 20 68 6f | to the.|Xsame ho|
|00001210| 73 74 20 61 64 64 72 65 | 73 73 2e 20 20 54 68 65 |st addre|ss. The|
|00001220| 20 69 64 65 61 20 69 73 | 20 74 68 61 74 20 69 74 | idea is| that it|
|00001230| 20 69 73 20 6d 75 63 68 | 20 65 61 73 69 65 72 20 | is much| easier |
|00001240| 74 6f 20 63 6f 6d 70 72 | 6f 6d 69 73 65 0a 58 74 |to compr|omise.Xt|
|00001250| 68 65 20 61 64 64 72 65 | 73 73 2d 3e 6e 61 6d 65 |he addre|ss->name|
|00001260| 20 6d 61 70 20 6f 66 20 | 73 6f 6d 65 20 72 61 6e | map of |some ran|
|00001270| 64 6f 6d 20 6e 61 6d 65 | 20 73 65 72 76 65 72 20 |dom name| server |
|00001280| 74 68 61 6e 20 74 6f 20 | 63 6f 6d 70 72 6f 6d 69 |than to |compromi|
|00001290| 73 65 20 74 68 65 0a 58 | 6e 61 6d 65 2d 3e 61 64 |se the.X|name->ad|
|000012a0| 64 72 65 73 73 20 6d 61 | 70 20 74 68 61 74 20 69 |dress ma|p that i|
|000012b0| 73 20 73 70 65 63 69 66 | 69 63 20 74 6f 20 79 6f |s specif|ic to yo|
|000012c0| 75 72 20 64 6f 6d 61 69 | 6e 2e 20 20 49 66 20 74 |ur domai|n. If t|
|000012d0| 68 65 20 73 6f 75 72 63 | 65 20 69 73 0a 58 63 6f |he sourc|e is.Xco|
|000012e0| 6d 70 69 6c 65 64 20 77 | 69 74 68 20 2d 44 50 41 |mpiled w|ith -DPA|
|000012f0| 52 41 4e 4f 49 44 2c 20 | 74 68 65 20 66 72 6f 6e |RANOID, |the fron|
|00001300| 74 20 65 6e 64 73 20 6a | 75 73 74 73 20 64 72 6f |t ends j|usts dro|
|00001310| 70 20 74 68 65 20 63 6f | 6e 6e 65 63 74 69 6f 6e |p the co|nnection|
|00001320| 20 69 6e 0a 58 63 61 73 | 65 20 6f 66 20 61 20 68 | in.Xcas|e of a h|
|00001330| 6f 73 74 20 6e 61 6d 65 | 2f 61 64 64 72 65 73 73 |ost name|/address|
|00001340| 20 6d 69 73 6d 61 74 63 | 68 2e 20 4f 74 68 65 72 | mismatc|h. Other|
|00001350| 77 69 73 65 2c 20 74 68 | 65 20 66 72 6f 6e 74 20 |wise, th|e front |
|00001360| 65 6e 64 73 20 6a 75 73 | 74 0a 58 69 67 6e 6f 72 |ends jus|t.Xignor|
|00001370| 65 20 74 68 65 20 62 61 | 64 20 68 6f 73 74 20 6e |e the ba|d host n|
|00001380| 61 6d 65 20 61 6e 64 20 | 75 73 65 20 74 68 65 20 |ame and |use the |
|00001390| 68 6f 73 74 20 61 64 64 | 72 65 73 73 20 77 68 65 |host add|ress whe|
|000013a0| 6e 20 63 6f 6e 73 75 6c | 74 69 6e 67 20 74 68 65 |n consul|ting the|
|000013b0| 0a 58 61 63 63 65 73 73 | 20 63 6f 6e 74 72 6f 6c |.Xaccess| control|
|000013c0| 20 66 69 6c 65 73 2e 0a | 58 0a 58 4d 69 6e 6f 72 | files..|X.XMinor|
|000013d0| 20 65 6e 68 61 6e 63 65 | 6d 65 6e 74 73 3a 20 0a | enhance|ments: .|
|000013e0| 58 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |X-------|--------|
|000013f0| 2d 2d 2d 2d 0a 58 0a 58 | 54 68 65 20 68 6f 73 74 |----.X.X|The host|
|00001400| 20 61 63 63 65 73 73 20 | 63 6f 6e 74 72 6f 6c 20 | access |control |
|00001410| 66 69 6c 65 73 20 6e 6f | 77 20 73 75 70 70 6f 72 |files no|w suppor|
|00001420| 74 20 6d 6f 72 65 20 74 | 79 70 65 73 20 6f 66 20 |t more t|ypes of |
|00001430| 77 69 6c 64 20 63 61 72 | 64 73 20 61 6e 64 0a 58 |wild car|ds and.X|
|00001440| 28 6f 70 74 69 6f 6e 61 | 6c 6c 79 29 20 61 6c 6c |(optiona|lly) all|
|00001450| 6f 77 20 74 68 65 20 75 | 73 65 20 6f 66 20 6e 65 |ow the u|se of ne|
|00001460| 74 67 72 6f 75 70 20 6e | 61 6d 65 73 2e 20 20 4e |tgroup n|ames. N|
|00001470| 65 74 67 72 6f 75 70 20 | 73 75 70 70 6f 72 74 20 |etgroup |support |
|00001480| 69 73 0a 58 75 73 75 61 | 6c 6c 79 20 61 76 61 69 |is.Xusua|lly avai|
|00001490| 6c 61 62 6c 65 20 6f 6e | 20 73 79 73 74 65 6d 73 |lable on| systems|
|000014a0| 20 77 69 74 68 20 4e 49 | 53 20 28 66 6f 72 6d 65 | with NI|S (forme|
|000014b0| 72 6c 79 20 59 50 29 20 | 73 6f 66 74 77 61 72 65 |rly YP) |software|
|000014c0| 2e 0a 58 0a 58 52 65 6c | 61 74 65 64 20 73 6f 66 |..X.XRel|ated sof|
|000014d0| 74 77 61 72 65 3a 0a 58 | 2d 2d 2d 2d 2d 2d 2d 2d |tware:.X|--------|
|000014e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 0a 58 0a 58 56 65 72 |--------|-.X.XVer|
|000014f0| 73 69 6f 6e 73 20 6f 66 | 20 72 73 68 64 20 61 6e |sions of| rshd an|
|00001500| 64 20 72 6c 6f 67 69 6e | 64 2c 20 68 61 63 6b 65 |d rlogin|d, hacke|
|00001510| 64 20 74 6f 20 72 65 70 | 6f 72 74 20 74 68 65 20 |d to rep|ort the |
|00001520| 72 65 6d 6f 74 65 20 75 | 73 65 72 20 6e 61 6d 65 |remote u|ser name|
|00001530| 20 61 73 0a 58 77 65 6c | 6c 2c 20 61 72 65 20 61 | as.Xwel|l, are a|
|00001540| 76 61 69 6c 61 62 6c 65 | 20 66 6f 72 20 61 6e 6f |vailable| for ano|
|00001550| 6e 20 66 74 70 20 28 66 | 74 70 2e 77 69 6e 2e 74 |n ftp (f|tp.win.t|
|00001560| 75 65 2e 6e 6c 3a 2f 70 | 75 62 2f 6c 6f 67 64 61 |ue.nl:/p|ub/logda|
|00001570| 65 6d 6f 6e 2e 74 61 72 | 2e 5a 29 2e 20 20 0a 58 |emon.tar|.Z). .X|
|00001580| 54 68 61 74 20 61 72 63 | 68 69 76 65 20 61 6c 73 |That arc|hive als|
|00001590| 6f 20 63 6f 6e 74 61 69 | 6e 73 20 61 20 74 66 74 |o contai|ns a tft|
|000015a0| 70 64 20 73 6f 75 72 63 | 65 20 74 68 61 74 20 6c |pd sourc|e that l|
|000015b0| 6f 67 73 20 74 68 65 20 | 72 65 6d 6f 74 65 20 68 |ogs the |remote h|
|000015c0| 6f 73 74 0a 58 6e 61 6d | 65 20 28 6e 69 63 65 20 |ost.Xnam|e (nice |
|000015d0| 69 66 20 79 6f 75 20 77 | 61 6e 74 20 74 6f 20 6b |if you w|ant to k|
|000015e0| 6e 6f 77 20 77 68 6f 20 | 69 73 20 69 6e 74 65 72 |now who |is inter|
|000015f0| 65 73 74 65 64 20 69 6e | 20 79 6f 75 72 20 2f 65 |ested in| your /e|
|00001600| 74 63 2f 70 61 73 73 77 | 64 0a 58 66 69 6c 65 29 |tc/passw|d.Xfile)|
|00001610| 2e 20 20 41 6c 6c 20 74 | 68 6f 73 65 20 70 72 6f |. All t|hose pro|
|00001620| 67 72 61 6d 73 20 68 61 | 76 65 20 62 65 65 6e 20 |grams ha|ve been |
|00001630| 74 65 73 74 65 64 20 6f | 6e 6c 79 20 77 69 74 68 |tested o|nly with|
|00001640| 20 53 75 6e 4f 53 20 3e | 3d 20 34 2e 30 2e 0a 58 | SunOS >|= 4.0..X|
|00001650| 0a 58 41 6e 6f 74 68 65 | 72 20 77 61 79 20 74 6f |.XAnothe|r way to|
|00001660| 20 6d 61 6e 61 67 65 20 | 61 63 63 65 73 73 20 74 | manage |access t|
|00001670| 6f 20 74 63 70 2f 69 70 | 20 73 65 72 76 69 63 65 |o tcp/ip| service|
|00001680| 73 20 69 73 20 69 6c 6c | 75 73 74 72 61 74 65 64 |s is ill|ustrated|
|00001690| 20 62 79 20 74 68 65 0a | 58 73 65 72 76 65 72 73 | by the.|Xservers|
|000016a0| 20 70 72 6f 76 69 64 65 | 64 20 77 69 74 68 20 74 | provide|d with t|
|000016b0| 68 65 20 61 75 74 68 75 | 74 69 6c 20 70 61 63 6b |he authu|til pack|
|000016c0| 61 67 65 20 28 63 6f 6d | 70 2e 73 6f 75 72 63 65 |age (com|p.source|
|000016d0| 73 2e 75 6e 69 78 20 76 | 6f 6c 75 6d 65 0a 58 32 |s.unix v|olume.X2|
|000016e0| 32 29 2e 20 54 68 69 73 | 20 68 61 73 20 74 68 65 |2). This| has the|
|000016f0| 20 61 64 76 61 6e 74 61 | 67 65 20 74 68 61 74 20 | advanta|ge that |
|00001700| 6f 6e 65 20 77 69 6c 6c | 20 67 65 74 20 74 68 65 |one will| get the|
|00001710| 20 72 65 6d 6f 74 65 20 | 75 73 65 72 6e 61 6d 65 | remote |username|
|00001720| 20 66 72 6f 6d 0a 58 61 | 6e 79 20 68 6f 73 74 20 | from.Xa|ny host |
|00001730| 73 75 70 70 6f 72 74 69 | 6e 67 20 52 46 43 20 39 |supporti|ng RFC 9|
|00001740| 33 31 20 73 65 63 75 72 | 69 74 79 2e 20 20 42 79 |31 secur|ity. By|
|00001750| 20 69 6e 73 74 61 6c 6c | 69 6e 67 20 74 68 65 20 | install|ing the |
|00001760| 61 75 74 68 20 70 61 63 | 6b 61 67 65 0a 58 28 73 |auth pac|kage.X(s|
|00001770| 61 6d 65 20 76 6f 6c 75 | 6d 65 29 20 6f 6e 65 20 |ame volu|me) one |
|00001780| 73 75 70 70 6f 72 74 73 | 20 52 46 43 20 39 33 31 |supports| RFC 931|
|00001790| 20 73 65 63 75 72 69 74 | 79 20 74 6f 6f 20 28 62 | securit|y too (b|
|000017a0| 75 74 20 79 6f 75 20 77 | 69 6c 6c 20 68 61 76 65 |ut you w|ill have|
|000017b0| 20 74 6f 0a 58 62 65 6c | 69 65 76 65 20 77 68 61 | to.Xbel|ieve wha|
|000017c0| 74 20 74 68 65 20 72 65 | 6d 6f 74 65 20 68 6f 73 |t the re|mote hos|
|000017d0| 74 20 74 65 6c 6c 73 20 | 79 6f 75 29 2e 20 20 45 |t tells |you). E|
|000017e0| 76 65 6e 74 75 61 6c 6c | 79 20 6f 6e 65 20 63 61 |ventuall|y one ca|
|000017f0| 6e 20 73 74 61 72 74 0a | 58 63 75 74 74 69 6e 67 |n start.|Xcutting|
|00001800| 20 6f 66 66 20 75 6e 61 | 75 74 68 65 6e 74 69 63 | off una|uthentic|
|00001810| 61 74 65 64 20 63 6f 6e | 6e 65 63 74 69 6f 6e 73 |ated con|nections|
|00001820| 2e 20 54 68 69 73 20 69 | 73 20 6f 62 76 69 6f 75 |. This i|s obviou|
|00001830| 73 6c 79 20 61 20 6d 75 | 63 68 20 6d 6f 72 65 0a |sly a mu|ch more.|
|00001840| 58 61 64 76 61 6e 63 65 | 64 20 61 70 70 72 6f 61 |Xadvance|d approa|
|00001850| 63 68 20 74 68 61 6e 20 | 77 68 61 74 20 6d 79 20 |ch than |what my |
|00001860| 66 72 6f 6e 74 2d 65 6e | 64 20 70 72 6f 67 72 61 |front-en|d progra|
|00001870| 6d 73 20 70 72 6f 76 69 | 64 65 2e 20 54 68 65 20 |ms provi|de. The |
|00001880| 70 72 65 73 65 6e 74 0a | 58 70 61 63 6b 61 67 65 |present.|Xpackage|
|00001890| 20 69 73 20 6d 6f 72 65 | 20 73 75 69 74 61 62 6c | is more| suitabl|
|000018a0| 65 20 66 6f 72 20 74 68 | 6f 73 65 20 77 68 6f 20 |e for th|ose who |
|000018b0| 6c 61 63 6b 20 74 68 65 | 20 72 65 73 6f 75 72 63 |lack the| resourc|
|000018c0| 65 73 20 74 6f 20 69 6e | 73 74 61 6c 6c 0a 58 61 |es to in|stall.Xa|
|000018d0| 6e 79 74 68 69 6e 67 20 | 74 68 61 74 20 72 65 71 |nything |that req|
|000018e0| 75 69 72 65 73 20 6d 6f | 72 65 20 74 68 61 6e 20 |uires mo|re than |
|000018f0| 6a 75 73 74 20 72 65 6e | 61 6d 69 6e 67 20 61 20 |just ren|aming a |
|00001900| 63 6f 75 70 6c 65 20 6f | 66 20 65 78 65 63 75 74 |couple o|f execut|
|00001910| 61 62 6c 65 73 2e 0a 58 | 0a 58 43 6f 6e 66 69 67 |ables..X|.XConfig|
|00001920| 75 72 61 74 69 6f 6e 20 | 61 6e 64 20 69 6e 73 74 |uration |and inst|
|00001930| 61 6c 6c 61 74 69 6f 6e | 20 28 74 68 65 20 65 61 |allation| (the ea|
|00001940| 73 79 20 77 61 79 29 3a | 0a 58 2d 2d 2d 2d 2d 2d |sy way):|.X------|
|00001950| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001960| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001970| 2d 2d 2d 2d 2d 2d 2d 2d | 0a 58 0a 58 41 6e 20 61 |--------|.X.XAn a|
|00001980| 64 76 61 6e 63 65 64 20 | 69 6e 73 74 61 6c 6c 61 |dvanced |installa|
|00001990| 74 69 6f 6e 20 72 65 63 | 69 70 65 20 69 73 20 67 |tion rec|ipe is g|
|000019a0| 69 76 65 6e 20 6c 61 74 | 65 72 6f 6e 2e 20 54 68 |iven lat|eron. Th|
|000019b0| 65 20 22 65 61 73 79 20 | 77 61 79 22 20 72 65 63 |e "easy |way" rec|
|000019c0| 69 70 65 0a 58 72 65 71 | 75 69 72 65 73 20 6e 6f |ipe.Xreq|uires no|
|000019d0| 20 63 68 61 6e 67 65 73 | 20 74 6f 20 65 78 69 73 | changes| to exis|
|000019e0| 74 69 6e 67 20 73 6f 66 | 74 77 61 72 65 20 6f 72 |ting sof|tware or|
|000019f0| 20 63 6f 6e 66 69 67 75 | 72 61 74 69 6f 6e 20 66 | configu|ration f|
|00001a00| 69 6c 65 73 2e 0a 58 0a | 58 49 66 20 79 6f 75 20 |iles..X.|XIf you |
|00001a10| 64 6f 6e 27 74 20 72 75 | 6e 20 55 6c 74 72 69 78 |don't ru|n Ultrix|
|00001a20| 2c 20 79 6f 75 20 64 6f | 6e 27 74 20 6e 65 65 64 |, you do|n't need|
|00001a30| 20 74 68 65 20 6d 69 73 | 63 64 20 66 72 6f 6e 74 | the mis|cd front|
|00001a40| 2d 65 6e 64 20 70 72 6f | 67 72 61 6d 2e 0a 58 54 |-end pro|gram..XT|
|00001a50| 68 65 20 55 6c 74 72 69 | 78 20 6d 69 73 63 64 20 |he Ultri|x miscd |
|00001a60| 64 61 65 6d 6f 6e 20 69 | 6d 70 6c 65 6d 65 6e 74 |daemon i|mplement|
|00001a70| 73 20 61 6d 6f 6e 67 20 | 6f 74 68 65 72 73 20 74 |s among |others t|
|00001a80| 68 65 20 53 59 53 54 41 | 54 20 73 65 72 76 69 63 |he SYSTA|T servic|
|00001a90| 65 2c 0a 58 77 68 69 63 | 68 20 70 69 70 65 73 20 |e,.Xwhic|h pipes |
|00001aa0| 74 68 65 20 6f 75 74 70 | 75 74 20 66 72 6f 6d 20 |the outp|ut from |
|00001ab0| 74 68 65 20 57 48 4f 20 | 63 6f 6d 6d 61 6e 64 20 |the WHO |command |
|00001ac0| 74 6f 20 73 74 61 6e 64 | 61 72 64 20 6f 75 74 70 |to stand|ard outp|
|00001ad0| 75 74 2e 0a 58 0a 58 42 | 79 20 64 65 66 61 75 6c |ut..X.XB|y defaul|
|00001ae0| 74 2c 20 74 68 65 20 66 | 72 6f 6e 74 2d 65 6e 64 |t, the f|ront-end|
|00001af0| 20 70 72 6f 67 72 61 6d | 73 20 61 73 73 75 6d 65 | program|s assume|
|00001b00| 20 74 68 61 74 20 74 68 | 65 20 76 65 6e 64 6f 72 | that th|e vendor|
|00001b10| 2d 70 72 6f 76 69 64 65 | 64 0a 58 64 61 65 6d 6f |-provide|d.Xdaemo|
|00001b20| 6e 73 20 77 69 6c 6c 20 | 62 65 20 6d 6f 76 65 64 |ns will |be moved|
|00001b30| 20 74 6f 20 74 68 65 20 | 22 2f 75 73 72 2f 65 74 | to the |"/usr/et|
|00001b40| 63 2f 2e 2e 2e 22 20 64 | 69 72 65 63 74 6f 72 79 |c/..." d|irectory|
|00001b50| 2e 20 20 49 66 20 79 6f | 75 20 77 61 6e 74 0a 58 |. If yo|u want.X|
|00001b60| 73 6f 6d 65 74 68 69 6e | 67 20 65 6c 73 65 2c 20 |somethin|g else, |
|00001b70| 61 64 6a 75 73 74 20 74 | 68 65 20 52 45 41 4c 5f |adjust t|he REAL_|
|00001b80| 44 41 45 4d 4f 4e 20 61 | 6e 64 20 74 68 65 20 52 |DAEMON a|nd the R|
|00001b90| 45 41 4c 5f 44 41 45 4d | 4f 4e 5f 44 49 52 20 6d |EAL_DAEM|ON_DIR m|
|00001ba0| 61 63 72 6f 73 0a 58 69 | 6e 20 74 68 65 20 66 69 |acros.Xi|n the fi|
|00001bb0| 6c 65 73 20 6d 69 73 63 | 64 2e 63 20 61 6e 64 20 |les misc|d.c and |
|00001bc0| 74 63 70 64 2e 63 2e 0a | 58 0a 58 42 79 20 64 65 |tcpd.c..|X.XBy de|
|00001bd0| 66 61 75 6c 74 2c 20 63 | 6f 6e 6e 65 63 74 69 6f |fault, c|onnectio|
|00001be0| 6e 73 20 61 72 65 20 6c | 6f 67 67 65 64 20 74 6f |ns are l|ogged to|
|00001bf0| 20 74 68 65 20 73 61 6d | 65 20 70 6c 61 63 65 20 | the sam|e place |
|00001c00| 77 68 65 72 65 20 74 68 | 65 20 73 65 6e 64 6d 61 |where th|e sendma|
|00001c10| 69 6c 0a 58 6c 6f 67 20 | 65 6e 74 72 69 65 73 20 |il.Xlog |entries |
|00001c20| 67 6f 2e 20 20 49 66 20 | 63 6f 6e 6e 65 63 74 69 |go. If |connecti|
|00001c30| 6f 6e 73 20 73 68 6f 75 | 6c 64 20 62 65 20 6c 6f |ons shou|ld be lo|
|00001c40| 67 67 65 64 20 65 6c 73 | 65 77 68 65 72 65 2c 20 |gged els|ewhere, |
|00001c50| 61 64 6a 75 73 74 20 74 | 68 65 0a 58 4c 4f 47 5f |adjust t|he.XLOG_|
|00001c60| 4d 41 49 4c 20 6d 61 63 | 72 6f 20 69 6e 20 74 68 |MAIL mac|ro in th|
|00001c70| 65 20 6d 69 73 63 64 2e | 63 20 61 6e 64 20 74 63 |e miscd.|c and tc|
|00001c80| 70 64 2e 63 20 66 69 6c | 65 73 2c 20 61 6e 64 20 |pd.c fil|es, and |
|00001c90| 75 70 64 61 74 65 20 79 | 6f 75 72 20 73 79 73 6c |update y|our sysl|
|00001ca0| 6f 67 0a 58 63 6f 6e 66 | 69 67 75 72 61 74 69 6f |og.Xconf|iguratio|
|00001cb0| 6e 20 66 69 6c 65 20 28 | 75 73 75 61 6c 6c 79 2c |n file (|usually,|
|00001cc0| 20 2f 65 74 63 2f 73 79 | 73 6c 6f 67 2e 63 6f 6e | /etc/sy|slog.con|
|00001cd0| 66 29 2e 20 20 4d 6f 73 | 74 20 55 6c 74 72 69 78 |f). Mos|t Ultrix|
|00001ce0| 20 76 65 72 73 69 6f 6e | 73 20 0a 58 64 6f 20 6e | version|s .Xdo n|
|00001cf0| 6f 74 20 70 72 6f 76 69 | 64 65 20 74 68 69 73 20 |ot provi|de this |
|00001d00| 66 6c 65 78 69 62 69 6c | 69 74 79 2c 20 74 68 6f |flexibil|ity, tho|
|00001d10| 75 67 68 2e 0a 58 0a 58 | 42 79 20 64 65 66 61 75 |ugh..X.X|By defau|
|00001d20| 6c 74 2c 20 74 68 65 20 | 66 72 6f 6e 74 2d 65 6e |lt, the |front-en|
|00001d30| 64 20 70 72 6f 67 72 61 | 6d 73 20 73 75 70 70 6f |d progra|ms suppo|
|00001d40| 72 74 20 68 6f 73 74 20 | 61 63 63 65 73 73 20 63 |rt host |access c|
|00001d50| 6f 6e 74 72 6f 6c 2e 20 | 20 41 63 63 65 73 73 0a |ontrol. | Access.|
|00001d60| 58 63 6f 6e 74 72 6f 6c | 20 69 73 20 74 75 72 6e |Xcontrol| is turn|
|00001d70| 65 64 20 6f 66 66 20 77 | 68 65 6e 20 74 68 65 20 |ed off w|hen the |
|00001d80| 2f 65 74 63 2f 68 6f 73 | 74 73 2e 7b 61 6c 6c 6f |/etc/hos|ts.{allo|
|00001d90| 77 2c 64 65 6e 79 7d 20 | 66 69 6c 65 73 20 64 6f |w,deny} |files do|
|00001da0| 20 6e 6f 74 0a 58 65 78 | 69 73 74 2e 20 49 66 20 | not.Xex|ist. If |
|00001db0| 79 6f 75 20 64 6f 20 6e | 6f 74 20 6e 65 65 64 20 |you do n|ot need |
|00001dc0| 73 75 70 70 6f 72 74 20 | 66 6f 72 20 68 6f 73 74 |support |for host|
|00001dd0| 20 61 63 63 65 73 73 20 | 63 6f 6e 74 72 6f 6c 2c | access |control,|
|00001de0| 20 61 64 6a 75 73 74 20 | 74 68 65 0a 58 6d 61 6b | adjust |the.Xmak|
|00001df0| 65 66 69 6c 65 20 73 6f | 20 74 68 61 74 20 74 68 |efile so| that th|
|00001e00| 65 20 70 72 6f 67 72 61 | 6d 73 20 61 72 65 20 63 |e progra|ms are c|
|00001e10| 6f 6d 70 69 6c 65 64 20 | 77 69 74 68 6f 75 74 20 |ompiled |without |
|00001e20| 2d 44 48 4f 53 54 53 5f | 41 43 43 45 53 53 2e 0a |-DHOSTS_|ACCESS..|
|00001e30| 58 4e 6f 74 65 3a 20 20 | 74 68 65 20 68 6f 73 74 |XNote: |the host|
|00001e40| 20 61 63 63 65 73 73 20 | 63 6f 6e 74 72 6f 6c 20 | access |control |
|00001e50| 66 61 63 69 6c 69 74 79 | 20 72 65 71 75 69 72 65 |facility| require|
|00001e60| 73 20 74 68 65 20 73 74 | 72 63 68 72 28 29 2c 20 |s the st|rchr(), |
|00001e70| 73 74 72 73 70 6e 28 29 | 0a 58 61 6e 64 20 73 74 |strspn()|.Xand st|
|00001e80| 72 74 6f 6b 28 29 20 72 | 6f 75 74 69 6e 65 73 2e |rtok() r|outines.|
|00001e90| 0a 58 0a 58 49 66 20 79 | 6f 75 72 20 43 20 6c 69 |.X.XIf y|our C li|
|00001ea0| 62 72 61 72 79 20 64 6f | 65 73 20 6e 6f 74 20 70 |brary do|es not p|
|00001eb0| 72 6f 76 69 64 65 20 74 | 68 65 20 73 74 72 63 61 |rovide t|he strca|
|00001ec0| 73 65 63 6d 70 28 29 20 | 72 6f 75 74 69 6e 65 2c |secmp() |routine,|
|00001ed0| 20 61 64 6a 75 73 74 20 | 74 68 65 0a 58 41 55 58 | adjust |the.XAUX|
|00001ee0| 5f 4f 42 4a 20 6d 61 63 | 72 6f 20 69 6e 20 74 68 |_OBJ mac|ro in th|
|00001ef0| 65 20 4d 61 6b 65 66 69 | 6c 65 20 73 6f 20 74 68 |e Makefi|le so th|
|00001f00| 61 74 20 69 74 20 75 73 | 65 73 20 74 68 65 20 73 |at it us|es the s|
|00001f10| 74 72 63 61 73 65 63 6d | 70 28 29 20 76 65 72 73 |trcasecm|p() vers|
|00001f20| 69 6f 6e 0a 58 70 72 6f | 76 69 64 65 64 20 77 69 |ion.Xpro|vided wi|
|00001f30| 74 68 20 74 68 69 73 20 | 70 61 63 6b 61 67 65 2e |th this |package.|
|00001f40| 0a 58 0a 58 49 6e 20 74 | 68 65 20 4d 61 6b 65 66 |.X.XIn t|he Makef|
|00001f50| 69 6c 65 2c 20 61 64 64 | 20 2d 44 6d 65 6d 63 6d |ile, add| -Dmemcm|
|00001f60| 70 3d 62 63 6d 70 20 74 | 6f 20 74 68 65 20 43 46 |p=bcmp t|o the CF|
|00001f70| 4c 41 47 53 20 6d 61 63 | 72 6f 20 69 66 20 79 6f |LAGS mac|ro if yo|
|00001f80| 75 72 20 73 79 73 74 65 | 6d 0a 58 64 6f 65 73 20 |ur syste|m.Xdoes |
|00001f90| 6e 6f 74 20 68 61 76 65 | 20 6d 65 6d 63 6d 70 28 |not have| memcmp(|
|00001fa0| 29 2c 20 61 6e 64 20 61 | 64 64 20 2d 44 4e 45 54 |), and a|dd -DNET|
|00001fb0| 47 52 4f 55 50 20 74 6f | 20 74 68 65 20 43 46 4c |GROUP to| the CFL|
|00001fc0| 41 47 53 20 6d 61 63 72 | 6f 20 69 66 20 79 6f 75 |AGS macr|o if you|
|00001fd0| 72 0a 58 73 79 73 74 65 | 6d 20 73 75 70 70 6f 72 |r.Xsyste|m suppor|
|00001fe0| 74 73 20 6e 65 74 67 72 | 6f 75 70 73 2e 0a 58 0a |ts netgr|oups..X.|
|00001ff0| 58 43 6f 6d 70 69 6c 65 | 20 77 69 74 68 20 2d 44 |XCompile| with -D|
|00002000| 50 41 52 41 4e 4f 49 44 | 20 69 66 20 79 6f 75 20 |PARANOID| if you |
|00002010| 77 61 6e 74 20 74 6f 20 | 64 72 6f 70 20 63 6f 6e |want to |drop con|
|00002020| 6e 65 63 74 69 6f 6e 73 | 20 77 68 65 6e 20 61 20 |nections| when a |
|00002030| 72 65 6d 6f 74 65 0a 58 | 68 6f 73 74 20 6e 61 6d |remote.X|host nam|
|00002040| 65 20 64 6f 65 73 20 6e | 6f 74 20 61 67 72 65 65 |e does n|ot agree|
|00002050| 20 77 69 74 68 20 74 68 | 65 20 72 65 6d 6f 74 65 | with th|e remote|
|00002060| 20 68 6f 73 74 20 61 64 | 64 72 65 73 73 2e 20 54 | host ad|dress. T|
|00002070| 68 69 73 20 68 65 6c 70 | 73 20 0a 58 61 67 61 69 |his help|s .Xagai|
|00002080| 6e 73 74 20 61 74 74 61 | 63 6b 73 20 74 68 72 6f |nst atta|cks thro|
|00002090| 75 67 68 20 63 6f 6d 70 | 72 6f 6d 69 73 65 64 20 |ugh comp|romised |
|000020a0| 64 6f 6d 61 69 6e 20 6e | 61 6d 65 20 73 65 72 76 |domain n|ame serv|
|000020b0| 65 72 73 2c 20 62 75 74 | 20 6d 61 79 0a 58 6f 63 |ers, but| may.Xoc|
|000020c0| 63 61 73 69 6f 6e 61 6c | 6c 79 20 63 61 75 73 65 |casional|ly cause|
|000020d0| 20 61 20 70 65 72 66 65 | 63 74 6c 79 20 6c 65 67 | a perfe|ctly leg|
|000020e0| 61 6c 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 20 74 6f |al conne|ction to|
|000020f0| 20 62 65 20 72 65 66 75 | 73 65 64 20 64 75 65 20 | be refu|sed due |
|00002100| 74 6f 0a 58 74 72 61 6e | 73 69 65 6e 74 20 6e 61 |to.Xtran|sient na|
|00002110| 6d 65 20 73 65 72 76 65 | 72 20 6c 6f 6f 6b 75 70 |me serve|r lookup|
|00002120| 20 70 72 6f 62 6c 65 6d | 73 2e 0a 58 0a 58 54 68 | problem|s..X.XTh|
|00002130| 65 20 74 63 70 64 20 70 | 72 6f 67 72 61 6d 20 69 |e tcpd p|rogram i|
|00002140| 73 20 69 6e 74 65 6e 64 | 65 64 20 66 6f 72 20 6d |s intend|ed for m|
|00002150| 6f 6e 69 74 6f 72 69 6e | 67 20 63 6f 6e 6e 65 63 |onitorin|g connec|
|00002160| 74 69 6f 6e 73 20 74 6f | 20 74 68 65 20 74 65 6c |tions to| the tel|
|00002170| 6e 65 74 2c 0a 58 66 69 | 6e 67 65 72 2c 20 66 74 |net,.Xfi|nger, ft|
|00002180| 70 2c 20 65 78 65 63 2c | 20 72 73 68 20 61 6e 64 |p, exec,| rsh and|
|00002190| 20 72 6c 6f 67 69 6e 20 | 73 65 72 76 69 63 65 73 | rlogin |services|
|000021a0| 2e 20 44 65 63 69 64 65 | 20 77 68 69 63 68 20 73 |. Decide| which s|
|000021b0| 65 72 76 69 63 65 73 20 | 79 6f 75 0a 58 77 61 6e |ervices |you.Xwan|
|000021c0| 74 20 74 6f 20 62 65 20 | 6d 6f 6e 69 74 6f 72 65 |t to be |monitore|
|000021d0| 64 2e 20 4d 6f 76 65 20 | 74 68 65 20 76 65 6e 64 |d. Move |the vend|
|000021e0| 6f 72 2d 70 72 6f 76 69 | 64 65 64 20 64 61 65 6d |or-provi|ded daem|
|000021f0| 6f 6e 20 70 72 6f 67 72 | 61 6d 73 20 74 6f 20 74 |on progr|ams to t|
|00002200| 68 65 0a 58 6c 6f 63 61 | 74 69 6f 6e 20 73 70 65 |he.Xloca|tion spe|
|00002210| 63 69 66 69 65 64 20 62 | 79 20 74 68 65 20 52 45 |cified b|y the RE|
|00002220| 41 4c 5f 44 41 45 4d 4f | 4e 5f 44 49 52 20 6d 61 |AL_DAEMO|N_DIR ma|
|00002230| 63 72 6f 20 69 6e 20 74 | 68 65 20 66 69 6c 65 20 |cro in t|he file |
|00002240| 74 63 70 64 2e 63 2c 20 | 61 6e 64 0a 58 63 6f 70 |tcpd.c, |and.Xcop|
|00002250| 79 20 74 68 65 20 74 63 | 70 64 20 66 72 6f 6e 74 |y the tc|pd front|
|00002260| 20 65 6e 64 20 74 6f 20 | 74 68 65 20 6c 6f 63 61 | end to |the loca|
|00002270| 74 69 6f 6e 73 20 77 68 | 65 72 65 20 74 68 65 20 |tions wh|ere the |
|00002280| 76 65 6e 64 6f 72 2d 70 | 72 6f 76 69 64 65 64 0a |vendor-p|rovided.|
|00002290| 58 64 61 65 6d 6f 6e 73 | 20 75 73 65 64 20 74 6f |Xdaemons| used to|
|000022a0| 20 62 65 2e 20 54 68 61 | 74 20 69 73 2c 20 6f 6e | be. Tha|t is, on|
|000022b0| 65 20 63 6f 70 79 20 6f | 66 20 74 68 65 20 74 63 |e copy o|f the tc|
|000022c0| 70 64 20 66 72 6f 6e 74 | 20 65 6e 64 20 66 6f 72 |pd front| end for|
|000022d0| 20 65 61 63 68 0a 58 73 | 65 72 76 69 63 65 20 74 | each.Xs|ervice t|
|000022e0| 68 61 74 20 79 6f 75 20 | 77 61 6e 74 20 74 6f 20 |hat you |want to |
|000022f0| 6d 6f 6e 69 74 6f 72 2e | 0a 58 0a 58 55 6c 74 72 |monitor.|.X.XUltr|
|00002300| 69 78 20 6f 6e 6c 79 3a | 20 69 66 20 79 6f 75 20 |ix only:| if you |
|00002310| 77 61 6e 74 20 74 6f 20 | 6d 6f 6e 69 74 6f 72 20 |want to |monitor |
|00002320| 63 6f 6e 6e 65 63 74 69 | 6f 6e 73 20 74 6f 20 74 |connecti|ons to t|
|00002330| 68 65 20 53 59 53 54 41 | 54 20 73 65 72 76 69 63 |he SYSTA|T servic|
|00002340| 65 2c 0a 58 6d 6f 76 65 | 20 74 68 65 20 76 65 6e |e,.Xmove| the ven|
|00002350| 64 6f 72 2d 70 72 6f 76 | 69 64 65 64 20 6d 69 73 |dor-prov|ided mis|
|00002360| 63 64 20 64 61 65 6d 6f | 6e 20 74 6f 20 74 68 65 |cd daemo|n to the|
|00002370| 20 6c 6f 63 61 74 69 6f | 6e 20 73 70 65 63 69 66 | locatio|n specif|
|00002380| 69 65 64 20 62 79 20 74 | 68 65 0a 58 52 45 41 4c |ied by t|he.XREAL|
|00002390| 5f 44 41 45 4d 4f 4e 20 | 6d 61 63 72 6f 20 69 6e |_DAEMON |macro in|
|000023a0| 20 74 68 65 20 6d 69 73 | 63 64 2e 63 20 66 69 6c | the mis|cd.c fil|
|000023b0| 65 2c 20 61 6e 64 20 69 | 6e 73 74 61 6c 6c 20 74 |e, and i|nstall t|
|000023c0| 68 65 20 6d 69 73 63 64 | 20 66 72 6f 6e 74 20 65 |he miscd| front e|
|000023d0| 6e 64 0a 58 69 6e 74 6f | 20 74 68 65 20 6f 72 69 |nd.Xinto| the ori|
|000023e0| 67 69 6e 61 6c 20 6d 69 | 73 63 64 20 6c 6f 63 61 |ginal mi|scd loca|
|000023f0| 74 69 6f 6e 2e 0a 58 0a | 58 43 6f 6e 66 69 67 75 |tion..X.|XConfigu|
|00002400| 72 61 74 69 6f 6e 20 61 | 6e 64 20 69 6e 73 74 61 |ration a|nd insta|
|00002410| 6c 6c 61 74 69 6f 6e 20 | 28 74 68 65 20 61 64 76 |llation |(the adv|
|00002420| 61 6e 63 65 64 20 77 61 | 79 29 3a 0a 58 2d 2d 2d |anced wa|y):.X---|
|00002430| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002440| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002450| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0a |--------|-------.|
|00002460| 58 0a 58 49 6e 73 74 65 | 61 64 20 6f 66 20 6d 6f |X.XInste|ad of mo|
|00002470| 76 69 6e 67 20 74 68 65 | 20 76 65 6e 64 6f 72 2d |ving the| vendor-|
|00002480| 70 72 6f 76 69 64 65 64 | 20 64 61 65 6d 6f 6e 73 |provided| daemons|
|00002490| 20 74 6f 20 61 6e 6f 74 | 68 65 72 20 64 69 72 65 | to anot|her dire|
|000024a0| 63 74 6f 72 79 2c 0a 58 | 64 65 66 69 6e 65 20 74 |ctory,.X|define t|
|000024b0| 68 65 20 52 45 41 4c 5f | 44 41 45 4d 4f 4e 5f 44 |he REAL_|DAEMON_D|
|000024c0| 49 52 20 74 6f 20 72 65 | 66 6c 65 63 74 20 74 68 |IR to re|flect th|
|000024d0| 65 20 70 72 65 73 65 6e | 74 20 6c 6f 63 61 74 69 |e presen|t locati|
|000024e0| 6f 6e 20 6f 66 20 74 68 | 6f 73 65 0a 58 64 61 65 |on of th|ose.Xdae|
|000024f0| 6d 6f 6e 73 2c 20 61 6e | 64 20 69 6e 73 74 61 6c |mons, an|d instal|
|00002500| 6c 20 74 68 65 20 74 63 | 70 64 20 63 6f 6d 6d 61 |l the tc|pd comma|
|00002510| 6e 64 20 69 6e 20 74 68 | 65 20 73 61 6d 65 20 64 |nd in th|e same d|
|00002520| 69 72 65 63 74 6f 72 79 | 2e 20 54 68 65 6e 20 64 |irectory|. Then d|
|00002530| 6f 0a 58 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |o.Xthe f|ollowing|
|00002540| 20 65 64 69 74 73 20 74 | 6f 20 74 68 65 20 69 6e | edits t|o the in|
|00002550| 65 74 64 20 63 6f 6e 66 | 69 67 75 72 61 74 69 6f |etd conf|iguratio|
|00002560| 6e 20 66 69 6c 65 20 28 | 75 73 75 61 6c 6c 79 20 |n file (|usually |
|00002570| 69 6e 0a 58 2f 65 74 63 | 2f 69 6e 65 74 64 2e 63 |in.X/etc|/inetd.c|
|00002580| 6f 6e 66 29 3a 0a 58 0a | 58 20 20 20 20 74 65 6c |onf):.X.|X tel|
|00002590| 6e 65 74 20 20 73 74 72 | 65 61 6d 20 20 74 63 70 |net str|eam tcp|
|000025a0| 20 20 20 20 20 6e 6f 77 | 61 69 74 20 20 72 6f 6f | now|ait roo|
|000025b0| 74 20 20 20 20 2f 75 73 | 72 2f 65 74 63 2f 69 6e |t /us|r/etc/in|
|000025c0| 2e 74 65 6c 6e 65 74 64 | 20 20 20 20 20 69 6e 2e |.telnetd| in.|
|000025d0| 74 65 6c 6e 65 74 64 0a | 58 0a 58 62 65 63 6f 6d |telnetd.|X.Xbecom|
|000025e0| 65 73 3a 0a 58 0a 58 20 | 20 20 20 74 65 6c 6e 65 |es:.X.X | telne|
|000025f0| 74 20 20 73 74 72 65 61 | 6d 20 20 74 63 70 20 20 |t strea|m tcp |
|00002600| 20 20 20 6e 6f 77 61 69 | 74 20 20 72 6f 6f 74 20 | nowai|t root |
|00002610| 20 20 20 2f 75 73 72 2f | 65 74 63 2f 74 63 70 64 | /usr/|etc/tcpd|
|00002620| 20 20 20 20 20 20 20 20 | 20 20 20 69 6e 2e 74 65 | | in.te|
|00002630| 6c 6e 65 74 64 0a 58 0a | 58 28 74 68 65 20 65 78 |lnetd.X.|X(the ex|
|00002640| 61 6d 70 6c 65 20 61 70 | 70 6c 69 65 73 20 74 6f |ample ap|plies to|
|00002650| 20 53 75 6e 4f 53 20 34 | 2e 78 3b 20 6f 74 68 65 | SunOS 4|.x; othe|
|00002660| 72 20 55 4e 49 58 20 69 | 6d 70 6c 65 6d 65 6e 74 |r UNIX i|mplement|
|00002670| 61 74 69 6f 6e 73 20 73 | 68 6f 75 6c 64 0a 58 6e |ations s|hould.Xn|
|00002680| 6f 74 20 64 69 66 66 65 | 72 20 6d 75 63 68 29 2e |ot diffe|r much).|
|00002690| 20 53 69 6d 69 6c 61 72 | 20 63 68 61 6e 67 65 73 | Similar| changes|
|000026a0| 20 77 69 6c 6c 20 62 65 | 20 6e 65 65 64 65 64 20 | will be| needed |
|000026b0| 66 6f 72 20 74 68 65 20 | 6f 74 68 65 72 20 73 65 |for the |other se|
|000026c0| 72 76 69 63 65 73 0a 58 | 74 68 61 74 20 61 72 65 |rvices.X|that are|
|000026d0| 20 74 6f 20 62 65 20 63 | 6f 76 65 72 65 64 20 62 | to be c|overed b|
|000026e0| 79 20 74 68 65 20 74 63 | 70 64 20 66 72 6f 6e 74 |y the tc|pd front|
|000026f0| 2d 65 6e 64 20 70 72 6f | 67 72 61 6d 2e 0a 58 0a |-end pro|gram..X.|
|00002700| 58 41 70 6f 6c 6c 6f 20 | 55 4e 49 58 20 75 73 65 |XApollo |UNIX use|
|00002710| 72 73 20 77 69 6c 6c 20 | 77 61 6e 74 20 74 6f 20 |rs will |want to |
|00002720| 69 6e 73 74 61 6c 6c 20 | 74 68 65 20 66 72 6f 6e |install |the fron|
|00002730| 74 20 65 6e 64 20 75 6e | 64 65 72 20 61 20 64 69 |t end un|der a di|
|00002740| 66 66 65 72 65 6e 74 0a | 58 6e 61 6d 65 20 62 65 |fferent.|Xname be|
|00002750| 63 61 75 73 65 20 74 63 | 70 64 20 69 73 20 74 68 |cause tc|pd is th|
|00002760| 65 20 6e 61 6d 65 20 6f | 66 20 61 6e 20 61 6c 72 |e name o|f an alr|
|00002770| 65 61 64 79 20 65 78 69 | 73 74 69 6e 67 20 63 6f |eady exi|sting co|
|00002780| 6d 6d 61 6e 64 2e 20 41 | 20 73 75 69 74 61 62 6c |mmand. A| suitabl|
|00002790| 65 20 0a 58 6e 61 6d 65 | 20 66 6f 72 20 74 68 65 |e .Xname| for the|
|000027a0| 20 66 72 6f 6e 74 2d 65 | 6e 64 20 70 72 6f 67 72 | front-e|nd progr|
|000027b0| 61 6d 20 77 6f 75 6c 64 | 20 62 65 20 22 66 72 6f |am would| be "fro|
|000027c0| 6e 74 64 22 2e 0a 58 0a | 58 54 68 65 20 73 61 6d |ntd"..X.|XThe sam|
|000027d0| 65 20 74 72 69 63 6b 20 | 63 61 6e 20 62 65 20 70 |e trick |can be p|
|000027e0| 6c 61 79 65 64 20 77 69 | 74 68 20 74 68 65 20 55 |layed wi|th the U|
|000027f0| 6c 74 72 69 78 20 6d 69 | 73 63 64 20 64 61 65 6d |ltrix mi|scd daem|
|00002800| 6f 6e 20 62 75 74 20 74 | 68 65 6e 20 74 68 65 0a |on but t|hen the.|
|00002810| 58 64 61 65 6d 6f 6e 20 | 66 72 6f 6e 74 20 65 6e |Xdaemon |front en|
|00002820| 64 20 77 69 6c 6c 20 68 | 61 76 65 20 74 6f 20 62 |d will h|ave to b|
|00002830| 65 20 69 6e 73 74 61 6c | 6c 65 64 20 75 6e 64 65 |e instal|led unde|
|00002840| 72 20 61 20 64 69 66 66 | 65 72 65 6e 74 20 6e 61 |r a diff|erent na|
|00002850| 6d 65 2e 0a 58 0a 58 41 | 63 6b 6e 6f 77 6c 65 64 |me..X.XA|cknowled|
|00002860| 67 65 6d 65 6e 74 73 3a | 0a 58 2d 2d 2d 2d 2d 2d |gements:|.X------|
|00002870| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 0a 58 0a 58 54 |--------|---.X.XT|
|00002880| 68 61 6e 6b 73 20 74 6f | 20 42 72 65 6e 64 61 6e |hanks to| Brendan|
|00002890| 20 4b 65 68 6f 65 20 28 | 62 72 65 6e 64 61 6e 40 | Kehoe (|brendan@|
|000028a0| 63 73 2e 77 69 64 65 6e | 65 72 2e 65 64 75 29 2c |cs.widen|er.edu),|
|000028b0| 20 48 65 69 6d 69 72 20 | 53 76 65 72 72 69 73 73 | Heimir |Sverriss|
|000028c0| 6f 6e 0a 58 28 68 65 69 | 6d 69 72 40 68 61 66 72 |on.X(hei|mir@hafr|
|000028d0| 6f 2e 69 73 29 20 61 6e | 64 20 44 61 6e 20 42 65 |o.is) an|d Dan Be|
|000028e0| 72 6e 73 74 65 69 6e 20 | 28 62 72 6e 73 74 6e 64 |rnstein |(brnstnd|
|000028f0| 40 6b 72 61 6d 64 65 6e | 2e 61 63 66 2e 6e 79 75 |@kramden|.acf.nyu|
|00002900| 2e 65 64 75 29 20 66 6f | 72 0a 58 66 65 65 64 62 |.edu) fo|r.Xfeedb|
|00002910| 61 63 6b 20 6f 6e 20 61 | 6e 20 65 61 72 6c 69 65 |ack on a|n earlie|
|00002920| 72 20 72 65 6c 65 61 73 | 65 20 6f 66 20 74 68 69 |r releas|e of thi|
|00002930| 73 20 70 72 6f 64 75 63 | 74 2e 20 20 54 68 61 6e |s produc|t. Than|
|00002940| 6b 73 20 74 6f 20 4a 6f | 68 6e 20 4b 69 6d 62 61 |ks to Jo|hn Kimba|
|00002950| 6c 6c 0a 58 28 6a 6b 69 | 6d 62 61 6c 6c 40 73 72 |ll.X(jki|mball@sr|
|00002960| 63 2e 68 6f 6e 65 79 77 | 65 6c 6c 2e 63 6f 6d 29 |c.honeyw|ell.com)|
|00002970| 20 66 6f 72 20 73 75 67 | 67 65 73 74 69 6e 67 20 | for sug|gesting |
|00002980| 74 68 65 20 68 6f 73 74 | 20 6e 61 6d 65 20 74 6f |the host| name to|
|00002990| 20 68 6f 73 74 0a 58 61 | 64 64 72 65 73 73 20 6d | host.Xa|ddress m|
|000029a0| 61 70 70 69 6e 67 20 63 | 68 65 63 6b 2e 20 57 69 |apping c|heck. Wi|
|000029b0| 6c 6c 65 6d 2d 4a 61 6e | 20 57 69 74 68 61 67 65 |llem-Jan| Withage|
|000029c0| 6e 20 28 77 6a 77 40 65 | 62 2e 65 6c 65 2e 74 75 |n (wjw@e|b.ele.tu|
|000029d0| 65 2e 6e 6c 29 20 70 72 | 6f 76 69 64 65 64 0a 58 |e.nl) pr|ovided.X|
|000029e0| 75 73 65 66 75 6c 20 69 | 6e 66 6f 72 6d 61 74 69 |useful i|nformati|
|000029f0| 6f 6e 20 6f 6e 20 68 6f | 77 20 74 6f 20 64 65 61 |on on ho|w to dea|
|00002a00| 6c 20 77 69 74 68 20 74 | 68 65 20 41 70 6f 6c 6c |l with t|he Apoll|
|00002a10| 6f 20 55 4e 49 58 20 65 | 6e 76 69 72 6f 6e 6d 65 |o UNIX e|nvironme|
|00002a20| 6e 74 2e 0a 58 0a 58 09 | 57 69 65 74 73 65 20 56 |nt..X.X.|Wietse V|
|00002a30| 65 6e 65 6d 61 20 28 77 | 69 65 74 73 65 40 77 7a |enema (w|ietse@wz|
|00002a40| 76 2e 77 69 6e 2e 74 75 | 65 2e 6e 6c 29 2c 0a 58 |v.win.tu|e.nl),.X|
|00002a50| 09 4d 61 74 68 65 6d 61 | 74 69 63 73 20 61 6e 64 |.Mathema|tics and|
|00002a60| 20 43 6f 6d 70 75 74 69 | 6e 67 20 53 63 69 65 6e | Computi|ng Scien|
|00002a70| 63 65 2c 0a 58 09 45 69 | 6e 64 68 6f 76 65 6e 20 |ce,.X.Ei|ndhoven |
|00002a80| 55 6e 69 76 65 72 73 69 | 74 79 20 6f 66 20 54 65 |Universi|ty of Te|
|00002a90| 63 68 6e 6f 6c 6f 67 79 | 2c 0a 58 09 54 68 65 20 |chnology|,.X.The |
|00002aa0| 4e 65 74 68 65 72 6c 61 | 6e 64 73 2e 0a 45 4e 44 |Netherla|nds..END|
|00002ab0| 5f 4f 46 5f 52 45 41 44 | 4d 45 0a 69 66 20 74 65 |_OF_READ|ME.if te|
|00002ac0| 73 74 20 38 35 35 33 20 | 2d 6e 65 20 60 77 63 20 |st 8553 |-ne `wc |
|00002ad0| 2d 63 20 3c 52 45 41 44 | 4d 45 60 3b 20 74 68 65 |-c <READ|ME`; the|
|00002ae0| 6e 0a 20 20 20 20 65 63 | 68 6f 20 73 68 61 72 3a |n. ec|ho shar:|
|00002af0| 20 5c 22 52 45 41 44 4d | 45 5c 22 20 75 6e 70 61 | \"READM|E\" unpa|
|00002b00| 63 6b 65 64 20 77 69 74 | 68 20 77 72 6f 6e 67 20 |cked wit|h wrong |
|00002b10| 73 69 7a 65 21 0a 66 69 | 0a 23 20 65 6e 64 20 6f |size!.fi|.# end o|
|00002b20| 66 20 6f 76 65 72 77 72 | 69 74 69 6e 67 20 63 68 |f overwr|iting ch|
|00002b30| 65 63 6b 0a 66 69 0a 69 | 66 20 74 65 73 74 20 2d |eck.fi.i|f test -|
|00002b40| 66 20 6d 69 73 63 64 2e | 63 20 2d 61 20 22 24 7b |f miscd.|c -a "${|
|00002b50| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|00002b60| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|00002b70| 20 57 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | Will no|t over-w|
|00002b80| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|00002b90| 6c 65 20 5c 22 6d 69 73 | 63 64 2e 63 5c 22 0a 65 |le \"mis|cd.c\".e|
|00002ba0| 6c 73 65 0a 65 63 68 6f | 20 73 68 61 72 3a 20 45 |lse.echo| shar: E|
|00002bb0| 78 74 72 61 63 74 69 6e | 67 20 5c 22 6d 69 73 63 |xtractin|g \"misc|
|00002bc0| 64 2e 63 5c 22 20 5c 28 | 31 37 30 39 20 63 68 61 |d.c\" \(|1709 cha|
|00002bd0| 72 61 63 74 65 72 73 5c | 29 0a 73 65 64 20 22 73 |racters\|).sed "s|
|00002be0| 2f 5e 58 2f 2f 22 20 3e | 6d 69 73 63 64 2e 63 20 |/^X//" >|miscd.c |
|00002bf0| 3c 3c 27 45 4e 44 5f 4f | 46 5f 6d 69 73 63 64 2e |<<'END_O|F_miscd.|
|00002c00| 63 27 0a 58 20 2f 2a 0a | 58 20 20 2a 20 46 72 6f |c'.X /*.|X * Fro|
|00002c10| 6e 74 20 65 6e 64 20 74 | 6f 20 74 68 65 20 55 4c |nt end t|o the UL|
|00002c20| 54 52 49 58 20 6d 69 73 | 63 64 20 73 65 72 76 69 |TRIX mis|cd servi|
|00002c30| 63 65 2e 20 54 68 65 20 | 66 72 6f 6e 74 20 65 6e |ce. The |front en|
|00002c40| 64 20 6c 6f 67 73 20 74 | 68 65 20 72 65 6d 6f 74 |d logs t|he remot|
|00002c50| 65 20 68 6f 73 74 0a 58 | 20 20 2a 20 6e 61 6d 65 |e host.X| * name|
|00002c60| 20 61 6e 64 20 74 68 65 | 6e 20 69 6e 76 6f 6b 65 | and the|n invoke|
|00002c70| 73 20 74 68 65 20 72 65 | 61 6c 20 6d 69 73 63 64 |s the re|al miscd|
|00002c80| 20 64 61 65 6d 6f 6e 2e | 20 49 6e 73 74 61 6c 6c | daemon.| Install|
|00002c90| 20 61 73 20 22 2f 75 73 | 72 2f 65 74 63 2f 6d 69 | as "/us|r/etc/mi|
|00002ca0| 73 63 64 22 2c 0a 58 20 | 20 2a 20 61 66 74 65 72 |scd",.X | * after|
|00002cb0| 20 6d 6f 76 69 6e 67 20 | 74 68 65 20 72 65 61 6c | moving |the real|
|00002cc0| 20 6d 69 73 63 64 20 64 | 61 65 6d 6f 6e 20 74 6f | miscd d|aemon to|
|00002cd0| 20 74 68 65 20 22 2f 75 | 73 72 2f 65 74 63 2f 2e | the "/u|sr/etc/.|
|00002ce0| 2e 2e 22 20 64 69 72 65 | 63 74 6f 72 79 2e 0a 58 |.." dire|ctory..X|
|00002cf0| 20 20 2a 20 43 6f 6e 6e | 65 63 74 69 6f 6e 73 20 | * Conn|ections |
|00002d00| 61 6e 64 20 64 69 61 67 | 6e 6f 73 74 69 63 73 20 |and diag|nostics |
|00002d10| 61 72 65 20 6c 6f 67 67 | 65 64 20 74 68 72 6f 75 |are logg|ed throu|
|00002d20| 67 68 20 73 79 73 6c 6f | 67 28 33 29 2e 0a 58 20 |gh syslo|g(3)..X |
|00002d30| 20 2a 20 0a 58 20 20 2a | 20 54 68 65 20 55 6c 74 | * .X *| The Ult|
|00002d40| 72 69 78 20 6d 69 73 63 | 64 20 70 72 6f 67 72 61 |rix misc|d progra|
|00002d50| 6d 20 69 6d 70 6c 65 6d | 65 6e 74 73 20 74 68 65 |m implem|ents the|
|00002d60| 20 73 79 73 74 61 74 20 | 73 65 72 76 69 63 65 2c | systat |service,|
|00002d70| 20 77 68 69 63 68 20 70 | 69 70 65 73 20 74 68 65 | which p|ipes the|
|00002d80| 0a 58 20 20 2a 20 6f 75 | 74 70 75 74 20 66 72 6f |.X * ou|tput fro|
|00002d90| 6d 20 77 68 6f 28 31 29 | 20 74 6f 20 73 74 64 6f |m who(1)| to stdo|
|00002da0| 75 74 2e 20 54 68 69 73 | 20 69 6e 66 6f 72 6d 61 |ut. This| informa|
|00002db0| 74 69 6f 6e 20 69 73 20 | 70 6f 74 65 6e 74 69 61 |tion is |potentia|
|00002dc0| 6c 6c 79 20 75 73 65 66 | 75 6c 20 74 6f 0a 58 20 |lly usef|ul to.X |
|00002dd0| 20 2a 20 73 79 73 74 65 | 6d 73 20 63 72 61 63 6b | * syste|ms crack|
|00002de0| 65 72 73 2e 0a 58 20 20 | 2a 20 0a 58 20 20 2a 20 |ers..X |* .X * |
|00002df0| 43 6f 6d 70 69 6c 65 20 | 77 69 74 68 20 2d 44 48 |Compile |with -DH|
|00002e00| 4f 53 54 53 5f 41 43 43 | 45 53 53 20 69 6e 20 6f |OSTS_ACC|ESS in o|
|00002e10| 72 64 65 72 20 74 6f 20 | 65 6e 61 62 6c 65 20 61 |rder to |enable a|
|00002e20| 63 63 65 73 73 20 63 6f | 6e 74 72 6f 6c 2e 20 53 |ccess co|ntrol. S|
|00002e30| 65 65 20 74 68 65 0a 58 | 20 20 2a 20 68 6f 73 74 |ee the.X| * host|
|00002e40| 73 5f 61 63 63 65 73 73 | 28 35 29 20 6d 61 6e 75 |s_access|(5) manu|
|00002e50| 61 6c 20 70 61 67 65 20 | 66 6f 72 20 64 65 74 61 |al page |for deta|
|00002e60| 69 6c 73 2e 0a 58 20 20 | 2a 20 0a 58 20 20 2a 20 |ils..X |* .X * |
|00002e70| 41 75 74 68 6f 72 3a 20 | 57 69 65 74 73 65 20 56 |Author: |Wietse V|
|00002e80| 65 6e 65 6d 61 2c 20 45 | 69 6e 64 68 6f 76 65 6e |enema, E|indhoven|
|00002e90| 20 55 6e 69 76 65 72 73 | 69 74 79 20 6f 66 20 54 | Univers|ity of T|
|00002ea0| 65 63 68 6e 6f 6c 6f 67 | 79 2c 20 54 68 65 20 4e |echnolog|y, The N|
|00002eb0| 65 74 68 65 72 6c 61 6e | 64 73 2e 0a 58 20 20 2a |etherlan|ds..X *|
|00002ec0| 2f 0a 58 0a 58 23 69 66 | 6e 64 65 66 20 6c 69 6e |/.X.X#if|ndef lin|
|00002ed0| 74 0a 58 73 74 61 74 69 | 63 20 63 68 61 72 20 73 |t.Xstati|c char s|
|00002ee0| 63 63 73 69 64 5b 5d 20 | 3d 20 22 40 28 23 29 20 |ccsid[] |= "@(#) |
|00002ef0| 6d 69 73 63 64 2e 63 20 | 31 2e 31 20 39 31 2f 30 |miscd.c |1.1 91/0|
|00002f00| 31 2f 30 36 20 32 32 3a | 33 30 3a 33 32 22 3b 0a |1/06 22:|30:32";.|
|00002f10| 58 23 65 6e 64 69 66 0a | 58 0a 58 23 69 6e 63 6c |X#endif.|X.X#incl|
|00002f20| 75 64 65 20 3c 73 74 64 | 69 6f 2e 68 3e 0a 58 23 |ude <std|io.h>.X#|
|00002f30| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 6c 6f 67 2e |include |<syslog.|
|00002f40| 68 3e 0a 58 0a 58 2f 2a | 20 54 68 65 20 66 6f 6c |h>.X.X/*| The fol|
|00002f50| 6c 6f 77 69 6e 67 20 73 | 70 65 63 69 66 69 65 73 |lowing s|pecifies|
|00002f60| 20 77 68 65 72 65 20 74 | 68 65 20 76 65 6e 64 6f | where t|he vendo|
|00002f70| 72 2d 70 72 6f 76 69 64 | 65 64 20 64 61 65 6d 6f |r-provid|ed daemo|
|00002f80| 6e 20 73 68 6f 75 6c 64 | 20 67 6f 2e 20 2a 2f 0a |n should| go. */.|
|00002f90| 58 0a 58 23 64 65 66 69 | 6e 65 20 52 45 41 4c 5f |X.X#defi|ne REAL_|
|00002fa0| 44 41 45 4d 4f 4e 09 22 | 2f 75 73 72 2f 65 74 63 |DAEMON."|/usr/etc|
|00002fb0| 2f 2e 2e 2e 2f 6d 69 73 | 63 64 22 0a 58 0a 58 6d |/.../mis|cd".X.Xm|
|00002fc0| 61 69 6e 28 61 72 67 63 | 2c 20 61 72 67 76 29 0a |ain(argc|, argv).|
|00002fd0| 58 69 6e 74 20 20 20 20 | 20 61 72 67 63 3b 0a 58 |Xint | argc;.X|
|00002fe0| 63 68 61 72 20 20 2a 2a | 61 72 67 76 3b 0a 58 7b |char **|argv;.X{|
|00002ff0| 0a 58 20 20 20 20 63 68 | 61 72 20 20 20 2a 66 72 |.X ch|ar *fr|
|00003000| 6f 6d 68 6f 73 74 28 29 | 3b 0a 58 20 20 20 20 63 |omhost()|;.X c|
|00003010| 68 61 72 20 20 20 2a 68 | 6f 73 74 5f 6e 61 6d 65 |har *h|ost_name|
|00003020| 3b 0a 58 0a 58 20 20 20 | 20 2f 2a 0a 58 20 20 20 |;.X.X | /*.X |
|00003030| 20 20 2a 20 4f 70 65 6e | 20 61 20 63 68 61 6e 6e | * Open| a chann|
|00003040| 65 6c 20 74 6f 20 74 68 | 65 20 73 79 73 6c 6f 67 |el to th|e syslog|
|00003050| 20 64 61 65 6d 6f 6e 2e | 20 4f 6c 64 65 72 20 76 | daemon.| Older v|
|00003060| 65 72 73 69 6f 6e 73 20 | 6f 66 20 6f 70 65 6e 6c |ersions |of openl|
|00003070| 6f 67 28 29 0a 58 20 20 | 20 20 20 2a 20 72 65 71 |og().X | * req|
|00003080| 75 69 72 65 20 6f 6e 6c | 79 20 74 77 6f 20 61 72 |uire onl|y two ar|
|00003090| 67 75 6d 65 6e 74 73 2e | 0a 58 20 20 20 20 20 2a |guments.|.X *|
|000030a0| 2f 0a 58 0a 58 23 69 66 | 64 65 66 20 4c 4f 47 5f |/.X.X#if|def LOG_|
|000030b0| 4d 41 49 4c 0a 58 20 20 | 20 20 28 76 6f 69 64 29 |MAIL.X | (void)|
|000030c0| 20 6f 70 65 6e 6c 6f 67 | 28 61 72 67 76 5b 30 5d | openlog|(argv[0]|
|000030d0| 2c 20 4c 4f 47 5f 50 49 | 44 2c 20 4c 4f 47 5f 4d |, LOG_PI|D, LOG_M|
|000030e0| 41 49 4c 29 3b 0a 58 23 | 65 6c 73 65 0a 58 20 20 |AIL);.X#|else.X |
|000030f0| 20 20 28 76 6f 69 64 29 | 20 6f 70 65 6e 6c 6f 67 | (void)| openlog|
|00003100| 28 61 72 67 76 5b 30 5d | 2c 20 4c 4f 47 5f 50 49 |(argv[0]|, LOG_PI|
|00003110| 44 29 3b 0a 58 23 65 6e | 64 69 66 0a 58 0a 58 20 |D);.X#en|dif.X.X |
|00003120| 20 20 20 2f 2a 20 46 69 | 6e 64 20 6f 75 74 20 61 | /* Fi|nd out a|
|00003130| 6e 64 20 72 65 70 6f 72 | 74 20 74 68 65 20 72 65 |nd repor|t the re|
|00003140| 6d 6f 74 65 20 68 6f 73 | 74 20 6e 61 6d 65 2e 20 |mote hos|t name. |
|00003150| 2a 2f 0a 58 0a 58 20 20 | 20 20 69 66 20 28 28 68 |*/.X.X | if ((h|
|00003160| 6f 73 74 5f 6e 61 6d 65 | 20 3d 20 66 72 6f 6d 68 |ost_name| = fromh|
|00003170| 6f 73 74 28 29 29 20 3d | 3d 20 30 29 0a 58 09 68 |ost()) =|= 0).X.h|
|00003180| 6f 73 74 5f 6e 61 6d 65 | 20 3d 20 22 75 6e 6b 6e |ost_name| = "unkn|
|00003190| 6f 77 6e 22 3b 0a 58 20 | 20 20 20 73 79 73 6c 6f |own";.X | syslo|
|000031a0| 67 28 4c 4f 47 5f 49 4e | 46 4f 2c 20 22 63 6f 6e |g(LOG_IN|FO, "con|
|000031b0| 6e 65 63 74 20 66 72 6f | 6d 20 25 73 22 2c 20 68 |nect fro|m %s", h|
|000031c0| 6f 73 74 5f 6e 61 6d 65 | 29 3b 0a 58 0a 58 20 20 |ost_name|);.X.X |
|000031d0| 20 20 2f 2a 20 43 68 65 | 63 6b 20 77 68 65 74 68 | /* Che|ck wheth|
|000031e0| 65 72 20 74 68 69 73 20 | 68 6f 73 74 20 63 61 6e |er this |host can|
|000031f0| 20 61 63 63 65 73 73 20 | 74 68 65 20 73 65 72 76 | access |the serv|
|00003200| 69 63 65 20 69 6e 20 61 | 72 67 76 5b 30 5d 2e 20 |ice in a|rgv[0]. |
|00003210| 2a 2f 0a 58 0a 58 23 69 | 66 64 65 66 20 48 4f 53 |*/.X.X#i|fdef HOS|
|00003220| 54 53 5f 41 43 43 45 53 | 53 0a 58 20 20 20 20 68 |TS_ACCES|S.X h|
|00003230| 6f 73 74 73 5f 61 63 63 | 65 73 73 28 61 72 67 76 |osts_acc|ess(argv|
|00003240| 5b 30 5d 2c 20 68 6f 73 | 74 5f 6e 61 6d 65 29 3b |[0], hos|t_name);|
|00003250| 0a 58 23 65 6e 64 69 66 | 0a 58 0a 58 20 20 20 20 |.X#endif|.X.X |
|00003260| 2f 2a 20 49 6e 76 6f 6b | 65 20 74 68 65 20 72 65 |/* Invok|e the re|
|00003270| 61 6c 20 64 61 65 6d 6f | 6e 20 70 72 6f 67 72 61 |al daemo|n progra|
|00003280| 6d 2e 20 2a 2f 0a 58 0a | 58 20 20 20 20 28 76 6f |m. */.X.|X (vo|
|00003290| 69 64 29 20 65 78 65 63 | 76 28 52 45 41 4c 5f 44 |id) exec|v(REAL_D|
|000032a0| 41 45 4d 4f 4e 2c 20 61 | 72 67 76 29 3b 0a 58 20 |AEMON, a|rgv);.X |
|000032b0| 20 20 20 73 79 73 6c 6f | 67 28 4c 4f 47 5f 45 52 | syslo|g(LOG_ER|
|000032c0| 52 2c 20 22 25 73 3a 20 | 25 6d 22 2c 20 52 45 41 |R, "%s: |%m", REA|
|000032d0| 4c 5f 44 41 45 4d 4f 4e | 29 3b 0a 58 20 20 20 20 |L_DAEMON|);.X |
|000032e0| 72 65 74 75 72 6e 20 28 | 31 29 3b 0a 58 7d 0a 45 |return (|1);.X}.E|
|000032f0| 4e 44 5f 4f 46 5f 6d 69 | 73 63 64 2e 63 0a 69 66 |ND_OF_mi|scd.c.if|
|00003300| 20 74 65 73 74 20 31 37 | 30 39 20 2d 6e 65 20 60 | test 17|09 -ne `|
|00003310| 77 63 20 2d 63 20 3c 6d | 69 73 63 64 2e 63 60 3b |wc -c <m|iscd.c`;|
|00003320| 20 74 68 65 6e 0a 20 20 | 20 20 65 63 68 6f 20 73 | then. | echo s|
|00003330| 68 61 72 3a 20 5c 22 6d | 69 73 63 64 2e 63 5c 22 |har: \"m|iscd.c\"|
|00003340| 20 75 6e 70 61 63 6b 65 | 64 20 77 69 74 68 20 77 | unpacke|d with w|
|00003350| 72 6f 6e 67 20 73 69 7a | 65 21 0a 66 69 0a 23 20 |rong siz|e!.fi.# |
|00003360| 65 6e 64 20 6f 66 20 6f | 76 65 72 77 72 69 74 69 |end of o|verwriti|
|00003370| 6e 67 20 63 68 65 63 6b | 0a 66 69 0a 69 66 20 74 |ng check|.fi.if t|
|00003380| 65 73 74 20 2d 66 20 74 | 63 70 64 2e 63 20 2d 61 |est -f t|cpd.c -a|
|00003390| 20 22 24 7b 31 7d 22 20 | 21 3d 20 22 2d 63 22 20 | "${1}" |!= "-c" |
|000033a0| 3b 20 74 68 65 6e 20 0a | 20 20 65 63 68 6f 20 73 |; then .| echo s|
|000033b0| 68 61 72 3a 20 57 69 6c | 6c 20 6e 6f 74 20 6f 76 |har: Wil|l not ov|
|000033c0| 65 72 2d 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |er-write| existin|
|000033d0| 67 20 66 69 6c 65 20 5c | 22 74 63 70 64 2e 63 5c |g file \|"tcpd.c\|
|000033e0| 22 0a 65 6c 73 65 0a 65 | 63 68 6f 20 73 68 61 72 |".else.e|cho shar|
|000033f0| 3a 20 45 78 74 72 61 63 | 74 69 6e 67 20 5c 22 74 |: Extrac|ting \"t|
|00003400| 63 70 64 2e 63 5c 22 20 | 5c 28 31 38 37 33 20 63 |cpd.c\" |\(1873 c|
|00003410| 68 61 72 61 63 74 65 72 | 73 5c 29 0a 73 65 64 20 |haracter|s\).sed |
|00003420| 22 73 2f 5e 58 2f 2f 22 | 20 3e 74 63 70 64 2e 63 |"s/^X//"| >tcpd.c|
|00003430| 20 3c 3c 27 45 4e 44 5f | 4f 46 5f 74 63 70 64 2e | <<'END_|OF_tcpd.|
|00003440| 63 27 0a 58 20 2f 2a 0a | 58 20 20 2a 20 47 65 6e |c'.X /*.|X * Gen|
|00003450| 65 72 61 6c 20 66 72 6f | 6e 74 20 65 6e 64 20 66 |eral fro|nt end f|
|00003460| 6f 72 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 2d 6f 72 |or conne|ction-or|
|00003470| 69 65 6e 74 65 64 20 74 | 63 70 2f 69 70 20 73 65 |iented t|cp/ip se|
|00003480| 72 76 69 63 65 73 2e 20 | 54 68 69 73 20 70 72 6f |rvices. |This pro|
|00003490| 67 72 61 6d 0a 58 20 20 | 2a 20 6c 6f 67 73 20 74 |gram.X |* logs t|
|000034a0| 68 65 20 72 65 6d 6f 74 | 65 20 68 6f 73 74 20 6e |he remot|e host n|
|000034b0| 61 6d 65 20 61 6e 64 20 | 74 68 65 6e 20 69 6e 76 |ame and |then inv|
|000034c0| 6f 6b 65 73 20 74 68 65 | 20 72 65 61 6c 20 64 61 |okes the| real da|
|000034d0| 65 6d 6f 6e 2e 20 46 6f | 72 20 65 78 61 6d 70 6c |emon. Fo|r exampl|
|000034e0| 65 2c 0a 58 20 20 2a 20 | 69 6e 73 74 61 6c 6c 20 |e,.X * |install |
|000034f0| 61 73 20 2f 75 73 72 2f | 65 74 63 2f 7b 66 69 6e |as /usr/|etc/{fin|
|00003500| 67 65 72 64 2c 74 65 6c | 6e 65 74 64 2c 66 74 70 |gerd,tel|netd,ftp|
|00003510| 64 2c 72 6c 6f 67 69 6e | 64 2c 72 73 68 64 2c 72 |d,rlogin|d,rshd,r|
|00003520| 65 78 65 63 64 7d 2c 20 | 61 66 74 65 72 0a 58 20 |execd}, |after.X |
|00003530| 20 2a 20 73 61 76 69 6e | 67 20 74 68 65 20 72 65 | * savin|g the re|
|00003540| 61 6c 20 64 61 65 6d 6f | 6e 73 20 69 6e 20 74 68 |al daemo|ns in th|
|00003550| 65 20 64 69 72 65 63 74 | 6f 72 79 20 22 2f 75 73 |e direct|ory "/us|
|00003560| 72 2f 65 74 63 2f 2e 2e | 2e 22 2e 20 54 68 69 73 |r/etc/..|.". This|
|00003570| 20 61 72 72 61 6e 67 65 | 6d 65 6e 74 0a 58 20 20 | arrange|ment.X |
|00003580| 2a 20 72 65 71 75 69 72 | 65 73 20 74 68 61 74 20 |* requir|es that |
|00003590| 74 68 65 20 6e 65 74 77 | 6f 72 6b 20 64 61 65 6d |the netw|ork daem|
|000035a0| 6f 6e 73 20 61 72 65 20 | 73 74 61 72 74 65 64 20 |ons are |started |
|000035b0| 62 79 20 69 6e 65 74 64 | 20 6f 72 20 73 6f 6d 65 |by inetd| or some|
|000035c0| 74 68 69 6e 67 0a 58 20 | 20 2a 20 73 69 6d 69 6c |thing.X | * simil|
|000035d0| 61 72 2e 20 43 6f 6e 6e | 65 63 74 69 6f 6e 73 20 |ar. Conn|ections |
|000035e0| 61 6e 64 20 64 69 61 67 | 6e 6f 73 74 69 63 73 20 |and diag|nostics |
|000035f0| 61 72 65 20 6c 6f 67 67 | 65 64 20 74 68 72 6f 75 |are logg|ed throu|
|00003600| 67 68 20 73 79 73 6c 6f | 67 28 33 29 2e 0a 58 20 |gh syslo|g(3)..X |
|00003610| 20 2a 20 0a 58 20 20 2a | 20 43 6f 6d 70 69 6c 65 | * .X *| Compile|
|00003620| 20 77 69 74 68 20 2d 44 | 48 4f 53 54 53 5f 41 43 | with -D|HOSTS_AC|
|00003630| 43 45 53 53 20 69 6e 20 | 6f 72 64 65 72 20 74 6f |CESS in |order to|
|00003640| 20 65 6e 61 62 6c 65 20 | 61 63 63 65 73 73 20 63 | enable |access c|
|00003650| 6f 6e 74 72 6f 6c 2e 20 | 53 65 65 20 74 68 65 0a |ontrol. |See the.|
|00003660| 58 20 20 2a 20 68 6f 73 | 74 73 5f 61 63 63 65 73 |X * hos|ts_acces|
|00003670| 73 28 35 29 20 6d 61 6e | 75 61 6c 20 70 61 67 65 |s(5) man|ual page|
|00003680| 20 66 6f 72 20 64 65 74 | 61 69 6c 73 2e 0a 58 20 | for det|ails..X |
|00003690| 20 2a 20 0a 58 20 20 2a | 20 41 75 74 68 6f 72 3a | * .X *| Author:|
|000036a0| 20 57 69 65 74 73 65 20 | 56 65 6e 65 6d 61 2c 20 | Wietse |Venema, |
|000036b0| 45 69 6e 64 68 6f 76 65 | 6e 20 55 6e 69 76 65 72 |Eindhove|n Univer|
|000036c0| 73 69 74 79 20 6f 66 20 | 54 65 63 68 6e 6f 6c 6f |sity of |Technolo|
|000036d0| 67 79 2c 20 54 68 65 20 | 4e 65 74 68 65 72 6c 61 |gy, The |Netherla|
|000036e0| 6e 64 73 2e 0a 58 20 20 | 2a 2f 0a 58 0a 58 23 69 |nds..X |*/.X.X#i|
|000036f0| 66 6e 64 65 66 20 6c 69 | 6e 74 0a 58 73 74 61 74 |fndef li|nt.Xstat|
|00003700| 69 63 20 63 68 61 72 20 | 73 63 63 73 69 64 5b 5d |ic char |sccsid[]|
|00003710| 20 3d 20 22 40 28 23 29 | 20 74 63 70 64 2e 63 20 | = "@(#)| tcpd.c |
|00003720| 31 2e 31 20 39 31 2f 30 | 31 2f 30 36 20 32 32 3a |1.1 91/0|1/06 22:|
|00003730| 33 30 3a 33 36 22 3b 0a | 58 23 65 6e 64 69 66 0a |30:36";.|X#endif.|
|00003740| 58 0a 58 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |X.X#incl|ude <std|
|00003750| 69 6f 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |io.h>.X#|include |
|00003760| 3c 73 79 73 6c 6f 67 2e | 68 3e 0a 58 23 69 6e 63 |<syslog.|h>.X#inc|
|00003770| 6c 75 64 65 20 3c 73 79 | 73 2f 74 79 70 65 73 2e |lude <sy|s/types.|
|00003780| 68 3e 0a 58 23 69 6e 63 | 6c 75 64 65 20 3c 73 79 |h>.X#inc|lude <sy|
|00003790| 73 2f 70 61 72 61 6d 2e | 68 3e 0a 58 23 69 66 6e |s/param.|h>.X#ifn|
|000037a0| 64 65 66 20 4d 41 58 50 | 41 54 48 4e 41 4d 45 4c |def MAXP|ATHNAMEL|
|000037b0| 45 4e 0a 58 23 64 65 66 | 69 6e 65 20 4d 41 58 50 |EN.X#def|ine MAXP|
|000037c0| 41 54 48 4e 41 4d 45 4c | 45 4e 09 42 55 46 53 49 |ATHNAMEL|EN.BUFSI|
|000037d0| 5a 0a 58 23 65 6e 64 69 | 66 0a 58 0a 58 2f 2a 20 |Z.X#endi|f.X.X/* |
|000037e0| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 73 70 |The foll|owing sp|
|000037f0| 65 63 69 66 69 65 73 20 | 77 68 65 72 65 20 74 68 |ecifies |where th|
|00003800| 65 20 76 65 6e 64 6f 72 | 2d 70 72 6f 76 69 64 65 |e vendor|-provide|
|00003810| 64 20 64 61 65 6d 6f 6e | 73 20 73 68 6f 75 6c 64 |d daemon|s should|
|00003820| 20 67 6f 2e 20 2a 2f 0a | 58 0a 58 23 64 65 66 69 | go. */.|X.X#defi|
|00003830| 6e 65 20 52 45 41 4c 5f | 44 41 45 4d 4f 4e 5f 44 |ne REAL_|DAEMON_D|
|00003840| 49 52 09 22 2f 75 73 72 | 2f 65 74 63 2f 2e 2e 2e |IR."/usr|/etc/...|
|00003850| 22 0a 58 0a 58 6d 61 69 | 6e 28 61 72 67 63 2c 20 |".X.Xmai|n(argc, |
|00003860| 61 72 67 76 29 0a 58 69 | 6e 74 20 20 20 20 20 61 |argv).Xi|nt a|
|00003870| 72 67 63 3b 0a 58 63 68 | 61 72 20 20 2a 2a 61 72 |rgc;.Xch|ar **ar|
|00003880| 67 76 3b 0a 58 7b 0a 58 | 20 20 20 20 63 68 61 72 |gv;.X{.X| char|
|00003890| 20 20 20 2a 66 72 6f 6d | 68 6f 73 74 28 29 3b 0a | *from|host();.|
|000038a0| 58 20 20 20 20 63 68 61 | 72 20 20 20 2a 68 6f 73 |X cha|r *hos|
|000038b0| 74 5f 6e 61 6d 65 3b 0a | 58 20 20 20 20 63 68 61 |t_name;.|X cha|
|000038c0| 72 20 20 20 20 70 61 74 | 68 5b 4d 41 58 50 41 54 |r pat|h[MAXPAT|
|000038d0| 48 4e 41 4d 45 4c 45 4e | 5d 3b 0a 58 0a 58 20 20 |HNAMELEN|];.X.X |
|000038e0| 20 20 2f 2a 0a 58 20 20 | 20 20 20 2a 20 4f 70 65 | /*.X | * Ope|
|000038f0| 6e 20 61 20 63 68 61 6e | 6e 65 6c 20 74 6f 20 74 |n a chan|nel to t|
|00003900| 68 65 20 73 79 73 6c 6f | 67 20 64 61 65 6d 6f 6e |he syslo|g daemon|
|00003910| 2e 20 4f 6c 64 65 72 20 | 76 65 72 73 69 6f 6e 73 |. Older |versions|
|00003920| 20 6f 66 20 6f 70 65 6e | 6c 6f 67 28 29 0a 58 20 | of open|log().X |
|00003930| 20 20 20 20 2a 20 72 65 | 71 75 69 72 65 20 6f 6e | * re|quire on|
|00003940| 6c 79 20 74 77 6f 20 61 | 72 67 75 6d 65 6e 74 73 |ly two a|rguments|
|00003950| 2e 0a 58 20 20 20 20 20 | 2a 2f 0a 58 0a 58 23 69 |..X |*/.X.X#i|
|00003960| 66 64 65 66 20 4c 4f 47 | 5f 4d 41 49 4c 0a 58 20 |fdef LOG|_MAIL.X |
|00003970| 20 20 20 28 76 6f 69 64 | 29 20 6f 70 65 6e 6c 6f | (void|) openlo|
|00003980| 67 28 61 72 67 76 5b 30 | 5d 2c 20 4c 4f 47 5f 50 |g(argv[0|], LOG_P|
|00003990| 49 44 2c 20 4c 4f 47 5f | 4d 41 49 4c 29 3b 0a 58 |ID, LOG_|MAIL);.X|
|000039a0| 23 65 6c 73 65 0a 58 20 | 20 20 20 28 76 6f 69 64 |#else.X | (void|
|000039b0| 29 20 6f 70 65 6e 6c 6f | 67 28 61 72 67 76 5b 30 |) openlo|g(argv[0|
|000039c0| 5d 2c 20 4c 4f 47 5f 50 | 49 44 29 3b 0a 58 23 65 |], LOG_P|ID);.X#e|
|000039d0| 6e 64 69 66 0a 58 0a 58 | 20 20 20 20 2f 2a 20 46 |ndif.X.X| /* F|
|000039e0| 69 6e 64 20 6f 75 74 20 | 61 6e 64 20 72 65 70 6f |ind out |and repo|
|000039f0| 72 74 20 74 68 65 20 72 | 65 6d 6f 74 65 20 68 6f |rt the r|emote ho|
|00003a00| 73 74 20 6e 61 6d 65 2e | 20 2a 2f 0a 58 0a 58 20 |st name.| */.X.X |
|00003a10| 20 20 20 69 66 20 28 28 | 68 6f 73 74 5f 6e 61 6d | if ((|host_nam|
|00003a20| 65 20 3d 20 66 72 6f 6d | 68 6f 73 74 28 29 29 20 |e = from|host()) |
|00003a30| 3d 3d 20 30 29 0a 58 09 | 68 6f 73 74 5f 6e 61 6d |== 0).X.|host_nam|
|00003a40| 65 20 3d 20 22 75 6e 6b | 6e 6f 77 6e 22 3b 0a 58 |e = "unk|nown";.X|
|00003a50| 20 20 20 20 73 79 73 6c | 6f 67 28 4c 4f 47 5f 49 | sysl|og(LOG_I|
|00003a60| 4e 46 4f 2c 20 22 63 6f | 6e 6e 65 63 74 20 66 72 |NFO, "co|nnect fr|
|00003a70| 6f 6d 20 25 73 22 2c 20 | 68 6f 73 74 5f 6e 61 6d |om %s", |host_nam|
|00003a80| 65 29 3b 0a 58 0a 58 20 | 20 20 20 2f 2a 20 43 68 |e);.X.X | /* Ch|
|00003a90| 65 63 6b 20 77 68 65 74 | 68 65 72 20 74 68 69 73 |eck whet|her this|
|00003aa0| 20 68 6f 73 74 20 63 61 | 6e 20 61 63 63 65 73 73 | host ca|n access|
|00003ab0| 20 74 68 65 20 73 65 72 | 76 69 63 65 20 69 6e 20 | the ser|vice in |
|00003ac0| 61 72 67 76 5b 30 5d 2e | 20 2a 2f 0a 58 0a 58 23 |argv[0].| */.X.X#|
|00003ad0| 69 66 64 65 66 20 48 4f | 53 54 53 5f 41 43 43 45 |ifdef HO|STS_ACCE|
|00003ae0| 53 53 0a 58 20 20 20 20 | 68 6f 73 74 73 5f 61 63 |SS.X |hosts_ac|
|00003af0| 63 65 73 73 28 61 72 67 | 76 5b 30 5d 2c 20 68 6f |cess(arg|v[0], ho|
|00003b00| 73 74 5f 6e 61 6d 65 29 | 3b 0a 58 23 65 6e 64 69 |st_name)|;.X#endi|
|00003b10| 66 0a 58 0a 58 20 20 20 | 20 2f 2a 20 49 6e 76 6f |f.X.X | /* Invo|
|00003b20| 6b 65 20 74 68 65 20 72 | 65 61 6c 20 64 61 65 6d |ke the r|eal daem|
|00003b30| 6f 6e 20 70 72 6f 67 72 | 61 6d 2e 20 2a 2f 0a 58 |on progr|am. */.X|
|00003b40| 0a 58 20 20 20 20 28 76 | 6f 69 64 29 20 73 70 72 |.X (v|oid) spr|
|00003b50| 69 6e 74 66 28 70 61 74 | 68 2c 20 22 25 73 2f 25 |intf(pat|h, "%s/%|
|00003b60| 73 22 2c 20 52 45 41 4c | 5f 44 41 45 4d 4f 4e 5f |s", REAL|_DAEMON_|
|00003b70| 44 49 52 2c 20 61 72 67 | 76 5b 30 5d 29 3b 0a 58 |DIR, arg|v[0]);.X|
|00003b80| 20 20 20 20 28 76 6f 69 | 64 29 20 65 78 65 63 76 | (voi|d) execv|
|00003b90| 28 70 61 74 68 2c 20 61 | 72 67 76 29 3b 0a 58 20 |(path, a|rgv);.X |
|00003ba0| 20 20 20 73 79 73 6c 6f | 67 28 4c 4f 47 5f 45 52 | syslo|g(LOG_ER|
|00003bb0| 52 2c 20 22 25 73 3a 20 | 25 6d 22 2c 20 70 61 74 |R, "%s: |%m", pat|
|00003bc0| 68 29 3b 0a 58 20 20 20 | 20 72 65 74 75 72 6e 20 |h);.X | return |
|00003bd0| 28 31 29 3b 0a 58 7d 0a | 45 4e 44 5f 4f 46 5f 74 |(1);.X}.|END_OF_t|
|00003be0| 63 70 64 2e 63 0a 69 66 | 20 74 65 73 74 20 31 38 |cpd.c.if| test 18|
|00003bf0| 37 33 20 2d 6e 65 20 60 | 77 63 20 2d 63 20 3c 74 |73 -ne `|wc -c <t|
|00003c00| 63 70 64 2e 63 60 3b 20 | 74 68 65 6e 0a 20 20 20 |cpd.c`; |then. |
|00003c10| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 74 63 | echo sh|ar: \"tc|
|00003c20| 70 64 2e 63 5c 22 20 75 | 6e 70 61 63 6b 65 64 20 |pd.c\" u|npacked |
|00003c30| 77 69 74 68 20 77 72 6f | 6e 67 20 73 69 7a 65 21 |with wro|ng size!|
|00003c40| 0a 66 69 0a 23 20 65 6e | 64 20 6f 66 20 6f 76 65 |.fi.# en|d of ove|
|00003c50| 72 77 72 69 74 69 6e 67 | 20 63 68 65 63 6b 0a 66 |rwriting| check.f|
|00003c60| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 66 72 6f |i.if tes|t -f fro|
|00003c70| 6d 68 6f 73 74 2e 63 20 | 2d 61 20 22 24 7b 31 7d |mhost.c |-a "${1}|
|00003c80| 22 20 21 3d 20 22 2d 63 | 22 20 3b 20 74 68 65 6e |" != "-c|" ; then|
|00003c90| 20 0a 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 57 | . echo| shar: W|
|00003ca0| 69 6c 6c 20 6e 6f 74 20 | 6f 76 65 72 2d 77 72 69 |ill not |over-wri|
|00003cb0| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|00003cc0| 20 5c 22 66 72 6f 6d 68 | 6f 73 74 2e 63 5c 22 0a | \"fromh|ost.c\".|
|00003cd0| 65 6c 73 65 0a 65 63 68 | 6f 20 73 68 61 72 3a 20 |else.ech|o shar: |
|00003ce0| 45 78 74 72 61 63 74 69 | 6e 67 20 5c 22 66 72 6f |Extracti|ng \"fro|
|00003cf0| 6d 68 6f 73 74 2e 63 5c | 22 20 5c 28 33 39 38 32 |mhost.c\|" \(3982|
|00003d00| 20 63 68 61 72 61 63 74 | 65 72 73 5c 29 0a 73 65 | charact|ers\).se|
|00003d10| 64 20 22 73 2f 5e 58 2f | 2f 22 20 3e 66 72 6f 6d |d "s/^X/|/" >from|
|00003d20| 68 6f 73 74 2e 63 20 3c | 3c 27 45 4e 44 5f 4f 46 |host.c <|<'END_OF|
|00003d30| 5f 66 72 6f 6d 68 6f 73 | 74 2e 63 27 0a 58 20 2f |_fromhos|t.c'.X /|
|00003d40| 2a 0a 58 20 20 2a 20 66 | 72 6f 6d 68 6f 73 74 28 |*.X * f|romhost(|
|00003d50| 29 20 72 65 74 75 72 6e | 73 20 74 68 65 20 6e 61 |) return|s the na|
|00003d60| 6d 65 20 6f 66 20 74 68 | 65 20 68 6f 73 74 20 61 |me of th|e host a|
|00003d70| 74 20 74 68 65 20 6f 74 | 68 65 72 20 65 6e 64 20 |t the ot|her end |
|00003d80| 6f 66 20 73 74 61 6e 64 | 61 72 64 0a 58 20 20 2a |of stand|ard.X *|
|00003d90| 20 69 6e 70 75 74 2c 20 | 74 68 65 20 68 6f 73 74 | input, |the host|
|00003da0| 20 61 64 64 72 65 73 73 | 20 69 66 20 6e 61 6d 65 | address| if name|
|00003db0| 20 6c 6f 6f 6b 75 70 20 | 66 61 69 6c 73 2c 20 22 | lookup |fails, "|
|00003dc0| 73 74 64 69 6e 22 20 69 | 66 20 69 74 20 69 73 20 |stdin" i|f it is |
|00003dd0| 63 6f 6e 6e 65 63 74 65 | 64 0a 58 20 20 2a 20 74 |connecte|d.X * t|
|00003de0| 6f 20 61 20 74 65 72 6d | 69 6e 61 6c 2c 20 6f 72 |o a term|inal, or|
|00003df0| 20 61 20 6e 75 6c 6c 20 | 70 6f 69 6e 74 65 72 20 | a null |pointer |
|00003e00| 69 6e 20 61 6c 6c 20 6f | 74 68 65 72 20 63 61 73 |in all o|ther cas|
|00003e10| 65 73 2e 0a 58 20 20 2a | 20 0a 58 20 20 2a 20 50 |es..X *| .X * P|
|00003e20| 72 6f 74 65 63 74 69 6f | 6e 20 61 67 61 69 6e 73 |rotectio|n agains|
|00003e30| 74 20 73 70 6f 6f 66 69 | 6e 67 20 6f 66 20 6e 61 |t spoofi|ng of na|
|00003e40| 69 76 65 20 72 73 68 20 | 61 6e 64 20 72 6c 6f 67 |ive rsh |and rlog|
|00003e50| 69 6e 64 20 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |ind impl|ementati|
|00003e60| 6f 6e 73 3a 0a 58 20 20 | 2a 20 0a 58 20 20 2a 20 |ons:.X |* .X * |
|00003e70| 49 6e 69 74 69 61 6c 6c | 79 2c 20 61 6c 6c 20 77 |Initiall|y, all w|
|00003e80| 65 20 68 61 76 65 20 69 | 73 20 74 68 65 20 72 65 |e have i|s the re|
|00003e90| 6d 6f 74 65 20 68 6f 73 | 74 20 61 64 64 72 65 73 |mote hos|t addres|
|00003ea0| 73 2e 20 49 66 20 74 68 | 65 20 68 6f 73 74 20 61 |s. If th|e host a|
|00003eb0| 64 64 72 65 73 73 2d 3e | 6e 61 6d 65 0a 58 20 20 |ddress->|name.X |
|00003ec0| 2a 20 6d 61 70 70 69 6e | 67 20 69 73 20 61 76 61 |* mappin|g is ava|
|00003ed0| 69 6c 61 62 6c 65 2c 20 | 66 72 6f 6d 68 6f 73 74 |ilable, |fromhost|
|00003ee0| 28 29 20 76 65 72 69 66 | 69 65 73 20 74 68 61 74 |() verif|ies that|
|00003ef0| 20 74 68 65 20 68 6f 73 | 74 20 6e 61 6d 65 2d 3e | the hos|t name->|
|00003f00| 61 64 64 72 65 73 73 0a | 58 20 20 2a 20 6d 61 70 |address.|X * map|
|00003f10| 70 69 6e 67 20 79 69 65 | 6c 64 73 20 74 68 65 20 |ping yie|lds the |
|00003f20| 6f 72 69 67 69 6e 61 6c | 20 68 6f 73 74 20 61 64 |original| host ad|
|00003f30| 64 72 65 73 73 2e 20 54 | 68 65 20 69 64 65 61 20 |dress. T|he idea |
|00003f40| 69 73 20 74 68 61 74 20 | 69 74 20 69 73 20 6d 75 |is that |it is mu|
|00003f50| 63 68 0a 58 20 20 2a 20 | 65 61 73 69 65 72 20 74 |ch.X * |easier t|
|00003f60| 6f 20 63 6f 6d 70 72 6f | 6d 69 73 65 20 73 6f 6d |o compro|mise som|
|00003f70| 65 20 72 61 6e 64 6f 6d | 20 61 64 64 72 65 73 73 |e random| address|
|00003f80| 2d 3e 6e 61 6d 65 20 6d | 61 70 20 28 62 65 63 61 |->name m|ap (beca|
|00003f90| 75 73 65 20 74 68 65 72 | 65 20 69 73 20 6f 6e 65 |use ther|e is one|
|00003fa0| 0a 58 20 20 2a 20 66 6f | 72 20 61 6c 6d 6f 73 74 |.X * fo|r almost|
|00003fb0| 20 65 76 65 72 79 20 6e | 65 74 77 6f 72 6b 29 2c | every n|etwork),|
|00003fc0| 20 74 68 61 6e 20 74 6f | 20 63 6f 6d 70 72 6f 6d | than to| comprom|
|00003fd0| 69 73 65 20 74 68 65 20 | 6e 61 6d 65 2d 3e 61 64 |ise the |name->ad|
|00003fe0| 64 72 65 73 73 20 6d 61 | 70 20 74 68 61 74 0a 58 |dress ma|p that.X|
|00003ff0| 20 20 2a 20 69 73 20 75 | 6e 69 71 75 65 20 66 6f | * is u|nique fo|
|00004000| 72 20 79 6f 75 72 20 69 | 6e 74 65 72 6e 65 74 20 |r your i|nternet |
|00004010| 64 6f 6d 61 69 6e 2e 0a | 58 20 20 2a 20 0a 58 20 |domain..|X * .X |
|00004020| 20 2a 20 41 6e 79 77 61 | 79 2c 20 69 66 20 74 68 | * Anywa|y, if th|
|00004030| 65 20 74 65 73 74 20 66 | 61 69 6c 73 2c 20 66 72 |e test f|ails, fr|
|00004040| 6f 6d 68 6f 73 74 28 29 | 20 65 69 74 68 65 72 20 |omhost()| either |
|00004050| 64 72 6f 70 73 20 74 68 | 65 20 63 6f 6e 6e 65 63 |drops th|e connec|
|00004060| 74 69 6f 6e 20 28 77 68 | 65 6e 0a 58 20 20 2a 20 |tion (wh|en.X * |
|00004070| 63 6f 6d 70 69 6c 65 64 | 20 77 69 74 68 20 2d 44 |compiled| with -D|
|00004080| 50 41 52 41 4e 4f 49 44 | 29 20 6f 72 20 6a 75 73 |PARANOID|) or jus|
|00004090| 74 20 72 65 74 75 72 6e | 73 20 74 68 65 20 72 65 |t return|s the re|
|000040a0| 6d 6f 74 65 20 68 6f 73 | 74 20 61 64 64 72 65 73 |mote hos|t addres|
|000040b0| 73 20 69 6e 73 74 65 61 | 64 0a 58 20 20 2a 20 6f |s instea|d.X * o|
|000040c0| 66 20 74 68 65 20 62 61 | 64 20 72 65 6d 6f 74 65 |f the ba|d remote|
|000040d0| 20 68 6f 73 74 20 6e 61 | 6d 65 20 28 6e 6f 74 20 | host na|me (not |
|000040e0| 63 6f 6d 70 69 6c 65 64 | 20 77 69 74 68 20 2d 44 |compiled| with -D|
|000040f0| 50 41 52 41 4e 4f 49 44 | 29 2e 0a 58 20 20 2a 20 |PARANOID|)..X * |
|00004100| 0a 58 20 20 2a 20 44 69 | 61 67 6e 6f 73 74 69 63 |.X * Di|agnostic|
|00004110| 73 20 61 72 65 20 72 65 | 70 6f 72 74 65 64 20 74 |s are re|ported t|
|00004120| 68 72 6f 75 67 68 20 73 | 79 73 6c 6f 67 28 33 29 |hrough s|yslog(3)|
|00004130| 2e 0a 58 20 20 2a 20 0a | 58 20 20 2a 20 41 75 74 |..X * .|X * Aut|
|00004140| 68 6f 72 3a 20 57 69 65 | 74 73 65 20 56 65 6e 65 |hor: Wie|tse Vene|
|00004150| 6d 61 2c 20 45 69 6e 64 | 68 6f 76 65 6e 20 55 6e |ma, Eind|hoven Un|
|00004160| 69 76 65 72 73 69 74 79 | 20 6f 66 20 54 65 63 68 |iversity| of Tech|
|00004170| 6e 6f 6c 6f 67 79 2c 20 | 54 68 65 20 4e 65 74 68 |nology, |The Neth|
|00004180| 65 72 6c 61 6e 64 73 2e | 0a 58 20 20 2a 2f 0a 58 |erlands.|.X */.X|
|00004190| 0a 58 23 69 66 6e 64 65 | 66 20 6c 69 6e 74 0a 58 |.X#ifnde|f lint.X|
|000041a0| 73 74 61 74 69 63 20 63 | 68 61 72 20 73 63 63 73 |static c|har sccs|
|000041b0| 69 64 5b 5d 20 3d 20 22 | 40 28 23 29 20 66 72 6f |id[] = "|@(#) fro|
|000041c0| 6d 68 6f 73 74 2e 63 20 | 31 2e 32 20 39 31 2f 30 |mhost.c |1.2 91/0|
|000041d0| 35 2f 32 30 20 31 33 3a | 32 38 3a 30 31 22 3b 0a |5/20 13:|28:01";.|
|000041e0| 58 23 65 6e 64 69 66 0a | 58 0a 58 23 69 6e 63 6c |X#endif.|X.X#incl|
|000041f0| 75 64 65 20 3c 73 74 64 | 69 6f 2e 68 3e 0a 58 23 |ude <std|io.h>.X#|
|00004200| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 74 79 70 |include |<sys/typ|
|00004210| 65 73 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |es.h>.X#|include |
|00004220| 3c 73 79 73 2f 70 61 72 | 61 6d 2e 68 3e 0a 58 23 |<sys/par|am.h>.X#|
|00004230| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 73 6f 63 |include |<sys/soc|
|00004240| 6b 65 74 2e 68 3e 0a 58 | 23 69 6e 63 6c 75 64 65 |ket.h>.X|#include|
|00004250| 20 3c 73 79 73 6c 6f 67 | 2e 68 3e 0a 58 23 69 6e | <syslog|.h>.X#in|
|00004260| 63 6c 75 64 65 20 3c 6e | 65 74 69 6e 65 74 2f 69 |clude <n|etinet/i|
|00004270| 6e 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |n.h>.X#i|nclude <|
|00004280| 6e 65 74 64 62 2e 68 3e | 0a 58 0a 58 23 69 66 6e |netdb.h>|.X.X#ifn|
|00004290| 64 65 66 20 4d 41 58 48 | 4f 53 54 4e 41 4d 45 4c |def MAXH|OSTNAMEL|
|000042a0| 45 4e 0a 58 23 64 65 66 | 69 6e 65 20 4d 41 58 48 |EN.X#def|ine MAXH|
|000042b0| 4f 53 54 4e 41 4d 45 4c | 45 4e 09 42 55 46 53 49 |OSTNAMEL|EN.BUFSI|
|000042c0| 5a 0a 58 23 65 6e 64 69 | 66 0a 58 0a 58 2f 2a 20 |Z.X#endi|f.X.X/* |
|000042d0| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 61 72 |The foll|owing ar|
|000042e0| 65 20 74 6f 20 62 65 20 | 75 73 65 64 20 69 6e 20 |e to be |used in |
|000042f0| 61 73 73 69 67 6e 6d 65 | 6e 74 20 63 6f 6e 74 65 |assignme|nt conte|
|00004300| 78 74 2c 20 6e 6f 74 20 | 69 6e 20 63 6f 6d 70 61 |xt, not |in compa|
|00004310| 72 69 73 6f 6e 73 20 2a | 2f 0a 58 0a 58 23 64 65 |risons *|/.X.X#de|
|00004320| 66 69 6e 65 09 47 4f 4f | 44 09 31 0a 58 23 64 65 |fine.GOO|D.1.X#de|
|00004330| 66 69 6e 65 09 42 41 44 | 09 30 0a 58 0a 58 2f 2a |fine.BAD|.0.X.X/*|
|00004340| 20 66 72 6f 6d 68 6f 73 | 74 20 2d 20 66 69 6e 64 | fromhos|t - find|
|00004350| 20 6f 75 74 20 77 68 61 | 74 20 69 73 20 61 74 20 | out wha|t is at |
|00004360| 74 68 65 20 6f 74 68 65 | 72 20 65 6e 64 20 6f 66 |the othe|r end of|
|00004370| 20 73 74 61 6e 64 61 72 | 64 20 69 6e 70 75 74 20 | standar|d input |
|00004380| 2a 2f 0a 58 0a 58 63 68 | 61 72 20 20 20 2a 66 72 |*/.X.Xch|ar *fr|
|00004390| 6f 6d 68 6f 73 74 28 29 | 0a 58 7b 0a 58 20 20 20 |omhost()|.X{.X |
|000043a0| 20 73 74 72 75 63 74 20 | 73 6f 63 6b 61 64 64 72 | struct |sockaddr|
|000043b0| 20 73 61 3b 0a 58 20 20 | 20 20 73 74 72 75 63 74 | sa;.X | struct|
|000043c0| 20 73 6f 63 6b 61 64 64 | 72 5f 69 6e 20 2a 73 69 | sockadd|r_in *si|
|000043d0| 6e 20 3d 20 28 73 74 72 | 75 63 74 20 73 6f 63 6b |n = (str|uct sock|
|000043e0| 61 64 64 72 5f 69 6e 20 | 2a 29 20 28 26 73 61 29 |addr_in |*) (&sa)|
|000043f0| 3b 0a 58 20 20 20 20 73 | 74 72 75 63 74 20 68 6f |;.X s|truct ho|
|00004400| 73 74 65 6e 74 20 2a 68 | 70 3b 0a 58 20 20 20 20 |stent *h|p;.X |
|00004410| 69 6e 74 20 20 20 20 20 | 73 6f 63 6b 74 20 3d 20 |int |sockt = |
|00004420| 66 69 6c 65 6e 6f 28 73 | 74 64 69 6e 29 3b 0a 58 |fileno(s|tdin);.X|
|00004430| 20 20 20 20 69 6e 74 20 | 20 20 20 20 6c 65 6e 67 | int | leng|
|00004440| 74 68 20 3d 20 73 69 7a | 65 6f 66 28 73 61 29 3b |th = siz|eof(sa);|
|00004450| 0a 58 20 20 20 20 73 74 | 61 74 69 63 20 63 68 61 |.X st|atic cha|
|00004460| 72 20 72 65 6d 6f 74 65 | 68 6f 73 74 5b 4d 41 58 |r remote|host[MAX|
|00004470| 48 4f 53 54 4e 41 4d 45 | 4c 45 4e 20 2b 20 31 5d |HOSTNAME|LEN + 1]|
|00004480| 3b 0a 58 20 20 20 20 63 | 68 61 72 20 20 20 2a 69 |;.X c|har *i|
|00004490| 6e 65 74 5f 6e 74 6f 61 | 28 29 3b 0a 58 20 20 20 |net_ntoa|();.X |
|000044a0| 20 63 68 61 72 20 20 20 | 2a 73 74 72 6e 63 70 79 | char |*strncpy|
|000044b0| 28 29 3b 0a 58 0a 58 20 | 20 20 20 2f 2a 20 54 72 |();.X.X | /* Tr|
|000044c0| 79 20 74 6f 20 62 65 20 | 73 6d 61 72 74 20 69 66 |y to be |smart if|
|000044d0| 20 73 74 61 6e 64 61 72 | 64 20 69 6e 70 75 74 20 | standar|d input |
|000044e0| 69 73 20 6e 6f 74 20 63 | 6f 6e 6e 65 63 74 65 64 |is not c|onnected|
|000044f0| 20 74 6f 20 61 20 73 6f | 63 6b 65 74 2e 20 2a 2f | to a so|cket. */|
|00004500| 0a 58 0a 58 20 20 20 20 | 69 66 20 28 67 65 74 70 |.X.X |if (getp|
|00004510| 65 65 72 6e 61 6d 65 28 | 73 6f 63 6b 74 2c 20 26 |eername(|sockt, &|
|00004520| 73 61 2c 20 26 6c 65 6e | 67 74 68 29 20 3c 20 30 |sa, &len|gth) < 0|
|00004530| 29 20 7b 0a 58 09 69 66 | 20 28 69 73 61 74 74 79 |) {.X.if| (isatty|
|00004540| 28 73 6f 63 6b 74 29 29 | 20 7b 0a 58 09 20 20 20 |(sockt))| {.X. |
|00004550| 20 72 65 74 75 72 6e 20 | 28 22 73 74 64 69 6e 22 | return |("stdin"|
|00004560| 29 3b 0a 58 09 7d 20 65 | 6c 73 65 20 7b 0a 58 09 |);.X.} e|lse {.X.|
|00004570| 20 20 20 20 73 79 73 6c | 6f 67 28 4c 4f 47 5f 45 | sysl|og(LOG_E|
|00004580| 52 52 2c 20 22 67 65 74 | 70 65 65 72 6e 61 6d 65 |RR, "get|peername|
|00004590| 3a 20 25 6d 22 29 3b 0a | 58 09 20 20 20 20 72 65 |: %m");.|X. re|
|000045a0| 74 75 72 6e 20 28 30 29 | 3b 0a 58 09 7d 0a 58 20 |turn (0)|;.X.}.X |
|000045b0| 20 20 20 7d 0a 58 20 20 | 20 20 69 66 20 28 73 61 | }.X | if (sa|
|000045c0| 2e 73 61 5f 66 61 6d 69 | 6c 79 20 21 3d 20 41 46 |.sa_fami|ly != AF|
|000045d0| 5f 49 4e 45 54 29 20 7b | 0a 58 09 73 79 73 6c 6f |_INET) {|.X.syslo|
|000045e0| 67 28 4c 4f 47 5f 45 52 | 52 2c 20 22 75 6e 6b 6e |g(LOG_ER|R, "unkn|
|000045f0| 6f 77 6e 20 61 64 64 72 | 65 73 73 20 66 61 6d 69 |own addr|ess fami|
|00004600| 6c 79 20 25 6c 64 22 2c | 20 28 6c 6f 6e 67 29 20 |ly %ld",| (long) |
|00004610| 73 61 2e 73 61 5f 66 61 | 6d 69 6c 79 29 3b 0a 58 |sa.sa_fa|mily);.X|
|00004620| 09 72 65 74 75 72 6e 20 | 28 30 29 3b 0a 58 20 20 |.return |(0);.X |
|00004630| 20 20 7d 0a 58 20 20 20 | 20 2f 2a 20 4c 6f 6f 6b | }.X | /* Look|
|00004640| 20 75 70 20 74 68 65 20 | 72 65 6d 6f 74 65 20 68 | up the |remote h|
|00004650| 6f 73 74 20 6e 61 6d 65 | 2e 20 55 73 65 20 69 74 |ost name|. Use it|
|00004660| 73 20 61 64 64 72 65 73 | 73 20 69 66 20 6e 61 6d |s addres|s if nam|
|00004670| 65 20 6c 6f 6f 6b 75 70 | 20 66 61 69 6c 73 2e 20 |e lookup| fails. |
|00004680| 2a 2f 0a 58 0a 58 20 20 | 20 20 69 66 20 28 28 68 |*/.X.X | if ((h|
|00004690| 70 20 3d 20 67 65 74 68 | 6f 73 74 62 79 61 64 64 |p = geth|ostbyadd|
|000046a0| 72 28 28 63 68 61 72 20 | 2a 29 20 26 73 69 6e 2d |r((char |*) &sin-|
|000046b0| 3e 73 69 6e 5f 61 64 64 | 72 2e 73 5f 61 64 64 72 |>sin_add|r.s_addr|
|000046c0| 2c 0a 58 09 09 09 20 20 | 20 20 73 69 7a 65 6f 66 |,.X... | sizeof|
|000046d0| 28 73 69 6e 2d 3e 73 69 | 6e 5f 61 64 64 72 2e 73 |(sin->si|n_addr.s|
|000046e0| 5f 61 64 64 72 29 2c 0a | 58 09 09 09 20 20 20 20 |_addr),.|X... |
|000046f0| 41 46 5f 49 4e 45 54 29 | 29 20 3d 3d 20 30 29 20 |AF_INET)|) == 0) |
|00004700| 7b 0a 58 09 72 65 74 75 | 72 6e 20 28 69 6e 65 74 |{.X.retu|rn (inet|
|00004710| 5f 6e 74 6f 61 28 73 69 | 6e 2d 3e 73 69 6e 5f 61 |_ntoa(si|n->sin_a|
|00004720| 64 64 72 29 29 3b 0a 58 | 20 20 20 20 7d 0a 58 20 |ddr));.X| }.X |
|00004730| 20 20 20 2f 2a 20 53 61 | 76 65 20 74 68 65 20 68 | /* Sa|ve the h|
|00004740| 6f 73 74 20 6e 61 6d 65 | 20 62 65 66 6f 72 65 20 |ost name| before |
|00004750| 74 68 65 20 67 65 74 68 | 6f 73 74 62 79 78 78 78 |the geth|ostbyxxx|
|00004760| 28 29 20 72 6f 75 74 69 | 6e 65 73 20 63 6c 6f 62 |() routi|nes clob|
|00004770| 62 65 72 20 69 74 2e 20 | 2a 2f 0a 58 0a 58 20 20 |ber it. |*/.X.X |
|00004780| 20 20 28 76 6f 69 64 29 | 20 73 74 72 6e 63 70 79 | (void)| strncpy|
|00004790| 28 72 65 6d 6f 74 65 68 | 6f 73 74 2c 20 68 70 2d |(remoteh|ost, hp-|
|000047a0| 3e 68 5f 6e 61 6d 65 2c | 20 73 69 7a 65 6f 66 28 |>h_name,| sizeof(|
|000047b0| 72 65 6d 6f 74 65 68 6f | 73 74 29 20 2d 20 31 29 |remoteho|st) - 1)|
|000047c0| 3b 0a 58 20 20 20 20 72 | 65 6d 6f 74 65 68 6f 73 |;.X r|emotehos|
|000047d0| 74 5b 73 69 7a 65 6f 66 | 28 72 65 6d 6f 74 65 68 |t[sizeof|(remoteh|
|000047e0| 6f 73 74 29 20 2d 20 31 | 5d 20 3d 20 30 3b 0a 58 |ost) - 1|] = 0;.X|
|000047f0| 0a 58 20 20 20 20 2f 2a | 0a 58 20 20 20 20 20 2a |.X /*|.X *|
|00004800| 20 44 65 63 69 64 65 20 | 77 68 61 74 20 74 6f 20 | Decide |what to |
|00004810| 64 6f 20 69 66 20 74 68 | 65 20 68 6f 73 74 20 6e |do if th|e host n|
|00004820| 61 6d 65 20 64 6f 65 73 | 20 6e 6f 74 20 6d 61 74 |ame does| not mat|
|00004830| 63 68 20 74 68 65 20 61 | 64 64 72 65 73 73 20 6f |ch the a|ddress o|
|00004840| 72 20 69 66 20 77 65 0a | 58 20 20 20 20 20 2a 20 |r if we.|X * |
|00004850| 61 72 65 20 75 6e 61 62 | 6c 65 20 74 6f 20 76 65 |are unab|le to ve|
|00004860| 72 69 66 79 20 74 68 61 | 74 20 74 68 65 20 68 6f |rify tha|t the ho|
|00004870| 73 74 20 6e 61 6d 65 20 | 6d 61 74 63 68 65 73 20 |st name |matches |
|00004880| 74 68 65 20 61 64 64 72 | 65 73 73 2e 0a 58 20 20 |the addr|ess..X |
|00004890| 20 20 20 2a 2f 0a 58 0a | 58 20 20 20 20 69 66 20 | */.X.|X if |
|000048a0| 28 6d 61 74 63 68 6e 61 | 6d 65 28 72 65 6d 6f 74 |(matchna|me(remot|
|000048b0| 65 68 6f 73 74 2c 20 73 | 69 6e 29 29 20 7b 0a 58 |ehost, s|in)) {.X|
|000048c0| 09 72 65 74 75 72 6e 20 | 28 72 65 6d 6f 74 65 68 |.return |(remoteh|
|000048d0| 6f 73 74 29 3b 0a 58 20 | 20 20 20 7d 20 65 6c 73 |ost);.X | } els|
|000048e0| 65 20 7b 0a 58 23 69 66 | 64 65 66 09 50 41 52 41 |e {.X#if|def.PARA|
|000048f0| 4e 4f 49 44 0a 58 09 65 | 78 69 74 28 30 29 3b 0a |NOID.X.e|xit(0);.|
|00004900| 58 23 65 6c 73 65 0a 58 | 09 72 65 74 75 72 6e 20 |X#else.X|.return |
|00004910| 28 69 6e 65 74 5f 6e 74 | 6f 61 28 73 69 6e 2d 3e |(inet_nt|oa(sin->|
|00004920| 73 69 6e 5f 61 64 64 72 | 29 29 3b 0a 58 23 65 6e |sin_addr|));.X#en|
|00004930| 64 69 66 0a 58 20 20 20 | 20 7d 0a 58 7d 0a 58 0a |dif.X | }.X}.X.|
|00004940| 58 2f 2a 20 6d 61 74 63 | 68 6e 61 6d 65 20 2d 20 |X/* matc|hname - |
|00004950| 64 65 74 65 72 6d 69 6e | 65 20 69 66 20 68 6f 73 |determin|e if hos|
|00004960| 74 20 6e 61 6d 65 20 6d | 61 74 63 68 65 73 20 61 |t name m|atches a|
|00004970| 64 64 72 65 73 73 20 2a | 2f 0a 58 0a 58 73 74 61 |ddress *|/.X.Xsta|
|00004980| 74 69 63 20 69 6e 74 20 | 6d 61 74 63 68 6e 61 6d |tic int |matchnam|
|00004990| 65 28 72 65 6d 6f 74 65 | 68 6f 73 74 2c 20 73 69 |e(remote|host, si|
|000049a0| 6e 29 0a 58 63 68 61 72 | 20 20 20 2a 72 65 6d 6f |n).Xchar| *remo|
|000049b0| 74 65 68 6f 73 74 3b 0a | 58 73 74 72 75 63 74 20 |tehost;.|Xstruct |
|000049c0| 73 6f 63 6b 61 64 64 72 | 5f 69 6e 20 2a 73 69 6e |sockaddr|_in *sin|
|000049d0| 3b 0a 58 7b 0a 58 20 20 | 20 20 73 74 72 75 63 74 |;.X{.X | struct|
|000049e0| 20 68 6f 73 74 65 6e 74 | 20 2a 68 70 3b 0a 58 20 | hostent| *hp;.X |
|000049f0| 20 20 20 69 6e 74 20 20 | 20 20 20 69 3b 0a 58 0a | int | i;.X.|
|00004a00| 58 20 20 20 20 69 66 20 | 28 28 68 70 20 3d 20 67 |X if |((hp = g|
|00004a10| 65 74 68 6f 73 74 62 79 | 6e 61 6d 65 28 72 65 6d |ethostby|name(rem|
|00004a20| 6f 74 65 68 6f 73 74 29 | 29 20 3d 3d 20 30 29 20 |otehost)|) == 0) |
|00004a30| 7b 0a 58 0a 58 09 2f 2a | 0a 58 09 20 2a 20 55 6e |{.X.X./*|.X. * Un|
|00004a40| 61 62 6c 65 20 74 6f 20 | 76 65 72 69 66 79 20 74 |able to |verify t|
|00004a50| 68 61 74 20 74 68 65 20 | 68 6f 73 74 20 6e 61 6d |hat the |host nam|
|00004a60| 65 20 6d 61 74 63 68 65 | 73 20 74 68 65 20 61 64 |e matche|s the ad|
|00004a70| 64 72 65 73 73 2e 20 54 | 68 69 73 20 6d 61 79 20 |dress. T|his may |
|00004a80| 62 65 0a 58 09 20 2a 20 | 61 20 74 72 61 6e 73 69 |be.X. * |a transi|
|00004a90| 65 6e 74 20 70 72 6f 62 | 6c 65 6d 20 6f 72 20 61 |ent prob|lem or a|
|00004aa0| 20 62 6f 74 63 68 65 64 | 20 6e 61 6d 65 20 73 65 | botched| name se|
|00004ab0| 72 76 65 72 20 73 65 74 | 75 70 2e 0a 58 09 20 2a |rver set|up..X. *|
|00004ac0| 2f 0a 58 0a 58 09 73 79 | 73 6c 6f 67 28 4c 4f 47 |/.X.X.sy|slog(LOG|
|00004ad0| 5f 45 52 52 2c 20 22 67 | 65 74 68 6f 73 74 62 79 |_ERR, "g|ethostby|
|00004ae0| 6e 61 6d 65 28 25 73 29 | 3a 20 6c 6f 6f 6b 75 70 |name(%s)|: lookup|
|00004af0| 20 66 61 69 6c 75 72 65 | 22 2c 20 72 65 6d 6f 74 | failure|", remot|
|00004b00| 65 68 6f 73 74 29 3b 0a | 58 09 72 65 74 75 72 6e |ehost);.|X.return|
|00004b10| 20 28 42 41 44 29 3b 0a | 58 20 20 20 20 7d 20 65 | (BAD);.|X } e|
|00004b20| 6c 73 65 20 7b 0a 58 0a | 58 09 2f 2a 20 4c 6f 6f |lse {.X.|X./* Loo|
|00004b30| 6b 20 75 70 20 74 68 65 | 20 68 6f 73 74 20 61 64 |k up the| host ad|
|00004b40| 64 72 65 73 73 20 69 6e | 20 74 68 65 20 61 64 64 |dress in| the add|
|00004b50| 72 65 73 73 20 6c 69 73 | 74 20 77 65 20 6a 75 73 |ress lis|t we jus|
|00004b60| 74 20 67 6f 74 2e 20 2a | 2f 0a 58 0a 58 09 66 6f |t got. *|/.X.X.fo|
|00004b70| 72 20 28 69 20 3d 20 30 | 3b 20 68 70 2d 3e 68 5f |r (i = 0|; hp->h_|
|00004b80| 61 64 64 72 5f 6c 69 73 | 74 5b 69 5d 3b 20 69 2b |addr_lis|t[i]; i+|
|00004b90| 2b 29 20 7b 0a 58 09 20 | 20 20 20 69 66 20 28 6d |+) {.X. | if (m|
|00004ba0| 65 6d 63 6d 70 28 68 70 | 2d 3e 68 5f 61 64 64 72 |emcmp(hp|->h_addr|
|00004bb0| 5f 6c 69 73 74 5b 69 5d | 2c 20 28 63 61 64 64 72 |_list[i]|, (caddr|
|00004bc0| 5f 74 29 20 26 20 73 69 | 6e 2d 3e 73 69 6e 5f 61 |_t) & si|n->sin_a|
|00004bd0| 64 64 72 2c 0a 58 09 09 | 20 20 20 20 20 20 20 73 |ddr,.X..| s|
|00004be0| 69 7a 65 6f 66 28 73 69 | 6e 2d 3e 73 69 6e 5f 61 |izeof(si|n->sin_a|
|00004bf0| 64 64 72 29 29 20 3d 3d | 20 30 29 0a 58 09 09 72 |ddr)) ==| 0).X..r|
|00004c00| 65 74 75 72 6e 20 28 47 | 4f 4f 44 29 3b 0a 58 09 |eturn (G|OOD);.X.|
|00004c10| 7d 0a 58 0a 58 09 2f 2a | 0a 58 09 20 2a 20 54 68 |}.X.X./*|.X. * Th|
|00004c20| 65 20 68 6f 73 74 20 6e | 61 6d 65 20 64 6f 65 73 |e host n|ame does|
|00004c30| 20 6e 6f 74 20 6d 61 70 | 20 74 6f 20 74 68 65 20 | not map| to the |
|00004c40| 68 6f 73 74 20 61 64 64 | 72 65 73 73 2e 20 50 65 |host add|ress. Pe|
|00004c50| 72 68 61 70 73 20 73 6f | 6d 65 6f 6e 65 0a 58 09 |rhaps so|meone.X.|
|00004c60| 20 2a 20 68 61 73 20 63 | 6f 6d 70 72 6f 6d 69 73 | * has c|ompromis|
|00004c70| 65 64 20 61 20 6e 61 6d | 65 20 73 65 72 76 65 72 |ed a nam|e server|
|00004c80| 2e 20 4d 6f 72 65 20 6c | 69 6b 65 6c 79 20 73 6f |. More l|ikely so|
|00004c90| 6d 65 6f 6e 65 20 62 6f | 74 63 68 65 64 20 69 74 |meone bo|tched it|
|00004ca0| 2c 20 62 75 74 0a 58 09 | 20 2a 20 74 68 61 74 20 |, but.X.| * that |
|00004cb0| 63 6f 75 6c 64 20 62 65 | 20 64 61 6e 67 65 72 6f |could be| dangero|
|00004cc0| 75 73 2c 20 74 6f 6f 2e | 0a 58 09 20 2a 2f 0a 58 |us, too.|.X. */.X|
|00004cd0| 0a 58 09 73 79 73 6c 6f | 67 28 4c 4f 47 5f 45 52 |.X.syslo|g(LOG_ER|
|00004ce0| 52 2c 20 22 68 6f 73 74 | 20 6e 61 6d 65 2f 61 64 |R, "host| name/ad|
|00004cf0| 64 72 65 73 73 20 6d 69 | 73 6d 61 74 63 68 3a 20 |dress mi|smatch: |
|00004d00| 25 73 20 21 3d 20 25 73 | 22 2c 0a 58 09 20 20 20 |%s != %s|",.X. |
|00004d10| 20 20 20 20 69 6e 65 74 | 5f 6e 74 6f 61 28 73 69 | inet|_ntoa(si|
|00004d20| 6e 2d 3e 73 69 6e 5f 61 | 64 64 72 29 2c 20 68 70 |n->sin_a|ddr), hp|
|00004d30| 2d 3e 68 5f 6e 61 6d 65 | 29 3b 0a 58 09 72 65 74 |->h_name|);.X.ret|
|00004d40| 75 72 6e 20 28 42 41 44 | 29 3b 0a 58 20 20 20 20 |urn (BAD|);.X |
|00004d50| 7d 0a 58 7d 0a 45 4e 44 | 5f 4f 46 5f 66 72 6f 6d |}.X}.END|_OF_from|
|00004d60| 68 6f 73 74 2e 63 0a 69 | 66 20 74 65 73 74 20 33 |host.c.i|f test 3|
|00004d70| 39 38 32 20 2d 6e 65 20 | 60 77 63 20 2d 63 20 3c |982 -ne |`wc -c <|
|00004d80| 66 72 6f 6d 68 6f 73 74 | 2e 63 60 3b 20 74 68 65 |fromhost|.c`; the|
|00004d90| 6e 0a 20 20 20 20 65 63 | 68 6f 20 73 68 61 72 3a |n. ec|ho shar:|
|00004da0| 20 5c 22 66 72 6f 6d 68 | 6f 73 74 2e 63 5c 22 20 | \"fromh|ost.c\" |
|00004db0| 75 6e 70 61 63 6b 65 64 | 20 77 69 74 68 20 77 72 |unpacked| with wr|
|00004dc0| 6f 6e 67 20 73 69 7a 65 | 21 0a 66 69 0a 23 20 65 |ong size|!.fi.# e|
|00004dd0| 6e 64 20 6f 66 20 6f 76 | 65 72 77 72 69 74 69 6e |nd of ov|erwritin|
|00004de0| 67 20 63 68 65 63 6b 0a | 66 69 0a 69 66 20 74 65 |g check.|fi.if te|
|00004df0| 73 74 20 2d 66 20 68 6f | 73 74 73 5f 61 63 63 65 |st -f ho|sts_acce|
|00004e00| 73 73 2e 63 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |ss.c -a |"${1}" !|
|00004e10| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|00004e20| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|00004e30| 20 6e 6f 74 20 6f 76 65 | 72 2d 77 72 69 74 65 20 | not ove|r-write |
|00004e40| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 5c 22 |existing| file \"|
|00004e50| 68 6f 73 74 73 5f 61 63 | 63 65 73 73 2e 63 5c 22 |hosts_ac|cess.c\"|
|00004e60| 0a 65 6c 73 65 0a 65 63 | 68 6f 20 73 68 61 72 3a |.else.ec|ho shar:|
|00004e70| 20 45 78 74 72 61 63 74 | 69 6e 67 20 5c 22 68 6f | Extract|ing \"ho|
|00004e80| 73 74 73 5f 61 63 63 65 | 73 73 2e 63 5c 22 20 5c |sts_acce|ss.c\" \|
|00004e90| 28 34 39 39 32 20 63 68 | 61 72 61 63 74 65 72 73 |(4992 ch|aracters|
|00004ea0| 5c 29 0a 73 65 64 20 22 | 73 2f 5e 58 2f 2f 22 20 |\).sed "|s/^X//" |
|00004eb0| 3e 68 6f 73 74 73 5f 61 | 63 63 65 73 73 2e 63 20 |>hosts_a|ccess.c |
|00004ec0| 3c 3c 27 45 4e 44 5f 4f | 46 5f 68 6f 73 74 73 5f |<<'END_O|F_hosts_|
|00004ed0| 61 63 63 65 73 73 2e 63 | 27 0a 58 23 69 66 64 65 |access.c|'.X#ifde|
|00004ee0| 66 20 48 4f 53 54 53 5f | 41 43 43 45 53 53 0a 58 |f HOSTS_|ACCESS.X|
|00004ef0| 0a 58 20 2f 2a 0a 58 20 | 20 2a 20 54 68 69 73 20 |.X /*.X | * This |
|00004f00| 6d 6f 64 75 6c 65 20 69 | 6d 70 6c 65 6d 65 6e 74 |module i|mplement|
|00004f10| 73 20 61 20 73 69 6d 70 | 6c 65 20 62 75 74 20 65 |s a simp|le but e|
|00004f20| 66 66 65 63 74 69 76 65 | 20 66 6f 72 6d 20 6f 66 |ffective| form of|
|00004f30| 20 61 63 63 65 73 73 20 | 63 6f 6e 74 72 6f 6c 0a | access |control.|
|00004f40| 58 20 20 2a 20 62 61 73 | 65 64 20 6f 6e 20 68 6f |X * bas|ed on ho|
|00004f50| 73 74 20 28 6f 72 20 64 | 6f 6d 61 69 6e 29 20 6e |st (or d|omain) n|
|00004f60| 61 6d 65 73 2c 20 6e 65 | 74 67 72 6f 75 70 2c 20 |ames, ne|tgroup, |
|00004f70| 69 6e 74 65 72 6e 65 74 | 20 61 64 64 72 65 73 73 |internet| address|
|00004f80| 65 73 20 28 6f 72 20 6e | 65 74 77 6f 72 6b 0a 58 |es (or n|etwork.X|
|00004f90| 20 20 2a 20 6e 75 6d 62 | 65 72 73 29 20 61 6e 64 | * numb|ers) and|
|00004fa0| 20 64 61 65 6d 6f 6e 20 | 70 72 6f 63 65 73 73 20 | daemon |process |
|00004fb0| 6e 61 6d 65 73 2c 20 77 | 69 74 68 20 77 69 6c 64 |names, w|ith wild|
|00004fc0| 20 63 61 72 64 20 73 75 | 70 70 6f 72 74 2e 0a 58 | card su|pport..X|
|00004fd0| 20 20 2a 20 0a 58 20 20 | 2a 20 44 69 61 67 6e 6f | * .X |* Diagno|
|00004fe0| 73 74 69 63 73 20 61 72 | 65 20 72 65 70 6f 72 74 |stics ar|e report|
|00004ff0| 65 64 20 74 68 72 6f 75 | 67 68 20 73 79 73 6c 6f |ed throu|gh syslo|
|00005000| 67 28 33 29 2e 0a 58 20 | 20 2a 20 0a 58 20 20 2a |g(3)..X | * .X *|
|00005010| 20 43 6f 6d 70 69 6c 65 | 20 77 69 74 68 20 2d 44 | Compile| with -D|
|00005020| 48 4f 53 54 53 5f 41 43 | 43 45 53 53 20 69 6e 20 |HOSTS_AC|CESS in |
|00005030| 6f 72 64 65 72 20 74 6f | 20 65 6e 61 62 6c 65 20 |order to| enable |
|00005040| 61 63 63 65 73 73 20 63 | 6f 6e 74 72 6f 6c 2e 20 |access c|ontrol. |
|00005050| 53 65 65 20 74 68 65 0a | 58 20 20 2a 20 68 6f 73 |See the.|X * hos|
|00005060| 74 73 5f 61 63 63 65 73 | 73 28 35 29 20 6d 61 6e |ts_acces|s(5) man|
|00005070| 75 61 6c 20 70 61 67 65 | 20 66 6f 72 20 64 65 74 |ual page| for det|
|00005080| 61 69 6c 73 2e 0a 58 20 | 20 2a 20 0a 58 20 20 2a |ails..X | * .X *|
|00005090| 20 43 6f 6d 70 69 6c 65 | 20 77 69 74 68 20 2d 44 | Compile| with -D|
|000050a0| 4e 45 54 47 52 4f 55 50 | 20 69 66 20 79 6f 75 72 |NETGROUP| if your|
|000050b0| 20 6c 69 62 72 61 72 79 | 20 70 72 6f 76 69 64 65 | library| provide|
|000050c0| 73 20 73 75 70 70 6f 72 | 74 20 66 6f 72 20 6e 65 |s suppor|t for ne|
|000050d0| 74 67 72 6f 75 70 73 2e | 0a 58 20 20 2a 20 0a 58 |tgroups.|.X * .X|
|000050e0| 20 20 2a 20 41 75 74 68 | 6f 72 3a 20 57 69 65 74 | * Auth|or: Wiet|
|000050f0| 73 65 20 56 65 6e 65 6d | 61 2c 20 45 69 6e 64 68 |se Venem|a, Eindh|
|00005100| 6f 76 65 6e 20 55 6e 69 | 76 65 72 73 69 74 79 20 |oven Uni|versity |
|00005110| 6f 66 20 54 65 63 68 6e | 6f 6c 6f 67 79 2c 20 54 |of Techn|ology, T|
|00005120| 68 65 20 4e 65 74 68 65 | 72 6c 61 6e 64 73 2e 0a |he Nethe|rlands..|
|00005130| 58 20 20 2a 2f 0a 58 0a | 58 23 69 66 6e 64 65 66 |X */.X.|X#ifndef|
|00005140| 20 6c 69 6e 74 0a 58 73 | 74 61 74 69 63 20 63 68 | lint.Xs|tatic ch|
|00005150| 61 72 20 73 63 63 73 69 | 64 5b 5d 20 3d 20 22 40 |ar sccsi|d[] = "@|
|00005160| 28 23 29 20 68 6f 73 74 | 73 5f 61 63 63 65 73 73 |(#) host|s_access|
|00005170| 2e 63 20 31 2e 35 20 39 | 31 2f 30 35 2f 32 30 20 |.c 1.5 9|1/05/20 |
|00005180| 31 33 3a 32 38 3a 30 33 | 22 3b 0a 58 23 65 6e 64 |13:28:03|";.X#end|
|00005190| 69 66 0a 58 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |if.X.X#i|nclude <|
|000051a0| 73 74 64 69 6f 2e 68 3e | 0a 58 23 69 6e 63 6c 75 |stdio.h>|.X#inclu|
|000051b0| 64 65 20 3c 73 79 73 6c | 6f 67 2e 68 3e 0a 58 23 |de <sysl|og.h>.X#|
|000051c0| 69 6e 63 6c 75 64 65 20 | 3c 63 74 79 70 65 2e 68 |include |<ctype.h|
|000051d0| 3e 0a 58 0a 58 65 78 74 | 65 72 6e 20 63 68 61 72 |>.X.Xext|ern char|
|000051e0| 20 2a 66 67 65 74 73 28 | 29 3b 0a 58 65 78 74 65 | *fgets(|);.Xexte|
|000051f0| 72 6e 20 63 68 61 72 20 | 2a 73 74 72 63 68 72 28 |rn char |*strchr(|
|00005200| 29 3b 0a 58 65 78 74 65 | 72 6e 20 63 68 61 72 20 |);.Xexte|rn char |
|00005210| 2a 73 74 72 74 6f 6b 28 | 29 3b 0a 58 65 78 74 65 |*strtok(|);.Xexte|
|00005220| 72 6e 20 76 6f 69 64 20 | 65 78 69 74 28 29 3b 0a |rn void |exit();.|
|00005230| 58 0a 58 20 2f 2a 20 50 | 61 74 68 20 6e 61 6d 65 |X.X /* P|ath name|
|00005240| 73 20 6f 66 20 74 68 65 | 20 61 63 63 65 73 73 20 |s of the| access |
|00005250| 63 6f 6e 74 72 6f 6c 20 | 66 69 6c 65 73 2e 20 2a |control |files. *|
|00005260| 2f 0a 58 0a 58 23 64 65 | 66 69 6e 65 20 48 4f 53 |/.X.X#de|fine HOS|
|00005270| 54 53 5f 41 4c 4c 4f 57 | 09 22 2f 65 74 63 2f 68 |TS_ALLOW|."/etc/h|
|00005280| 6f 73 74 73 2e 61 6c 6c | 6f 77 22 0a 58 23 64 65 |osts.all|ow".X#de|
|00005290| 66 69 6e 65 20 48 4f 53 | 54 53 5f 44 45 4e 59 09 |fine HOS|TS_DENY.|
|000052a0| 22 2f 65 74 63 2f 68 6f | 73 74 73 2e 64 65 6e 79 |"/etc/ho|sts.deny|
|000052b0| 22 0a 58 0a 58 20 2f 2a | 20 44 65 6c 69 6d 69 74 |".X.X /*| Delimit|
|000052c0| 65 72 73 20 66 6f 72 20 | 6c 69 73 74 73 20 6f 66 |ers for |lists of|
|000052d0| 20 64 61 65 6d 6f 6e 73 | 20 6f 72 20 63 6c 69 65 | daemons| or clie|
|000052e0| 6e 74 73 2e 20 2a 2f 0a | 58 0a 58 73 74 61 74 69 |nts. */.|X.Xstati|
|000052f0| 63 20 63 68 61 72 20 73 | 65 70 5b 5d 20 3d 20 22 |c char s|ep[] = "|
|00005300| 2c 20 5c 74 22 3b 0a 58 | 0a 58 20 2f 2a 20 43 6f |, \t";.X|.X /* Co|
|00005310| 6e 73 74 61 6e 74 73 20 | 74 6f 20 62 65 20 75 73 |nstants |to be us|
|00005320| 65 64 20 69 6e 20 61 73 | 73 69 67 6e 6d 65 6e 74 |ed in as|signment|
|00005330| 73 20 6f 6e 6c 79 2c 20 | 6e 6f 74 20 69 6e 20 63 |s only, |not in c|
|00005340| 6f 6d 70 61 72 69 73 6f | 6e 73 2e 2e 2e 20 2a 2f |ompariso|ns... */|
|00005350| 0a 58 0a 58 23 64 65 66 | 69 6e 65 09 59 45 53 09 |.X.X#def|ine.YES.|
|00005360| 09 31 0a 58 23 64 65 66 | 69 6e 65 09 4e 4f 09 09 |.1.X#def|ine.NO..|
|00005370| 30 0a 58 0a 58 2f 2a 20 | 68 6f 73 74 73 5f 61 63 |0.X.X/* |hosts_ac|
|00005380| 63 65 73 73 20 2d 20 68 | 6f 73 74 20 61 63 63 65 |cess - h|ost acce|
|00005390| 73 73 20 63 6f 6e 74 72 | 6f 6c 20 66 61 63 69 6c |ss contr|ol facil|
|000053a0| 69 74 79 20 2a 2f 0a 58 | 0a 58 68 6f 73 74 73 5f |ity */.X|.Xhosts_|
|000053b0| 61 63 63 65 73 73 28 64 | 61 65 6d 6f 6e 2c 20 63 |access(d|aemon, c|
|000053c0| 6c 69 65 6e 74 29 0a 58 | 63 68 61 72 20 20 20 2a |lient).X|char *|
|000053d0| 64 61 65 6d 6f 6e 3b 0a | 58 63 68 61 72 20 20 20 |daemon;.|Xchar |
|000053e0| 2a 63 6c 69 65 6e 74 3b | 0a 58 7b 0a 58 0a 58 20 |*client;|.X{.X.X |
|000053f0| 20 20 20 2f 2a 0a 58 20 | 20 20 20 20 2a 20 49 66 | /*.X | * If|
|00005400| 20 74 68 65 20 28 64 61 | 65 6d 6f 6e 2c 20 63 6c | the (da|emon, cl|
|00005410| 69 65 6e 74 29 20 70 61 | 69 72 20 69 73 20 6d 61 |ient) pa|ir is ma|
|00005420| 74 63 68 65 64 20 62 79 | 20 61 6e 20 65 6e 74 72 |tched by| an entr|
|00005430| 79 20 69 6e 20 74 68 65 | 20 66 69 6c 65 0a 58 20 |y in the| file.X |
|00005440| 20 20 20 20 2a 20 2f 65 | 74 63 2f 68 6f 73 74 73 | * /e|tc/hosts|
|00005450| 2e 61 6c 6c 6f 77 2c 20 | 61 63 63 65 73 73 20 69 |.allow, |access i|
|00005460| 73 20 67 72 61 6e 74 65 | 64 2e 20 4f 74 68 65 72 |s grante|d. Other|
|00005470| 77 69 73 65 2c 20 69 66 | 20 74 68 65 20 28 64 61 |wise, if| the (da|
|00005480| 65 6d 6f 6e 2c 0a 58 20 | 20 20 20 20 2a 20 63 6c |emon,.X | * cl|
|00005490| 69 65 6e 74 29 20 70 61 | 69 72 20 69 73 20 6d 61 |ient) pa|ir is ma|
|000054a0| 74 63 68 65 64 20 62 79 | 20 61 6e 20 65 6e 74 72 |tched by| an entr|
|000054b0| 79 20 69 6e 20 2f 65 74 | 63 2f 68 6f 73 74 73 2e |y in /et|c/hosts.|
|000054c0| 64 65 6e 79 2c 20 61 63 | 63 65 73 73 20 69 73 0a |deny, ac|cess is.|
|000054d0| 58 20 20 20 20 20 2a 20 | 64 65 6e 69 65 64 2e 20 |X * |denied. |
|000054e0| 4f 74 68 65 72 77 69 73 | 65 2c 20 61 63 63 65 73 |Otherwis|e, acces|
|000054f0| 73 20 69 73 20 67 72 61 | 6e 74 65 64 2e 0a 58 20 |s is gra|nted..X |
|00005500| 20 20 20 20 2a 20 0a 58 | 20 20 20 20 20 2a 20 49 | * .X| * I|
|00005510| 66 20 61 20 63 6f 6e 6e | 65 63 74 69 6f 6e 20 69 |f a conn|ection i|
|00005520| 73 20 72 65 66 75 73 65 | 64 2c 20 77 65 20 77 72 |s refuse|d, we wr|
|00005530| 69 74 65 20 61 20 73 79 | 73 6c 6f 67 20 72 65 63 |ite a sy|slog rec|
|00005540| 6f 72 64 2c 20 62 75 74 | 20 64 6f 20 6e 6f 74 20 |ord, but| do not |
|00005550| 6e 6f 74 69 66 79 0a 58 | 20 20 20 20 20 2a 20 74 |notify.X| * t|
|00005560| 68 65 20 63 6c 69 65 6e | 74 2e 0a 58 20 20 20 20 |he clien|t..X |
|00005570| 20 2a 2f 0a 58 0a 58 20 | 20 20 20 69 66 20 28 74 | */.X.X | if (t|
|00005580| 61 62 6c 65 5f 6d 61 74 | 63 68 28 48 4f 53 54 53 |able_mat|ch(HOSTS|
|00005590| 5f 41 4c 4c 4f 57 2c 20 | 64 61 65 6d 6f 6e 2c 20 |_ALLOW, |daemon, |
|000055a0| 63 6c 69 65 6e 74 29 29 | 0a 58 09 72 65 74 75 72 |client))|.X.retur|
|000055b0| 6e 3b 0a 58 20 20 20 20 | 69 66 20 28 74 61 62 6c |n;.X |if (tabl|
|000055c0| 65 5f 6d 61 74 63 68 28 | 48 4f 53 54 53 5f 44 45 |e_match(|HOSTS_DE|
|000055d0| 4e 59 2c 20 64 61 65 6d | 6f 6e 2c 20 63 6c 69 65 |NY, daem|on, clie|
|000055e0| 6e 74 29 29 20 7b 0a 58 | 09 73 79 73 6c 6f 67 28 |nt)) {.X|.syslog(|
|000055f0| 4c 4f 47 5f 57 41 52 4e | 49 4e 47 2c 20 22 72 65 |LOG_WARN|ING, "re|
|00005600| 66 75 73 65 64 20 63 6f | 6e 6e 65 63 74 20 66 72 |fused co|nnect fr|
|00005610| 6f 6d 20 25 73 22 2c 20 | 63 6c 69 65 6e 74 29 3b |om %s", |client);|
|00005620| 0a 58 09 65 78 69 74 28 | 30 29 3b 0a 58 20 20 20 |.X.exit(|0);.X |
|00005630| 20 7d 0a 58 7d 0a 58 0a | 58 2f 2a 20 74 61 62 6c | }.X}.X.|X/* tabl|
|00005640| 65 5f 6d 61 74 63 68 20 | 2d 20 6d 61 74 63 68 20 |e_match |- match |
|00005650| 74 61 62 6c 65 20 65 6e | 74 72 69 65 73 20 77 69 |table en|tries wi|
|00005660| 74 68 20 28 64 61 65 6d | 6f 6e 2c 20 63 6c 69 65 |th (daem|on, clie|
|00005670| 6e 74 29 20 70 61 69 72 | 20 2a 2f 0a 58 0a 58 69 |nt) pair| */.X.Xi|
|00005680| 6e 74 20 20 20 20 20 74 | 61 62 6c 65 5f 6d 61 74 |nt t|able_mat|
|00005690| 63 68 28 74 61 62 6c 65 | 2c 20 64 61 65 6d 6f 6e |ch(table|, daemon|
|000056a0| 2c 20 63 6c 69 65 6e 74 | 29 0a 58 63 68 61 72 20 |, client|).Xchar |
|000056b0| 20 20 2a 74 61 62 6c 65 | 3b 0a 58 63 68 61 72 20 | *table|;.Xchar |
|000056c0| 20 20 2a 64 61 65 6d 6f | 6e 3b 0a 58 63 68 61 72 | *daemo|n;.Xchar|
|000056d0| 20 20 20 2a 63 6c 69 65 | 6e 74 3b 0a 58 7b 0a 58 | *clie|nt;.X{.X|
|000056e0| 20 20 20 20 46 49 4c 45 | 20 20 20 2a 66 70 3b 0a | FILE| *fp;.|
|000056f0| 58 20 20 20 20 63 68 61 | 72 20 20 20 20 73 76 5f |X cha|r sv_|
|00005700| 6c 69 73 74 5b 42 55 46 | 53 49 5a 5d 3b 09 09 2f |list[BUF|SIZ];../|
|00005710| 2a 20 62 65 63 6f 6d 65 | 73 20 6c 69 73 74 20 6f |* become|s list o|
|00005720| 66 20 64 61 65 6d 6f 6e | 73 20 2a 2f 0a 58 20 20 |f daemon|s */.X |
|00005730| 20 20 63 68 61 72 20 20 | 20 2a 63 6c 5f 6c 69 73 | char | *cl_lis|
|00005740| 74 3b 09 09 09 2f 2a 20 | 62 65 63 6f 6d 65 73 20 |t;.../* |becomes |
|00005750| 6c 69 73 74 20 6f 66 20 | 63 6c 69 65 6e 74 73 20 |list of |clients |
|00005760| 2a 2f 0a 58 20 20 20 20 | 69 6e 74 20 20 20 20 20 |*/.X |int |
|00005770| 6d 61 74 63 68 20 3d 20 | 4e 4f 3b 0a 58 20 20 20 |match = |NO;.X |
|00005780| 20 69 6e 74 20 20 20 20 | 20 65 6e 64 3b 0a 58 0a | int | end;.X.|
|00005790| 58 20 20 20 20 2f 2a 0a | 58 20 20 20 20 20 2a 20 |X /*.|X * |
|000057a0| 50 72 6f 63 65 73 73 20 | 74 68 65 20 74 61 62 6c |Process |the tabl|
|000057b0| 65 20 6f 6e 65 20 6c 69 | 6e 65 20 61 74 20 61 20 |e one li|ne at a |
|000057c0| 74 69 6d 65 2e 20 4c 69 | 6e 65 73 20 74 68 61 74 |time. Li|nes that|
|000057d0| 20 62 65 67 69 6e 20 77 | 69 74 68 20 61 20 27 23 | begin w|ith a '#|
|000057e0| 27 0a 58 20 20 20 20 20 | 2a 20 63 68 61 72 61 63 |'.X |* charac|
|000057f0| 74 65 72 20 61 72 65 20 | 69 67 6e 6f 72 65 64 2e |ter are |ignored.|
|00005800| 20 4e 6f 6e 2d 63 6f 6d | 6d 65 6e 74 20 6c 69 6e | Non-com|ment lin|
|00005810| 65 73 20 61 72 65 20 62 | 72 6f 6b 65 6e 20 61 74 |es are b|roken at|
|00005820| 20 74 68 65 20 27 3a 27 | 0a 58 20 20 20 20 20 2a | the ':'|.X *|
|00005830| 20 63 68 61 72 61 63 74 | 65 72 20 28 77 65 20 63 | charact|er (we c|
|00005840| 6f 6d 70 6c 61 69 6e 20 | 69 66 20 74 68 65 72 65 |omplain |if there|
|00005850| 20 69 73 20 6e 6f 6e 65 | 29 2e 20 54 68 65 20 6c | is none|). The l|
|00005860| 65 66 74 20 70 61 72 74 | 20 69 73 20 6d 61 74 63 |eft part| is matc|
|00005870| 68 65 64 0a 58 20 20 20 | 20 20 2a 20 61 67 61 69 |hed.X | * agai|
|00005880| 6e 73 74 20 74 68 65 20 | 64 61 65 6d 6f 6e 20 70 |nst the |daemon p|
|00005890| 72 6f 63 65 73 73 20 6e | 61 6d 65 20 28 61 72 67 |rocess n|ame (arg|
|000058a0| 76 5b 30 5d 29 2c 20 74 | 68 65 20 72 69 67 68 74 |v[0]), t|he right|
|000058b0| 20 70 61 72 74 20 61 67 | 61 69 6e 73 74 20 74 68 | part ag|ainst th|
|000058c0| 65 0a 58 20 20 20 20 20 | 2a 20 68 6f 73 74 20 6e |e.X |* host n|
|000058d0| 61 6d 65 2e 20 41 20 6e | 6f 6e 2d 65 78 69 73 74 |ame. A n|on-exist|
|000058e0| 69 6e 67 20 74 61 62 6c | 65 20 69 73 20 74 72 65 |ing tabl|e is tre|
|000058f0| 61 74 65 64 20 61 73 20 | 69 66 20 69 74 20 77 65 |ated as |if it we|
|00005900| 72 65 20 61 6e 20 65 6d | 70 74 79 0a 58 20 20 20 |re an em|pty.X |
|00005910| 20 20 2a 20 74 61 62 6c | 65 2e 0a 58 20 20 20 20 | * tabl|e..X |
|00005920| 20 2a 2f 0a 58 0a 58 20 | 20 20 20 69 66 20 28 66 | */.X.X | if (f|
|00005930| 70 20 3d 20 66 6f 70 65 | 6e 28 74 61 62 6c 65 2c |p = fope|n(table,|
|00005940| 20 22 72 22 29 29 20 7b | 0a 58 09 77 68 69 6c 65 | "r")) {|.X.while|
|00005950| 20 28 21 6d 61 74 63 68 | 20 26 26 20 66 67 65 74 | (!match| && fget|
|00005960| 73 28 73 76 5f 6c 69 73 | 74 2c 20 73 69 7a 65 6f |s(sv_lis|t, sizeo|
|00005970| 66 28 73 76 5f 6c 69 73 | 74 29 2c 20 66 70 29 29 |f(sv_lis|t), fp))|
|00005980| 20 7b 0a 58 09 20 20 20 | 20 69 66 20 28 73 76 5f | {.X. | if (sv_|
|00005990| 6c 69 73 74 5b 65 6e 64 | 20 3d 20 73 74 72 6c 65 |list[end| = strle|
|000059a0| 6e 28 73 76 5f 6c 69 73 | 74 29 20 2d 20 31 5d 20 |n(sv_lis|t) - 1] |
|000059b0| 21 3d 20 27 5c 6e 27 29 | 20 7b 0a 58 09 09 73 79 |!= '\n')| {.X..sy|
|000059c0| 73 6c 6f 67 28 4c 4f 47 | 5f 45 52 52 2c 20 22 25 |slog(LOG|_ERR, "%|
|000059d0| 73 3a 20 6c 69 6e 65 20 | 65 78 63 65 65 64 73 20 |s: line |exceeds |
|000059e0| 53 54 44 49 4f 20 62 75 | 66 66 65 72 20 73 69 7a |STDIO bu|ffer siz|
|000059f0| 65 22 2c 20 74 61 62 6c | 65 29 3b 0a 58 09 20 20 |e", tabl|e);.X. |
|00005a00| 20 20 7d 20 65 6c 73 65 | 20 7b 0a 58 09 09 73 76 | } else| {.X..sv|
|00005a10| 5f 6c 69 73 74 5b 65 6e | 64 5d 20 3d 20 27 5c 30 |_list[en|d] = '\0|
|00005a20| 27 3b 09 09 2f 2a 20 73 | 74 72 69 70 20 74 72 61 |';../* s|trip tra|
|00005a30| 69 6c 69 6e 67 20 6e 65 | 77 6c 69 6e 65 20 2a 2f |iling ne|wline */|
|00005a40| 0a 58 09 20 20 20 20 7d | 0a 58 09 20 20 20 20 69 |.X. }|.X. i|
|00005a50| 66 20 28 73 76 5f 6c 69 | 73 74 5b 30 5d 20 3d 3d |f (sv_li|st[0] ==|
|00005a60| 20 27 23 27 29 20 7b 09 | 09 2f 2a 20 73 6b 69 70 | '#') {.|./* skip|
|00005a70| 20 63 6f 6d 6d 65 6e 74 | 73 20 2a 2f 0a 58 09 09 | comment|s */.X..|
|00005a80| 63 6f 6e 74 69 6e 75 65 | 3b 0a 58 09 20 20 20 20 |continue|;.X. |
|00005a90| 7d 20 65 6c 73 65 20 69 | 66 20 28 28 63 6c 5f 6c |} else i|f ((cl_l|
|00005aa0| 69 73 74 20 3d 20 73 74 | 72 63 68 72 28 73 76 5f |ist = st|rchr(sv_|
|00005ab0| 6c 69 73 74 2c 20 27 3a | 27 29 29 20 3d 3d 20 30 |list, ':|')) == 0|
|00005ac0| 29 20 7b 0a 58 09 09 73 | 79 73 6c 6f 67 28 4c 4f |) {.X..s|yslog(LO|
|00005ad0| 47 5f 45 52 52 2c 20 22 | 25 73 3a 20 6d 61 6c 66 |G_ERR, "|%s: malf|
|00005ae0| 6f 72 6d 65 64 20 65 6e | 74 72 79 3a 20 5c 22 25 |ormed en|try: \"%|
|00005af0| 73 5c 22 22 2c 20 74 61 | 62 6c 65 2c 20 73 76 5f |s\"", ta|ble, sv_|
|00005b00| 6c 69 73 74 29 3b 0a 58 | 09 09 63 6f 6e 74 69 6e |list);.X|..contin|
|00005b10| 75 65 3b 0a 58 09 20 20 | 20 20 7d 20 65 6c 73 65 |ue;.X. | } else|
|00005b20| 20 7b 0a 58 09 09 2a 63 | 6c 5f 6c 69 73 74 2b 2b | {.X..*c|l_list++|
|00005b30| 20 3d 20 27 5c 30 27 3b | 09 09 2f 2a 20 62 72 65 | = '\0';|../* bre|
|00005b40| 61 6b 20 6c 69 6e 65 20 | 61 74 20 22 3a 22 20 2a |ak line |at ":" *|
|00005b50| 2f 0a 58 09 09 6d 61 74 | 63 68 20 3d 20 28 6c 69 |/.X..mat|ch = (li|
|00005b60| 73 74 5f 6d 61 74 63 68 | 28 73 76 5f 6c 69 73 74 |st_match|(sv_list|
|00005b70| 2c 20 64 61 65 6d 6f 6e | 29 0a 58 09 09 09 20 26 |, daemon|).X... &|
|00005b80| 26 20 6c 69 73 74 5f 6d | 61 74 63 68 28 63 6c 5f |& list_m|atch(cl_|
|00005b90| 6c 69 73 74 2c 20 63 6c | 69 65 6e 74 29 29 3b 0a |list, cl|ient));.|
|00005ba0| 58 09 20 20 20 20 7d 0a | 58 09 7d 0a 58 09 28 76 |X. }.|X.}.X.(v|
|00005bb0| 6f 69 64 29 20 66 63 6c | 6f 73 65 28 66 70 29 3b |oid) fcl|ose(fp);|
|00005bc0| 0a 58 20 20 20 20 7d 0a | 58 20 20 20 20 72 65 74 |.X }.|X ret|
|00005bd0| 75 72 6e 20 28 6d 61 74 | 63 68 29 3b 0a 58 7d 0a |urn (mat|ch);.X}.|
|00005be0| 58 0a 58 2f 2a 20 6c 69 | 73 74 5f 6d 61 74 63 68 |X.X/* li|st_match|
|00005bf0| 20 2d 20 6d 61 74 63 68 | 20 61 20 73 74 72 69 6e | - match| a strin|
|00005c00| 67 20 61 67 61 69 6e 73 | 74 20 61 20 6c 69 73 74 |g agains|t a list|
|00005c10| 20 6f 66 20 74 6f 6b 65 | 6e 73 20 2a 2f 0a 58 0a | of toke|ns */.X.|
|00005c20| 58 69 6e 74 20 20 20 20 | 20 6c 69 73 74 5f 6d 61 |Xint | list_ma|
|00005c30| 74 63 68 28 6c 69 73 74 | 2c 20 73 74 72 69 6e 67 |tch(list|, string|
|00005c40| 29 0a 58 63 68 61 72 20 | 20 20 2a 6c 69 73 74 3b |).Xchar | *list;|
|00005c50| 0a 58 63 68 61 72 20 20 | 20 2a 73 74 72 69 6e 67 |.Xchar | *string|
|00005c60| 3b 0a 58 7b 0a 58 20 20 | 20 20 63 68 61 72 20 20 |;.X{.X | char |
|00005c70| 20 2a 74 6f 6b 3b 0a 58 | 20 20 20 20 69 6e 74 20 | *tok;.X| int |
|00005c80| 20 20 20 20 74 6f 6b 5f | 6c 65 6e 3b 0a 58 20 20 | tok_|len;.X |
|00005c90| 20 20 69 6e 74 20 20 20 | 20 20 73 74 72 5f 6c 65 | int | str_le|
|00005ca0| 6e 3b 0a 58 0a 58 20 20 | 20 20 2f 2a 0a 58 20 20 |n;.X.X | /*.X |
|00005cb0| 20 20 20 2a 20 50 72 6f | 63 65 73 73 20 74 6f 6b | * Pro|cess tok|
|00005cc0| 65 6e 73 20 6f 6e 65 20 | 61 74 20 61 20 74 69 6d |ens one |at a tim|
|00005cd0| 65 2e 20 49 66 20 61 20 | 74 6f 6b 65 6e 20 68 61 |e. If a |token ha|
|00005ce0| 73 20 74 68 65 20 6d 61 | 67 69 63 20 76 61 6c 75 |s the ma|gic valu|
|00005cf0| 65 20 22 41 4c 4c 22 20 | 74 68 65 0a 58 20 20 20 |e "ALL" |the.X |
|00005d00| 20 20 2a 20 6d 61 74 63 | 68 20 61 6c 77 61 79 73 | * matc|h always|
|00005d10| 20 73 75 63 63 65 65 64 | 73 2e 20 49 66 20 74 68 | succeed|s. If th|
|00005d20| 65 20 74 6f 6b 65 6e 20 | 69 73 20 61 20 64 6f 6d |e token |is a dom|
|00005d30| 61 69 6e 20 6e 61 6d 65 | 2c 20 72 65 74 75 72 6e |ain name|, return|
|00005d40| 20 59 45 53 20 69 66 20 | 69 74 0a 58 20 20 20 20 | YES if |it.X |
|00005d50| 20 2a 20 6d 61 74 63 68 | 65 73 20 74 68 65 20 6c | * match|es the l|
|00005d60| 61 73 74 20 66 69 65 6c | 64 73 20 6f 66 20 74 68 |ast fiel|ds of th|
|00005d70| 65 20 73 74 72 69 6e 67 | 2e 20 49 66 20 74 68 65 |e string|. If the|
|00005d80| 20 74 6f 6b 65 6e 20 68 | 61 73 20 74 68 65 20 6d | token h|as the m|
|00005d90| 61 67 69 63 0a 58 20 20 | 20 20 20 2a 20 76 61 6c |agic.X | * val|
|00005da0| 75 65 20 22 4c 4f 43 41 | 4c 22 2c 20 72 65 74 75 |ue "LOCA|L", retu|
|00005db0| 72 6e 20 59 45 53 20 69 | 66 20 74 68 65 20 73 74 |rn YES i|f the st|
|00005dc0| 72 69 6e 67 20 64 6f 65 | 73 20 6e 6f 74 20 63 6f |ring doe|s not co|
|00005dd0| 6e 74 61 69 6e 20 61 20 | 22 2e 22 0a 58 20 20 20 |ntain a |".".X |
|00005de0| 20 20 2a 20 63 68 61 72 | 61 63 74 65 72 2e 20 49 | * char|acter. I|
|00005df0| 66 20 74 68 65 20 74 6f | 6b 65 6e 20 69 73 20 61 |f the to|ken is a|
|00005e00| 20 6e 65 74 77 6f 72 6b | 20 6e 75 6d 62 65 72 2c | network| number,|
|00005e10| 20 72 65 74 75 72 6e 20 | 59 45 53 20 69 66 20 69 | return |YES if i|
|00005e20| 74 20 6d 61 74 63 68 65 | 73 0a 58 20 20 20 20 20 |t matche|s.X |
|00005e30| 2a 20 74 68 65 20 68 65 | 61 64 20 6f 66 20 74 68 |* the he|ad of th|
|00005e40| 65 20 73 74 72 69 6e 67 | 2e 20 49 66 20 74 68 65 |e string|. If the|
|00005e50| 20 74 6f 6b 65 6e 20 6c | 6f 6f 6b 73 20 6c 69 6b | token l|ooks lik|
|00005e60| 65 20 61 20 6e 65 74 67 | 72 6f 75 70 20 6e 61 6d |e a netg|roup nam|
|00005e70| 65 2c 0a 58 20 20 20 20 | 20 2a 20 72 65 74 75 72 |e,.X | * retur|
|00005e80| 6e 20 59 45 53 20 69 66 | 20 74 68 65 20 73 74 72 |n YES if| the str|
|00005e90| 69 6e 67 20 69 73 20 61 | 20 28 68 6f 73 74 29 20 |ing is a| (host) |
|00005ea0| 6d 65 6d 62 65 72 20 6f | 66 20 74 68 65 20 6e 65 |member o|f the ne|
|00005eb0| 74 67 72 6f 75 70 2e 0a | 58 20 20 20 20 20 2a 20 |tgroup..|X * |
|00005ec0| 4f 74 68 65 72 77 69 73 | 65 2c 20 72 65 74 75 72 |Otherwis|e, retur|
|00005ed0| 6e 20 59 45 53 20 69 66 | 20 74 68 65 20 74 6f 6b |n YES if| the tok|
|00005ee0| 65 6e 20 66 75 6c 6c 79 | 20 6d 61 74 63 68 65 73 |en fully| matches|
|00005ef0| 20 74 68 65 20 73 74 72 | 69 6e 67 2e 20 4e 6f 74 | the str|ing. Not|
|00005f00| 65 3a 20 77 65 0a 58 20 | 20 20 20 20 2a 20 61 73 |e: we.X | * as|
|00005f10| 73 75 6d 65 20 74 68 61 | 74 20 61 20 64 61 65 6d |sume tha|t a daem|
|00005f20| 6f 6e 20 70 72 6f 63 65 | 73 73 20 6e 61 6d 65 20 |on proce|ss name |
|00005f30| 6e 65 76 65 72 20 62 65 | 67 69 6e 73 20 6f 72 20 |never be|gins or |
|00005f40| 65 6e 64 73 20 77 69 74 | 68 20 61 20 22 2e 22 20 |ends wit|h a "." |
|00005f50| 6f 72 0a 58 20 20 20 20 | 20 2a 20 22 40 22 20 63 |or.X | * "@" c|
|00005f60| 68 61 72 61 63 74 65 72 | 2e 0a 58 20 20 20 20 20 |haracter|..X |
|00005f70| 2a 2f 0a 58 0a 58 20 20 | 20 20 66 6f 72 20 28 74 |*/.X.X | for (t|
|00005f80| 6f 6b 20 3d 20 73 74 72 | 74 6f 6b 28 6c 69 73 74 |ok = str|tok(list|
|00005f90| 2c 20 73 65 70 29 3b 20 | 74 6f 6b 3b 20 74 6f 6b |, sep); |tok; tok|
|00005fa0| 20 3d 20 73 74 72 74 6f | 6b 28 28 63 68 61 72 20 | = strto|k((char |
|00005fb0| 2a 29 20 30 2c 20 73 65 | 70 29 29 20 7b 0a 58 09 |*) 0, se|p)) {.X.|
|00005fc0| 69 66 20 28 74 6f 6b 5b | 30 5d 20 3d 3d 20 27 2e |if (tok[|0] == '.|
|00005fd0| 27 29 20 7b 09 09 09 2f | 2a 20 64 6f 6d 61 69 6e |') {.../|* domain|
|00005fe0| 3a 20 6d 61 74 63 68 20 | 6c 61 73 74 20 66 69 65 |: match |last fie|
|00005ff0| 6c 64 73 20 2a 2f 0a 58 | 09 20 20 20 20 69 66 20 |lds */.X|. if |
|00006000| 28 28 73 74 72 5f 6c 65 | 6e 20 3d 20 73 74 72 6c |((str_le|n = strl|
|00006010| 65 6e 28 73 74 72 69 6e | 67 29 29 20 3e 20 28 74 |en(strin|g)) > (t|
|00006020| 6f 6b 5f 6c 65 6e 20 3d | 20 73 74 72 6c 65 6e 28 |ok_len =| strlen(|
|00006030| 74 6f 6b 29 29 0a 58 09 | 09 26 26 20 73 74 72 63 |tok)).X.|.&& strc|
|00006040| 61 73 65 63 6d 70 28 74 | 6f 6b 2c 20 73 74 72 69 |asecmp(t|ok, stri|
|00006050| 6e 67 20 2b 20 73 74 72 | 5f 6c 65 6e 20 2d 20 74 |ng + str|_len - t|
|00006060| 6f 6b 5f 6c 65 6e 29 20 | 3d 3d 20 30 29 0a 58 09 |ok_len) |== 0).X.|
|00006070| 09 72 65 74 75 72 6e 20 | 28 59 45 53 29 3b 0a 58 |.return |(YES);.X|
|00006080| 23 69 66 64 65 66 09 4e | 45 54 47 52 4f 55 50 0a |#ifdef.N|ETGROUP.|
|00006090| 58 09 7d 20 65 6c 73 65 | 20 69 66 20 28 74 6f 6b |X.} else| if (tok|
|000060a0| 5b 30 5d 20 3d 3d 20 27 | 40 27 29 20 7b 09 09 2f |[0] == '|@') {../|
|000060b0| 2a 20 6e 65 74 67 72 6f | 75 70 3a 20 6c 6f 6f 6b |* netgro|up: look|
|000060c0| 20 69 74 20 75 70 20 2a | 2f 0a 58 09 20 20 20 20 | it up *|/.X. |
|000060d0| 69 66 20 28 69 6e 6e 65 | 74 67 72 28 74 6f 6b 20 |if (inne|tgr(tok |
|000060e0| 2b 20 31 2c 20 73 74 72 | 69 6e 67 2c 20 28 63 68 |+ 1, str|ing, (ch|
|000060f0| 61 72 20 2a 29 20 30 2c | 20 28 63 68 61 72 20 2a |ar *) 0,| (char *|
|00006100| 29 20 30 29 29 0a 58 09 | 09 72 65 74 75 72 6e 20 |) 0)).X.|.return |
|00006110| 28 59 45 53 29 3b 0a 58 | 23 65 6e 64 69 66 0a 58 |(YES);.X|#endif.X|
|00006120| 09 7d 20 65 6c 73 65 20 | 69 66 20 28 73 74 72 63 |.} else |if (strc|
|00006130| 61 73 65 63 6d 70 28 74 | 6f 6b 2c 20 22 41 4c 4c |asecmp(t|ok, "ALL|
|00006140| 22 29 20 3d 3d 20 30 29 | 20 7b 09 2f 2a 20 61 6c |") == 0)| {./* al|
|00006150| 6c 3a 20 6d 61 74 63 68 | 20 61 6e 79 20 2a 2f 0a |l: match| any */.|
|00006160| 58 09 20 20 20 20 72 65 | 74 75 72 6e 20 28 59 45 |X. re|turn (YE|
|00006170| 53 29 3b 0a 58 09 7d 20 | 65 6c 73 65 20 69 66 20 |S);.X.} |else if |
|00006180| 28 73 74 72 63 61 73 65 | 63 6d 70 28 74 6f 6b 2c |(strcase|cmp(tok,|
|00006190| 20 22 4c 4f 43 41 4c 22 | 29 20 3d 3d 20 30 29 20 | "LOCAL"|) == 0) |
|000061a0| 7b 09 2f 2a 20 6c 6f 63 | 61 6c 3a 20 6e 6f 20 64 |{./* loc|al: no d|
|000061b0| 6f 74 73 20 2a 2f 0a 58 | 09 20 20 20 20 69 66 20 |ots */.X|. if |
|000061c0| 28 73 74 72 63 68 72 28 | 73 74 72 69 6e 67 2c 20 |(strchr(|string, |
|000061d0| 27 2e 27 29 20 3d 3d 20 | 30 29 0a 58 09 09 72 65 |'.') == |0).X..re|
|000061e0| 74 75 72 6e 20 28 59 45 | 53 29 3b 0a 58 09 7d 20 |turn (YE|S);.X.} |
|000061f0| 65 6c 73 65 20 69 66 20 | 28 21 73 74 72 63 61 73 |else if |(!strcas|
|00006200| 65 63 6d 70 28 74 6f 6b | 2c 20 73 74 72 69 6e 67 |ecmp(tok|, string|
|00006210| 29 29 20 7b 09 2f 2a 20 | 6d 61 74 63 68 20 68 6f |)) {./* |match ho|
|00006220| 73 74 20 6e 61 6d 65 20 | 6f 72 20 61 64 64 72 65 |st name |or addre|
|00006230| 73 73 20 2a 2f 0a 58 09 | 20 20 20 20 72 65 74 75 |ss */.X.| retu|
|00006240| 72 6e 20 28 59 45 53 29 | 3b 0a 58 09 7d 20 65 6c |rn (YES)|;.X.} el|
|00006250| 73 65 20 69 66 20 28 74 | 6f 6b 5b 28 74 6f 6b 5f |se if (t|ok[(tok_|
|00006260| 6c 65 6e 20 3d 20 73 74 | 72 6c 65 6e 28 74 6f 6b |len = st|rlen(tok|
|00006270| 29 29 20 2d 20 31 5d 20 | 3d 3d 20 27 2e 27 09 2f |)) - 1] |== '.'./|
|00006280| 2a 20 6e 65 74 20 6e 75 | 6d 62 65 72 20 2a 2f 0a |* net nu|mber */.|
|00006290| 58 09 09 20 20 20 26 26 | 20 73 74 72 6e 63 6d 70 |X.. &&| strncmp|
|000062a0| 28 74 6f 6b 2c 20 73 74 | 72 69 6e 67 2c 20 74 6f |(tok, st|ring, to|
|000062b0| 6b 5f 6c 65 6e 29 20 3d | 3d 20 30 29 20 7b 0a 58 |k_len) =|= 0) {.X|
|000062c0| 09 20 20 20 20 72 65 74 | 75 72 6e 20 28 59 45 53 |. ret|urn (YES|
|000062d0| 29 3b 0a 58 09 7d 0a 58 | 20 20 20 20 7d 0a 58 20 |);.X.}.X| }.X |
|000062e0| 20 20 20 72 65 74 75 72 | 6e 20 28 4e 4f 29 3b 0a | retur|n (NO);.|
|000062f0| 58 7d 0a 58 0a 58 23 65 | 6e 64 69 66 0a 45 4e 44 |X}.X.X#e|ndif.END|
|00006300| 5f 4f 46 5f 68 6f 73 74 | 73 5f 61 63 63 65 73 73 |_OF_host|s_access|
|00006310| 2e 63 0a 69 66 20 74 65 | 73 74 20 34 39 39 32 20 |.c.if te|st 4992 |
|00006320| 2d 6e 65 20 60 77 63 20 | 2d 63 20 3c 68 6f 73 74 |-ne `wc |-c <host|
|00006330| 73 5f 61 63 63 65 73 73 | 2e 63 60 3b 20 74 68 65 |s_access|.c`; the|
|00006340| 6e 0a 20 20 20 20 65 63 | 68 6f 20 73 68 61 72 3a |n. ec|ho shar:|
|00006350| 20 5c 22 68 6f 73 74 73 | 5f 61 63 63 65 73 73 2e | \"hosts|_access.|
|00006360| 63 5c 22 20 75 6e 70 61 | 63 6b 65 64 20 77 69 74 |c\" unpa|cked wit|
|00006370| 68 20 77 72 6f 6e 67 20 | 73 69 7a 65 21 0a 66 69 |h wrong |size!.fi|
|00006380| 0a 23 20 65 6e 64 20 6f | 66 20 6f 76 65 72 77 72 |.# end o|f overwr|
|00006390| 69 74 69 6e 67 20 63 68 | 65 63 6b 0a 66 69 0a 69 |iting ch|eck.fi.i|
|000063a0| 66 20 74 65 73 74 20 2d | 66 20 4d 61 6b 65 66 69 |f test -|f Makefi|
|000063b0| 6c 65 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |le -a "$|{1}" != |
|000063c0| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|000063d0| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|000063e0| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|000063f0| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 5c 22 4d 61 |isting f|ile \"Ma|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.