home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / net / pathcprune < prev    next >
Mailbox/MIME Entity  |  1987-03-06  |  18.5 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file Mailbox text, 1st line "From matt@ncr-sd.UUCP Fri Mar 6 20:49:31 1987", ASCII text default
100% TrID E-Mail message (Var. 2) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried x-fmt/111 Plain Text File default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime application/mbox default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 6d 61 74 | 74 40 6e 63 72 2d 73 64 |From mat|t@ncr-sd|
|00000010| 2e 55 55 43 50 20 46 72 | 69 20 4d 61 72 20 20 36 |.UUCP Fr|i Mar 6|
|00000020| 20 32 30 3a 34 39 3a 33 | 31 20 31 39 38 37 0a 50 | 20:49:3|1 1987.P|
|00000030| 61 74 68 3a 20 62 65 6e | 6f 21 73 65 69 73 6d 6f |ath: ben|o!seismo|
|00000040| 21 6c 6c 6c 2d 6c 63 63 | 21 70 74 73 66 61 21 69 |!lll-lcc|!ptsfa!i|
|00000050| 68 6e 70 34 21 6e 63 72 | 2d 73 64 21 6d 61 74 74 |hnp4!ncr|-sd!matt|
|00000060| 0a 46 72 6f 6d 3a 20 6d | 61 74 74 40 6e 63 72 2d |.From: m|att@ncr-|
|00000070| 73 64 2e 53 61 6e 44 69 | 65 67 6f 2e 4e 43 52 2e |sd.SanDi|ego.NCR.|
|00000080| 43 4f 4d 20 28 4d 61 74 | 74 20 43 6f 73 74 65 6c |COM (Mat|t Costel|
|00000090| 6c 6f 29 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |lo).News|groups: |
|000000a0| 6e 65 74 2e 73 6f 75 72 | 63 65 73 0a 53 75 62 6a |net.sour|ces.Subj|
|000000b0| 65 63 74 3a 20 50 61 74 | 68 70 72 75 6e 65 20 28 |ect: Pat|hprune (|
|000000c0| 74 6f 20 73 68 6f 72 74 | 65 6e 20 70 61 74 68 61 |to short|en patha|
|000000d0| 6c 69 61 73 20 66 69 6c | 65 73 29 0a 4b 65 79 77 |lias fil|es).Keyw|
|000000e0| 6f 72 64 73 3a 20 70 61 | 74 68 61 6c 69 61 73 20 |ords: pa|thalias |
|000000f0| 70 61 74 68 70 72 75 6e | 65 0a 4d 65 73 73 61 67 |pathprun|e.Messag|
|00000100| 65 2d 49 44 3a 20 3c 31 | 34 31 31 40 6e 63 72 2d |e-ID: <1|411@ncr-|
|00000110| 73 64 2e 53 61 6e 44 69 | 65 67 6f 2e 4e 43 52 2e |sd.SanDi|ego.NCR.|
|00000120| 43 4f 4d 3e 0a 44 61 74 | 65 3a 20 37 20 4d 61 72 |COM>.Dat|e: 7 Mar|
|00000130| 20 38 37 20 30 31 3a 34 | 39 3a 33 31 20 47 4d 54 | 87 01:4|9:31 GMT|
|00000140| 0a 52 65 70 6c 79 2d 54 | 6f 3a 20 6d 61 74 74 40 |.Reply-T|o: matt@|
|00000150| 6e 63 72 2d 73 64 2e 55 | 55 43 50 20 28 4d 61 74 |ncr-sd.U|UCP (Mat|
|00000160| 74 20 43 6f 73 74 65 6c | 6c 6f 29 0a 46 6f 6c 6c |t Costel|lo).Foll|
|00000170| 6f 77 75 70 2d 54 6f 3a | 20 63 6f 6d 70 2e 73 6f |owup-To:| comp.so|
|00000180| 75 72 63 65 73 2e 64 0a | 44 69 73 74 72 69 62 75 |urces.d.|Distribu|
|00000190| 74 69 6f 6e 3a 20 77 6f | 72 6c 64 0a 4f 72 67 61 |tion: wo|rld.Orga|
|000001a0| 6e 69 7a 61 74 69 6f 6e | 3a 20 4e 43 52 20 43 6f |nization|: NCR Co|
|000001b0| 72 70 6f 72 61 74 69 6f | 6e 2c 20 52 61 6e 63 68 |rporatio|n, Ranch|
|000001c0| 6f 20 42 65 72 6e 61 72 | 64 6f 0a 4c 69 6e 65 73 |o Bernar|do.Lines|
|000001d0| 3a 20 36 37 35 0a 0a 3a | 09 73 68 61 72 3a 09 53 |: 675..:|.shar:.S|
|000001e0| 68 65 6c 6c 20 41 72 63 | 68 69 76 65 72 0a 23 20 |hell Arc|hiver.# |
|000001f0| 52 75 6e 20 74 68 69 73 | 20 74 65 78 74 20 77 69 |Run this| text wi|
|00000200| 74 68 20 2f 62 69 6e 2f | 73 68 20 74 6f 20 63 72 |th /bin/|sh to cr|
|00000210| 65 61 74 65 3a 0a 23 09 | 52 45 41 44 4d 45 0a 23 |eate:.#.|README.#|
|00000220| 09 70 61 74 68 70 72 75 | 6e 65 2e 31 0a 23 09 70 |.pathpru|ne.1.#.p|
|00000230| 61 74 68 70 72 75 6e 65 | 2e 63 0a 0a 73 65 64 20 |athprune|.c..sed |
|00000240| 27 73 2f 5e 58 2f 2f 27 | 20 3c 3c 27 53 48 41 52 |'s/^X//'| <<'SHAR|
|00000250| 5f 45 4f 46 27 20 3e 52 | 45 41 44 4d 45 3b 20 63 |_EOF' >R|EADME; c|
|00000260| 68 6d 6f 64 20 36 34 34 | 20 52 45 41 44 4d 45 0a |hmod 644| README.|
|00000270| 58 48 65 72 65 20 69 73 | 20 61 20 70 72 6f 67 72 |XHere is| a progr|
|00000280| 61 6d 20 74 6f 20 6d 61 | 6b 65 20 79 6f 75 72 20 |am to ma|ke your |
|00000290| 70 61 74 68 73 20 66 69 | 6c 65 20 28 66 72 6f 6d |paths fi|le (from|
|000002a0| 20 70 61 74 68 61 6c 69 | 61 73 29 20 73 6d 61 6c | pathali|as) smal|
|000002b0| 6c 65 72 0a 58 62 79 20 | 72 65 6d 6f 76 69 6e 67 |ler.Xby |removing|
|000002c0| 20 72 65 64 75 6e 64 61 | 6e 74 20 65 6e 74 72 69 | redunda|nt entri|
|000002d0| 65 73 2e 20 20 49 20 77 | 72 6f 74 65 20 69 74 20 |es. I w|rote it |
|000002e0| 62 65 63 61 75 73 65 20 | 77 65 20 63 75 72 72 65 |because |we curre|
|000002f0| 6e 74 6c 79 0a 58 63 72 | 65 61 74 65 20 74 77 6f |ntly.Xcr|eate two|
|00000300| 20 64 69 66 66 65 72 65 | 6e 74 20 70 61 74 68 73 | differe|nt paths|
|00000310| 20 66 69 6c 65 73 20 66 | 6f 72 20 74 68 65 20 73 | files f|or the s|
|00000320| 79 73 74 65 6d 73 20 69 | 6e 20 6f 75 72 20 64 6f |ystems i|n our do|
|00000330| 6d 61 69 6e 2e 0a 58 4d | 6f 73 74 20 73 79 73 74 |main..XM|ost syst|
|00000340| 65 6d 73 20 67 65 74 20 | 61 20 66 69 6c 65 20 63 |ems get |a file c|
|00000350| 6f 6e 74 61 69 6e 69 6e | 67 20 6f 6e 6c 79 20 74 |ontainin|g only t|
|00000360| 68 65 20 68 6f 73 74 73 | 20 77 69 74 68 69 6e 20 |he hosts| within |
|00000370| 74 68 65 20 64 6f 6d 61 | 69 6e 2c 0a 58 77 68 69 |the doma|in,.Xwhi|
|00000380| 6c 65 20 74 68 65 20 64 | 6f 6d 61 69 6e 20 67 61 |le the d|omain ga|
|00000390| 74 65 77 61 79 28 73 29 | 20 67 65 74 20 74 68 65 |teway(s)| get the|
|000003a0| 20 66 75 6c 6c 20 64 61 | 74 61 62 61 73 65 20 64 | full da|tabase d|
|000003b0| 69 73 74 72 69 62 75 74 | 65 64 20 69 6e 0a 58 74 |istribut|ed in.Xt|
|000003c0| 68 65 20 6e 65 77 73 67 | 72 6f 75 70 73 20 6d 6f |he newsg|roups mo|
|000003d0| 64 2e 6d 61 70 20 61 6e | 64 20 6e 63 72 2e 6d 61 |d.map an|d ncr.ma|
|000003e0| 70 73 2e 20 20 54 68 65 | 20 6c 61 72 67 65 20 70 |ps. The| large p|
|000003f0| 61 74 68 73 20 66 69 6c | 65 20 69 73 20 74 6f 6f |aths fil|e is too|
|00000400| 0a 58 6c 61 72 67 65 20 | 28 7e 35 30 30 6b 29 20 |.Xlarge |(~500k) |
|00000410| 74 6f 20 77 61 6e 74 20 | 74 6f 20 73 68 69 70 20 |to want |to ship |
|00000420| 61 6c 6c 20 6f 76 65 72 | 2e 20 20 50 61 74 68 70 |all over|. Pathp|
|00000430| 72 75 6e 65 20 63 61 6e | 20 6f 66 74 65 6e 20 72 |rune can| often r|
|00000440| 65 6d 6f 76 65 0a 58 65 | 6e 6f 75 67 68 20 6f 66 |emove.Xe|nough of|
|00000450| 20 61 20 70 61 74 68 73 | 20 66 69 6c 65 20 74 6f | a paths| file to|
|00000460| 20 6d 61 6b 65 20 74 72 | 61 6e 73 6d 69 73 73 69 | make tr|ansmissi|
|00000470| 6f 6e 20 6f 66 20 69 74 | 20 75 73 69 6e 67 20 75 |on of it| using u|
|00000480| 75 63 70 20 66 65 61 73 | 69 62 6c 65 2e 0a 58 0a |ucp feas|ible..X.|
|00000490| 58 0a 58 54 68 65 20 74 | 77 6f 20 74 61 62 6c 65 |X.XThe t|wo table|
|000004a0| 73 20 68 65 72 65 20 73 | 68 6f 77 20 74 68 65 20 |s here s|how the |
|000004b0| 61 63 74 75 61 6c 20 63 | 6f 6d 70 72 65 73 73 69 |actual c|ompressi|
|000004c0| 6f 6e 20 6f 6e 20 74 77 | 6f 20 64 69 66 66 65 72 |on on tw|o differ|
|000004d0| 65 6e 74 20 73 79 73 74 | 65 6d 73 2c 0a 58 77 69 |ent syst|ems,.Xwi|
|000004e0| 74 68 20 74 68 65 20 70 | 61 74 68 61 6c 69 61 73 |th the p|athalias|
|000004f0| 20 65 6e 74 72 69 65 73 | 20 62 72 6f 6b 65 6e 20 | entries| broken |
|00000500| 64 6f 77 6e 20 69 6e 74 | 6f 20 74 68 72 65 65 20 |down int|o three |
|00000510| 74 79 70 65 73 3a 0a 58 | 09 67 61 74 65 77 61 79 |types:.X|.gateway|
|00000520| 09 09 64 6f 6d 61 69 6e | 20 67 61 74 65 77 61 79 |..domain| gateway|
|00000530| 20 65 6e 74 72 79 20 28 | 73 74 61 72 74 73 20 77 | entry (|starts w|
|00000540| 69 74 68 20 61 20 27 2e | 27 29 0a 58 09 64 6f 6d |ith a '.|').X.dom|
|00000550| 61 69 6e 09 09 68 6f 73 | 74 20 62 65 6c 6f 6e 67 |ain..hos|t belong|
|00000560| 73 20 74 6f 20 61 20 64 | 6f 6d 61 69 6e 20 28 68 |s to a d|omain (h|
|00000570| 6f 73 74 20 68 61 73 20 | 61 20 27 2e 27 20 69 6e |ost has |a '.' in|
|00000580| 20 69 74 29 0a 58 09 68 | 6f 73 74 09 09 73 69 6d | it).X.h|ost..sim|
|00000590| 70 6c 65 20 68 6f 73 74 | 20 6e 61 6d 65 20 28 69 |ple host| name (i|
|000005a0| 6e 20 74 68 65 20 2e 75 | 75 63 70 20 64 6f 6d 61 |n the .u|ucp doma|
|000005b0| 69 6e 29 0a 58 0a 58 54 | 68 65 20 6e 75 6d 62 65 |in).X.XT|he numbe|
|000005c0| 72 73 20 6c 69 73 74 65 | 64 20 61 72 65 20 74 68 |rs liste|d are th|
|000005d0| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 6c 69 6e 65 |e number| of line|
|000005e0| 73 20 61 6e 64 20 70 65 | 72 63 65 6e 74 61 67 65 |s and pe|rcentage|
|000005f0| 20 6f 66 20 6f 72 69 67 | 69 6e 61 6c 0a 58 6c 69 | of orig|inal.Xli|
|00000600| 6e 65 73 2e 20 20 54 68 | 65 20 22 64 6f 6d 61 69 |nes. Th|e "domai|
|00000610| 6e 22 20 76 61 6c 75 65 | 73 20 61 72 65 20 73 6c |n" value|s are sl|
|00000620| 69 67 68 74 6c 79 20 73 | 6b 65 77 65 64 20 62 65 |ightly s|kewed be|
|00000630| 63 61 75 73 65 20 42 65 | 72 6b 65 6c 65 79 20 6c |cause Be|rkeley l|
|00000640| 69 73 74 73 0a 58 33 34 | 34 20 68 6f 73 74 73 20 |ists.X34|4 hosts |
|00000650| 69 6e 20 74 68 65 20 62 | 65 72 6b 65 6c 65 79 2e |in the b|erkeley.|
|00000660| 65 64 75 20 64 6f 6d 61 | 69 6e 20 77 69 74 68 6f |edu doma|in witho|
|00000670| 75 74 20 61 6e 79 20 64 | 6f 6d 61 69 6e 20 67 61 |ut any d|omain ga|
|00000680| 74 65 77 61 79 2e 0a 58 | 0a 58 66 6f 72 20 6e 63 |teway..X|.Xfor nc|
|00000690| 72 2d 73 64 20 28 64 6f | 6d 61 69 6e 20 67 61 74 |r-sd (do|main gat|
|000006a0| 65 77 61 79 29 0a 58 20 | 20 20 20 20 20 20 20 20 |eway).X | |
|000006b0| 20 20 20 6f 72 69 67 20 | 20 20 20 20 20 20 20 2d | orig | -|
|000006c0| 76 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2d |v | -|
|000006d0| 76 74 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2d |vt | -|
|000006e0| 76 75 74 0a 58 67 61 74 | 65 77 61 79 20 20 20 20 |vut.Xgat|eway |
|000006f0| 20 20 31 39 39 20 20 20 | 20 20 31 32 38 20 20 30 | 199 | 128 0|
|00000700| 2e 36 34 20 20 20 20 20 | 20 20 31 32 34 20 20 30 |.64 | 124 0|
|00000710| 2e 36 32 20 20 20 20 20 | 20 20 31 32 34 20 20 30 |.62 | 124 0|
|00000720| 2e 36 32 0a 58 64 6f 6d | 61 69 6e 20 20 20 20 20 |.62.Xdom|ain |
|00000730| 20 31 35 34 30 20 20 20 | 20 20 36 35 32 20 20 30 | 1540 | 652 0|
|00000740| 2e 34 32 20 20 20 20 20 | 20 20 36 35 32 20 20 30 |.42 | 652 0|
|00000750| 2e 34 32 20 20 20 20 20 | 20 20 36 35 32 20 20 30 |.42 | 652 0|
|00000760| 2e 34 32 0a 58 68 6f 73 | 74 20 20 20 20 20 20 20 |.42.Xhos|t |
|00000770| 20 38 35 31 35 20 20 20 | 20 38 35 31 35 20 20 31 | 8515 | 8515 1|
|00000780| 2e 30 30 20 20 20 20 20 | 20 38 35 31 35 20 20 31 |.00 | 8515 1|
|00000790| 2e 30 30 20 20 20 20 20 | 20 38 35 31 35 20 20 31 |.00 | 8515 1|
|000007a0| 2e 30 30 0a 58 74 6f 74 | 61 6c 20 20 20 20 20 20 |.00.Xtot|al |
|000007b0| 31 30 32 35 34 20 20 20 | 20 39 32 39 35 20 20 30 |10254 | 9295 0|
|000007c0| 2e 39 31 20 20 20 20 20 | 20 39 32 39 31 20 20 30 |.91 | 9291 0|
|000007d0| 2e 39 31 20 20 20 20 20 | 20 39 32 39 31 20 20 30 |.91 | 9291 0|
|000007e0| 2e 39 31 0a 58 0a 58 66 | 6f 72 20 73 65 2d 73 64 |.91.X.Xf|or se-sd|
|000007f0| 20 28 69 6e 74 65 72 6e | 61 6c 20 6e 6f 64 65 29 | (intern|al node)|
|00000800| 0a 58 20 20 20 20 20 20 | 20 20 20 20 20 20 6f 72 |.X | or|
|00000810| 69 67 20 20 20 20 20 20 | 20 20 2d 76 20 20 20 20 |ig | -v |
|00000820| 20 20 20 20 20 20 20 20 | 20 20 2d 76 74 20 20 20 | | -vt |
|00000830| 20 20 20 20 20 20 20 20 | 20 20 2d 76 75 74 0a 58 | | -vut.X|
|00000840| 67 61 74 65 77 61 79 20 | 20 20 20 20 20 31 39 39 |gateway | 199|
|00000850| 20 20 20 20 20 31 32 34 | 20 20 30 2e 36 32 20 20 | 124| 0.62 |
|00000860| 20 20 20 20 20 31 32 30 | 20 20 30 2e 36 30 20 20 | 120| 0.60 |
|00000870| 20 20 20 20 20 31 32 30 | 20 20 30 2e 36 30 0a 58 | 120| 0.60.X|
|00000880| 64 6f 6d 61 69 6e 20 20 | 20 20 20 20 31 35 34 30 |domain | 1540|
|00000890| 20 20 20 20 20 36 32 33 | 20 20 30 2e 34 30 20 20 | 623| 0.40 |
|000008a0| 20 20 20 20 20 36 32 33 | 20 20 30 2e 34 30 20 20 | 623| 0.40 |
|000008b0| 20 20 20 20 20 36 32 33 | 20 20 30 2e 34 30 0a 58 | 623| 0.40.X|
|000008c0| 68 6f 73 74 20 20 20 20 | 20 20 20 20 38 35 31 35 |host | 8515|
|000008d0| 20 20 20 20 38 35 31 35 | 20 20 31 2e 30 30 20 20 | 8515| 1.00 |
|000008e0| 20 20 20 20 38 35 31 35 | 20 20 31 2e 30 30 20 20 | 8515| 1.00 |
|000008f0| 20 20 20 20 20 20 20 32 | 20 20 30 2e 30 30 0a 58 | 2| 0.00.X|
|00000900| 74 6f 74 61 6c 20 20 20 | 20 20 20 31 30 32 35 34 |total | 10254|
|00000910| 20 20 20 20 39 32 36 32 | 20 20 30 2e 39 30 20 20 | 9262| 0.90 |
|00000920| 20 20 20 20 39 32 35 38 | 20 20 30 2e 39 30 20 20 | 9258| 0.90 |
|00000930| 20 20 20 20 20 37 34 35 | 20 20 30 2e 30 37 0a 58 | 745| 0.07.X|
|00000940| 0a 58 0a 58 54 68 65 20 | 70 72 6f 67 72 61 6d 20 |.X.XThe |program |
|00000950| 77 69 6c 6c 20 63 6f 6d | 70 69 6c 65 20 75 6e 64 |will com|pile und|
|00000960| 65 72 20 62 6f 74 68 20 | 53 59 53 56 20 61 6e 64 |er both |SYSV and|
|00000970| 20 42 53 44 34 2e 32 2c | 20 61 6e 64 20 77 69 6c | BSD4.2,| and wil|
|00000980| 6c 0a 58 73 68 6f 75 6c | 64 20 61 6c 73 6f 20 63 |l.Xshoul|d also c|
|00000990| 6f 6d 70 69 6c 65 20 75 | 6e 64 65 72 20 56 37 2e |ompile u|nder V7.|
|000009a0| 20 20 53 65 65 20 74 68 | 65 20 62 65 67 69 6e 6e | See th|e beginn|
|000009b0| 69 6e 67 20 6f 66 20 74 | 68 65 20 73 6f 75 72 63 |ing of t|he sourc|
|000009c0| 65 0a 58 66 69 6c 65 20 | 66 6f 72 20 63 6f 6d 70 |e.Xfile |for comp|
|000009d0| 69 6c 61 74 69 6f 6e 20 | 69 6e 73 74 72 75 63 74 |ilation |instruct|
|000009e0| 69 6f 6e 73 2e 20 20 49 | 74 20 64 6f 65 73 20 75 |ions. I|t does u|
|000009f0| 73 65 20 67 65 74 6f 70 | 74 28 33 29 2e 0a 53 48 |se getop|t(3)..SH|
|00000a00| 41 52 5f 45 4f 46 0a 73 | 65 64 20 27 73 2f 5e 58 |AR_EOF.s|ed 's/^X|
|00000a10| 2f 2f 27 20 3c 3c 27 53 | 48 41 52 5f 45 4f 46 27 |//' <<'S|HAR_EOF'|
|00000a20| 20 3e 70 61 74 68 70 72 | 75 6e 65 2e 31 3b 20 63 | >pathpr|une.1; c|
|00000a30| 68 6d 6f 64 20 36 34 34 | 20 70 61 74 68 70 72 75 |hmod 644| pathpru|
|00000a40| 6e 65 2e 31 0a 58 2e 5c | 22 20 40 28 23 29 70 61 |ne.1.X.\|" @(#)pa|
|00000a50| 74 68 70 72 75 6e 65 2e | 31 09 6d 61 74 74 2e 63 |thprune.|1.matt.c|
|00000a60| 6f 73 74 65 6c 6c 6f 40 | 73 61 6e 64 69 65 67 6f |ostello@|sandiego|
|00000a70| 2e 6e 63 72 2e 63 6f 6d | 20 38 37 2f 30 33 2f 30 |.ncr.com| 87/03/0|
|00000a80| 36 0a 58 2e 54 48 20 50 | 41 54 48 50 52 55 4e 45 |6.X.TH P|ATHPRUNE|
|00000a90| 20 31 20 0a 58 2e 53 48 | 20 4e 41 4d 45 0a 58 70 | 1 .X.SH| NAME.Xp|
|00000aa0| 61 74 68 70 72 75 6e 65 | 20 5c 2d 20 70 72 75 6e |athprune| \- prun|
|00000ab0| 65 20 75 6e 6e 65 63 65 | 73 73 61 72 79 20 65 6e |e unnece|ssary en|
|00000ac0| 74 72 69 65 73 20 69 6e | 20 70 61 74 68 61 6c 69 |tries in| pathali|
|00000ad0| 61 73 20 64 61 74 61 62 | 61 73 65 0a 58 2e 53 48 |as datab|ase.X.SH|
|00000ae0| 20 53 59 4e 4f 50 53 49 | 53 0a 58 2e 42 20 70 61 | SYNOPSI|S.X.B pa|
|00000af0| 74 68 70 72 75 6e 65 0a | 58 5b 0a 58 2e 42 20 5c |thprune.|X[.X.B \|
|00000b00| 2d 76 75 74 6a 0a 58 5d | 20 5b 0a 58 2e 42 49 20 |-vutj.X]| [.X.BI |
|00000b10| 5c 2d 64 20 5c 30 64 6f | 6d 61 69 6e 0a 58 5d 20 |\-d \0do|main.X] |
|00000b20| 5b 0a 58 2e 42 49 20 5c | 2d 68 20 5c 30 64 6f 6d |[.X.BI \|-h \0dom|
|00000b30| 61 69 6e 0a 58 5d 20 5b | 0a 58 2e 42 49 20 5c 2d |ain.X] [|.X.BI \-|
|00000b40| 72 20 5c 30 64 6f 6d 61 | 69 6e 0a 58 5d 20 5b 0a |r \0doma|in.X] [.|
|00000b50| 58 2e 49 20 69 6e 66 69 | 6c 65 0a 58 5b 0a 58 2e |X.I infi|le.X[.X.|
|00000b60| 49 20 6f 75 74 66 69 6c | 65 0a 58 5d 20 5d 0a 58 |I outfil|e.X] ].X|
|00000b70| 2e 61 64 20 62 0a 58 2e | 53 48 20 44 45 53 43 52 |.ad b.X.|SH DESCR|
|00000b80| 49 50 54 49 4f 4e 0a 58 | 2e 49 20 50 61 74 68 70 |IPTION.X|.I Pathp|
|00000b90| 72 75 6e 65 0a 58 70 72 | 75 6e 65 73 20 75 6e 6e |rune.Xpr|unes unn|
|00000ba0| 65 63 65 73 73 61 72 79 | 20 65 6e 74 72 69 65 73 |ecessary| entries|
|00000bb0| 20 66 72 6f 6d 20 61 20 | 73 6f 72 74 65 64 20 5c | from a |sorted \|
|00000bc0| 66 49 70 61 74 68 61 6c | 69 61 73 5c 66 52 28 31 |fIpathal|ias\fR(1|
|00000bd0| 29 20 64 61 74 61 62 61 | 73 65 2e 0a 58 49 74 20 |) databa|se..XIt |
|00000be0| 64 6f 65 73 20 74 68 69 | 73 20 62 79 20 72 65 61 |does thi|s by rea|
|00000bf0| 64 69 6e 67 20 61 20 73 | 6f 72 74 65 64 20 64 61 |ding a s|orted da|
|00000c00| 74 61 62 61 73 65 20 61 | 6e 64 20 74 68 65 6e 20 |tabase a|nd then |
|00000c10| 77 72 69 74 69 6e 67 20 | 6f 75 74 20 61 0a 58 73 |writing |out a.Xs|
|00000c20| 6d 61 6c 6c 65 72 20 6f | 6e 65 2e 20 20 49 74 20 |maller o|ne. It |
|00000c30| 70 72 65 73 65 72 76 65 | 73 20 74 68 65 20 6f 72 |preserve|s the or|
|00000c40| 69 67 69 6e 61 6c 20 73 | 6f 72 74 65 64 20 6f 72 |iginal s|orted or|
|00000c50| 64 65 72 2e 0a 58 2e 50 | 50 0a 58 41 6e 79 20 73 |der..X.P|P.XAny s|
|00000c60| 75 62 64 6f 6d 61 69 6e | 20 67 61 74 65 77 61 79 |ubdomain| gateway|
|00000c70| 20 77 68 6f 73 65 20 70 | 61 74 68 20 69 73 20 74 | whose p|ath is t|
|00000c80| 68 65 20 73 61 6d 65 20 | 61 73 20 74 68 65 20 70 |he same |as the p|
|00000c90| 61 72 65 6e 74 20 64 6f | 6d 61 69 6e 0a 58 67 61 |arent do|main.Xga|
|00000ca0| 74 65 77 61 79 20 69 73 | 20 75 6e 6e 65 63 65 73 |teway is| unneces|
|00000cb0| 73 61 72 79 2e 20 20 54 | 68 65 20 73 75 62 64 6f |sary. T|he subdo|
|00000cc0| 6d 61 69 6e 20 67 61 74 | 65 77 61 79 20 69 73 20 |main gat|eway is |
|00000cd0| 61 6c 73 6f 20 75 6e 6e | 65 63 65 73 73 61 72 79 |also unn|ecessary|
|00000ce0| 20 69 66 0a 58 69 74 73 | 20 70 61 74 68 20 70 61 | if.Xits| path pa|
|00000cf0| 73 73 65 73 20 74 68 72 | 6f 75 67 68 20 74 68 65 |sses thr|ough the|
|00000d00| 20 70 61 72 65 6e 74 20 | 64 6f 6d 61 69 6e 20 67 | parent |domain g|
|00000d10| 61 74 65 77 61 79 2e 20 | 20 54 68 69 73 20 69 73 |ateway. | This is|
|00000d20| 20 73 75 62 6a 65 63 74 | 0a 58 74 6f 20 6f 6e 65 | subject|.Xto one|
|00000d30| 20 76 65 72 79 20 69 6d | 70 6f 72 74 61 6e 74 20 | very im|portant |
|00000d40| 72 75 6c 65 3b 20 69 66 | 20 74 68 65 20 70 61 74 |rule; if| the pat|
|00000d50| 68 20 69 73 20 5c 66 42 | 25 73 5c 66 52 20 74 68 |h is \fB|%s\fR th|
|00000d60| 65 6e 20 74 68 65 20 64 | 6f 6d 61 69 6e 20 67 61 |en the d|omain ga|
|00000d70| 74 65 77 61 79 0a 58 69 | 73 20 61 6c 77 61 79 73 |teway.Xi|s always|
|00000d80| 20 6e 65 63 65 73 73 61 | 72 79 2e 20 20 54 68 69 | necessa|ry. Thi|
|00000d90| 73 20 72 75 6c 65 20 61 | 6c 6c 6f 77 73 20 74 68 |s rule a|llows th|
|00000da0| 65 20 6c 6f 63 61 6c 20 | 6d 61 69 6c 65 72 20 74 |e local |mailer t|
|00000db0| 6f 20 64 65 74 65 63 74 | 20 69 6e 76 61 6c 69 64 |o detect| invalid|
|00000dc0| 0a 58 68 6f 73 74 73 20 | 69 6e 20 74 68 65 20 64 |.Xhosts |in the d|
|00000dd0| 6f 6d 61 69 6e 73 20 66 | 6f 72 20 77 68 69 63 68 |omains f|or which|
|00000de0| 20 69 74 20 69 73 20 61 | 20 67 61 74 65 77 61 79 | it is a| gateway|
|00000df0| 2e 0a 58 2e 50 50 0a 58 | 41 20 68 6f 73 74 20 65 |..X.PP.X|A host e|
|00000e00| 6e 74 72 79 20 69 73 20 | 75 6e 6e 65 63 65 73 73 |ntry is |unnecess|
|00000e10| 61 72 79 20 69 66 20 69 | 74 73 20 70 61 74 68 20 |ary if i|ts path |
|00000e20| 61 72 72 69 76 65 73 20 | 61 74 20 6f 72 20 70 61 |arrives |at or pa|
|00000e30| 73 73 65 73 20 74 68 72 | 6f 75 67 68 0a 58 74 68 |sses thr|ough.Xth|
|00000e40| 65 20 63 6f 72 72 65 73 | 70 6f 6e 64 69 6e 67 20 |e corres|ponding |
|00000e50| 64 6f 6d 61 69 6e 20 67 | 61 74 65 77 61 79 20 65 |domain g|ateway e|
|00000e60| 6e 74 72 79 2e 20 20 46 | 6f 72 20 73 69 6d 70 6c |ntry. F|or simpl|
|00000e70| 65 20 68 6f 73 74 20 6e | 61 6d 65 73 20 74 68 69 |e host n|ames thi|
|00000e80| 73 20 69 73 20 74 68 65 | 0a 58 70 73 65 75 64 6f |s is the|.Xpseudo|
|00000e90| 2d 64 6f 6d 61 69 6e 20 | 22 2e 75 75 63 70 22 2e |-domain |".uucp".|
|00000ea0| 0a 58 2e 50 50 0a 58 54 | 68 69 73 20 63 61 6e 20 |.X.PP.XT|his can |
|00000eb0| 6d 6f 72 65 20 65 61 73 | 69 6c 79 20 65 78 70 6c |more eas|ily expl|
|00000ec0| 61 69 6e 65 64 20 62 79 | 20 65 78 61 6d 70 6c 65 |ained by| example|
|00000ed0| 2e 20 20 41 73 73 75 6d | 65 20 74 68 65 20 69 6e |. Assum|e the in|
|00000ee0| 70 75 74 20 6f 66 3a 0a | 58 2e 74 72 20 7e 2e 0a |put of:.|X.tr ~..|
|00000ef0| 58 2e 52 53 0a 58 2e 6e | 66 0a 58 7e 63 6f 6d 09 |X.RS.X.n|f.X~com.|
|00000f00| 09 09 6e 63 72 2d 73 64 | 21 73 63 75 62 65 64 21 |..ncr-sd|!scubed!|
|00000f10| 73 65 69 73 6d 6f 21 25 | 73 0a 58 7e 6e 63 72 2e |seismo!%|s.X~ncr.|
|00000f20| 63 6f 6d 09 09 6e 63 72 | 2d 73 64 21 25 73 0a 58 |com..ncr|-sd!%s.X|
|00000f30| 7e 73 61 6e 64 69 65 67 | 6f 2e 6e 63 72 2e 63 6f |~sandieg|o.ncr.co|
|00000f40| 6d 09 6e 63 72 2d 73 64 | 21 25 73 0a 58 7e 6f 74 |m.ncr-sd|!%s.X~ot|
|00000f50| 68 65 72 09 09 09 6e 63 | 72 2d 73 64 21 25 73 0a |her...nc|r-sd!%s.|
|00000f60| 58 7e 75 75 63 70 09 09 | 09 6e 63 72 2d 73 64 21 |X~uucp..|.ncr-sd!|
|00000f70| 25 73 0a 58 66 61 6c 73 | 74 61 66 2e 73 61 6e 64 |%s.Xfals|taf.sand|
|00000f80| 69 65 67 6f 2e 6e 63 72 | 2e 63 6f 6d 09 6e 63 72 |iego.ncr|.com.ncr|
|00000f90| 2d 73 64 21 66 61 6c 73 | 74 61 66 21 25 73 0a 58 |-sd!fals|taf!%s.X|
|00000fa0| 6e 63 72 2d 73 64 2e 73 | 61 6e 64 69 65 67 6f 2e |ncr-sd.s|andiego.|
|00000fb0| 6e 63 72 2e 63 6f 6d 09 | 6e 63 72 2d 73 64 21 25 |ncr.com.|ncr-sd!%|
|00000fc0| 73 0a 58 73 65 2d 73 64 | 2e 73 61 6e 64 69 65 67 |s.Xse-sd|.sandieg|
|00000fd0| 6f 2e 6e 63 72 2e 63 6f | 6d 09 25 73 0a 58 74 6f |o.ncr.co|m.%s.Xto|
|00000fe0| 77 65 72 35 2e 73 61 6e | 64 69 65 67 6f 2e 6e 63 |wer5.san|diego.nc|
|00000ff0| 72 2e 63 6f 6d 09 74 6f | 77 65 72 35 21 25 73 0a |r.com.to|wer5!%s.|
|00001000| 58 2e 66 69 0a 58 2e 52 | 45 0a 58 41 66 74 65 72 |X.fi.X.R|E.XAfter|
|00001010| 20 70 72 6f 63 65 73 73 | 69 6e 67 2c 20 74 68 65 | process|ing, the|
|00001020| 20 6f 75 74 70 75 74 20 | 77 69 6c 6c 20 62 65 3a | output |will be:|
|00001030| 0a 58 2e 52 53 0a 58 2e | 6e 66 0a 58 7e 63 6f 6d |.X.RS.X.|nf.X~com|
|00001040| 09 09 09 6e 63 72 2d 73 | 64 21 73 63 75 62 65 64 |...ncr-s|d!scubed|
|00001050| 21 73 65 69 73 6d 6f 21 | 25 73 0a 58 7e 6e 63 72 |!seismo!|%s.X~ncr|
|00001060| 2e 63 6f 6d 09 09 6e 63 | 72 2d 73 64 21 25 73 0a |.com..nc|r-sd!%s.|
|00001070| 58 7e 6f 74 68 65 72 09 | 09 09 6e 63 72 2d 73 64 |X~other.|..ncr-sd|
|00001080| 21 25 73 0a 58 7e 75 75 | 63 70 09 09 09 6e 63 72 |!%s.X~uu|cp...ncr|
|00001090| 2d 73 64 21 25 73 0a 58 | 73 65 2d 73 64 2e 73 61 |-sd!%s.X|se-sd.sa|
|000010a0| 6e 64 69 65 67 6f 2e 6e | 63 72 2e 63 6f 6d 09 25 |ndiego.n|cr.com.%|
|000010b0| 73 0a 58 74 6f 77 65 72 | 35 2e 73 61 6e 64 69 65 |s.Xtower|5.sandie|
|000010c0| 67 6f 2e 6e 63 72 2e 63 | 6f 6d 09 74 6f 77 65 72 |go.ncr.c|om.tower|
|000010d0| 35 21 25 73 0a 58 2e 66 | 69 0a 58 2e 52 45 0a 58 |5!%s.X.f|i.X.RE.X|
|000010e0| 54 68 65 20 64 6f 6d 61 | 69 6e 20 67 61 74 65 77 |The doma|in gatew|
|000010f0| 61 79 20 2e 73 61 6e 64 | 69 65 67 6f 2e 6e 63 72 |ay .sand|iego.ncr|
|00001100| 2e 63 6f 6d 20 77 61 73 | 20 72 65 6d 6f 76 65 64 |.com was| removed|
|00001110| 20 62 65 63 61 75 73 65 | 20 2e 6e 63 72 2e 63 6f | because| .ncr.co|
|00001120| 6d 20 77 69 6c 6c 20 67 | 65 74 0a 58 75 73 20 74 |m will g|et.Xus t|
|00001130| 6f 20 74 68 65 20 73 61 | 6d 65 20 70 6c 61 63 65 |o the sa|me place|
|00001140| 2e 20 20 49 66 20 74 68 | 65 20 5c 66 42 5c 2d 74 |. If th|e \fB\-t|
|00001150| 5c 66 52 20 6f 70 74 69 | 6f 6e 20 68 61 64 20 62 |\fR opti|on had b|
|00001160| 65 65 6e 20 73 70 65 63 | 69 66 69 65 64 20 74 68 |een spec|ified th|
|00001170| 65 20 2e 63 6f 6d 0a 58 | 61 6e 64 20 2e 6e 63 72 |e .com.X|and .ncr|
|00001180| 2e 63 6f 6d 20 67 61 74 | 65 77 61 79 73 20 77 6f |.com gat|eways wo|
|00001190| 75 6c 64 20 61 6c 73 6f | 20 68 61 76 65 20 62 65 |uld also| have be|
|000011a0| 65 6e 20 72 65 6d 6f 76 | 65 64 2e 20 20 41 6c 6c |en remov|ed. All|
|000011b0| 20 68 6f 73 74 73 20 74 | 68 61 74 20 6c 69 65 0a | hosts t|hat lie.|
|000011c0| 58 62 65 79 6f 6e 64 20 | 74 68 65 20 2e 6e 63 72 |Xbeyond |the .ncr|
|000011d0| 2e 63 6f 6d 20 28 6f 72 | 20 2e 6f 74 68 65 72 20 |.com (or| .other |
|000011e0| 66 6f 72 20 5c 66 42 5c | 2d 74 5c 66 52 29 20 67 |for \fB\|-t\fR) g|
|000011f0| 61 74 65 77 61 79 20 77 | 65 72 65 20 61 6c 73 6f |ateway w|ere also|
|00001200| 20 72 65 6d 6f 76 65 64 | 0a 58 61 73 20 62 65 69 | removed|.Xas bei|
|00001210| 6e 67 20 75 6e 6e 65 63 | 65 73 73 61 72 79 2e 0a |ng unnec|essary..|
|00001220| 58 2e 50 50 0a 58 54 68 | 65 0a 58 2e 49 20 70 61 |X.PP.XTh|e.X.I pa|
|00001230| 74 68 70 72 75 6e 65 0a | 58 6f 70 74 69 6f 6e 73 |thprune.|Xoptions|
|00001240| 20 61 72 65 3a 0a 58 2e | 54 50 20 36 0a 58 2e 42 | are:.X.|TP 6.X.B|
|00001250| 20 5c 2d 76 0a 58 52 65 | 70 6f 72 74 20 73 6f 6d | \-v.XRe|port som|
|00001260| 65 20 73 74 61 74 69 73 | 74 69 63 73 20 6f 6e 20 |e statis|tics on |
|00001270| 74 68 65 20 73 74 61 6e | 64 61 72 64 20 65 72 72 |the stan|dard err|
|00001280| 6f 72 20 6f 75 74 70 75 | 74 2e 0a 58 2e 54 50 0a |or outpu|t..X.TP.|
|00001290| 58 2e 42 20 5c 2d 75 0a | 58 44 65 6c 65 74 65 20 |X.B \-u.|XDelete |
|000012a0| 73 69 6d 70 6c 65 20 68 | 6f 73 74 73 20 28 68 6f |simple h|osts (ho|
|000012b0| 73 74 2e 75 75 63 70 29 | 20 69 66 20 74 68 65 79 |st.uucp)| if they|
|000012c0| 20 70 61 73 73 20 74 68 | 72 6f 75 67 68 20 74 68 | pass th|rough th|
|000012d0| 65 20 64 6f 6d 61 69 6e | 20 67 61 74 65 77 61 79 |e domain| gateway|
|000012e0| 20 66 6f 72 0a 58 22 2e | 75 75 63 70 22 2e 0a 58 | for.X".|uucp"..X|
|000012f0| 2e 54 50 0a 58 2e 42 20 | 5c 2d 74 0a 58 50 6f 73 |.TP.X.B |\-t.XPos|
|00001300| 73 69 62 6c 79 20 64 65 | 6c 65 74 65 20 74 68 65 |sibly de|lete the|
|00001310| 20 67 61 74 65 77 61 79 | 73 20 66 6f 72 20 74 6f | gateway|s for to|
|00001320| 70 2d 6c 65 76 65 6c 20 | 64 6f 6d 61 69 6e 20 6e |p-level |domain n|
|00001330| 61 6d 65 73 2e 20 20 54 | 68 65 20 70 73 65 75 64 |ames. T|he pseud|
|00001340| 6f 2d 64 6f 6d 61 69 6e | 0a 58 67 61 74 65 77 61 |o-domain|.Xgatewa|
|00001350| 79 20 66 6f 72 20 22 2e | 6f 74 68 65 72 22 20 6d |y for ".|other" m|
|00001360| 75 73 74 20 62 65 20 70 | 72 65 73 65 6e 74 3b 20 |ust be p|resent; |
|00001370| 74 68 69 73 20 64 6f 6d | 61 69 6e 20 67 61 74 65 |this dom|ain gate|
|00001380| 77 61 79 20 69 73 20 75 | 73 65 64 20 61 73 20 61 |way is u|sed as a|
|00001390| 0a 58 73 6d 61 72 74 65 | 72 20 6d 61 63 68 69 6e |.Xsmarte|r machin|
|000013a0| 65 20 66 6f 72 20 64 6f | 6d 61 69 6e 20 6e 61 6d |e for do|main nam|
|000013b0| 65 73 2e 0a 58 2e 54 50 | 0a 58 2e 42 20 5c 2d 6a |es..X.TP|.X.B \-j|
|000013c0| 0a 58 4a 75 6e 6b 20 61 | 6c 6c 20 68 6f 73 74 73 |.XJunk a|ll hosts|
|000013d0| 20 74 68 61 74 20 64 6f | 20 6e 6f 74 20 62 65 6c | that do| not bel|
|000013e0| 6f 6e 67 20 74 6f 20 61 | 20 76 61 6c 69 64 20 74 |ong to a| valid t|
|000013f0| 6f 70 2d 6c 65 76 65 6c | 20 64 6f 6d 61 69 6e 2e |op-level| domain.|
|00001400| 0a 58 2e 54 50 0a 58 2e | 42 49 20 5c 2d 64 20 5c |.X.TP.X.|BI \-d \|
|00001410| 30 64 6f 6d 61 69 6e 0a | 58 50 72 65 73 65 72 76 |0domain.|XPreserv|
|00001420| 65 20 74 68 65 20 64 6f | 6d 61 69 6e 20 67 61 74 |e the do|main gat|
|00001430| 65 77 61 79 20 66 6f 72 | 20 5c 66 49 64 6f 6d 61 |eway for| \fIdoma|
|00001440| 69 6e 5c 66 52 20 61 6e | 64 20 61 6e 79 20 73 75 |in\fR an|d any su|
|00001450| 62 64 6f 6d 61 69 6e 20 | 67 61 74 65 77 61 79 73 |bdomain |gateways|
|00001460| 20 6f 66 0a 58 5c 66 49 | 64 6f 6d 61 69 6e 5c 66 | of.X\fI|domain\f|
|00001470| 52 2e 20 20 4e 6f 72 6d | 61 6c 6c 79 20 73 75 62 |R. Norm|ally sub|
|00001480| 64 6f 6d 61 69 6e 20 67 | 61 74 65 77 61 79 73 20 |domain g|ateways |
|00001490| 77 69 6c 6c 20 62 65 20 | 72 65 6d 6f 76 65 64 20 |will be |removed |
|000014a0| 69 66 20 74 68 65 79 20 | 70 61 73 73 0a 58 74 68 |if they |pass.Xth|
|000014b0| 72 6f 75 67 68 20 74 68 | 65 20 64 6f 6d 61 69 6e |rough th|e domain|
|000014c0| 20 67 61 74 65 77 61 79 | 2e 20 20 54 68 69 73 20 | gateway|. This |
|000014d0| 6f 70 74 69 6f 6e 20 77 | 69 6c 6c 20 70 72 65 73 |option w|ill pres|
|000014e0| 65 72 76 65 20 74 68 65 | 73 65 20 67 61 74 65 77 |erve the|se gatew|
|000014f0| 61 79 73 20 69 6e 0a 58 | 74 68 65 20 64 61 74 61 |ays in.X|the data|
|00001500| 62 61 73 65 20 69 6e 20 | 63 61 73 65 20 74 68 65 |base in |case the|
|00001510| 20 64 61 74 61 62 61 73 | 65 20 69 73 20 75 73 65 | databas|e is use|
|00001520| 64 20 66 6f 72 20 64 6f | 6d 61 69 6e 20 71 75 61 |d for do|main qua|
|00001530| 6c 69 66 69 63 61 74 69 | 6f 6e 2e 0a 58 53 70 65 |lificati|on..XSpe|
|00001540| 63 69 66 79 69 6e 67 20 | 5c 66 42 5c 2d 64 20 6f |cifying |\fB\-d o|
|00001550| 74 68 65 72 5c 66 52 20 | 77 69 6c 6c 20 70 72 65 |ther\fR |will pre|
|00001560| 73 65 72 76 65 20 61 6c | 6c 20 64 6f 6d 61 69 6e |serve al|l domain|
|00001570| 20 67 61 74 65 77 61 79 | 73 20 69 6e 20 74 68 65 | gateway|s in the|
|00001580| 20 64 61 74 61 62 61 73 | 65 2e 0a 58 2e 54 50 0a | databas|e..X.TP.|
|00001590| 58 2e 42 49 20 5c 2d 68 | 20 5c 30 64 6f 6d 61 69 |X.BI \-h| \0domai|
|000015a0| 6e 0a 58 50 72 65 73 65 | 72 76 65 20 61 6c 6c 20 |n.XPrese|rve all |
|000015b0| 68 6f 73 74 20 6e 61 6d | 65 73 20 69 6e 20 74 68 |host nam|es in th|
|000015c0| 65 20 5c 66 49 64 6f 6d | 61 69 6e 5c 66 52 2c 20 |e \fIdom|ain\fR, |
|000015d0| 6f 72 20 73 75 62 64 6f | 6d 61 69 6e 73 20 6f 66 |or subdo|mains of|
|000015e0| 20 5c 66 49 64 6f 6d 61 | 69 6e 5c 66 52 2e 0a 58 | \fIdoma|in\fR..X|
|000015f0| 2e 54 50 0a 58 2e 42 49 | 20 5c 2d 72 20 5c 30 64 |.TP.X.BI| \-r \0d|
|00001600| 6f 6d 61 69 6e 0a 58 52 | 65 6d 6f 76 65 20 61 6c |omain.XR|emove al|
|00001610| 6c 20 68 6f 73 74 20 6e | 61 6d 65 73 20 69 6e 20 |l host n|ames in |
|00001620| 74 68 65 20 5c 66 49 64 | 6f 6d 61 69 6e 5c 66 52 |the \fId|omain\fR|
|00001630| 2c 20 6f 72 20 73 75 62 | 64 6f 6d 61 69 6e 73 20 |, or sub|domains |
|00001640| 6f 66 20 5c 66 49 64 6f | 6d 61 69 6e 5c 66 52 2e |of \fIdo|main\fR.|
|00001650| 0a 58 54 68 69 73 20 69 | 73 20 75 73 65 66 75 6c |.XThis i|s useful|
|00001660| 20 66 6f 72 20 64 6f 6d | 61 69 6e 73 20 6c 69 6b | for dom|ains lik|
|00001670| 65 20 62 65 72 6b 65 6c | 65 79 2e 65 64 75 20 77 |e berkel|ey.edu w|
|00001680| 68 69 63 68 20 6c 69 73 | 74 20 73 65 76 65 72 61 |hich lis|t severa|
|00001690| 6c 0a 58 68 75 6e 64 72 | 65 64 20 68 6f 73 74 73 |l.Xhundr|ed hosts|
|000016a0| 20 69 6e 20 74 68 65 20 | 64 6f 6d 61 69 6e 2c 20 | in the |domain, |
|000016b0| 62 75 74 20 68 61 76 65 | 20 6e 6f 20 64 6f 6d 61 |but have| no doma|
|000016c0| 69 6e 20 67 61 74 65 77 | 61 79 2e 20 20 4f 66 20 |in gatew|ay. Of |
|000016d0| 63 6f 75 72 73 65 2c 20 | 79 6f 75 0a 58 63 6f 75 |course, |you.Xcou|
|000016e0| 6c 64 20 61 6c 77 61 79 | 73 20 63 6f 6e 66 75 73 |ld alway|s confus|
|000016f0| 65 20 75 63 62 76 61 78 | 20 62 79 20 6c 69 73 74 |e ucbvax| by list|
|00001700| 69 6e 67 20 69 74 20 61 | 73 20 74 68 65 20 64 6f |ing it a|s the do|
|00001710| 6d 61 69 6e 20 67 61 74 | 65 77 61 79 2e 0a 58 2e |main gat|eway..X.|
|00001720| 49 50 0a 58 53 70 65 63 | 69 66 79 69 6e 67 20 5c |IP.XSpec|ifying \|
|00001730| 66 42 5c 2d 72 20 75 75 | 63 70 5c 66 52 20 77 69 |fB\-r uu|cp\fR wi|
|00001740| 6c 6c 20 72 65 6d 6f 76 | 65 20 61 6c 6c 20 73 69 |ll remov|e all si|
|00001750| 6d 70 6c 65 20 68 6f 73 | 74 20 6e 61 6d 65 73 2e |mple hos|t names.|
|00001760| 0a 58 2e 50 50 0a 58 54 | 68 65 20 5c 66 42 5c 2d |.X.PP.XT|he \fB\-|
|00001770| 64 5c 66 52 2c 20 5c 66 | 42 5c 2d 68 5c 66 52 20 |d\fR, \f|B\-h\fR |
|00001780| 61 6e 64 20 5c 66 42 5c | 2d 72 5c 66 52 20 6f 70 |and \fB\|-r\fR op|
|00001790| 74 69 6f 6e 73 20 6d 61 | 79 20 62 65 20 73 70 65 |tions ma|y be spe|
|000017a0| 63 69 66 69 65 64 20 61 | 73 0a 58 6d 61 6e 79 20 |cified a|s.Xmany |
|000017b0| 74 69 6d 65 73 20 61 73 | 20 77 61 6e 74 65 64 2e |times as| wanted.|
|000017c0| 0a 58 2e 53 48 20 42 55 | 47 53 0a 58 2e 49 20 50 |.X.SH BU|GS.X.I P|
|000017d0| 61 74 68 70 72 75 6e 65 | 0a 58 61 73 73 75 6d 65 |athprune|.Xassume|
|000017e0| 73 20 62 61 6e 67 2d 72 | 6f 75 74 65 64 20 70 61 |s bang-r|outed pa|
|000017f0| 74 68 73 20 61 6e 64 20 | 77 69 6c 6c 20 6e 6f 74 |ths and |will not|
|00001800| 20 6d 61 74 63 68 20 67 | 61 74 65 77 61 79 20 70 | match g|ateway p|
|00001810| 61 74 68 73 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |aths con|taining |
|00001820| 27 40 27 73 2e 0a 58 2e | 62 72 0a 58 2e 42 20 2e |'@'s..X.|br.X.B .|
|00001830| 6f 74 68 65 72 0a 58 69 | 73 20 73 70 65 63 69 66 |other.Xi|s specif|
|00001840| 69 63 20 74 6f 20 4e 43 | 52 27 73 20 76 65 72 73 |ic to NC|R's vers|
|00001850| 69 6f 6e 20 6f 66 20 73 | 6d 61 69 6c 2e 0a 58 2e |ion of s|mail..X.|
|00001860| 53 48 20 22 53 45 45 20 | 41 4c 53 4f 22 0a 58 70 |SH "SEE |ALSO".Xp|
|00001870| 61 74 68 61 6c 69 61 73 | 28 31 29 0a 58 2e 53 48 |athalias|(1).X.SH|
|00001880| 20 41 55 54 48 4f 52 0a | 58 4d 61 74 74 20 43 6f | AUTHOR.|XMatt Co|
|00001890| 73 74 65 6c 6c 6f 09 3c | 6d 61 74 74 2e 63 6f 73 |stello.<|matt.cos|
|000018a0| 74 65 6c 6c 6f 40 73 61 | 6e 64 69 65 67 6f 2e 6e |tello@sa|ndiego.n|
|000018b0| 63 72 2e 63 6f 6d 3e 0a | 53 48 41 52 5f 45 4f 46 |cr.com>.|SHAR_EOF|
|000018c0| 0a 73 65 64 20 27 73 2f | 5e 58 2f 2f 27 20 3c 3c |.sed 's/|^X//' <<|
|000018d0| 27 53 48 41 52 5f 45 4f | 46 27 20 3e 70 61 74 68 |'SHAR_EO|F' >path|
|000018e0| 70 72 75 6e 65 2e 63 3b | 20 63 68 6d 6f 64 20 34 |prune.c;| chmod 4|
|000018f0| 34 34 20 70 61 74 68 70 | 72 75 6e 65 2e 63 0a 58 |44 pathp|rune.c.X|
|00001900| 23 69 66 6e 64 65 66 20 | 6c 69 6e 74 0a 58 73 74 |#ifndef |lint.Xst|
|00001910| 61 74 69 63 20 63 68 61 | 72 20 73 63 63 73 49 44 |atic cha|r sccsID|
|00001920| 5b 5d 20 3d 20 22 40 28 | 23 29 70 61 74 68 70 72 |[] = "@(|#)pathpr|
|00001930| 75 6e 65 2e 63 09 31 2e | 31 20 44 65 6c 74 61 3a |une.c.1.|1 Delta:|
|00001940| 20 31 34 3a 35 38 3a 32 | 36 20 33 2f 36 2f 38 37 | 14:58:2|6 3/6/87|
|00001950| 22 3b 0a 58 23 65 6e 64 | 69 66 0a 58 2f 2a 0a 58 |";.X#end|if.X/*.X|
|00001960| 20 2a 20 20 50 72 75 6e | 65 20 64 6f 77 6e 20 61 | * Prun|e down a|
|00001970| 20 70 61 74 68 61 6c 69 | 61 73 20 66 69 6c 65 20 | pathali|as file |
|00001980| 62 79 20 74 68 72 6f 77 | 69 6e 67 20 6f 75 74 20 |by throw|ing out |
|00001990| 61 6c 6c 20 75 6e 6e 65 | 63 65 73 73 61 72 79 20 |all unne|cessary |
|000019a0| 65 6e 74 72 69 65 73 2e | 0a 58 20 2a 0a 58 20 2a |entries.|.X *.X *|
|000019b0| 20 20 55 73 61 67 65 0a | 58 20 2a 09 70 61 74 68 | Usage.|X *.path|
|000019c0| 70 72 75 6e 65 20 5b 6f | 70 74 69 6f 6e 73 5d 20 |prune [o|ptions] |
|000019d0| 5b 20 69 6e 66 69 6c 65 | 20 5b 6f 75 74 66 69 6c |[ infile| [outfil|
|000019e0| 65 5d 20 5d 0a 58 20 2a | 0a 58 20 2a 09 2d 75 09 |e] ].X *|.X *.-u.|
|000019f0| 70 72 75 6e 65 20 2e 75 | 75 63 70 28 69 6d 70 6c |prune .u|ucp(impl|
|00001a00| 69 65 64 29 20 65 6e 74 | 72 69 65 73 0a 58 20 2a |ied) ent|ries.X *|
|00001a10| 09 2d 74 09 70 72 75 6e | 65 20 74 6f 70 20 6c 65 |.-t.prun|e top le|
|00001a20| 76 65 6c 20 28 76 69 61 | 20 2e 6f 74 68 65 72 29 |vel (via| .other)|
|00001a30| 20 65 6e 74 72 69 65 73 | 0a 58 20 2a 09 2d 64 20 | entries|.X *.-d |
|00001a40| 64 6f 6d 09 73 61 63 72 | 65 64 20 64 6f 6d 61 69 |dom.sacr|ed domai|
|00001a50| 6e 2c 20 64 6f 20 6e 6f | 74 20 70 72 75 6e 65 20 |n, do no|t prune |
|00001a60| 64 6f 6d 61 69 6e 20 67 | 61 74 65 77 61 79 73 0a |domain g|ateways.|
|00001a70| 58 20 2a 09 2d 68 20 64 | 6f 6d 09 73 61 63 72 65 |X *.-h d|om.sacre|
|00001a80| 64 20 68 6f 73 74 73 2c | 20 64 6f 20 6e 6f 74 20 |d hosts,| do not |
|00001a90| 70 72 75 6e 65 20 68 6f | 73 74 73 20 69 6e 20 74 |prune ho|sts in t|
|00001aa0| 68 69 73 20 64 6f 6d 61 | 69 6e 20 28 6f 72 20 73 |his doma|in (or s|
|00001ab0| 75 62 64 6f 6d 61 69 6e | 73 29 0a 58 20 2a 09 2d |ubdomain|s).X *.-|
|00001ac0| 72 20 64 6f 6d 09 72 65 | 6d 6f 76 65 20 61 6c 6c |r dom.re|move all|
|00001ad0| 20 68 6f 73 74 73 20 69 | 6e 20 74 68 69 73 20 64 | hosts i|n this d|
|00001ae0| 6f 6d 61 69 6e 20 28 61 | 6e 64 20 73 75 62 64 6f |omain (a|nd subdo|
|00001af0| 6d 61 69 6e 73 29 0a 58 | 20 2a 09 2d 6a 09 6a 75 |mains).X| *.-j.ju|
|00001b00| 6e 6b 20 61 6c 6c 20 68 | 6f 73 74 73 20 77 69 74 |nk all h|osts wit|
|00001b10| 68 20 62 6f 67 75 73 20 | 74 6f 70 2d 6c 65 76 65 |h bogus |top-leve|
|00001b20| 6c 20 64 6f 6d 61 69 6e | 73 0a 58 20 2a 09 2d 76 |l domain|s.X *.-v|
|00001b30| 09 76 65 72 62 6f 73 65 | 2c 20 70 72 69 6e 74 20 |.verbose|, print |
|00001b40| 73 74 61 74 69 73 74 69 | 63 73 0a 58 20 2a 0a 58 |statisti|cs.X *.X|
|00001b50| 20 2a 20 20 43 6f 6d 70 | 69 6c 61 74 69 6f 6e 0a | * Comp|ilation.|
|00001b60| 58 20 2a 09 63 63 20 2d | 4f 20 2d 6f 20 70 61 74 |X *.cc -|O -o pat|
|00001b70| 68 70 72 75 6e 65 20 70 | 61 74 68 70 72 75 6e 65 |hprune p|athprune|
|00001b80| 2e 63 09 09 09 23 20 66 | 6f 72 20 55 53 47 20 73 |.c...# f|or USG s|
|00001b90| 79 73 74 65 6d 73 0a 58 | 20 2a 09 63 63 20 2d 44 |ystems.X| *.cc -D|
|00001ba0| 42 53 44 20 2d 4f 20 2d | 6f 20 70 61 74 68 70 72 |BSD -O -|o pathpr|
|00001bb0| 75 6e 65 20 70 61 74 68 | 70 72 75 6e 65 2e 63 20 |une path|prune.c |
|00001bc0| 67 65 74 6f 70 74 2e 6f | 09 23 20 66 6f 72 20 42 |getopt.o|.# for B|
|00001bd0| 53 44 20 73 79 73 74 65 | 6d 73 0a 58 20 2a 0a 58 |SD syste|ms.X *.X|
|00001be0| 20 2a 20 20 44 69 73 63 | 6c 61 69 6d 65 72 0a 58 | * Disc|laimer.X|
|00001bf0| 20 2a 09 50 61 74 68 70 | 72 75 6e 65 20 69 73 20 | *.Pathp|rune is |
|00001c00| 69 6e 20 74 68 65 20 70 | 75 62 6c 69 63 20 64 6f |in the p|ublic do|
|00001c10| 6d 61 69 6e 2e 20 20 49 | 74 20 6d 61 79 20 62 65 |main. I|t may be|
|00001c20| 20 75 73 65 64 20 62 79 | 20 61 6e 79 20 70 65 72 | used by| any per|
|00001c30| 73 6f 6e 20 6f 72 0a 58 | 20 2a 09 6f 72 67 61 6e |son or.X| *.organ|
|00001c40| 69 7a 61 74 69 6f 6e 2c | 20 69 6e 20 61 6e 79 20 |ization,| in any |
|00001c50| 77 61 79 20 61 6e 64 20 | 66 6f 72 20 61 6e 79 20 |way and |for any |
|00001c60| 70 75 72 70 6f 73 65 2e | 20 20 54 68 65 72 65 20 |purpose.| There |
|00001c70| 69 73 20 6e 6f 20 77 61 | 72 72 61 6e 74 79 0a 58 |is no wa|rranty.X|
|00001c80| 20 2a 09 6f 66 20 61 6e | 79 20 6b 69 6e 64 20 66 | *.of an|y kind f|
|00001c90| 6f 72 20 74 68 69 73 20 | 70 72 6f 67 72 61 6d 2e |or this |program.|
|00001ca0| 20 20 57 68 61 74 20 79 | 6f 75 20 73 65 65 20 69 | What y|ou see i|
|00001cb0| 73 20 77 68 61 74 20 79 | 6f 75 20 67 65 74 2e 0a |s what y|ou get..|
|00001cc0| 58 20 2a 0a 58 20 2a 20 | 20 48 69 73 74 6f 72 79 |X *.X * | History|
|00001cd0| 0a 58 20 2a 09 31 2e 31 | 09 4d 61 72 20 36 2c 20 |.X *.1.1|.Mar 6, |
|00001ce0| 31 39 38 37 0a 58 20 2a | 09 09 57 72 69 74 74 65 |1987.X *|..Writte|
|00001cf0| 6e 20 62 79 20 4d 61 74 | 74 20 43 6f 73 74 65 6c |n by Mat|t Costel|
|00001d00| 6c 6f 0a 58 20 2a 2f 0a | 58 23 20 69 6e 63 6c 75 |lo.X */.|X# inclu|
|00001d10| 64 65 20 3c 73 74 64 69 | 6f 2e 68 3e 0a 58 0a 58 |de <stdi|o.h>.X.X|
|00001d20| 23 20 64 65 66 69 6e 65 | 20 56 4f 49 44 09 28 76 |# define| VOID.(v|
|00001d30| 6f 69 64 29 09 2f 2a 20 | 64 65 66 69 6e 65 20 65 |oid)./* |define e|
|00001d40| 6d 70 74 79 20 66 6f 72 | 20 6e 6f 6e 2d 76 6f 69 |mpty for| non-voi|
|00001d50| 64 73 20 2a 2f 0a 58 23 | 20 64 65 66 69 6e 65 20 |ds */.X#| define |
|00001d60| 55 55 43 50 4e 41 4d 45 | 09 22 75 75 63 70 22 0a |UUCPNAME|."uucp".|
|00001d70| 58 23 20 64 65 66 69 6e | 65 20 4f 54 48 45 52 4e |X# defin|e OTHERN|
|00001d80| 41 4d 45 09 22 6f 74 68 | 65 72 22 0a 58 0a 58 23 |AME."oth|er".X.X#|
|00001d90| 20 69 66 64 65 66 20 42 | 53 44 0a 58 0a 58 23 20 | ifdef B|SD.X.X# |
|00001da0| 69 6e 63 6c 75 64 65 20 | 3c 73 74 72 69 6e 67 73 |include |<strings|
|00001db0| 2e 68 3e 0a 58 23 20 64 | 65 66 69 6e 65 20 73 74 |.h>.X# d|efine st|
|00001dc0| 72 63 68 72 28 73 2c 63 | 29 20 69 6e 64 65 78 28 |rchr(s,c|) index(|
|00001dd0| 73 2c 63 29 0a 58 23 20 | 64 65 66 69 6e 65 20 73 |s,c).X# |define s|
|00001de0| 74 72 72 63 68 72 28 73 | 2c 63 29 20 72 69 6e 64 |trrchr(s|,c) rind|
|00001df0| 65 78 28 73 2c 63 29 0a | 58 65 78 74 65 72 6e 20 |ex(s,c).|Xextern |
|00001e00| 63 68 61 72 09 2a 67 65 | 74 73 28 29 3b 0a 58 0a |char.*ge|ts();.X.|
|00001e10| 58 63 68 61 72 20 2a 0a | 58 73 74 72 74 6f 6b 28 |Xchar *.|Xstrtok(|
|00001e20| 20 73 74 72 2c 20 64 65 | 6c 69 6d 73 20 29 0a 58 | str, de|lims ).X|
|00001e30| 72 65 67 69 73 74 65 72 | 20 63 68 61 72 20 2a 73 |register| char *s|
|00001e40| 74 72 2c 20 2a 64 65 6c | 69 6d 73 3b 0a 58 7b 0a |tr, *del|ims;.X{.|
|00001e50| 58 09 73 74 61 74 69 63 | 20 63 68 61 72 20 2a 73 |X.static| char *s|
|00001e60| 74 72 6e 65 78 74 3b 0a | 58 09 63 68 61 72 20 2a |trnext;.|X.char *|
|00001e70| 74 6f 6b 65 6e 3b 0a 58 | 09 69 66 20 28 21 73 74 |token;.X|.if (!st|
|00001e80| 72 29 20 73 74 72 3d 73 | 74 72 6e 65 78 74 3b 0a |r) str=s|trnext;.|
|00001e90| 58 09 77 68 69 6c 65 20 | 28 2a 73 74 72 20 26 26 |X.while |(*str &&|
|00001ea0| 20 69 6e 64 65 78 28 64 | 65 6c 69 6d 73 2c 2a 73 | index(d|elims,*s|
|00001eb0| 74 72 29 29 0a 58 09 09 | 73 74 72 2b 2b 3b 09 2f |tr)).X..|str++;./|
|00001ec0| 2a 20 73 6b 69 70 20 6c | 65 61 64 69 6e 67 20 64 |* skip l|eading d|
|00001ed0| 65 6c 69 6d 69 74 65 72 | 73 20 2a 2f 0a 58 09 69 |elimiter|s */.X.i|
|00001ee0| 66 20 28 21 2a 73 74 72 | 29 0a 58 09 09 72 65 74 |f (!*str|).X..ret|
|00001ef0| 75 72 6e 20 28 4e 55 4c | 4c 29 3b 0a 58 09 74 6f |urn (NUL|L);.X.to|
|00001f00| 6b 65 6e 20 3d 20 73 74 | 72 3b 0a 58 09 77 68 69 |ken = st|r;.X.whi|
|00001f10| 6c 65 20 28 2a 73 74 72 | 20 26 26 20 21 69 6e 64 |le (*str| && !ind|
|00001f20| 65 78 28 64 65 6c 69 6d | 73 2c 2a 73 74 72 29 29 |ex(delim|s,*str))|
|00001f30| 0a 58 09 09 73 74 72 2b | 2b 3b 09 2f 2a 20 73 6b |.X..str+|+;./* sk|
|00001f40| 69 70 20 74 6f 6b 65 6e | 20 63 68 61 72 61 63 74 |ip token| charact|
|00001f50| 65 72 73 20 2a 2f 0a 58 | 09 69 66 20 28 2a 73 74 |ers */.X|.if (*st|
|00001f60| 72 29 09 73 74 72 6e 65 | 78 74 20 3d 20 73 74 72 |r).strne|xt = str|
|00001f70| 3b 0a 58 09 65 6c 73 65 | 20 09 09 2a 73 74 72 6e |;.X.else| ..*strn|
|00001f80| 65 78 74 2b 2b 20 3d 20 | 27 5c 30 27 3b 0a 58 09 |ext++ = |'\0';.X.|
|00001f90| 72 65 74 75 72 6e 20 28 | 74 6f 6b 65 6e 29 3b 0a |return (|token);.|
|00001fa0| 58 7d 0a 58 0a 58 23 20 | 65 6c 73 65 20 2f 2a 20 |X}.X.X# |else /* |
|00001fb0| 21 42 53 44 20 2a 2f 0a | 58 0a 58 23 20 69 6e 63 |!BSD */.|X.X# inc|
|00001fc0| 6c 75 64 65 20 3c 73 74 | 72 69 6e 67 2e 68 3e 0a |lude <st|ring.h>.|
|00001fd0| 58 23 20 69 6e 63 6c 75 | 64 65 20 3c 6d 65 6d 6f |X# inclu|de <memo|
|00001fe0| 72 79 2e 68 3e 0a 58 65 | 78 74 65 72 6e 20 76 6f |ry.h>.Xe|xtern vo|
|00001ff0| 69 64 09 65 78 69 74 28 | 29 3b 0a 58 65 78 74 65 |id.exit(|);.Xexte|
|00002000| 72 6e 20 76 6f 69 64 09 | 70 65 72 72 6f 72 28 29 |rn void.|perror()|
|00002010| 3b 0a 58 0a 58 23 20 65 | 6e 64 69 66 20 2f 2a 20 |;.X.X# e|ndif /* |
|00002020| 21 42 53 44 20 2a 2f 0a | 58 0a 58 65 78 74 65 72 |!BSD */.|X.Xexter|
|00002030| 6e 20 63 68 61 72 09 2a | 6d 61 6c 6c 6f 63 28 29 |n char.*|malloc()|
|00002040| 3b 0a 58 65 78 74 65 72 | 6e 20 63 68 61 72 09 2a |;.Xexter|n char.*|
|00002050| 63 61 6c 6c 6f 63 28 29 | 3b 0a 58 63 68 61 72 09 |calloc()|;.Xchar.|
|00002060| 09 2a 73 74 72 61 6c 6c | 6f 63 28 29 3b 09 09 2f |.*strall|oc();../|
|00002070| 2a 20 46 4f 52 57 41 52 | 44 20 2a 2f 0a 58 0a 58 |* FORWAR|D */.X.X|
|00002080| 73 74 72 75 63 74 20 64 | 6e 6f 64 65 20 7b 0a 58 |struct d|node {.X|
|00002090| 09 73 74 72 75 63 74 20 | 64 6e 6f 64 65 20 2a 6c |.struct |dnode *l|
|000020a0| 6e 6f 64 65 3b 09 2f 2a | 20 70 6f 69 6e 74 65 72 |node;./*| pointer|
|000020b0| 20 74 6f 20 6c 69 74 74 | 6c 65 72 20 6e 6f 64 65 | to litt|ler node|
|000020c0| 20 6e 61 6d 65 20 2a 2f | 0a 58 09 73 74 72 75 63 | name */|.X.struc|
|000020d0| 74 20 64 6e 6f 64 65 20 | 2a 62 6e 6f 64 65 3b 09 |t dnode |*bnode;.|
|000020e0| 2f 2a 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 62 69 |/* point|er to bi|
|000020f0| 67 67 65 72 20 6e 6f 64 | 65 20 6e 61 6d 65 20 2a |gger nod|e name *|
|00002100| 2f 0a 58 09 73 74 72 75 | 63 74 20 64 6e 6f 64 65 |/.X.stru|ct dnode|
|00002110| 20 2a 63 68 69 6c 64 72 | 65 6e 3b 09 2f 2a 20 70 | *childr|en;./* p|
|00002120| 6f 69 6e 74 65 72 20 74 | 6f 20 63 68 69 6c 64 72 |ointer t|o childr|
|00002130| 65 6e 73 20 6e 6f 64 65 | 20 6e 61 6d 65 73 20 2a |ens node| names *|
|00002140| 2f 0a 58 09 73 74 72 75 | 63 74 20 64 6e 6f 64 65 |/.X.stru|ct dnode|
|00002150| 20 2a 6f 72 64 65 72 3b | 09 2f 2a 20 70 6f 69 6e | *order;|./* poin|
|00002160| 74 65 72 20 74 6f 20 6e | 65 78 74 20 6e 6f 64 65 |ter to n|ext node|
|00002170| 20 69 6e 20 6f 72 69 67 | 69 6e 61 6c 20 6f 72 64 | in orig|inal ord|
|00002180| 65 72 20 2a 2f 0a 58 09 | 63 68 61 72 20 2a 66 75 |er */.X.|char *fu|
|00002190| 6c 6c 6e 61 6d 65 3b 09 | 09 2f 2a 20 66 75 6c 6c |llname;.|./* full|
|000021a0| 20 6e 61 6d 65 20 6f 66 | 20 74 68 69 73 20 64 6f | name of| this do|
|000021b0| 6d 61 69 6e 20 67 61 74 | 65 77 61 79 20 2a 2f 0a |main gat|eway */.|
|000021c0| 58 09 63 68 61 72 20 2a | 6e 6f 64 65 6e 61 6d 65 |X.char *|nodename|
|000021d0| 3b 09 09 2f 2a 20 6c 61 | 73 74 20 70 6f 72 74 69 |;../* la|st porti|
|000021e0| 6f 6e 20 6f 66 20 74 68 | 65 20 64 6f 6d 61 69 6e |on of th|e domain|
|000021f0| 20 6e 61 6d 65 20 2a 2f | 0a 58 09 63 68 61 72 20 | name */|.X.char |
|00002200| 2a 70 61 74 68 6e 61 6d | 65 3b 09 09 2f 2a 20 70 |*pathnam|e;../* p|
|00002210| 61 74 68 20 6e 61 6d 65 | 20 74 6f 20 67 61 74 65 |ath name| to gate|
|00002220| 77 61 79 20 66 6f 72 20 | 74 68 69 73 20 6e 6f 64 |way for |this nod|
|00002230| 65 20 2a 2f 0a 58 09 63 | 68 61 72 20 2a 6c 69 6e |e */.X.c|har *lin|
|00002240| 65 3b 09 09 2f 2a 20 74 | 68 65 20 66 75 6c 6c 20 |e;../* t|he full |
|00002250| 6c 69 6e 65 20 66 72 6f | 6d 20 74 68 65 20 70 61 |line fro|m the pa|
|00002260| 74 68 73 20 66 69 6c 65 | 20 2a 2f 0a 58 09 69 6e |ths file| */.X.in|
|00002270| 74 20 66 6c 61 67 73 3b | 0a 58 7d 3b 0a 58 23 20 |t flags;|.X};.X# |
|00002280| 64 65 66 69 6e 65 20 53 | 41 43 52 45 44 5f 44 4f |define S|ACRED_DO|
|00002290| 4d 41 49 4e 09 30 30 31 | 0a 58 23 20 64 65 66 69 |MAIN.001|.X# defi|
|000022a0| 6e 65 20 53 41 43 52 45 | 44 5f 48 4f 53 54 09 30 |ne SACRE|D_HOST.0|
|000022b0| 30 32 0a 58 23 20 64 65 | 66 69 6e 65 20 52 45 4d |02.X# de|fine REM|
|000022c0| 4f 56 45 5f 48 4f 53 54 | 09 30 30 34 0a 58 0a 58 |OVE_HOST|.004.X.X|
|000022d0| 73 74 72 75 63 74 20 64 | 6e 6f 64 65 20 2a 72 6f |struct d|node *ro|
|000022e0| 6f 74 6e 6f 64 65 20 3d | 20 4e 55 4c 4c 3b 09 2f |otnode =| NULL;./|
|000022f0| 2a 20 72 6f 6f 74 20 6f | 66 20 74 68 65 20 64 6f |* root o|f the do|
|00002300| 6d 61 69 6e 20 28 6e 6f | 64 65 29 20 74 72 65 65 |main (no|de) tree|
|00002310| 20 2a 2f 0a 58 73 74 72 | 75 63 74 20 64 6e 6f 64 | */.Xstr|uct dnod|
|00002320| 65 20 2a 6c 6f 6f 6b 5f | 6e 6f 64 65 28 29 3b 09 |e *look_|node();.|
|00002330| 2f 2a 20 6c 6f 6f 6b 20 | 66 6f 72 20 61 20 6e 6f |/* look |for a no|
|00002340| 64 65 20 2a 2f 0a 58 73 | 74 72 75 63 74 20 64 6e |de */.Xs|truct dn|
|00002350| 6f 64 65 20 2a 61 64 64 | 5f 6e 6f 64 65 28 29 3b |ode *add|_node();|
|00002360| 09 2f 2a 20 6c 6f 6f 6b | 20 66 6f 72 20 61 20 6e |./* look| for a n|
|00002370| 6f 64 65 20 2a 2f 0a 58 | 0a 58 73 74 72 75 63 74 |ode */.X|.Xstruct|
|00002380| 20 64 6e 6f 64 65 20 2a | 66 69 72 73 74 6e 6f 64 | dnode *|firstnod|
|00002390| 65 20 3d 20 4e 55 4c 4c | 3b 09 2f 2a 20 74 6f 20 |e = NULL|;./* to |
|000023a0| 6b 65 65 70 20 6f 72 69 | 67 69 6e 61 6c 20 6f 72 |keep ori|ginal or|
|000023b0| 64 65 72 20 2a 2f 0a 58 | 73 74 72 75 63 74 20 64 |der */.X|struct d|
|000023c0| 6e 6f 64 65 20 2a 6c 61 | 73 74 6e 6f 64 65 20 3d |node *la|stnode =|
|000023d0| 20 4e 55 4c 4c 3b 09 2f | 2a 20 66 6f 72 20 70 65 | NULL;./|* for pe|
|000023e0| 72 66 6f 72 6d 61 6e 63 | 65 20 2a 2f 0a 58 0a 58 |rformanc|e */.X.X|
|000023f0| 63 68 61 72 20 2a 09 09 | 6f 74 68 65 72 70 61 74 |char *..|otherpat|
|00002400| 68 20 3d 20 22 21 21 21 | 21 21 21 21 22 3b 0a 58 |h = "!!!|!!!!";.X|
|00002410| 63 68 61 72 20 2a 09 09 | 75 75 63 70 70 61 74 68 |char *..|uucppath|
|00002420| 20 3d 20 22 21 21 21 21 | 21 21 21 22 3b 0a 58 69 | = "!!!!|!!!";.Xi|
|00002430| 6e 74 09 09 66 6c 67 5f | 74 6f 70 64 65 6c 3b 0a |nt..flg_|topdel;.|
|00002440| 58 69 6e 74 09 09 66 6c | 67 5f 64 6f 6e 74 70 72 |Xint..fl|g_dontpr|
|00002450| 75 6e 65 3b 0a 58 69 6e | 74 09 09 66 6c 67 5f 6a |une;.Xin|t..flg_j|
|00002460| 75 6e 6b 62 6f 67 75 73 | 3b 0a 58 69 6e 74 09 09 |unkbogus|;.Xint..|
|00002470| 66 6c 67 5f 75 75 63 70 | 64 65 6c 3b 0a 58 69 6e |flg_uucp|del;.Xin|
|00002480| 74 09 09 66 6c 67 5f 72 | 65 6d 6f 76 65 75 75 63 |t..flg_r|emoveuuc|
|00002490| 70 3b 0a 58 69 6e 74 09 | 09 66 6c 67 5f 76 65 72 |p;.Xint.|.flg_ver|
|000024a0| 62 6f 73 65 3b 0a 58 0a | 58 69 6e 74 09 67 77 5f |bose;.X.|Xint.gw_|
|000024b0| 69 6e 2c 20 67 77 5f 6f | 75 74 3b 0a 58 69 6e 74 |in, gw_o|ut;.Xint|
|000024c0| 09 64 6f 6d 5f 69 6e 2c | 20 64 6f 6d 5f 6f 75 74 |.dom_in,| dom_out|
|000024d0| 3b 0a 58 69 6e 74 09 68 | 73 74 5f 69 6e 2c 20 68 |;.Xint.h|st_in, h|
|000024e0| 73 74 5f 6f 75 74 3b 0a | 58 0a 58 6d 61 69 6e 28 |st_out;.|X.Xmain(|
|000024f0| 61 72 67 63 2c 61 72 67 | 76 29 0a 58 69 6e 74 20 |argc,arg|v).Xint |
|00002500| 61 72 67 63 3b 0a 58 63 | 68 61 72 20 2a 2a 61 72 |argc;.Xc|har **ar|
|00002510| 67 76 3b 0a 58 7b 0a 58 | 09 72 65 67 69 73 74 65 |gv;.X{.X|.registe|
|00002520| 72 20 73 74 72 75 63 74 | 20 64 6e 6f 64 65 20 2a |r struct| dnode *|
|00002530| 70 3b 0a 58 09 72 65 67 | 69 73 74 65 72 20 69 3b |p;.X.reg|ister i;|
|00002540| 0a 58 09 65 78 74 65 72 | 6e 20 69 6e 74 20 6f 70 |.X.exter|n int op|
|00002550| 74 69 6e 64 3b 0a 58 09 | 65 78 74 65 72 6e 20 63 |tind;.X.|extern c|
|00002560| 68 61 72 20 2a 6f 70 74 | 61 72 67 3b 0a 58 09 63 |har *opt|arg;.X.c|
|00002570| 68 61 72 20 6c 69 6e 65 | 62 75 66 5b 42 55 46 53 |har line|buf[BUFS|
|00002580| 49 5a 5d 3b 0a 58 0a 58 | 09 77 68 69 6c 65 20 28 |IZ];.X.X|.while (|
|00002590| 28 69 20 3d 20 67 65 74 | 6f 70 74 28 61 72 67 63 |(i = get|opt(argc|
|000025a0| 2c 61 72 67 76 2c 22 75 | 74 6a 76 64 3a 68 3a 72 |,argv,"u|tjvd:h:r|
|000025b0| 3a 22 29 29 20 21 3d 20 | 45 4f 46 29 20 73 77 69 |:")) != |EOF) swi|
|000025c0| 74 63 68 20 28 69 29 20 | 7b 0a 58 09 09 63 61 73 |tch (i) |{.X..cas|
|000025d0| 65 20 27 75 27 3a 09 2f | 2a 20 70 72 75 6e 65 20 |e 'u':./|* prune |
|000025e0| 68 6f 73 74 2e 75 75 63 | 70 20 65 6e 74 72 69 65 |host.uuc|p entrie|
|000025f0| 73 20 77 68 65 72 65 20 | 70 6f 73 73 69 62 6c 65 |s where |possible|
|00002600| 20 2a 2f 0a 58 09 09 09 | 66 6c 67 5f 75 75 63 70 | */.X...|flg_uucp|
|00002610| 64 65 6c 2b 2b 3b 0a 58 | 09 09 09 62 72 65 61 6b |del++;.X|...break|
|00002620| 3b 0a 58 09 09 63 61 73 | 65 20 27 74 27 3a 09 2f |;.X..cas|e 't':./|
|00002630| 2a 20 70 72 75 6e 65 20 | 74 6f 70 20 6c 65 76 65 |* prune |top leve|
|00002640| 6c 20 64 6f 6d 61 69 6e | 20 6e 61 6d 65 73 20 2a |l domain| names *|
|00002650| 2f 0a 58 09 09 09 66 6c | 67 5f 74 6f 70 64 65 6c |/.X...fl|g_topdel|
|00002660| 2b 2b 3b 0a 58 09 09 09 | 62 72 65 61 6b 3b 0a 58 |++;.X...|break;.X|
|00002670| 09 09 63 61 73 65 20 27 | 6a 27 3a 09 2f 2a 20 6a |..case '|j':./* j|
|00002680| 75 73 74 20 68 6f 73 74 | 73 20 69 6e 20 62 6f 67 |ust host|s in bog|
|00002690| 75 73 20 74 6f 70 2d 6c | 65 76 65 6c 20 64 6f 6d |us top-l|evel dom|
|000026a0| 61 69 6e 73 20 2a 2f 0a | 58 09 09 09 66 6c 67 5f |ains */.|X...flg_|
|000026b0| 6a 75 6e 6b 62 6f 67 75 | 73 2b 2b 3b 0a 58 09 09 |junkbogu|s++;.X..|
|000026c0| 09 62 72 65 61 6b 3b 0a | 58 09 09 63 61 73 65 20 |.break;.|X..case |
|000026d0| 27 76 27 3a 0a 58 09 09 | 09 66 6c 67 5f 76 65 72 |'v':.X..|.flg_ver|
|000026e0| 62 6f 73 65 2b 2b 3b 0a | 58 09 09 09 62 72 65 61 |bose++;.|X...brea|
|000026f0| 6b 3b 0a 58 09 09 63 61 | 73 65 20 27 64 27 3a 0a |k;.X..ca|se 'd':.|
|00002700| 58 09 09 09 64 6f 6d 66 | 6c 61 67 28 20 6f 70 74 |X...domf|lag( opt|
|00002710| 61 72 67 2c 20 53 41 43 | 52 45 44 5f 44 4f 4d 41 |arg, SAC|RED_DOMA|
|00002720| 49 4e 20 29 3b 0a 58 09 | 09 09 62 72 65 61 6b 3b |IN );.X.|..break;|
|00002730| 0a 58 09 09 63 61 73 65 | 20 27 68 27 3a 0a 58 09 |.X..case| 'h':.X.|
|00002740| 09 09 64 6f 6d 66 6c 61 | 67 28 20 6f 70 74 61 72 |..domfla|g( optar|
|00002750| 67 2c 20 53 41 43 52 45 | 44 5f 48 4f 53 54 20 29 |g, SACRE|D_HOST )|
|00002760| 3b 0a 58 09 09 09 62 72 | 65 61 6b 3b 0a 58 09 09 |;.X...br|eak;.X..|
|00002770| 63 61 73 65 20 27 72 27 | 3a 0a 58 09 09 09 64 6f |case 'r'|:.X...do|
|00002780| 6d 66 6c 61 67 28 20 6f | 70 74 61 72 67 2c 20 52 |mflag( o|ptarg, R|
|00002790| 45 4d 4f 56 45 5f 48 4f | 53 54 20 29 3b 0a 58 09 |EMOVE_HO|ST );.X.|
|000027a0| 09 09 62 72 65 61 6b 3b | 0a 58 0a 58 09 09 64 65 |..break;|.X.X..de|
|000027b0| 66 61 75 6c 74 3a 0a 58 | 55 73 61 67 65 3a 0a 58 |fault:.X|Usage:.X|
|000027c0| 56 4f 49 44 20 66 70 75 | 74 73 28 22 55 73 61 67 |VOID fpu|ts("Usag|
|000027d0| 65 3a 20 70 61 74 68 70 | 72 75 6e 65 20 5b 2d 76 |e: pathp|rune [-v|
|000027e0| 75 74 6a 5d 20 5b 2d 5b | 64 68 72 5d 20 64 6f 6d |utj] [-[|dhr] dom|
|000027f0| 5d 20 5b 20 69 6e 66 69 | 6c 65 20 5b 6f 75 74 66 |] [ infi|le [outf|
|00002800| 69 6c 65 5d 20 5d 5c 6e | 22 2c 0a 58 09 09 09 09 |ile] ]\n|",.X....|
|00002810| 73 74 64 65 72 72 20 29 | 3b 0a 58 09 09 09 65 78 |stderr )|;.X...ex|
|00002820| 69 74 28 32 29 3b 0a 58 | 09 7d 0a 58 09 69 66 20 |it(2);.X|.}.X.if |
|00002830| 28 20 28 6f 70 74 69 6e | 64 20 3c 20 61 72 67 63 |( (optin|d < argc|
|00002840| 29 20 26 26 0a 58 09 20 | 20 20 20 20 28 66 72 65 |) &&.X. | (fre|
|00002850| 6f 70 65 6e 28 20 61 72 | 67 76 5b 6f 70 74 69 6e |open( ar|gv[optin|
|00002860| 64 2b 2b 5d 2c 20 22 72 | 22 2c 20 73 74 64 69 6e |d++], "r|", stdin|
|00002870| 20 29 20 3d 3d 20 4e 55 | 4c 4c 29 20 29 20 7b 0a | ) == NU|LL) ) {.|
|00002880| 58 09 09 56 4f 49 44 20 | 66 70 75 74 73 28 22 70 |X..VOID |fputs("p|
|00002890| 61 74 68 70 72 75 6e 65 | 3a 20 63 61 6e 6e 6f 74 |athprune|: cannot|
|000028a0| 20 6f 70 65 6e 20 22 2c | 20 73 74 64 65 72 72 20 | open ",| stderr |
|000028b0| 29 3b 0a 58 09 09 70 65 | 72 72 6f 72 28 20 61 72 |);.X..pe|rror( ar|
|000028c0| 67 76 5b 2d 2d 6f 70 74 | 69 6e 64 5d 20 29 3b 0a |gv[--opt|ind] );.|
|000028d0| 58 09 09 65 78 69 74 28 | 31 29 3b 0a 58 09 7d 0a |X..exit(|1);.X.}.|
|000028e0| 58 09 69 66 20 28 20 28 | 6f 70 74 69 6e 64 20 3c |X.if ( (|optind <|
|000028f0| 20 61 72 67 63 29 20 26 | 26 0a 58 09 20 20 20 20 | argc) &|&.X. |
|00002900| 20 28 66 72 65 6f 70 65 | 6e 28 20 61 72 67 76 5b | (freope|n( argv[|
|00002910| 6f 70 74 69 6e 64 2b 2b | 5d 2c 20 22 77 22 2c 20 |optind++|], "w", |
|00002920| 73 74 64 6f 75 74 20 29 | 20 3d 3d 20 4e 55 4c 4c |stdout )| == NULL|
|00002930| 29 20 29 20 7b 0a 58 09 | 09 56 4f 49 44 20 66 70 |) ) {.X.|.VOID fp|
|00002940| 75 74 73 28 22 70 61 74 | 68 70 72 75 6e 65 3a 20 |uts("pat|hprune: |
|00002950| 63 61 6e 6e 6f 74 20 63 | 72 65 61 74 65 20 22 2c |cannot c|reate ",|
|00002960| 20 73 74 64 65 72 72 20 | 29 3b 0a 58 09 09 70 65 | stderr |);.X..pe|
|00002970| 72 72 6f 72 28 20 61 72 | 67 76 5b 2d 2d 6f 70 74 |rror( ar|gv[--opt|
|00002980| 69 6e 64 5d 20 29 3b 0a | 58 09 09 65 78 69 74 28 |ind] );.|X..exit(|
|00002990| 31 29 3b 0a 58 09 7d 0a | 58 09 69 66 20 28 6f 70 |1);.X.}.|X.if (op|
|000029a0| 74 69 6e 64 20 3c 20 61 | 72 67 63 29 20 7b 0a 58 |tind < a|rgc) {.X|
|000029b0| 09 09 67 6f 74 6f 20 55 | 73 61 67 65 3b 0a 58 09 |..goto U|sage;.X.|
|000029c0| 7d 0a 58 0a 58 0a 58 09 | 2f 2a 20 20 52 65 61 64 |}.X.X.X.|/* Read|
|000029d0| 20 69 6e 20 74 68 65 20 | 66 69 6c 65 20 61 20 6c | in the |file a l|
|000029e0| 69 6e 65 20 61 74 20 61 | 20 74 69 6d 65 2e 20 20 |ine at a| time. |
|000029f0| 54 68 65 72 65 20 61 72 | 65 20 74 77 6f 20 6b 69 |There ar|e two ki|
|00002a00| 6e 64 73 20 6f 66 20 6c | 69 6e 65 73 3a 0a 58 09 |nds of l|ines:.X.|
|00002a10| 20 2a 20 20 6e 6f 64 65 | 20 6c 69 6e 65 73 20 61 | * node| lines a|
|00002a20| 6e 64 20 67 61 74 65 77 | 61 79 20 6c 69 6e 65 73 |nd gatew|ay lines|
|00002a30| 2e 20 20 57 68 69 6c 65 | 20 77 65 20 61 72 65 20 |. While| we are |
|00002a40| 72 65 61 64 69 6e 67 20 | 67 61 74 65 77 61 79 20 |reading |gateway |
|00002a50| 6c 69 6e 65 73 0a 58 09 | 20 2a 20 20 77 65 20 6a |lines.X.| * we j|
|00002a60| 75 73 74 20 72 65 61 64 | 20 74 68 65 6d 20 69 6e |ust read| them in|
|00002a70| 20 61 6e 64 20 73 61 76 | 65 20 74 68 65 6d 2e 20 | and sav|e them. |
|00002a80| 20 4f 6e 63 65 20 77 65 | 20 67 65 74 20 61 20 6e | Once we| get a n|
|00002a90| 6f 6e 2d 67 61 74 65 77 | 61 79 0a 58 09 20 2a 20 |on-gatew|ay.X. * |
|00002aa0| 20 6c 69 6e 65 2c 20 77 | 65 20 70 72 75 6e 65 2e | line, w|e prune.|
|00002ab0| 0a 58 09 20 2a 2f 0a 58 | 0a 58 09 2f 2a 20 20 52 |.X. */.X|.X./* R|
|00002ac0| 65 61 64 20 69 6e 20 61 | 6c 6c 20 74 68 65 20 64 |ead in a|ll the d|
|00002ad0| 6f 6d 61 69 6e 20 67 61 | 74 65 77 61 79 73 2e 0a |omain ga|teways..|
|00002ae0| 58 09 20 2a 2f 0a 58 09 | 66 6f 72 20 28 3b 3b 29 |X. */.X.|for (;;)|
|00002af0| 20 7b 0a 58 09 09 69 66 | 20 28 67 65 74 73 28 20 | {.X..if| (gets( |
|00002b00| 6c 69 6e 65 62 75 66 20 | 29 20 3d 3d 20 4e 55 4c |linebuf |) == NUL|
|00002b10| 4c 29 0a 58 09 09 09 66 | 61 74 61 6c 28 22 75 6e |L).X...f|atal("un|
|00002b20| 65 78 70 65 63 74 65 64 | 20 45 4f 46 22 29 3b 0a |expected| EOF");.|
|00002b30| 58 09 09 69 66 20 28 6c | 69 6e 65 62 75 66 5b 30 |X..if (l|inebuf[0|
|00002b40| 5d 20 21 3d 20 27 2e 27 | 29 0a 58 09 09 09 62 72 |] != '.'|).X...br|
|00002b50| 65 61 6b 3b 0a 58 09 09 | 67 77 5f 69 6e 2b 2b 3b |eak;.X..|gw_in++;|
|00002b60| 0a 58 09 09 61 64 64 5f | 67 61 74 65 77 61 79 28 |.X..add_|gateway(|
|00002b70| 20 6c 69 6e 65 62 75 66 | 20 29 3b 0a 58 09 7d 0a | linebuf| );.X.}.|
|00002b80| 58 09 69 66 20 28 72 6f | 6f 74 6e 6f 64 65 20 3d |X.if (ro|otnode =|
|00002b90| 3d 20 4e 55 4c 4c 29 0a | 58 09 09 66 61 74 61 6c |= NULL).|X..fatal|
|00002ba0| 28 22 6e 6f 20 64 6f 6d | 61 69 6e 20 67 61 74 65 |("no dom|ain gate|
|00002bb0| 77 61 79 73 22 29 3b 0a | 58 0a 58 09 2f 2a 20 20 |ways");.|X.X./* |
|00002bc0| 4e 6f 77 20 70 72 75 6e | 65 20 6f 75 74 20 61 6e |Now prun|e out an|
|00002bd0| 79 20 75 6e 6e 65 63 65 | 73 73 61 72 79 20 64 6f |y unnece|ssary do|
|00002be0| 6d 61 69 6e 20 67 61 74 | 65 77 61 79 73 2e 20 20 |main gat|eways. |
|00002bf0| 54 68 65 79 20 77 69 6c | 6c 20 62 65 0a 58 09 20 |They wil|l be.X. |
|00002c00| 2a 20 20 75 6e 6e 65 63 | 65 73 73 61 72 79 20 69 |* unnec|essary i|
|00002c10| 66 20 74 68 65 79 20 61 | 72 65 20 61 20 73 75 62 |f they a|re a sub|
|00002c20| 64 6f 6d 61 69 6e 20 61 | 6e 64 20 74 68 65 20 70 |domain a|nd the p|
|00002c30| 61 74 68 20 70 61 73 73 | 65 73 0a 58 09 20 2a 20 |ath pass|es.X. * |
|00002c40| 20 74 68 72 6f 75 67 68 | 20 74 68 65 20 64 6f 6d | through| the dom|
|00002c50| 61 69 6e 20 67 61 74 65 | 77 61 79 2e 20 20 57 65 |ain gate|way. We|
|00002c60| 20 77 69 6c 6c 20 6c 65 | 61 76 65 20 61 6c 6f 6e | will le|ave alon|
|00002c70| 65 20 61 6e 79 20 65 6e | 74 72 69 65 73 0a 58 09 |e any en|tries.X.|
|00002c80| 20 2a 20 20 66 6f 72 20 | 6f 75 72 73 65 6c 76 65 | * for |ourselve|
|00002c90| 73 20 28 25 73 29 20 62 | 65 63 61 75 73 65 20 77 |s (%s) b|ecause w|
|00002ca0| 65 20 6d 61 79 20 75 73 | 65 20 74 68 65 6d 20 74 |e may us|e them t|
|00002cb0| 6f 20 71 75 61 6c 69 66 | 79 2e 0a 58 09 20 2a 2f |o qualif|y..X. */|
|00002cc0| 0a 58 09 69 66 20 28 28 | 70 20 3d 20 6c 6f 6f 6b |.X.if ((|p = look|
|00002cd0| 5f 6e 6f 64 65 28 20 26 | 72 6f 6f 74 6e 6f 64 65 |_node( &|rootnode|
|00002ce0| 2c 20 55 55 43 50 4e 41 | 4d 45 20 29 29 20 21 3d |, UUCPNA|ME )) !=|
|00002cf0| 20 4e 55 4c 4c 29 20 7b | 0a 58 09 09 75 75 63 70 | NULL) {|.X..uucp|
|00002d00| 70 61 74 68 20 3d 20 70 | 2d 3e 70 61 74 68 6e 61 |path = p|->pathna|
|00002d10| 6d 65 3b 0a 58 09 09 70 | 2d 3e 66 6c 61 67 73 20 |me;.X..p|->flags |
|00002d20| 7c 3d 20 53 41 43 52 45 | 44 5f 44 4f 4d 41 49 4e ||= SACRE|D_DOMAIN|
|00002d30| 3b 0a 58 09 09 69 66 20 | 28 70 2d 3e 66 6c 61 67 |;.X..if |(p->flag|
|00002d40| 73 20 26 20 52 45 4d 4f | 56 45 5f 48 4f 53 54 29 |s & REMO|VE_HOST)|
|00002d50| 0a 58 09 09 09 66 6c 67 | 5f 72 65 6d 6f 76 65 75 |.X...flg|_removeu|
|00002d60| 75 63 70 2b 2b 3b 0a 58 | 09 7d 0a 58 09 69 66 20 |ucp++;.X|.}.X.if |
|00002d70| 28 28 70 20 3d 20 6c 6f | 6f 6b 5f 6e 6f 64 65 28 |((p = lo|ok_node(|
|00002d80| 20 26 72 6f 6f 74 6e 6f | 64 65 2c 20 4f 54 48 45 | &rootno|de, OTHE|
|00002d90| 52 4e 41 4d 45 20 29 29 | 20 21 3d 20 4e 55 4c 4c |RNAME ))| != NULL|
|00002da0| 29 20 7b 0a 58 09 09 69 | 66 20 28 66 6c 67 5f 74 |) {.X..i|f (flg_t|
|00002db0| 6f 70 64 65 6c 29 0a 58 | 09 09 09 6f 74 68 65 72 |opdel).X|...other|
|00002dc0| 70 61 74 68 20 3d 20 70 | 2d 3e 70 61 74 68 6e 61 |path = p|->pathna|
|00002dd0| 6d 65 3b 0a 58 09 09 69 | 66 20 28 70 2d 3e 66 6c |me;.X..i|f (p->fl|
|00002de0| 61 67 73 20 26 20 53 41 | 43 52 45 44 5f 44 4f 4d |ags & SA|CRED_DOM|
|00002df0| 41 49 4e 29 0a 58 09 09 | 09 66 6c 67 5f 64 6f 6e |AIN).X..|.flg_don|
|00002e00| 74 70 72 75 6e 65 2b 2b | 3b 0a 58 09 09 70 2d 3e |tprune++|;.X..p->|
|00002e10| 66 6c 61 67 73 20 7c 3d | 20 53 41 43 52 45 44 5f |flags |=| SACRED_|
|00002e20| 44 4f 4d 41 49 4e 3b 0a | 58 09 7d 0a 58 0a 58 09 |DOMAIN;.|X.}.X.X.|
|00002e30| 69 66 20 28 21 66 6c 67 | 5f 64 6f 6e 74 70 72 75 |if (!flg|_dontpru|
|00002e40| 6e 65 29 0a 58 09 09 70 | 72 75 6e 65 5f 67 61 74 |ne).X..p|rune_gat|
|00002e50| 65 77 61 79 28 20 72 6f | 6f 74 6e 6f 64 65 2c 20 |eway( ro|otnode, |
|00002e60| 6f 74 68 65 72 70 61 74 | 68 20 29 3b 0a 58 0a 58 |otherpat|h );.X.X|
|00002e70| 09 2f 2a 20 20 4e 6f 77 | 20 70 72 69 6e 74 20 6f |./* Now| print o|
|00002e80| 75 74 20 74 68 65 20 67 | 61 74 65 77 61 79 20 65 |ut the g|ateway e|
|00002e90| 6e 74 72 69 65 73 20 69 | 6e 20 74 68 65 20 6f 72 |ntries i|n the or|
|00002ea0| 69 67 69 6e 61 6c 20 6f | 72 64 65 72 2e 0a 58 09 |iginal o|rder..X.|
|00002eb0| 20 2a 2f 0a 58 09 66 6f | 72 20 28 20 70 20 3d 20 | */.X.fo|r ( p = |
|00002ec0| 66 69 72 73 74 6e 6f 64 | 65 3b 20 70 20 21 3d 20 |firstnod|e; p != |
|00002ed0| 4e 55 4c 4c 3b 20 70 20 | 3d 20 70 2d 3e 6f 72 64 |NULL; p |= p->ord|
|00002ee0| 65 72 20 29 20 7b 0a 58 | 09 09 69 66 20 28 70 2d |er ) {.X|..if (p-|
|00002ef0| 3e 6c 69 6e 65 20 21 3d | 20 4e 55 4c 4c 29 20 7b |>line !=| NULL) {|
|00002f00| 0a 58 09 09 09 67 77 5f | 6f 75 74 2b 2b 3b 0a 58 |.X...gw_|out++;.X|
|00002f10| 09 09 09 56 4f 49 44 20 | 70 75 74 73 28 20 70 2d |...VOID |puts( p-|
|00002f20| 3e 6c 69 6e 65 20 29 3b | 0a 58 09 09 7d 0a 58 09 |>line );|.X..}.X.|
|00002f30| 7d 0a 58 0a 58 09 2f 2a | 20 20 41 6c 6c 20 74 68 |}.X.X./*| All th|
|00002f40| 65 20 72 65 6d 61 69 6e | 69 6e 67 20 6c 69 6e 65 |e remain|ing line|
|00002f50| 73 20 69 6e 20 74 68 65 | 20 66 69 6c 65 20 77 69 |s in the| file wi|
|00002f60| 6c 6c 20 62 65 20 6e 6f | 64 65 20 6e 61 6d 65 73 |ll be no|de names|
|00002f70| 2e 0a 58 09 20 2a 20 20 | 4c 6f 6f 6b 20 75 70 20 |..X. * |Look up |
|00002f80| 74 68 65 20 64 6f 6d 61 | 69 6e 20 6e 61 6d 65 20 |the doma|in name |
|00002f90| 74 6f 20 73 65 65 20 77 | 68 61 74 20 67 61 74 65 |to see w|hat gate|
|00002fa0| 77 61 79 20 77 65 20 77 | 6f 75 6c 64 20 75 73 65 |way we w|ould use|
|00002fb0| 3b 0a 58 09 20 2a 20 20 | 49 66 20 74 68 65 20 67 |;.X. * |If the g|
|00002fc0| 61 74 65 77 61 79 20 69 | 73 20 6f 6e 20 74 68 65 |ateway i|s on the|
|00002fd0| 20 70 61 74 68 20 74 6f | 20 74 68 65 20 6e 6f 64 | path to| the nod|
|00002fe0| 65 20 6e 61 6d 65 20 74 | 68 65 6e 20 77 65 20 64 |e name t|hen we d|
|00002ff0| 6f 0a 58 09 20 2a 20 20 | 6e 6f 74 20 6e 65 65 64 |o.X. * |not need|
|00003000| 20 74 68 69 73 20 65 6e | 74 72 79 2e 0a 58 09 20 | this en|try..X. |
|00003010| 2a 20 20 49 66 20 74 68 | 65 79 20 61 72 65 20 73 |* If th|ey are s|
|00003020| 69 6d 70 6c 65 20 6e 6f | 64 65 20 6e 61 6d 65 73 |imple no|de names|
|00003030| 20 77 65 20 68 61 76 65 | 20 74 6f 20 70 61 73 73 | we have| to pass|
|00003040| 20 74 68 65 6d 20 72 69 | 67 68 74 0a 58 09 20 2a | them ri|ght.X. *|
|00003050| 20 20 74 68 72 6f 75 67 | 68 20 75 6e 6c 65 73 73 | throug|h unless|
|00003060| 20 77 65 20 68 61 76 65 | 20 61 20 75 73 65 66 75 | we have| a usefu|
|00003070| 6c 6c 20 22 2e 75 75 63 | 70 22 20 67 61 74 65 77 |ll ".uuc|p" gatew|
|00003080| 61 79 20 61 6c 6f 6e 67 | 0a 58 09 20 2a 20 20 74 |ay along|.X. * t|
|00003090| 68 65 20 77 61 79 2e 0a | 58 09 20 2a 2f 0a 58 09 |he way..|X. */.X.|
|000030a0| 66 6f 72 20 28 3b 3b 29 | 20 7b 0a 58 09 09 63 68 |for (;;)| {.X..ch|
|000030b0| 65 63 6b 5f 6e 65 65 64 | 65 64 28 20 6c 69 6e 65 |eck_need|ed( line|
|000030c0| 62 75 66 20 29 3b 0a 58 | 0a 58 09 09 2f 2a 20 20 |buf );.X|.X../* |
|000030d0| 4e 6f 77 20 67 65 74 20 | 61 6e 6f 74 68 65 72 20 |Now get |another |
|000030e0| 6c 69 6e 65 2e 0a 58 09 | 09 20 2a 2f 0a 58 09 09 |line..X.|. */.X..|
|000030f0| 69 66 20 28 67 65 74 73 | 28 20 6c 69 6e 65 62 75 |if (gets|( linebu|
|00003100| 66 20 29 20 3d 3d 20 4e | 55 4c 4c 29 0a 58 09 09 |f ) == N|ULL).X..|
|00003110| 09 62 72 65 61 6b 3b 0a | 58 09 09 69 66 20 28 6c |.break;.|X..if (l|
|00003120| 69 6e 65 62 75 66 5b 30 | 5d 20 3d 3d 20 27 2e 27 |inebuf[0|] == '.'|
|00003130| 29 0a 58 09 09 09 66 61 | 74 61 6c 28 22 75 6e 65 |).X...fa|tal("une|
|00003140| 78 70 65 63 74 65 64 20 | 64 6f 6d 61 69 6e 20 67 |xpected |domain g|
|00003150| 61 74 65 77 61 79 22 29 | 3b 0a 58 09 7d 0a 58 0a |ateway")|;.X.}.X.|
|00003160| 58 09 69 66 20 28 66 6c | 67 5f 76 65 72 62 6f 73 |X.if (fl|g_verbos|
|00003170| 65 29 20 7b 0a 58 09 09 | 56 4f 49 44 20 66 70 72 |e) {.X..|VOID fpr|
|00003180| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 22 67 61 74 |intf(std|err,"gat|
|00003190| 65 77 61 79 5c 74 25 38 | 64 25 38 64 5c 74 25 35 |eway\t%8|d%8d\t%5|
|000031a0| 2e 32 66 5c 6e 22 2c 0a | 58 09 09 09 67 77 5f 69 |.2f\n",.|X...gw_i|
|000031b0| 6e 2c 20 67 77 5f 6f 75 | 74 2c 20 28 64 6f 75 62 |n, gw_ou|t, (doub|
|000031c0| 6c 65 29 67 77 5f 6f 75 | 74 20 2f 20 28 64 6f 75 |le)gw_ou|t / (dou|
|000031d0| 62 6c 65 29 67 77 5f 69 | 6e 20 29 3b 0a 58 09 09 |ble)gw_i|n );.X..|
|000031e0| 56 4f 49 44 20 66 70 72 | 69 6e 74 66 28 73 74 64 |VOID fpr|intf(std|
|000031f0| 65 72 72 2c 22 64 6f 6d | 61 69 6e 5c 74 25 38 64 |err,"dom|ain\t%8d|
|00003200| 25 38 64 5c 74 25 35 2e | 32 66 5c 6e 22 2c 0a 58 |%8d\t%5.|2f\n",.X|
|00003210| 09 09 09 64 6f 6d 5f 69 | 6e 2c 20 64 6f 6d 5f 6f |...dom_i|n, dom_o|
|00003220| 75 74 2c 20 28 64 6f 75 | 62 6c 65 29 64 6f 6d 5f |ut, (dou|ble)dom_|
|00003230| 6f 75 74 20 2f 20 28 64 | 6f 75 62 6c 65 29 64 6f |out / (d|ouble)do|
|00003240| 6d 5f 69 6e 20 29 3b 0a | 58 09 09 56 4f 49 44 20 |m_in );.|X..VOID |
|00003250| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 22 |fprintf(|stderr,"|
|00003260| 68 6f 73 74 5c 74 25 38 | 64 25 38 64 5c 74 25 35 |host\t%8|d%8d\t%5|
|00003270| 2e 32 66 5c 6e 22 2c 0a | 58 09 09 09 68 73 74 5f |.2f\n",.|X...hst_|
|00003280| 69 6e 2c 20 68 73 74 5f | 6f 75 74 2c 20 28 64 6f |in, hst_|out, (do|
|00003290| 75 62 6c 65 29 68 73 74 | 5f 6f 75 74 20 2f 20 28 |uble)hst|_out / (|
|000032a0| 64 6f 75 62 6c 65 29 68 | 73 74 5f 69 6e 20 29 3b |double)h|st_in );|
|000032b0| 0a 58 09 7d 0a 58 0a 58 | 09 65 78 69 74 28 30 29 |.X.}.X.X|.exit(0)|
|000032c0| 3b 0a 58 7d 0a 58 0a 58 | 0a 58 64 6f 6d 66 6c 61 |;.X}.X.X|.Xdomfla|
|000032d0| 67 28 20 6e 61 6d 65 2c | 20 66 6c 61 67 73 20 29 |g( name,| flags )|
|000032e0| 0a 58 72 65 67 69 73 74 | 65 72 20 63 68 61 72 20 |.Xregist|er char |
|000032f0| 2a 6e 61 6d 65 3b 0a 58 | 69 6e 74 20 66 6c 61 67 |*name;.X|int flag|
|00003300| 73 3b 0a 58 7b 0a 58 09 | 72 65 67 69 73 74 65 72 |s;.X{.X.|register|
|00003310| 20 73 74 72 75 63 74 20 | 64 6e 6f 64 65 20 2a 2a | struct |dnode **|
|00003320| 70 70 3b 0a 58 09 72 65 | 67 69 73 74 65 72 20 73 |pp;.X.re|gister s|
|00003330| 74 72 75 63 74 20 64 6e | 6f 64 65 20 2a 70 3b 0a |truct dn|ode *p;.|
|00003340| 58 09 72 65 67 69 73 74 | 65 72 20 63 68 61 72 20 |X.regist|er char |
|00003350| 2a 73 3b 0a 58 0a 58 09 | 70 70 20 3d 20 26 72 6f |*s;.X.X.|pp = &ro|
|00003360| 6f 74 6e 6f 64 65 3b 0a | 58 09 77 68 69 6c 65 20 |otnode;.|X.while |
|00003370| 28 28 73 20 3d 20 73 74 | 72 72 63 68 72 28 20 6e |((s = st|rrchr( n|
|00003380| 61 6d 65 2c 20 27 2e 27 | 20 29 29 20 21 3d 20 4e |ame, '.'| )) != N|
|00003390| 55 4c 4c 29 20 7b 0a 58 | 09 09 2a 73 2b 2b 20 3d |ULL) {.X|..*s++ =|
|000033a0| 20 27 5c 30 27 3b 09 2f | 2a 20 74 6f 20 6d 6f 73 | '\0';./|* to mos|
|000033b0| 74 20 73 69 67 6e 69 66 | 69 63 61 6e 74 20 70 61 |t signif|icant pa|
|000033c0| 72 74 20 6f 66 20 64 6f | 6d 61 69 6e 20 6e 61 6d |rt of do|main nam|
|000033d0| 65 20 2a 2f 0a 58 09 09 | 70 20 3d 20 61 64 64 5f |e */.X..|p = add_|
|000033e0| 6e 6f 64 65 28 20 70 70 | 2c 20 73 20 29 3b 0a 58 |node( pp|, s );.X|
|000033f0| 09 09 70 70 20 3d 20 26 | 28 70 2d 3e 63 68 69 6c |..pp = &|(p->chil|
|00003400| 64 72 65 6e 29 3b 0a 58 | 09 7d 0a 58 09 69 66 20 |dren);.X|.}.X.if |
|00003410| 28 2a 6e 61 6d 65 29 0a | 58 09 09 70 20 3d 20 61 |(*name).|X..p = a|
|00003420| 64 64 5f 6e 6f 64 65 28 | 20 70 70 2c 20 6e 61 6d |dd_node(| pp, nam|
|00003430| 65 20 29 3b 0a 58 0a 58 | 09 70 2d 3e 66 6c 61 67 |e );.X.X|.p->flag|
|00003440| 73 20 7c 3d 20 66 6c 61 | 67 73 3b 0a 58 7d 0a 58 |s |= fla|gs;.X}.X|
|00003450| 0a 58 61 64 64 5f 67 61 | 74 65 77 61 79 28 20 62 |.Xadd_ga|teway( b|
|00003460| 75 66 20 29 0a 58 72 65 | 67 69 73 74 65 72 20 63 |uf ).Xre|gister c|
|00003470| 68 61 72 20 2a 62 75 66 | 3b 0a 58 7b 0a 58 09 72 |har *buf|;.X{.X.r|
|00003480| 65 67 69 73 74 65 72 20 | 73 74 72 75 63 74 20 64 |egister |struct d|
|00003490| 6e 6f 64 65 20 2a 2a 70 | 70 3b 0a 58 09 72 65 67 |node **p|p;.X.reg|
|000034a0| 69 73 74 65 72 20 73 74 | 72 75 63 74 20 64 6e 6f |ister st|ruct dno|
|000034b0| 64 65 20 2a 70 3b 0a 58 | 09 72 65 67 69 73 74 65 |de *p;.X|.registe|
|000034c0| 72 20 63 68 61 72 20 2a | 73 3b 0a 58 09 63 68 61 |r char *|s;.X.cha|
|000034d0| 72 20 2a 20 6c 69 6e 65 | 3b 0a 58 09 63 68 61 72 |r * line|;.X.char|
|000034e0| 20 2a 20 67 77 3b 0a 58 | 09 63 68 61 72 20 2a 20 | * gw;.X|.char * |
|000034f0| 70 61 74 68 3b 0a 58 0a | 58 09 2f 2a 20 20 53 61 |path;.X.|X./* Sa|
|00003500| 76 65 20 74 68 65 20 6f | 72 69 67 69 6e 61 6c 20 |ve the o|riginal |
|00003510| 6c 69 6e 65 20 62 65 63 | 61 75 73 65 20 77 65 20 |line bec|ause we |
|00003520| 77 69 6c 6c 20 6e 65 65 | 64 20 69 74 20 6c 61 74 |will nee|d it lat|
|00003530| 65 72 2e 0a 58 09 20 2a | 2f 0a 58 09 6c 69 6e 65 |er..X. *|/.X.line|
|00003540| 20 3d 20 73 74 72 61 6c | 6c 6f 63 28 20 62 75 66 | = stral|loc( buf|
|00003550| 20 29 3b 0a 58 0a 58 09 | 69 66 20 28 28 67 77 20 | );.X.X.|if ((gw |
|00003560| 3d 20 73 74 72 74 6f 6b | 28 20 62 75 66 2c 20 22 |= strtok|( buf, "|
|00003570| 20 5c 74 22 20 29 29 20 | 3d 3d 20 4e 55 4c 4c 29 | \t" )) |== NULL)|
|00003580| 0a 58 09 09 66 61 74 61 | 6c 28 22 6d 69 73 73 69 |.X..fata|l("missi|
|00003590| 6e 67 20 67 61 74 65 77 | 61 79 20 6f 6e 20 6c 69 |ng gatew|ay on li|
|000035a0| 6e 65 22 29 3b 0a 58 09 | 67 77 20 3d 20 73 74 72 |ne");.X.|gw = str|
|000035b0| 61 6c 6c 6f 63 28 20 67 | 77 20 29 3b 0a 58 09 69 |alloc( g|w );.X.i|
|000035c0| 66 20 28 28 70 61 74 68 | 20 3d 20 73 74 72 74 6f |f ((path| = strto|
|000035d0| 6b 28 20 28 63 68 61 72 | 20 2a 29 4e 55 4c 4c 2c |k( (char| *)NULL,|
|000035e0| 20 22 20 5c 74 22 20 29 | 29 20 3d 3d 20 4e 55 4c | " \t" )|) == NUL|
|000035f0| 4c 29 0a 58 09 09 66 61 | 74 61 6c 28 22 6d 69 73 |L).X..fa|tal("mis|
|00003600| 73 69 6e 67 20 70 61 74 | 68 20 6f 6e 20 67 61 74 |sing pat|h on gat|
|00003610| 65 77 61 79 20 6c 69 6e | 65 22 29 3b 0a 58 09 70 |eway lin|e");.X.p|
|00003620| 61 74 68 20 3d 20 73 74 | 72 61 6c 6c 6f 63 28 20 |ath = st|ralloc( |
|00003630| 70 61 74 68 20 29 3b 0a | 58 0a 58 09 2f 2a 20 20 |path );.|X.X./* |
|00003640| 47 6f 20 64 6f 77 6e 20 | 74 68 72 6f 75 67 68 20 |Go down |through |
|00003650| 61 6c 6c 20 74 68 65 20 | 6e 6f 64 65 73 20 6c 6f |all the |nodes lo|
|00003660| 6f 6b 69 6e 67 20 66 6f | 72 20 74 68 69 73 20 6f |oking fo|r this o|
|00003670| 6e 65 2e 0a 58 09 20 2a | 20 20 57 65 20 77 6f 6e |ne..X. *| We won|
|00003680| 27 74 20 61 63 74 75 61 | 6c 6c 79 20 66 69 6e 64 |'t actua|lly find|
|00003690| 20 69 74 20 62 75 74 20 | 77 69 6c 6c 20 63 72 65 | it but |will cre|
|000036a0| 61 74 65 20 65 76 65 72 | 79 74 68 69 6e 67 0a 58 |ate ever|ything.X|
|000036b0| 09 20 2a 20 20 61 6c 6f | 6e 67 20 74 68 65 20 77 |. * alo|ng the w|
|000036c0| 61 79 2e 0a 58 09 20 2a | 2f 0a 58 09 70 70 20 3d |ay..X. *|/.X.pp =|
|000036d0| 20 26 72 6f 6f 74 6e 6f | 64 65 3b 0a 58 09 77 68 | &rootno|de;.X.wh|
|000036e0| 69 6c 65 20 28 28 73 20 | 3d 20 73 74 72 72 63 68 |ile ((s |= strrch|
|000036f0| 72 28 20 62 75 66 2c 20 | 27 2e 27 20 29 29 20 21 |r( buf, |'.' )) !|
|00003700| 3d 20 4e 55 4c 4c 29 20 | 7b 0a 58 09 09 2a 73 2b |= NULL) |{.X..*s+|
|00003710| 2b 20 3d 20 27 5c 30 27 | 3b 09 2f 2a 20 74 6f 20 |+ = '\0'|;./* to |
|00003720| 6d 6f 73 74 20 73 69 67 | 6e 69 66 69 63 61 6e 74 |most sig|nificant|
|00003730| 20 70 61 72 74 20 6f 66 | 20 64 6f 6d 61 69 6e 20 | part of| domain |
|00003740| 6e 61 6d 65 20 2a 2f 0a | 58 09 09 70 20 3d 20 61 |name */.|X..p = a|
|00003750| 64 64 5f 6e 6f 64 65 28 | 20 70 70 2c 20 73 20 29 |dd_node(| pp, s )|
|00003760| 3b 0a 58 09 09 70 70 20 | 3d 20 26 28 70 2d 3e 63 |;.X..pp |= &(p->c|
|00003770| 68 69 6c 64 72 65 6e 29 | 3b 0a 58 09 7d 0a 58 0a |hildren)|;.X.}.X.|
|00003780| 58 09 2f 2a 20 20 4d 61 | 6b 65 20 73 75 72 65 20 |X./* Ma|ke sure |
|00003790| 74 68 61 74 20 74 68 69 | 73 20 6f 6e 65 20 68 61 |that thi|s one ha|
|000037a0| 73 6e 27 74 20 61 6c 72 | 65 61 64 79 20 62 65 65 |sn't alr|eady bee|
|000037b0| 6e 20 75 73 65 64 2e 0a | 58 09 20 2a 2f 0a 58 09 |n used..|X. */.X.|
|000037c0| 69 66 20 28 70 2d 3e 6c | 69 6e 65 20 21 3d 20 4e |if (p->l|ine != N|
|000037d0| 55 4c 4c 29 0a 58 09 09 | 66 61 74 61 6c 28 22 64 |ULL).X..|fatal("d|
|000037e0| 75 70 6c 69 63 61 74 65 | 20 67 61 74 65 77 61 79 |uplicate| gateway|
|000037f0| 20 6e 61 6d 65 20 66 6f | 75 6e 64 22 29 3b 0a 58 | name fo|und");.X|
|00003800| 09 70 2d 3e 6c 69 6e 65 | 20 3d 20 6c 69 6e 65 3b |.p->line| = line;|
|00003810| 0a 58 09 70 2d 3e 66 75 | 6c 6c 6e 61 6d 65 20 3d |.X.p->fu|llname =|
|00003820| 20 67 77 3b 0a 58 09 70 | 2d 3e 70 61 74 68 6e 61 | gw;.X.p|->pathna|
|00003830| 6d 65 20 3d 20 70 61 74 | 68 3b 0a 58 0a 58 09 2f |me = pat|h;.X.X./|
|00003840| 2a 20 20 42 75 69 6c 64 | 20 74 68 65 20 63 6f 72 |* Build| the cor|
|00003850| 72 65 63 74 20 70 6f 69 | 6e 74 65 72 73 20 73 6f |rect poi|nters so|
|00003860| 20 77 65 20 63 61 6e 20 | 70 72 6f 63 65 73 73 20 | we can |process |
|00003870| 74 68 65 73 65 20 6e 6f | 64 65 73 0a 58 09 20 2a |these no|des.X. *|
|00003880| 20 20 69 6e 20 74 68 65 | 20 6f 72 69 67 69 6e 61 | in the| origina|
|00003890| 6c 20 6f 72 64 65 72 20 | 77 68 65 6e 20 69 74 20 |l order |when it |
|000038a0| 63 6f 6d 65 73 20 74 69 | 6d 65 20 74 6f 20 70 72 |comes ti|me to pr|
|000038b0| 69 6e 74 20 74 68 65 6d | 0a 58 09 20 2a 20 20 62 |int them|.X. * b|
|000038c0| 61 63 6b 20 6f 75 74 2e | 0a 58 09 20 2a 2f 0a 58 |ack out.|.X. */.X|
|000038d0| 09 69 66 20 28 66 69 72 | 73 74 6e 6f 64 65 20 3d |.if (fir|stnode =|
|000038e0| 3d 20 4e 55 4c 4c 29 0a | 58 09 09 66 69 72 73 74 |= NULL).|X..first|
|000038f0| 6e 6f 64 65 20 3d 20 70 | 3b 0a 58 09 69 66 20 28 |node = p|;.X.if (|
|00003900| 6c 61 73 74 6e 6f 64 65 | 20 21 3d 20 4e 55 4c 4c |lastnode| != NULL|
|00003910| 29 0a 58 09 09 6c 61 73 | 74 6e 6f 64 65 2d 3e 6f |).X..las|tnode->o|
|00003920| 72 64 65 72 20 3d 20 70 | 3b 0a 58 09 6c 61 73 74 |rder = p|;.X.last|
|00003930| 6e 6f 64 65 20 3d 20 70 | 3b 0a 58 7d 0a 58 0a 58 |node = p|;.X}.X.X|
|00003940| 0a 58 73 74 72 75 63 74 | 20 64 6e 6f 64 65 20 2a |.Xstruct| dnode *|
|00003950| 0a 58 6c 6f 6f 6b 5f 6e | 6f 64 65 28 20 70 70 2c |.Xlook_n|ode( pp,|
|00003960| 20 6e 61 6d 65 20 29 0a | 58 72 65 67 69 73 74 65 | name ).|Xregiste|
|00003970| 72 20 73 74 72 75 63 74 | 20 64 6e 6f 64 65 20 2a |r struct| dnode *|
|00003980| 2a 70 70 3b 0a 58 72 65 | 67 69 73 74 65 72 20 63 |*pp;.Xre|gister c|
|00003990| 68 61 72 20 2a 6e 61 6d | 65 3b 0a 58 7b 0a 58 09 |har *nam|e;.X{.X.|
|000039a0| 72 65 67 69 73 74 65 72 | 20 69 3b 0a 58 09 2f 2a |register| i;.X./*|
|000039b0| 20 20 53 65 61 72 63 68 | 20 64 6f 77 6e 20 74 68 | Search| down th|
|000039c0| 65 20 6e 6f 64 65 20 74 | 72 65 65 20 6c 6f 6f 6b |e node t|ree look|
|000039d0| 69 6e 67 20 66 6f 72 20 | 61 20 6e 6f 64 65 20 77 |ing for |a node w|
|000039e0| 69 74 68 20 74 68 65 0a | 58 09 20 2a 20 20 67 69 |ith the.|X. * gi|
|000039f0| 76 65 6e 20 6e 61 6d 65 | 2e 0a 58 09 20 2a 2f 0a |ven name|..X. */.|
|00003a00| 58 09 77 68 69 6c 65 20 | 28 2a 70 70 20 21 3d 20 |X.while |(*pp != |
|00003a10| 4e 55 4c 4c 29 20 7b 0a | 58 09 09 69 20 3d 20 73 |NULL) {.|X..i = s|
|00003a20| 74 72 63 6d 70 28 20 6e | 61 6d 65 2c 20 28 2a 70 |trcmp( n|ame, (*p|
|00003a30| 70 29 2d 3e 6e 6f 64 65 | 6e 61 6d 65 20 29 3b 0a |p)->node|name );.|
|00003a40| 58 09 09 69 66 20 28 69 | 20 3d 3d 20 30 29 0a 58 |X..if (i| == 0).X|
|00003a50| 09 09 09 72 65 74 75 72 | 6e 20 28 2a 70 70 29 3b |...retur|n (*pp);|
|00003a60| 0a 58 09 09 65 6c 73 65 | 20 69 66 20 28 69 20 3c |.X..else| if (i <|
|00003a70| 20 30 29 0a 58 09 09 09 | 70 70 20 3d 20 26 28 28 | 0).X...|pp = &((|
|00003a80| 2a 70 70 29 2d 3e 6c 6e | 6f 64 65 29 3b 0a 58 09 |*pp)->ln|ode);.X.|
|00003a90| 09 65 6c 73 65 0a 58 09 | 09 09 70 70 20 3d 20 26 |.else.X.|..pp = &|
|00003aa0| 28 28 2a 70 70 29 2d 3e | 62 6e 6f 64 65 29 3b 0a |((*pp)->|bnode);.|
|00003ab0| 58 09 7d 0a 58 09 72 65 | 74 75 72 6e 20 28 4e 55 |X.}.X.re|turn (NU|
|00003ac0| 4c 4c 29 3b 0a 58 7d 0a | 58 0a 58 73 74 72 75 63 |LL);.X}.|X.Xstruc|
|00003ad0| 74 20 64 6e 6f 64 65 20 | 2a 0a 58 61 64 64 5f 6e |t dnode |*.Xadd_n|
|00003ae0| 6f 64 65 28 20 70 70 2c | 20 6e 61 6d 65 20 29 0a |ode( pp,| name ).|
|00003af0| 58 72 65 67 69 73 74 65 | 72 20 73 74 72 75 63 74 |Xregiste|r struct|
|00003b00| 20 64 6e 6f 64 65 20 2a | 2a 70 70 3b 0a 58 72 65 | dnode *|*pp;.Xre|
|00003b10| 67 69 73 74 65 72 20 63 | 68 61 72 20 2a 6e 61 6d |gister c|har *nam|
|00003b20| 65 3b 0a 58 7b 0a 58 09 | 72 65 67 69 73 74 65 72 |e;.X{.X.|register|
|00003b30| 20 69 3b 0a 58 09 2f 2a | 20 20 53 65 61 72 63 68 | i;.X./*| Search|
|00003b40| 20 64 6f 77 6e 20 74 68 | 65 20 6e 6f 64 65 20 74 | down th|e node t|
|00003b50| 72 65 65 20 6c 6f 6f 6b | 69 6e 67 20 66 6f 72 20 |ree look|ing for |
|00003b60| 61 20 6e 6f 64 65 20 77 | 69 74 68 20 74 68 65 0a |a node w|ith the.|
|00003b70| 58 09 20 2a 20 20 67 69 | 76 65 6e 20 6e 61 6d 65 |X. * gi|ven name|
|00003b80| 2e 0a 58 09 20 2a 2f 0a | 58 09 77 68 69 6c 65 20 |..X. */.|X.while |
|00003b90| 28 2a 70 70 20 21 3d 20 | 4e 55 4c 4c 29 20 7b 0a |(*pp != |NULL) {.|
|00003ba0| 58 09 09 69 20 3d 20 73 | 74 72 63 6d 70 28 20 6e |X..i = s|trcmp( n|
|00003bb0| 61 6d 65 2c 20 28 2a 70 | 70 29 2d 3e 6e 6f 64 65 |ame, (*p|p)->node|
|00003bc0| 6e 61 6d 65 20 29 3b 0a | 58 09 09 69 66 20 28 69 |name );.|X..if (i|
|00003bd0| 20 3d 3d 20 30 29 0a 58 | 09 09 09 72 65 74 75 72 | == 0).X|...retur|
|00003be0| 6e 20 28 2a 70 70 29 3b | 0a 58 09 09 65 6c 73 65 |n (*pp);|.X..else|
|00003bf0| 20 69 66 20 28 69 20 3c | 20 30 29 0a 58 09 09 09 | if (i <| 0).X...|
|00003c00| 70 70 20 3d 20 26 28 28 | 2a 70 70 29 2d 3e 6c 6e |pp = &((|*pp)->ln|
|00003c10| 6f 64 65 29 3b 0a 58 09 | 09 65 6c 73 65 0a 58 09 |ode);.X.|.else.X.|
|00003c20| 09 09 70 70 20 3d 20 26 | 28 28 2a 70 70 29 2d 3e |..pp = &|((*pp)->|
|00003c30| 62 6e 6f 64 65 29 3b 0a | 58 09 7d 0a 58 0a 58 09 |bnode);.|X.}.X.X.|
|00003c40| 2f 2a 20 20 43 6f 75 6c | 64 6e 27 74 20 66 69 6e |/* Coul|dn't fin|
|00003c50| 64 20 73 75 63 68 20 61 | 20 6e 6f 64 65 2c 20 73 |d such a| node, s|
|00003c60| 6f 20 63 72 65 61 74 65 | 20 6f 6e 65 2e 0a 58 09 |o create| one..X.|
|00003c70| 20 2a 2f 0a 58 09 2a 70 | 70 20 3d 20 28 73 74 72 | */.X.*p|p = (str|
|00003c80| 75 63 74 20 64 6e 6f 64 | 65 20 2a 29 20 63 61 6c |uct dnod|e *) cal|
|00003c90| 6c 6f 63 28 20 31 2c 20 | 73 69 7a 65 6f 66 28 73 |loc( 1, |sizeof(s|
|00003ca0| 74 72 75 63 74 20 64 6e | 6f 64 65 29 20 29 3b 0a |truct dn|ode) );.|
|00003cb0| 58 09 69 66 20 28 2a 70 | 70 20 3d 3d 20 4e 55 4c |X.if (*p|p == NUL|
|00003cc0| 4c 29 0a 58 09 09 66 61 | 74 61 6c 28 22 63 61 6e |L).X..fa|tal("can|
|00003cd0| 6e 6f 74 20 61 6c 6c 6f | 63 61 74 65 20 6e 6f 64 |not allo|cate nod|
|00003ce0| 65 22 29 3b 0a 58 09 28 | 2a 70 70 29 2d 3e 6e 6f |e");.X.(|*pp)->no|
|00003cf0| 64 65 6e 61 6d 65 20 3d | 20 73 74 72 61 6c 6c 6f |dename =| strallo|
|00003d00| 63 28 20 6e 61 6d 65 20 | 29 3b 0a 58 09 72 65 74 |c( name |);.X.ret|
|00003d10| 75 72 6e 20 28 2a 70 70 | 29 3b 0a 58 7d 0a 58 0a |urn (*pp|);.X}.X.|
|00003d20| 58 70 72 75 6e 65 5f 67 | 61 74 65 77 61 79 28 20 |Xprune_g|ateway( |
|00003d30| 70 2c 20 70 61 72 70 61 | 74 68 20 29 0a 58 72 65 |p, parpa|th ).Xre|
|00003d40| 67 69 73 74 65 72 20 73 | 74 72 75 63 74 20 64 6e |gister s|truct dn|
|00003d50| 6f 64 65 20 2a 70 3b 0a | 58 72 65 67 69 73 74 65 |ode *p;.|Xregiste|
|00003d60| 72 20 63 68 61 72 20 2a | 70 61 72 70 61 74 68 3b |r char *|parpath;|
|00003d70| 09 09 2f 2a 20 70 61 72 | 65 6e 74 73 20 70 61 74 |../* par|ents pat|
|00003d80| 68 20 2a 2f 0a 58 7b 0a | 58 09 72 65 67 69 73 74 |h */.X{.|X.regist|
|00003d90| 65 72 20 70 61 72 6c 65 | 6e 20 3d 20 73 74 72 6c |er parle|n = strl|
|00003da0| 65 6e 28 20 70 61 72 70 | 61 74 68 20 29 20 2d 20 |en( parp|ath ) - |
|00003db0| 32 3b 0a 58 09 77 68 69 | 6c 65 20 28 70 20 21 3d |2;.X.whi|le (p !=|
|00003dc0| 20 4e 55 4c 4c 29 20 7b | 0a 58 09 09 2f 2a 20 20 | NULL) {|.X../* |
|00003dd0| 44 6f 20 74 68 65 20 6c | 65 66 74 20 73 69 64 65 |Do the l|eft side|
|00003de0| 20 6f 66 20 74 68 65 20 | 74 72 65 65 20 66 69 72 | of the |tree fir|
|00003df0| 73 74 2e 0a 58 09 09 20 | 2a 2f 0a 58 09 09 70 72 |st..X.. |*/.X..pr|
|00003e00| 75 6e 65 5f 67 61 74 65 | 77 61 79 28 20 70 2d 3e |une_gate|way( p->|
|00003e10| 6c 6e 6f 64 65 2c 20 70 | 61 72 70 61 74 68 20 29 |lnode, p|arpath )|
|00003e20| 3b 0a 58 0a 58 09 09 2f | 2a 20 20 43 68 65 63 6b |;.X.X../|* Check|
|00003e30| 20 74 6f 20 73 65 65 20 | 69 66 20 77 65 20 73 68 | to see |if we sh|
|00003e40| 61 72 65 20 61 20 63 6f | 6d 6d 6f 6e 20 70 61 74 |are a co|mmon pat|
|00003e50| 68 20 77 69 74 68 20 6f | 75 72 0a 58 09 09 20 2a |h with o|ur.X.. *|
|00003e60| 20 20 70 61 72 65 6e 74 | 2e 20 20 49 66 20 77 65 | parent|. If we|
|00003e70| 20 64 6f 20 74 68 69 73 | 20 69 73 20 61 20 72 65 | do this| is a re|
|00003e80| 64 75 6e 64 61 6e 74 20 | 67 61 74 65 77 61 79 20 |dundant |gateway |
|00003e90| 61 6e 64 0a 58 09 09 20 | 2a 20 20 63 61 6e 20 62 |and.X.. |* can b|
|00003ea0| 65 20 65 6c 69 6d 69 6e | 61 74 65 64 2e 0a 58 09 |e elimin|ated..X.|
|00003eb0| 09 20 2a 2f 0a 58 09 09 | 69 66 20 28 20 28 70 61 |. */.X..|if ( (pa|
|00003ec0| 72 6c 65 6e 20 3c 3d 20 | 30 29 20 7c 7c 20 28 70 |rlen <= |0) || (p|
|00003ed0| 2d 3e 6c 69 6e 65 20 3d | 3d 20 4e 55 4c 4c 29 20 |->line =|= NULL) |
|00003ee0| 7c 7c 0a 58 09 09 20 20 | 20 20 20 28 70 2d 3e 66 |||.X.. | (p->f|
|00003ef0| 6c 61 67 73 20 26 20 53 | 41 43 52 45 44 5f 44 4f |lags & S|ACRED_DO|
|00003f00| 4d 41 49 4e 29 20 7c 7c | 0a 58 09 09 20 20 20 20 |MAIN) |||.X.. |
|00003f10| 20 28 73 74 72 63 6d 70 | 28 20 70 2d 3e 70 61 74 | (strcmp|( p->pat|
|00003f20| 68 6e 61 6d 65 2c 20 22 | 25 73 22 20 29 20 3d 3d |hname, "|%s" ) ==|
|00003f30| 20 30 29 20 29 20 7b 0a | 58 09 09 09 2f 2a 20 20 | 0) ) {.|X.../* |
|00003f40| 57 65 20 6c 65 61 76 65 | 20 74 68 65 73 65 20 61 |We leave| these a|
|00003f50| 6c 6f 6e 65 2e 0a 58 09 | 09 09 20 2a 2f 0a 58 09 |lone..X.|.. */.X.|
|00003f60| 09 7d 20 65 6c 73 65 20 | 69 66 20 28 73 74 72 6e |.} else |if (strn|
|00003f70| 63 6d 70 28 20 70 2d 3e | 70 61 74 68 6e 61 6d 65 |cmp( p->|pathname|
|00003f80| 2c 20 70 61 72 70 61 74 | 68 2c 20 70 61 72 6c 65 |, parpat|h, parle|
|00003f90| 6e 20 29 20 3d 3d 20 30 | 29 20 7b 0a 58 09 09 09 |n ) == 0|) {.X...|
|00003fa0| 2f 2a 20 20 54 68 69 73 | 20 69 73 20 6e 6f 74 20 |/* This| is not |
|00003fb0| 6f 6e 65 20 77 65 20 6e | 65 65 64 20 74 6f 20 6b |one we n|eed to k|
|00003fc0| 6e 6f 77 2e 20 20 52 65 | 6d 6f 76 65 20 69 74 0a |now. Re|move it.|
|00003fd0| 58 09 09 09 20 2a 20 20 | 66 72 6f 6d 20 74 68 65 |X... * |from the|
|00003fe0| 20 72 61 6e 6b 73 20 6f | 66 20 74 68 65 20 6c 69 | ranks o|f the li|
|00003ff0| 76 69 6e 67 2e 0a 58 09 | 09 09 20 2a 2f 0a 58 09 |ving..X.|.. */.X.|
|00004000| 09 09 70 2d 3e 6c 69 6e | 65 20 3d 20 4e 55 4c 4c |..p->lin|e = NULL|
|00004010| 3b 0a 58 09 09 7d 0a 58 | 0a 58 09 09 2f 2a 20 20 |;.X..}.X|.X../* |
|00004020| 43 68 65 63 6b 20 6f 75 | 72 20 73 75 62 64 6f 6d |Check ou|r subdom|
|00004030| 61 69 6e 73 20 66 6f 72 | 20 75 73 65 6c 65 73 73 |ains for| useless|
|00004040| 6e 65 73 73 2e 0a 58 09 | 09 20 2a 2f 0a 58 09 09 |ness..X.|. */.X..|
|00004050| 69 66 20 28 21 28 70 2d | 3e 66 6c 61 67 73 20 26 |if (!(p-|>flags &|
|00004060| 20 53 41 43 52 45 44 5f | 44 4f 4d 41 49 4e 29 29 | SACRED_|DOMAIN))|
|00004070| 0a 58 09 09 09 70 72 75 | 6e 65 5f 67 61 74 65 77 |.X...pru|ne_gatew|
|00004080| 61 79 28 20 70 2d 3e 63 | 68 69 6c 64 72 65 6e 2c |ay( p->c|hildren,|
|00004090| 0a 58 09 09 09 09 20 20 | 20 20 20 20 20 28 70 2d |.X.... | (p-|
|000040a0| 3e 6c 69 6e 65 29 20 3f | 20 70 2d 3e 70 61 74 68 |>line) ?| p->path|
|000040b0| 6e 61 6d 65 20 3a 20 70 | 61 72 70 61 74 68 20 29 |name : p|arpath )|
|000040c0| 3b 0a 58 0a 58 09 09 2f | 2a 20 20 44 6f 20 74 68 |;.X.X../|* Do th|
|000040d0| 65 20 72 69 67 68 74 20 | 73 69 64 65 20 6f 66 20 |e right |side of |
|000040e0| 74 68 65 20 74 72 65 65 | 20 75 73 69 6e 67 20 74 |the tree| using t|
|000040f0| 61 69 6c 0a 58 09 09 20 | 2a 20 20 72 65 63 75 72 |ail.X.. |* recur|
|00004100| 73 69 6f 6e 2e 0a 58 09 | 09 20 2a 2f 0a 58 09 09 |sion..X.|. */.X..|
|00004110| 70 20 3d 20 70 2d 3e 62 | 6e 6f 64 65 3b 0a 58 09 |p = p->b|node;.X.|
|00004120| 7d 0a 58 7d 0a 58 0a 58 | 0a 58 63 68 65 63 6b 5f |}.X}.X.X|.Xcheck_|
|00004130| 6e 65 65 64 65 64 28 20 | 62 75 66 20 29 0a 58 72 |needed( |buf ).Xr|
|00004140| 65 67 69 73 74 65 72 20 | 63 68 61 72 20 2a 62 75 |egister |char *bu|
|00004150| 66 3b 0a 58 7b 0a 58 09 | 72 65 67 69 73 74 65 72 |f;.X{.X.|register|
|00004160| 20 73 74 72 75 63 74 20 | 64 6e 6f 64 65 20 2a 2a | struct |dnode **|
|00004170| 70 70 3b 0a 58 09 72 65 | 67 69 73 74 65 72 20 73 |pp;.X.re|gister s|
|00004180| 74 72 75 63 74 20 64 6e | 6f 64 65 20 2a 70 3b 0a |truct dn|ode *p;.|
|00004190| 58 09 72 65 67 69 73 74 | 65 72 20 63 68 61 72 20 |X.regist|er char |
|000041a0| 2a 73 3b 0a 58 09 63 68 | 61 72 20 2a 20 70 61 74 |*s;.X.ch|ar * pat|
|000041b0| 68 3b 0a 58 09 63 68 61 | 72 20 2a 20 67 77 70 61 |h;.X.cha|r * gwpa|
|000041c0| 74 68 3b 0a 58 09 69 6e | 74 09 69 73 64 6f 6d 61 |th;.X.in|t.isdoma|
|000041d0| 69 6e 3b 0a 58 09 63 68 | 61 72 09 74 6d 70 62 75 |in;.X.ch|ar.tmpbu|
|000041e0| 66 5b 42 55 46 53 49 5a | 5d 3b 0a 58 0a 58 09 56 |f[BUFSIZ|];.X.X.V|
|000041f0| 4f 49 44 20 73 74 72 63 | 70 79 28 20 74 6d 70 62 |OID strc|py( tmpb|
|00004200| 75 66 2c 20 62 75 66 20 | 29 3b 0a 58 09 2f 2a 20 |uf, buf |);.X./* |
|00004210| 20 45 78 74 72 61 63 74 | 20 74 68 65 20 68 6f 73 | Extract| the hos|
|00004220| 74 2f 64 6f 6d 61 69 6e | 20 6e 61 6d 65 2e 20 20 |t/domain| name. |
|00004230| 2a 2f 0a 58 09 69 66 20 | 28 73 74 72 74 6f 6b 28 |*/.X.if |(strtok(|
|00004240| 20 74 6d 70 62 75 66 2c | 20 22 20 5c 74 22 20 29 | tmpbuf,| " \t" )|
|00004250| 20 3d 3d 20 4e 55 4c 4c | 29 0a 58 09 09 66 61 74 | == NULL|).X..fat|
|00004260| 61 6c 28 22 62 6c 61 6e | 6b 20 6c 69 6e 65 22 29 |al("blan|k line")|
|00004270| 3b 0a 58 09 69 66 20 28 | 73 74 72 63 68 72 28 20 |;.X.if (|strchr( |
|00004280| 74 6d 70 62 75 66 2c 20 | 27 2e 27 20 29 20 21 3d |tmpbuf, |'.' ) !=|
|00004290| 20 4e 55 4c 4c 29 20 7b | 0a 58 09 09 69 73 64 6f | NULL) {|.X..isdo|
|000042a0| 6d 61 69 6e 20 3d 20 31 | 3b 0a 58 09 09 64 6f 6d |main = 1|;.X..dom|
|000042b0| 5f 69 6e 2b 2b 3b 0a 58 | 09 7d 20 65 6c 73 65 20 |_in++;.X|.} else |
|000042c0| 7b 0a 58 09 09 69 73 64 | 6f 6d 61 69 6e 20 3d 20 |{.X..isd|omain = |
|000042d0| 30 3b 0a 58 09 09 68 73 | 74 5f 69 6e 2b 2b 3b 0a |0;.X..hs|t_in++;.|
|000042e0| 58 09 7d 0a 58 09 2f 2a | 20 20 45 78 74 72 61 63 |X.}.X./*| Extrac|
|000042f0| 74 20 74 68 65 20 70 61 | 74 68 2e 20 20 2a 2f 0a |t the pa|th. */.|
|00004300| 58 09 69 66 20 28 28 70 | 61 74 68 20 3d 20 73 74 |X.if ((p|ath = st|
|00004310| 72 74 6f 6b 28 20 28 63 | 68 61 72 20 2a 29 4e 55 |rtok( (c|har *)NU|
|00004320| 4c 4c 2c 20 22 20 5c 74 | 22 20 29 29 20 3d 3d 20 |LL, " \t|" )) == |
|00004330| 4e 55 4c 4c 29 0a 58 09 | 09 66 61 74 61 6c 28 22 |NULL).X.|.fatal("|
|00004340| 6d 69 73 73 69 6e 67 20 | 70 61 74 68 22 29 3b 0a |missing |path");.|
|00004350| 58 09 69 66 20 28 73 74 | 72 63 6d 70 28 70 61 74 |X.if (st|rcmp(pat|
|00004360| 68 2c 20 22 25 73 22 29 | 20 3d 3d 20 30 29 20 7b |h, "%s")| == 0) {|
|00004370| 0a 58 09 09 2f 2a 20 20 | 54 68 69 73 20 69 73 20 |.X../* |This is |
|00004380| 66 6f 72 20 75 73 2e 20 | 20 57 65 20 64 6f 6e 27 |for us. | We don'|
|00004390| 74 20 64 61 72 65 20 64 | 65 6c 65 74 65 20 69 74 |t dare d|elete it|
|000043a0| 2e 0a 58 09 09 20 2a 2f | 0a 58 09 09 67 6f 74 6f |..X.. */|.X..goto|
|000043b0| 20 6b 65 65 70 3b 0a 58 | 09 7d 0a 58 0a 58 09 2f | keep;.X|.}.X.X./|
|000043c0| 2a 20 20 47 6f 20 64 6f | 77 6e 20 74 68 72 6f 75 |* Go do|wn throu|
|000043d0| 67 68 20 61 6c 6c 20 74 | 68 65 20 6e 6f 64 65 73 |gh all t|he nodes|
|000043e0| 20 6c 6f 6f 6b 69 6e 67 | 20 66 6f 72 20 74 68 69 | looking| for thi|
|000043f0| 73 20 6f 6e 65 2e 0a 58 | 09 20 2a 20 20 57 65 20 |s one..X|. * We |
|00004400| 77 6f 6e 27 74 20 61 63 | 74 75 61 6c 6c 79 20 66 |won't ac|tually f|
|00004410| 69 6e 64 20 69 74 20 62 | 75 74 20 77 69 6c 6c 20 |ind it b|ut will |
|00004420| 63 72 65 61 74 65 20 65 | 76 65 72 79 74 68 69 6e |create e|verythin|
|00004430| 67 0a 58 09 20 2a 20 20 | 61 6c 6f 6e 67 20 74 68 |g.X. * |along th|
|00004440| 65 20 77 61 79 2e 0a 58 | 09 20 2a 2f 0a 58 09 69 |e way..X|. */.X.i|
|00004450| 66 20 28 69 73 64 6f 6d | 61 69 6e 29 0a 58 09 09 |f (isdom|ain).X..|
|00004460| 67 77 70 61 74 68 20 3d | 20 6f 74 68 65 72 70 61 |gwpath =| otherpa|
|00004470| 74 68 3b 09 2f 2a 20 20 | 49 74 20 69 73 20 69 6e |th;./* |It is in|
|00004480| 20 61 20 64 6f 6d 61 69 | 6e 2e 20 20 2a 2f 0a 58 | a domai|n. */.X|
|00004490| 09 65 6c 73 65 20 69 66 | 20 28 66 6c 67 5f 72 65 |.else if| (flg_re|
|000044a0| 6d 6f 76 65 75 75 63 70 | 29 0a 58 09 09 72 65 74 |moveuucp|).X..ret|
|000044b0| 75 72 6e 3b 09 09 09 2f | 2a 20 20 54 68 65 79 20 |urn;.../|* They |
|000044c0| 61 6c 6c 20 67 6f 20 61 | 77 61 79 2e 20 20 2a 2f |all go a|way. */|
|000044d0| 0a 58 09 65 6c 73 65 20 | 69 66 20 28 66 6c 67 5f |.X.else |if (flg_|
|000044e0| 75 75 63 70 64 65 6c 29 | 0a 58 09 09 67 77 70 61 |uucpdel)|.X..gwpa|
|000044f0| 74 68 20 3d 20 75 75 63 | 70 70 61 74 68 3b 09 2f |th = uuc|ppath;./|
|00004500| 2a 20 20 2e 75 75 63 70 | 20 6d 61 79 20 62 65 20 |* .uucp| may be |
|00004510| 73 75 66 66 69 63 69 65 | 6e 74 20 20 2a 2f 0a 58 |sufficie|nt */.X|
|00004520| 09 65 6c 73 65 0a 58 09 | 09 67 77 70 61 74 68 20 |.else.X.|.gwpath |
|00004530| 3d 20 4e 55 4c 4c 3b 09 | 09 2f 2a 20 20 4b 65 65 |= NULL;.|./* Kee|
|00004540| 70 20 74 68 69 73 20 6f | 6e 65 2e 20 20 2a 2f 0a |p this o|ne. */.|
|00004550| 58 09 70 70 20 3d 20 26 | 72 6f 6f 74 6e 6f 64 65 |X.pp = &|rootnode|
|00004560| 3b 0a 58 09 77 68 69 6c | 65 20 28 28 73 20 3d 20 |;.X.whil|e ((s = |
|00004570| 73 74 72 72 63 68 72 28 | 20 74 6d 70 62 75 66 2c |strrchr(| tmpbuf,|
|00004580| 20 27 2e 27 20 29 29 20 | 21 3d 20 4e 55 4c 4c 29 | '.' )) |!= NULL)|
|00004590| 20 7b 0a 58 09 09 2a 73 | 2b 2b 20 3d 20 27 5c 30 | {.X..*s|++ = '\0|
|000045a0| 27 3b 09 2f 2a 20 74 6f | 20 6d 6f 73 74 20 73 69 |';./* to| most si|
|000045b0| 67 6e 69 66 69 63 61 6e | 74 20 70 61 72 74 20 6f |gnifican|t part o|
|000045c0| 66 20 64 6f 6d 61 69 6e | 20 6e 61 6d 65 20 2a 2f |f domain| name */|
|000045d0| 0a 58 09 09 70 20 3d 20 | 6c 6f 6f 6b 5f 6e 6f 64 |.X..p = |look_nod|
|000045e0| 65 28 20 70 70 2c 20 73 | 20 29 3b 0a 58 09 09 69 |e( pp, s| );.X..i|
|000045f0| 66 20 28 70 20 3d 3d 20 | 4e 55 4c 4c 29 20 7b 0a |f (p == |NULL) {.|
|00004600| 58 09 09 09 2f 2a 20 20 | 48 61 76 65 6e 27 74 20 |X.../* |Haven't |
|00004610| 73 65 65 6e 20 74 68 69 | 73 20 64 6f 6d 61 69 6e |seen thi|s domain|
|00004620| 20 62 65 66 6f 72 65 2e | 20 20 49 66 20 74 68 69 | before.| If thi|
|00004630| 73 20 69 73 0a 58 09 09 | 09 20 2a 20 20 61 20 62 |s is.X..|. * a b|
|00004640| 75 67 73 20 74 6f 70 2d | 6c 65 76 65 6c 20 64 6f |ugs top-|level do|
|00004650| 6d 61 69 6e 20 6e 61 6d | 65 20 77 65 20 77 61 6e |main nam|e we wan|
|00004660| 74 20 74 6f 20 6a 75 6e | 6b 20 69 74 2e 0a 58 09 |t to jun|k it..X.|
|00004670| 09 09 20 2a 2f 0a 58 09 | 09 09 69 66 20 28 66 6c |.. */.X.|..if (fl|
|00004680| 67 5f 6a 75 6e 6b 62 6f | 67 75 73 20 26 26 20 70 |g_junkbo|gus && p|
|00004690| 70 20 3d 3d 20 26 72 6f | 6f 74 6e 6f 64 65 29 0a |p == &ro|otnode).|
|000046a0| 58 09 09 09 09 72 65 74 | 75 72 6e 3b 0a 58 09 09 |X....ret|urn;.X..|
|000046b0| 09 62 72 65 61 6b 3b 0a | 58 09 09 7d 0a 58 09 09 |.break;.|X..}.X..|
|000046c0| 69 66 20 28 70 2d 3e 66 | 6c 61 67 73 20 26 20 53 |if (p->f|lags & S|
|000046d0| 41 43 52 45 44 5f 48 4f | 53 54 29 20 7b 0a 58 09 |ACRED_HO|ST) {.X.|
|000046e0| 09 09 67 77 70 61 74 68 | 20 3d 20 4e 55 4c 4c 3b |..gwpath| = NULL;|
|000046f0| 0a 58 09 09 09 62 72 65 | 61 6b 3b 0a 58 09 09 7d |.X...bre|ak;.X..}|
|00004700| 0a 58 09 09 69 66 20 28 | 70 2d 3e 66 6c 61 67 73 |.X..if (|p->flags|
|00004710| 20 26 20 52 45 4d 4f 56 | 45 5f 48 4f 53 54 29 20 | & REMOV|E_HOST) |
|00004720| 7b 0a 58 09 09 09 2f 2a | 20 20 44 6f 6e 27 74 20 |{.X.../*| Don't |
|00004730| 77 61 6e 74 20 61 6e 79 | 20 68 6f 73 74 73 20 69 |want any| hosts i|
|00004740| 6e 20 74 68 69 73 20 64 | 6f 6d 61 69 6e 2e 20 20 |n this d|omain. |
|00004750| 2a 2f 0a 58 09 09 09 72 | 65 74 75 72 6e 3b 0a 58 |*/.X...r|eturn;.X|
|00004760| 09 09 7d 0a 58 09 09 69 | 66 20 28 70 2d 3e 6c 69 |..}.X..i|f (p->li|
|00004770| 6e 65 20 21 3d 20 4e 55 | 4c 4c 29 0a 58 09 09 09 |ne != NU|LL).X...|
|00004780| 67 77 70 61 74 68 20 3d | 20 70 2d 3e 70 61 74 68 |gwpath =| p->path|
|00004790| 6e 61 6d 65 3b 0a 58 09 | 09 70 70 20 3d 20 26 28 |name;.X.|.pp = &(|
|000047a0| 70 2d 3e 63 68 69 6c 64 | 72 65 6e 29 3b 0a 58 09 |p->child|ren);.X.|
|000047b0| 7d 0a 58 0a 58 09 69 66 | 20 28 20 28 67 77 70 61 |}.X.X.if| ( (gwpa|
|000047c0| 74 68 20 3d 3d 20 4e 55 | 4c 4c 29 20 7c 7c 20 28 |th == NU|LL) || (|
|000047d0| 73 74 72 63 6d 70 28 20 | 67 77 70 61 74 68 2c 20 |strcmp( |gwpath, |
|000047e0| 22 25 73 22 20 29 20 3d | 3d 20 30 29 20 7c 7c 0a |"%s" ) =|= 0) ||.|
|000047f0| 58 09 20 20 20 20 20 28 | 73 74 72 6e 63 6d 70 28 |X. (|strncmp(|
|00004800| 20 70 61 74 68 2c 20 67 | 77 70 61 74 68 2c 20 73 | path, g|wpath, s|
|00004810| 74 72 6c 65 6e 28 67 77 | 70 61 74 68 29 2d 32 20 |trlen(gw|path)-2 |
|00004820| 29 20 21 3d 20 30 29 20 | 29 20 7b 0a 58 6b 65 65 |) != 0) |) {.Xkee|
|00004830| 70 3a 0a 58 09 09 69 66 | 20 28 69 73 64 6f 6d 61 |p:.X..if| (isdoma|
|00004840| 69 6e 29 09 64 6f 6d 5f | 6f 75 74 2b 2b 3b 0a 58 |in).dom_|out++;.X|
|00004850| 09 09 65 6c 73 65 09 09 | 68 73 74 5f 6f 75 74 2b |..else..|hst_out+|
|00004860| 2b 3b 0a 58 09 09 56 4f | 49 44 20 70 75 74 73 28 |+;.X..VO|ID puts(|
|00004870| 20 62 75 66 20 29 3b 0a | 58 09 7d 0a 58 7d 0a 58 | buf );.|X.}.X}.X|
|00004880| 0a 58 63 68 61 72 20 2a | 0a 58 73 74 72 61 6c 6c |.Xchar *|.Xstrall|
|00004890| 6f 63 28 20 73 74 72 20 | 29 0a 58 63 68 61 72 20 |oc( str |).Xchar |
|000048a0| 2a 73 74 72 3b 0a 58 7b | 0a 58 09 72 65 67 69 73 |*str;.X{|.X.regis|
|000048b0| 74 65 72 20 63 68 61 72 | 20 2a 73 3b 0a 58 09 69 |ter char| *s;.X.i|
|000048c0| 66 20 28 28 73 20 3d 20 | 6d 61 6c 6c 6f 63 28 20 |f ((s = |malloc( |
|000048d0| 28 75 6e 73 69 67 6e 65 | 64 29 28 73 74 72 6c 65 |(unsigne|d)(strle|
|000048e0| 6e 28 73 74 72 29 20 2b | 20 31 29 20 29 29 20 3d |n(str) +| 1) )) =|
|000048f0| 3d 20 4e 55 4c 4c 29 0a | 58 09 09 66 61 74 61 6c |= NULL).|X..fatal|
|00004900| 28 22 63 61 6e 6e 6f 74 | 20 61 6c 6c 6f 63 61 74 |("cannot| allocat|
|00004910| 65 20 73 74 72 69 6e 67 | 22 29 3b 0a 58 09 56 4f |e string|");.X.VO|
|00004920| 49 44 20 73 74 72 63 70 | 79 28 20 73 2c 20 73 74 |ID strcp|y( s, st|
|00004930| 72 20 29 3b 0a 58 09 72 | 65 74 75 72 6e 20 28 73 |r );.X.r|eturn (s|
|00004940| 29 3b 0a 58 7d 0a 58 0a | 58 66 61 74 61 6c 28 20 |);.X}.X.|Xfatal( |
|00004950| 72 65 61 73 6f 6e 20 29 | 0a 58 63 68 61 72 20 2a |reason )|.Xchar *|
|00004960| 20 72 65 61 73 6f 6e 3b | 0a 58 7b 0a 58 09 56 4f | reason;|.X{.X.VO|
|00004970| 49 44 20 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |ID fprin|tf(stder|
|00004980| 72 2c 22 70 61 74 68 70 | 72 75 6e 65 3a 20 25 73 |r,"pathp|rune: %s|
|00004990| 5c 6e 22 2c 20 72 65 61 | 73 6f 6e 20 29 3b 0a 58 |\n", rea|son );.X|
|000049a0| 09 65 78 69 74 28 31 29 | 3b 0a 58 7d 0a 53 48 41 |.exit(1)|;.X}.SHA|
|000049b0| 52 5f 45 4f 46 0a 65 78 | 69 74 20 30 0a 2d 2d 20 |R_EOF.ex|it 0.-- |
|000049c0| 0a 4d 61 74 74 20 43 6f | 73 74 65 6c 6c 6f 09 3c |.Matt Co|stello.<|
|000049d0| 6d 61 74 74 2e 63 6f 73 | 74 65 6c 6c 6f 40 53 61 |matt.cos|tello@Sa|
|000049e0| 6e 44 69 65 67 6f 2e 4e | 43 52 2e 43 4f 4d 3e 0a |nDiego.N|CR.COM>.|
|000049f0| 09 09 7b 73 64 63 73 76 | 61 78 2c 63 62 61 74 74 |..{sdcsv|ax,cbatt|
|00004a00| 2c 64 63 64 77 65 73 74 | 2c 6e 6f 73 63 2e 41 52 |,dcdwest|,nosc.AR|
|00004a10| 50 41 2c 69 68 6e 70 34 | 7d 21 6e 63 72 2d 73 64 |PA,ihnp4|}!ncr-sd|
|00004a20| 21 6d 61 74 74 0a 0a 0a | |!matt...| |
+--------+-------------------------+-------------------------+--------+--------+