home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: Tape Archive
(archive/tar).
You can browse this item here: filescan.tar
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Tape Archive (archive/tar)
| magic
| Supported |
100%
| file
| tar archive
| default
| |
99%
| file
| tar archive (V7), file filescan/, mode 755 , uid 243 , gid 0 , size 0 , seconds 4506467432
| default
| |
98%
| file
| data
| default
| |
100%
| lsar
| Tar
| default
| |
100%
| gt2
| TAR Archiv gefunden (Auflistung ist deaktiviert)
| default
| |
100%
| disktype
| Pre-POSIX tar archive
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 66 69 6c 65 73 63 61 6e | 2f 00 00 00 00 00 00 00 |filescan|/.......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 20 20 37 | 35 35 20 00 20 20 20 32 |.... 7|55 . 2|
|00000070| 34 33 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |43 . | 0 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 34 35 30 36 34 36 37 | 0 | 4506467|
|00000090| 34 33 32 20 20 20 35 35 | 36 37 00 20 00 00 00 00 |432 55|67. ....|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 66 69 6c 65 73 63 61 6e | 2f 53 68 61 72 46 69 6c |filescan|/SharFil|
|00000210| 65 2e 48 65 61 64 65 72 | 73 00 00 00 00 00 00 00 |e.Header|s.......|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00000270| 34 33 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |43 . | 0 . |
|00000280| 20 20 20 20 33 37 31 20 | 20 34 35 30 36 34 36 37 | 371 | 4506467|
|00000290| 34 33 33 20 20 31 30 36 | 33 30 00 20 00 00 00 00 |433 106|30. ....|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 3d 3d 3d 20 66 69 6c 65 | 73 63 61 6e 2e 73 68 61 |=== file|scan.sha|
|00000410| 72 20 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |r ======|========|
|00000420| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 0a 46 72 6f 6d |========|===.From|
|00000430| 20 72 69 61 63 73 21 65 | 6f 73 21 61 6d 65 73 21 | riacs!e|os!ames!|
|00000440| 73 75 6e 2d 62 61 72 72 | 21 63 73 2e 75 74 65 78 |sun-barr|!cs.utex|
|00000450| 61 73 2e 65 64 75 21 75 | 75 6e 65 74 21 61 6c 6c |as.edu!u|unet!all|
|00000460| 62 65 72 79 20 46 72 69 | 20 53 65 70 20 31 35 20 |bery Fri| Sep 15 |
|00000470| 30 38 3a 34 32 3a 33 36 | 20 50 44 54 20 31 39 38 |08:42:36| PDT 198|
|00000480| 39 0a 0a 50 6f 73 74 69 | 6e 67 2d 6e 75 6d 62 65 |9..Posti|ng-numbe|
|00000490| 72 3a 20 56 6f 6c 75 6d | 65 20 38 2c 20 49 73 73 |r: Volum|e 8, Iss|
|000004a0| 75 65 20 34 32 0a 53 75 | 62 6d 69 74 74 65 64 2d |ue 42.Su|bmitted-|
|000004b0| 62 79 3a 20 6d 6a 72 40 | 77 65 6c 63 68 6c 61 62 |by: mjr@|welchlab|
|000004c0| 2e 77 65 6c 63 68 2e 6a | 68 75 2e 65 64 75 20 28 |.welch.j|hu.edu (|
|000004d0| 4d 61 72 63 75 73 20 4a | 2e 20 52 61 6e 75 6d 29 |Marcus J|. Ranum)|
|000004e0| 0a 41 72 63 68 69 76 65 | 2d 6e 61 6d 65 3a 20 66 |.Archive|-name: f|
|000004f0| 69 6c 65 73 63 61 6e 0a | 0a 00 00 00 00 00 00 00 |ilescan.|........|
|00000500| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000600| 66 69 6c 65 73 63 61 6e | 2f 52 45 41 44 4d 45 00 |filescan|/README.|
|00000610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00000670| 34 33 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |43 . | 0 . |
|00000680| 20 20 20 31 37 34 33 20 | 20 34 35 30 36 34 36 37 | 1743 | 4506467|
|00000690| 34 32 36 20 20 20 36 35 | 34 34 00 20 00 00 00 00 |426 65|44. ....|
|000006a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 0a 09 54 68 69 73 20 69 | 73 20 61 20 66 61 69 72 |..This i|s a fair|
|00000810| 6c 79 20 73 69 6d 70 6c | 65 20 6c 69 74 74 6c 65 |ly simpl|e little|
|00000820| 20 70 72 6f 67 72 61 6d | 20 49 20 77 68 69 70 70 | program| I whipp|
|00000830| 65 64 20 75 70 20 61 66 | 74 65 72 20 49 20 72 65 |ed up af|ter I re|
|00000840| 61 64 0a 74 68 65 20 43 | 45 52 54 20 6d 65 73 73 |ad.the C|ERT mess|
|00000850| 61 67 65 73 20 61 62 6f | 75 74 20 76 65 72 73 69 |ages abo|ut versi|
|00000860| 6f 6e 73 20 6f 66 20 74 | 65 6c 6e 65 74 28 31 29 |ons of t|elnet(1)|
|00000870| 20 74 68 61 74 20 73 6e | 61 67 67 65 64 20 70 61 | that sn|agged pa|
|00000880| 73 73 77 6f 72 64 73 2e | 20 49 74 0a 72 65 61 64 |sswords.| It.read|
|00000890| 73 20 61 20 6c 69 73 74 | 20 6f 66 20 66 69 6c 65 |s a list| of file|
|000008a0| 73 20 61 6e 64 20 63 68 | 65 63 6b 73 20 74 68 65 |s and ch|ecks the|
|000008b0| 6d 20 61 67 61 69 6e 73 | 74 20 73 74 6f 72 65 64 |m agains|t stored|
|000008c0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 74 6f 20 | informa|tion to |
|000008d0| 73 65 65 0a 69 66 20 74 | 68 65 20 66 69 6c 65 73 |see.if t|he files|
|000008e0| 20 68 61 76 65 20 62 65 | 65 6e 20 6d 6f 6e 6b 65 | have be|en monke|
|000008f0| 79 65 64 20 77 69 74 68 | 2e 0a 0a 09 49 20 64 6f |yed with|....I do|
|00000900| 6e 27 74 20 74 68 69 6e | 6b 20 74 68 69 73 20 73 |n't thin|k this s|
|00000910| 6f 66 74 77 61 72 65 20 | 69 73 20 61 20 70 61 6e |oftware |is a pan|
|00000920| 61 63 65 61 20 66 6f 72 | 20 74 72 6f 6a 61 6e 20 |acea for| trojan |
|00000930| 68 6f 72 73 65 73 20 61 | 6e 64 0a 73 75 63 68 20 |horses a|nd.such |
|00000940| 66 6f 72 6d 73 20 6f 66 | 20 61 74 74 61 63 6b 2c |forms of| attack,|
|00000950| 20 62 75 74 20 49 20 2a | 64 6f 2a 20 74 68 69 6e | but I *|do* thin|
|00000960| 6b 20 69 74 27 73 20 61 | 20 73 74 65 70 2c 20 61 |k it's a| step, a|
|00000970| 6e 64 20 49 20 68 6f 70 | 65 20 69 74 73 20 66 6c |nd I hop|e its fl|
|00000980| 61 77 73 0a 74 72 69 67 | 67 65 72 20 6d 6f 72 65 |aws.trig|ger more|
|00000990| 20 69 6e 2d 64 65 70 74 | 68 20 61 70 70 72 6f 61 | in-dept|h approa|
|000009a0| 63 68 65 73 20 74 6f 20 | 74 68 65 73 65 20 70 72 |ches to |these pr|
|000009b0| 6f 62 6c 65 6d 73 2e 20 | 57 68 65 74 68 65 72 20 |oblems. |Whether |
|000009c0| 69 74 20 62 65 63 6f 6d | 65 73 20 61 0a 75 73 65 |it becom|es a.use|
|000009d0| 66 75 6c 20 73 65 63 75 | 72 69 74 79 20 74 6f 6f |ful secu|rity too|
|000009e0| 6c 2c 20 49 27 76 65 20 | 61 6c 72 65 61 64 79 20 |l, I've |already |
|000009f0| 72 65 61 6c 69 7a 65 64 | 20 69 74 20 6d 61 79 20 |realized| it may |
|00000a00| 73 61 76 65 20 6d 65 20 | 61 20 6c 6f 74 20 6f 66 |save me |a lot of|
|00000a10| 20 77 6f 72 6b 0a 6d 61 | 6b 69 6e 67 20 73 75 72 | work.ma|king sur|
|00000a20| 65 20 74 68 61 74 20 6d | 6f 64 69 66 69 65 64 20 |e that m|odified |
|00000a30| 66 69 6c 65 73 20 61 72 | 65 20 70 72 6f 70 65 72 |files ar|e proper|
|00000a40| 6c 79 20 63 61 72 72 69 | 65 64 20 66 6f 72 77 61 |ly carri|ed forwa|
|00000a50| 72 64 20 61 63 72 6f 73 | 73 0a 6f 70 65 72 61 74 |rd acros|s.operat|
|00000a60| 69 6e 67 20 73 79 73 74 | 65 6d 20 72 65 76 69 73 |ing syst|em revis|
|00000a70| 69 6f 6e 73 20 3a 2d 29 | 0a 0a 09 43 75 72 72 65 |ions :-)|...Curre|
|00000a80| 6e 74 6c 79 20 74 68 65 | 20 63 6f 64 65 20 69 73 |ntly the| code is|
|00000a90| 20 70 72 65 74 74 79 20 | 55 4e 49 58 20 73 70 65 | pretty |UNIX spe|
|00000aa0| 63 69 66 69 63 2c 20 74 | 68 6f 75 67 68 20 61 6e |cific, t|hough an|
|00000ab0| 79 20 6d 61 63 68 69 6e | 65 0a 77 69 74 68 20 64 |y machin|e.with d|
|00000ac0| 62 6d 20 6f 72 20 61 6e | 20 65 71 75 69 76 61 6c |bm or an| equival|
|00000ad0| 65 6e 74 2c 20 61 20 73 | 74 61 74 28 32 29 20 6f |ent, a s|tat(2) o|
|00000ae0| 72 20 65 71 75 69 76 61 | 6c 65 6e 74 20 73 79 73 |r equiva|lent sys|
|00000af0| 74 65 6d 20 63 61 6c 6c | 2c 20 61 6e 64 20 61 0a |tem call|, and a.|
|00000b00| 64 69 72 65 63 74 6f 72 | 79 20 6c 69 73 74 65 72 |director|y lister|
|00000b10| 20 6c 69 6b 65 20 66 69 | 6e 64 28 31 29 20 63 6f | like fi|nd(1) co|
|00000b20| 75 6c 64 20 75 73 65 20 | 69 74 2e 20 54 68 65 72 |uld use |it. Ther|
|00000b30| 65 20 6d 61 79 20 62 65 | 20 73 6f 6d 65 20 62 65 |e may be| some be|
|00000b40| 72 6b 6c 69 73 6d 73 0a | 69 6e 20 74 68 65 20 63 |rklisms.|in the c|
|00000b50| 6f 64 65 2c 20 62 75 74 | 20 49 20 61 73 73 75 72 |ode, but| I assur|
|00000b60| 65 20 79 6f 75 20 74 68 | 65 72 65 20 61 72 65 20 |e you th|ere are |
|00000b70| 6e 6f 20 4e 55 4c 4c 20 | 64 65 72 65 66 73 20 6f |no NULL |derefs o|
|00000b80| 72 20 61 6e 79 20 6f 66 | 20 74 68 61 74 0a 63 72 |r any of| that.cr|
|00000b90| 61 70 2e 0a 0a 09 41 6e | 79 68 6f 77 2c 20 64 6f |ap....An|yhow, do|
|00000ba0| 20 77 69 74 68 20 74 68 | 69 73 20 77 68 61 74 20 | with th|is what |
|00000bb0| 79 6f 75 20 77 69 6c 6c | 2e 20 48 6f 70 65 66 75 |you will|. Hopefu|
|00000bc0| 6c 6c 79 20 69 74 20 6d | 61 79 20 68 65 6c 70 0a |lly it m|ay help.|
|00000bd0| 73 6f 6d 65 6f 6e 65 2e | 0a 0a 2d 2d 6d 6a 72 28 |someone.|..--mjr(|
|00000be0| 29 3b 0a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |);......|........|
|00000bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c00| 66 69 6c 65 73 63 61 6e | 2f 4d 61 6b 65 66 69 6c |filescan|/Makefil|
|00000c10| 65 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |e.......|........|
|00000c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00000c70| 34 33 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |43 . | 0 . |
|00000c80| 20 20 20 31 34 34 32 20 | 20 34 35 30 36 34 36 37 | 1442 | 4506467|
|00000c90| 34 32 37 20 20 20 37 33 | 32 31 00 20 00 00 00 00 |427 73|21. ....|
|00000ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e00| 23 0a 23 09 4d 61 6b 65 | 66 69 6c 65 20 66 6f 72 |#.#.Make|file for|
|00000e10| 20 66 69 6c 65 73 63 61 | 6e 20 66 69 6c 65 20 73 | filesca|n file s|
|00000e20| 75 6d 6d 65 72 20 61 6e | 64 20 73 63 61 6e 6e 65 |ummer an|d scanne|
|00000e30| 72 2e 0a 23 09 43 6f 70 | 79 72 69 67 68 74 20 28 |r..#.Cop|yright (|
|00000e40| 43 29 2c 20 4d 61 72 63 | 75 73 20 4a 2e 20 52 61 |C), Marc|us J. Ra|
|00000e50| 6e 75 6d 2c 20 31 39 38 | 39 2e 20 41 6c 6c 20 72 |num, 198|9. All r|
|00000e60| 69 67 68 74 73 20 72 65 | 73 65 72 76 65 64 0a 23 |ights re|served.#|
|00000e70| 09 54 68 69 73 20 63 6f | 64 65 20 6d 61 79 20 62 |.This co|de may b|
|00000e80| 65 20 66 72 65 65 6c 79 | 20 64 69 73 74 72 69 62 |e freely| distrib|
|00000e90| 75 74 65 64 20 61 73 20 | 6c 6f 6e 67 20 61 73 20 |uted as |long as |
|00000ea0| 74 68 69 73 20 68 65 61 | 64 65 72 0a 23 09 72 65 |this hea|der.#.re|
|00000eb0| 6d 61 69 6e 73 20 69 6e | 74 61 63 74 2e 20 4e 6f |mains in|tact. No|
|00000ec0| 20 77 61 72 72 61 6e 74 | 69 65 73 20 61 72 65 20 | warrant|ies are |
|00000ed0| 65 78 70 72 65 73 73 65 | 64 20 6f 72 20 69 6d 70 |expresse|d or imp|
|00000ee0| 6c 69 65 64 20 61 73 0a | 23 09 74 6f 20 74 68 65 |lied as.|#.to the|
|00000ef0| 20 73 75 69 74 61 62 69 | 6c 69 74 79 20 6f 66 20 | suitabi|lity of |
|00000f00| 74 68 69 73 20 73 6f 66 | 74 77 61 72 65 20 66 6f |this sof|tware fo|
|00000f10| 72 20 61 6e 79 20 70 75 | 72 70 6f 73 65 20 61 74 |r any pu|rpose at|
|00000f20| 20 61 6c 6c 2e 0a 23 0a | 23 09 24 48 65 61 64 65 | all..#.|#.$Heade|
|00000f30| 72 3a 20 4d 61 6b 65 66 | 69 6c 65 2c 76 20 31 2e |r: Makef|ile,v 1.|
|00000f40| 31 20 38 39 2f 30 39 2f | 31 33 20 31 34 3a 32 31 |1 89/09/|13 14:21|
|00000f50| 3a 33 31 20 6d 6a 72 20 | 52 65 6c 20 24 0a 23 0a |:31 mjr |Rel $.#.|
|00000f60| 0a 49 4e 53 44 49 52 3d | 2f 75 73 72 2f 65 74 63 |.INSDIR=|/usr/etc|
|00000f70| 0a 4d 41 4e 44 49 52 3d | 2f 75 73 72 2f 6d 61 6e |.MANDIR=|/usr/man|
|00000f80| 2f 6d 61 6e 38 0a 0a 23 | 64 65 66 69 6e 65 20 44 |/man8..#|define D|
|00000f90| 42 4d 20 69 66 20 79 6f | 75 20 64 6f 6e 74 20 68 |BM if yo|u dont h|
|00000fa0| 61 76 65 20 4e 44 42 4d | 2e 0a 44 42 4d 3d 20 2d |ave NDBM|..DBM= -|
|00000fb0| 44 4e 44 42 4d 0a 23 44 | 42 4d 3d 20 2d 44 44 42 |DNDBM.#D|BM= -DDB|
|00000fc0| 4d 0a 0a 43 46 4c 41 47 | 53 3d 20 2d 4f 20 24 28 |M..CFLAG|S= -O $(|
|00000fd0| 44 42 4d 29 0a 4c 44 46 | 4c 41 47 53 3d 20 2d 73 |DBM).LDF|LAGS= -s|
|00000fe0| 0a 0a 4c 49 42 53 3d 20 | 2d 6c 64 62 6d 0a 0a 66 |..LIBS= |-ldbm..f|
|00000ff0| 69 6c 65 73 63 61 6e 3a | 09 66 69 6c 65 73 63 61 |ilescan:|.filesca|
|00001000| 6e 2e 6f 20 69 6e 5f 63 | 6b 73 75 6d 2e 6f 0a 09 |n.o in_c|ksum.o..|
|00001010| 63 63 20 24 28 4c 44 46 | 4c 41 47 53 29 20 2d 6f |cc $(LDF|LAGS) -o|
|00001020| 20 66 69 6c 65 73 63 61 | 6e 20 66 69 6c 65 73 63 | filesca|n filesc|
|00001030| 61 6e 2e 6f 20 69 6e 5f | 63 6b 73 75 6d 2e 6f 20 |an.o in_|cksum.o |
|00001040| 24 28 4c 49 42 53 29 0a | 0a 63 6c 65 61 6e 3a 0a |$(LIBS).|.clean:.|
|00001050| 09 72 6d 20 2d 66 20 63 | 6f 72 65 20 2a 2e 6f 20 |.rm -f c|ore *.o |
|00001060| 66 69 6c 65 73 63 61 6e | 0a 0a 6c 69 6e 74 3a 0a |filescan|..lint:.|
|00001070| 09 6c 69 6e 74 20 24 28 | 44 42 4d 29 20 66 69 6c |.lint $(|DBM) fil|
|00001080| 65 73 63 61 6e 2e 63 20 | 69 6e 5f 63 6b 73 75 6d |escan.c |in_cksum|
|00001090| 2e 63 0a 0a 69 6e 73 74 | 61 6c 6c 3a 20 66 69 6c |.c..inst|all: fil|
|000010a0| 65 73 63 61 6e 20 66 69 | 6c 65 73 63 61 6e 2e 38 |escan fi|lescan.8|
|000010b0| 0a 09 63 70 20 66 69 6c | 65 73 63 61 6e 20 24 28 |..cp fil|escan $(|
|000010c0| 49 4e 53 44 49 52 29 0a | 09 63 70 20 66 69 6c 65 |INSDIR).|.cp file|
|000010d0| 73 63 61 6e 2e 38 20 24 | 28 4d 41 4e 44 49 52 29 |scan.8 $|(MANDIR)|
|000010e0| 0a 09 63 68 6d 6f 64 20 | 36 34 34 20 24 28 4d 41 |..chmod |644 $(MA|
|000010f0| 4e 44 49 52 29 2f 66 69 | 6c 65 73 63 61 6e 2e 38 |NDIR)/fi|lescan.8|
|00001100| 0a 0a 66 69 6c 65 73 63 | 61 6e 2e 6f 3a 09 4d 61 |..filesc|an.o:.Ma|
|00001110| 6b 65 66 69 6c 65 20 66 | 69 6c 65 73 63 61 6e 2e |kefile f|ilescan.|
|00001120| 63 0a 64 20 75 73 65 20 | 69 74 2e 20 54 68 65 72 |c.d use |it. Ther|
|00001130| 65 20 6d 61 79 20 62 65 | 20 73 6f 6d 65 20 62 65 |e may be| some be|
|00001140| 72 6b 6c 69 73 6d 73 0a | 69 6e 20 74 68 65 20 63 |rklisms.|in the c|
|00001150| 6f 64 65 2c 20 62 75 74 | 20 49 20 61 73 73 75 72 |ode, but| I assur|
|00001160| 65 20 79 6f 75 20 74 68 | 65 72 65 20 61 72 65 20 |e you th|ere are |
|00001170| 6e 6f 20 4e 55 4c 4c 20 | 64 65 72 65 66 73 20 6f |no NULL |derefs o|
|00001180| 72 20 61 6e 79 20 6f 66 | 20 74 68 61 74 0a 63 72 |r any of| that.cr|
|00001190| 61 70 2e 0a 0a 09 41 6e | 79 68 6f 77 2c 20 64 6f |ap....An|yhow, do|
|000011a0| 20 77 69 74 68 20 74 68 | 69 73 20 77 68 61 74 20 | with th|is what |
|000011b0| 79 6f 75 20 77 69 6c 6c | 2e 20 48 6f 70 65 66 75 |you will|. Hopefu|
|000011c0| 6c 6c 79 20 69 74 20 6d | 61 79 20 68 65 6c 70 0a |lly it m|ay help.|
|000011d0| 73 6f 6d 65 6f 6e 65 2e | 0a 0a 2d 2d 6d 6a 72 28 |someone.|..--mjr(|
|000011e0| 29 3b 0a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |);......|........|
|000011f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001200| 66 69 6c 65 73 63 61 6e | 2f 66 69 6c 65 73 63 61 |filescan|/filesca|
|00001210| 6e 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |n.c.....|........|
|00001220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00001270| 34 33 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |43 . | 0 . |
|00001280| 20 20 31 35 32 32 30 20 | 20 34 35 30 36 34 36 37 | 15220 | 4506467|
|00001290| 34 33 30 20 20 20 37 36 | 32 32 00 20 00 00 00 00 |430 76|22. ....|
|000012a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001400| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 74 79 |#include| <sys/ty|
|00001410| 70 65 73 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |pes.h>.#|include |
|00001420| 3c 73 79 73 2f 73 74 61 | 74 2e 68 3e 0a 23 69 6e |<sys/sta|t.h>.#in|
|00001430| 63 6c 75 64 65 20 3c 73 | 79 73 2f 66 69 6c 65 2e |clude <s|ys/file.|
|00001440| 68 3e 0a 23 69 66 64 65 | 66 09 44 42 4d 0a 23 69 |h>.#ifde|f.DBM.#i|
|00001450| 6e 63 6c 75 64 65 20 3c | 64 62 6d 2e 68 3e 0a 23 |nclude <|dbm.h>.#|
|00001460| 65 6e 64 69 66 0a 23 69 | 66 64 65 66 09 4e 44 42 |endif.#i|fdef.NDB|
|00001470| 4d 0a 23 69 6e 63 6c 75 | 64 65 20 3c 6e 64 62 6d |M.#inclu|de <ndbm|
|00001480| 2e 68 3e 0a 23 65 6e 64 | 69 66 0a 23 69 6e 63 6c |.h>.#end|if.#incl|
|00001490| 75 64 65 20 3c 73 74 64 | 69 6f 2e 68 3e 0a 0a 2f |ude <std|io.h>../|
|000014a0| 2a 0a 09 66 69 6c 65 73 | 63 61 6e 20 66 69 6c 65 |*..files|can file|
|000014b0| 20 73 75 6d 6d 65 72 20 | 61 6e 64 20 73 63 61 6e | summer |and scan|
|000014c0| 6e 65 72 2e 0a 09 43 6f | 70 79 72 69 67 68 74 20 |ner...Co|pyright |
|000014d0| 28 43 29 2c 20 4d 61 72 | 63 75 73 20 4a 2e 20 52 |(C), Mar|cus J. R|
|000014e0| 61 6e 75 6d 2c 20 31 39 | 38 39 2e 20 41 6c 6c 20 |anum, 19|89. All |
|000014f0| 72 69 67 68 74 73 20 72 | 65 73 65 72 76 65 64 0a |rights r|eserved.|
|00001500| 09 54 68 69 73 20 63 6f | 64 65 20 6d 61 79 20 62 |.This co|de may b|
|00001510| 65 20 66 72 65 65 6c 79 | 20 64 69 73 74 72 69 62 |e freely| distrib|
|00001520| 75 74 65 64 20 61 73 20 | 6c 6f 6e 67 20 61 73 20 |uted as |long as |
|00001530| 74 68 69 73 20 68 65 61 | 64 65 72 0a 09 72 65 6d |this hea|der..rem|
|00001540| 61 69 6e 73 20 69 6e 74 | 61 63 74 2e 20 4e 6f 20 |ains int|act. No |
|00001550| 77 61 72 72 61 6e 74 69 | 65 73 20 61 72 65 20 65 |warranti|es are e|
|00001560| 78 70 72 65 73 73 65 64 | 20 6f 72 20 69 6d 70 6c |xpressed| or impl|
|00001570| 69 65 64 20 61 73 0a 09 | 74 6f 20 74 68 65 20 73 |ied as..|to the s|
|00001580| 75 69 74 61 62 69 6c 69 | 74 79 20 6f 66 20 74 68 |uitabili|ty of th|
|00001590| 69 73 20 73 6f 66 74 77 | 61 72 65 20 66 6f 72 20 |is softw|are for |
|000015a0| 61 6e 79 20 70 75 72 70 | 6f 73 65 20 61 74 20 61 |any purp|ose at a|
|000015b0| 6c 6c 2e 0a 2a 2f 0a 0a | 2f 2a 0a 20 2a 09 24 4c |ll..*/..|/*. *.$L|
|000015c0| 6f 67 3a 09 66 69 6c 65 | 73 63 61 6e 2e 63 2c 76 |og:.file|scan.c,v|
|000015d0| 20 24 0a 20 2a 20 52 65 | 76 69 73 69 6f 6e 20 31 | $. * Re|vision 1|
|000015e0| 2e 31 20 20 38 39 2f 30 | 39 2f 31 33 20 20 31 34 |.1 89/0|9/13 14|
|000015f0| 3a 32 36 3a 32 37 20 20 | 6d 6a 72 0a 20 2a 20 49 |:26:27 |mjr. * I|
|00001600| 6e 69 74 69 61 6c 20 72 | 65 76 69 73 69 6f 6e 0a |nitial r|evision.|
|00001610| 20 2a 20 0a 20 2a 20 0a | 2a 2f 0a 0a 23 69 66 6e | * . * .|*/..#ifn|
|00001620| 64 65 66 09 6c 69 6e 74 | 0a 73 74 61 74 69 63 09 |def.lint|.static.|
|00001630| 63 68 61 72 09 2a 72 63 | 73 69 64 5b 5d 20 3d 20 |char.*rc|sid[] = |
|00001640| 22 24 48 65 61 64 65 72 | 3a 20 66 69 6c 65 73 63 |"$Header|: filesc|
|00001650| 61 6e 2e 63 2c 76 20 31 | 2e 31 20 38 39 2f 30 39 |an.c,v 1|.1 89/09|
|00001660| 2f 31 33 20 31 34 3a 32 | 36 3a 32 37 20 6d 6a 72 |/13 14:2|6:27 mjr|
|00001670| 20 52 65 6c 20 24 22 3b | 0a 23 65 6e 64 69 66 0a | Rel $";|.#endif.|
|00001680| 0a 0a 65 78 74 65 72 6e | 09 64 61 74 75 6d 09 66 |..extern|.datum.f|
|00001690| 65 74 63 68 28 29 3b 0a | 65 78 74 65 72 6e 09 63 |etch();.|extern.c|
|000016a0| 68 61 72 09 2a 72 69 6e | 64 65 78 28 29 3b 0a 65 |har.*rin|dex();.e|
|000016b0| 78 74 65 72 6e 09 63 68 | 61 72 09 2a 67 65 74 70 |xtern.ch|ar.*getp|
|000016c0| 61 73 73 28 29 3b 0a 65 | 78 74 65 72 6e 09 63 68 |ass();.e|xtern.ch|
|000016d0| 61 72 09 2a 73 70 72 69 | 6e 74 66 28 29 3b 0a 0a |ar.*spri|ntf();..|
|000016e0| 73 74 61 74 69 63 09 76 | 6f 69 64 09 09 77 61 72 |static.v|oid..war|
|000016f0| 6e 28 29 3b 0a 0a 69 6e | 74 09 64 6f 63 68 65 63 |n();..in|t.dochec|
|00001700| 6b 69 6e 20 3d 20 30 3b | 0a 46 49 4c 45 09 2a 69 |kin = 0;|.FILE.*i|
|00001710| 6e 66 20 3d 20 7b 20 73 | 74 64 69 6e 20 7d 3b 0a |nf = { s|tdin };.|
|00001720| 46 49 4c 45 09 2a 6f 75 | 74 66 20 3d 20 7b 20 73 |FILE.*ou|tf = { s|
|00001730| 74 64 6f 75 74 20 7d 3b | 0a 69 6e 74 09 75 70 64 |tdout };|.int.upd|
|00001740| 66 6c 67 20 3d 20 30 3b | 0a 69 6e 74 09 73 75 6d |flg = 0;|.int.sum|
|00001750| 66 6c 67 20 3d 20 30 3b | 0a 23 69 66 64 65 66 09 |flg = 0;|.#ifdef.|
|00001760| 4e 44 42 4d 0a 44 42 4d | 09 2a 64 62 66 3b 09 09 |NDBM.DBM|.*dbf;..|
|00001770| 09 09 2f 2a 20 69 63 6b | 79 20 67 6c 6f 62 61 6c |../* ick|y global|
|00001780| 2c 20 49 20 6b 6e 6f 77 | 20 2a 2f 0a 65 78 74 65 |, I know| */.exte|
|00001790| 72 6e 09 44 42 4d 09 2a | 64 62 6d 5f 6f 70 65 6e |rn.DBM.*|dbm_open|
|000017a0| 28 29 3b 0a 23 65 6e 64 | 69 66 0a 0a 73 74 72 75 |();.#end|if..stru|
|000017b0| 63 74 09 73 65 63 72 65 | 63 09 7b 0a 09 73 74 72 |ct.secre|c.{..str|
|000017c0| 75 63 74 09 73 74 61 74 | 09 73 3b 09 09 2f 2a 20 |uct.stat|.s;../* |
|000017d0| 73 74 61 74 20 69 6e 66 | 6f 20 2a 2f 0a 09 69 6e |stat inf|o */..in|
|000017e0| 74 09 09 73 75 6d 3b 09 | 09 2f 2a 20 61 63 74 75 |t..sum;.|./* actu|
|000017f0| 61 6c 20 73 75 6d 20 2a | 2f 0a 09 63 68 61 72 09 |al sum *|/..char.|
|00001800| 09 73 75 6d 66 3b 09 09 | 2f 2a 20 63 68 65 63 6b |.sumf;..|/* check|
|00001810| 73 75 6d 20 69 73 20 70 | 72 65 73 65 6e 74 20 2a |sum is p|resent *|
|00001820| 2f 0a 7d 3b 0a 0a 0a 6d | 61 69 6e 28 61 63 2c 61 |/.};...m|ain(ac,a|
|00001830| 76 29 0a 69 6e 74 09 61 | 63 3b 0a 63 68 61 72 09 |v).int.a|c;.char.|
|00001840| 2a 2a 61 76 3b 0a 7b 0a | 23 69 66 64 65 66 09 44 |**av;.{.|#ifdef.D|
|00001850| 42 4d 0a 09 69 6e 74 09 | 64 6f 69 6e 69 74 20 3d |BM..int.|doinit =|
|00001860| 20 30 3b 0a 23 65 6e 64 | 69 66 0a 09 63 68 61 72 | 0;.#end|if..char|
|00001870| 09 62 75 66 5b 42 55 46 | 53 49 5a 5d 3b 0a 09 63 |.buf[BUF|SIZ];..c|
|00001880| 68 61 72 09 2a 64 62 66 | 69 6c 65 20 3d 20 4e 55 |har.*dbf|ile = NU|
|00001890| 4c 4c 3b 0a 09 69 6e 74 | 09 61 66 6c 67 20 3d 20 |LL;..int|.aflg = |
|000018a0| 30 3b 0a 09 69 6e 74 09 | 77 66 6c 67 20 3d 20 30 |0;..int.|wflg = 0|
|000018b0| 3b 0a 09 69 6e 74 09 65 | 72 72 63 6e 74 20 3d 20 |;..int.e|rrcnt = |
|000018c0| 30 3b 0a 09 69 6e 74 09 | 77 61 72 63 6e 74 20 3d |0;..int.|warcnt =|
|000018d0| 20 30 3b 0a 0a 09 77 68 | 69 6c 65 28 2a 2b 2b 61 | 0;...wh|ile(*++a|
|000018e0| 76 29 20 7b 0a 09 09 69 | 66 28 2a 2a 61 76 20 3d |v) {...i|f(**av =|
|000018f0| 3d 20 27 2d 27 29 20 7b | 0a 09 09 09 73 77 69 74 |= '-') {|....swit|
|00001900| 63 68 28 2a 28 2a 61 76 | 20 2b 20 31 29 29 20 7b |ch(*(*av| + 1)) {|
|00001910| 0a 09 09 09 63 61 73 65 | 20 27 61 27 3a 09 2f 2a |....case| 'a':./*|
|00001920| 20 61 70 70 65 6e 64 20 | 74 6f 20 6f 75 74 70 75 | append |to outpu|
|00001930| 74 20 2a 2f 0a 09 09 09 | 09 61 66 6c 67 2b 2b 3b |t */....|.aflg++;|
|00001940| 0a 09 09 09 09 62 72 65 | 61 6b 3b 0a 0a 09 09 09 |.....bre|ak;.....|
|00001950| 63 61 73 65 20 27 73 27 | 3a 09 2f 2a 20 70 65 72 |case 's'|:./* per|
|00001960| 66 6f 72 6d 20 63 68 65 | 63 6b 73 75 6d 20 6f 6e |form che|cksum on|
|00001970| 20 73 74 6f 72 65 20 2a | 2f 0a 09 09 09 09 73 75 | store *|/.....su|
|00001980| 6d 66 6c 67 2b 2b 3b 0a | 09 09 09 09 62 72 65 61 |mflg++;.|....brea|
|00001990| 6b 3b 0a 0a 09 09 09 63 | 61 73 65 20 27 75 27 3a |k;.....c|ase 'u':|
|000019a0| 09 2f 2a 20 75 70 64 61 | 74 65 20 63 68 61 6e 67 |./* upda|te chang|
|000019b0| 65 73 20 69 6e 20 64 61 | 74 61 62 61 73 65 20 2a |es in da|tabase *|
|000019c0| 2f 0a 09 09 09 09 75 70 | 64 66 6c 67 2b 2b 3b 0a |/.....up|dflg++;.|
|000019d0| 09 09 09 09 62 72 65 61 | 6b 3b 0a 0a 09 09 09 63 |....brea|k;.....c|
|000019e0| 61 73 65 20 27 77 27 3a | 09 2f 2a 20 65 78 69 74 |ase 'w':|./* exit|
|000019f0| 20 73 74 61 74 75 73 20 | 69 73 20 23 20 6f 66 20 | status |is # of |
|00001a00| 77 61 72 6e 69 6e 67 73 | 20 2a 2f 0a 09 09 09 09 |warnings| */.....|
|00001a10| 77 66 6c 67 2b 2b 3b 0a | 09 09 09 09 62 72 65 61 |wflg++;.|....brea|
|00001a20| 6b 3b 0a 0a 09 09 09 63 | 61 73 65 20 27 63 27 3a |k;.....c|ase 'c':|
|00001a30| 09 2f 2a 20 70 65 72 66 | 6f 72 6d 20 63 68 65 63 |./* perf|orm chec|
|00001a40| 6b 20 69 6e 20 2a 2f 0a | 09 09 09 09 64 6f 63 68 |k in */.|....doch|
|00001a50| 65 63 6b 69 6e 2b 2b 3b | 0a 09 09 09 09 62 72 65 |eckin++;|.....bre|
|00001a60| 61 6b 3b 0a 09 0a 23 69 | 66 64 65 66 09 44 42 4d |ak;...#i|fdef.DBM|
|00001a70| 0a 09 09 09 63 61 73 65 | 20 27 43 27 3a 09 2f 2a |....case| 'C':./*|
|00001a80| 20 69 6e 69 74 69 61 6c | 69 7a 65 20 61 6e 64 20 | initial|ize and |
|00001a90| 74 72 75 6e 63 61 74 65 | 20 64 61 74 61 62 61 73 |truncate| databas|
|00001aa0| 65 20 2a 2f 0a 09 09 09 | 09 64 6f 69 6e 69 74 2b |e */....|.doinit+|
|00001ab0| 2b 3b 0a 09 09 09 09 62 | 72 65 61 6b 3b 0a 23 65 |+;.....b|reak;.#e|
|00001ac0| 6e 64 69 66 0a 0a 09 09 | 09 63 61 73 65 20 27 6f |ndif....|.case 'o|
|00001ad0| 27 3a 09 2f 2a 20 6f 75 | 74 70 75 74 20 66 72 6f |':./* ou|tput fro|
|00001ae0| 6d 20 63 68 65 63 6b 20 | 2a 2f 0a 09 09 09 09 69 |m check |*/.....i|
|00001af0| 66 28 28 6f 75 74 66 20 | 3d 20 66 6f 70 65 6e 28 |f((outf |= fopen(|
|00001b00| 2a 2b 2b 61 76 2c 61 66 | 6c 67 3f 22 61 22 3a 22 |*++av,af|lg?"a":"|
|00001b10| 77 22 29 29 20 3d 3d 20 | 4e 55 4c 4c 29 20 7b 0a |w")) == |NULL) {.|
|00001b20| 09 09 09 09 09 70 65 72 | 72 6f 72 28 2a 61 76 29 |.....per|ror(*av)|
|00001b30| 3b 0a 09 09 09 09 09 65 | 78 69 74 28 31 29 3b 0a |;......e|xit(1);.|
|00001b40| 09 09 09 09 7d 0a 09 09 | 09 09 62 72 65 61 6b 3b |....}...|..break;|
|00001b50| 0a 0a 09 09 09 63 61 73 | 65 20 27 69 27 3a 09 2f |.....cas|e 'i':./|
|00001b60| 2a 20 69 6e 70 75 74 20 | 74 6f 20 63 68 65 63 6b |* input |to check|
|00001b70| 20 6f 72 20 73 74 6f 72 | 65 20 2a 2f 0a 09 09 09 | or stor|e */....|
|00001b80| 09 69 66 28 28 69 6e 66 | 20 3d 20 66 6f 70 65 6e |.if((inf| = fopen|
|00001b90| 28 2a 2b 2b 61 76 2c 22 | 72 22 29 29 20 3d 3d 20 |(*++av,"|r")) == |
|00001ba0| 4e 55 4c 4c 29 20 7b 0a | 09 09 09 09 09 70 65 72 |NULL) {.|.....per|
|00001bb0| 72 6f 72 28 2a 61 76 29 | 3b 0a 09 09 09 09 09 65 |ror(*av)|;......e|
|00001bc0| 78 69 74 28 31 29 3b 0a | 09 09 09 09 7d 0a 09 09 |xit(1);.|....}...|
|00001bd0| 09 09 62 72 65 61 6b 3b | 0a 0a 09 09 09 63 61 73 |..break;|.....cas|
|00001be0| 65 20 27 64 27 3a 09 2f | 2a 20 64 61 74 61 62 61 |e 'd':./|* databa|
|00001bf0| 73 65 20 6e 61 6d 65 20 | 2a 2f 0a 09 09 09 09 64 |se name |*/.....d|
|00001c00| 62 66 69 6c 65 20 3d 20 | 2a 2b 2b 61 76 3b 0a 09 |bfile = |*++av;..|
|00001c10| 09 09 09 62 72 65 61 6b | 3b 0a 0a 09 09 09 64 65 |...break|;.....de|
|00001c20| 66 61 75 6c 74 3a 0a 20 | 09 09 09 09 65 78 69 74 |fault:. |....exit|
|00001c30| 28 75 73 61 67 65 28 29 | 29 3b 0a 09 09 09 7d 0a |(usage()|);....}.|
|00001c40| 09 09 7d 0a 0a 09 7d 0a | 0a 09 69 66 28 64 62 66 |..}...}.|..if(dbf|
|00001c50| 69 6c 65 20 3d 3d 20 4e | 55 4c 4c 29 20 7b 0a 09 |ile == N|ULL) {..|
|00001c60| 09 28 76 6f 69 64 29 66 | 70 72 69 6e 74 66 28 73 |.(void)f|printf(s|
|00001c70| 74 64 65 72 72 2c 22 63 | 61 6e 27 74 20 69 6e 69 |tderr,"c|an't ini|
|00001c80| 74 69 61 6c 69 7a 65 20 | 77 69 74 68 6f 75 74 20 |tialize |without |
|00001c90| 64 61 74 62 61 73 65 20 | 66 69 6c 65 20 6e 61 6d |datbase |file nam|
|00001ca0| 65 5c 6e 22 29 3b 0a 09 | 09 65 78 69 74 28 75 73 |e\n");..|.exit(us|
|00001cb0| 61 67 65 28 29 29 3b 0a | 09 7d 0a 0a 0a 23 69 66 |age());.|.}...#if|
|00001cc0| 64 65 66 09 44 42 4d 0a | 09 2f 2a 20 63 72 65 61 |def.DBM.|./* crea|
|00001cd0| 74 65 20 6e 65 77 20 64 | 61 74 61 62 61 73 65 20 |te new d|atabase |
|00001ce0| 66 69 6c 65 73 2c 20 73 | 69 6e 63 65 20 44 42 4d |files, s|ince DBM|
|00001cf0| 20 69 73 20 6e 6f 74 20 | 73 6d 61 72 74 20 65 6e | is not |smart en|
|00001d00| 6f 75 67 68 20 74 6f 20 | 2a 2f 0a 09 69 66 28 64 |ough to |*/..if(d|
|00001d10| 6f 69 6e 69 74 29 20 7b | 0a 09 09 69 6e 74 09 77 |oinit) {|...int.w|
|00001d20| 66 64 3b 0a 0a 09 09 28 | 76 6f 69 64 29 73 70 72 |fd;....(|void)spr|
|00001d30| 69 6e 74 66 28 62 75 66 | 2c 22 25 73 2e 64 69 72 |intf(buf|,"%s.dir|
|00001d40| 22 2c 64 62 66 69 6c 65 | 29 3b 0a 09 09 69 66 28 |",dbfile|);...if(|
|00001d50| 28 77 66 64 20 3d 20 6f | 70 65 6e 28 62 75 66 2c |(wfd = o|pen(buf,|
|00001d60| 4f 5f 52 44 57 52 7c 4f | 5f 54 52 55 4e 43 7c 4f |O_RDWR|O|_TRUNC|O|
|00001d70| 5f 43 52 45 41 54 2c 30 | 36 30 30 29 29 20 3c 20 |_CREAT,0|600)) < |
|00001d80| 30 29 20 7b 0a 09 09 09 | 28 76 6f 69 64 29 66 70 |0) {....|(void)fp|
|00001d90| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 22 63 61 |rintf(st|derr,"ca|
|00001da0| 6e 6e 6f 74 20 63 72 65 | 61 74 65 20 22 29 3b 0a |nnot cre|ate ");.|
|00001db0| 09 09 09 70 65 72 72 6f | 72 28 62 75 66 29 3b 0a |...perro|r(buf);.|
|00001dc0| 09 09 09 65 78 69 74 28 | 31 29 3b 0a 09 09 7d 0a |...exit(|1);...}.|
|00001dd0| 09 09 28 76 6f 69 64 29 | 63 6c 6f 73 65 28 77 66 |..(void)|close(wf|
|00001de0| 64 29 3b 0a 09 09 28 76 | 6f 69 64 29 73 70 72 69 |d);...(v|oid)spri|
|00001df0| 6e 74 66 28 62 75 66 2c | 22 25 73 2e 70 61 67 22 |ntf(buf,|"%s.pag"|
|00001e00| 2c 64 62 66 69 6c 65 29 | 3b 0a 09 09 69 66 28 28 |,dbfile)|;...if((|
|00001e10| 77 66 64 20 3d 20 6f 70 | 65 6e 28 62 75 66 2c 4f |wfd = op|en(buf,O|
|00001e20| 5f 52 44 57 52 7c 4f 5f | 54 52 55 4e 43 7c 4f 5f |_RDWR|O_|TRUNC|O_|
|00001e30| 43 52 45 41 54 2c 30 36 | 30 30 29 29 20 3c 20 30 |CREAT,06|00)) < 0|
|00001e40| 29 20 7b 0a 09 09 09 28 | 76 6f 69 64 29 66 70 72 |) {....(|void)fpr|
|00001e50| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 22 63 61 6e |intf(std|err,"can|
|00001e60| 6e 6f 74 20 63 72 65 61 | 74 65 20 22 29 3b 0a 09 |not crea|te ");..|
|00001e70| 09 09 70 65 72 72 6f 72 | 28 62 75 66 29 3b 0a 09 |..perror|(buf);..|
|00001e80| 09 09 65 78 69 74 28 31 | 29 3b 0a 09 09 7d 0a 09 |..exit(1|);...}..|
|00001e90| 09 28 76 6f 69 64 29 63 | 6c 6f 73 65 28 77 66 64 |.(void)c|lose(wfd|
|00001ea0| 29 3b 0a 09 7d 0a 23 65 | 6e 64 69 66 0a 0a 0a 23 |);..}.#e|ndif...#|
|00001eb0| 69 66 64 65 66 09 44 42 | 4d 0a 09 2f 2a 20 6f 70 |ifdef.DB|M../* op|
|00001ec0| 65 6e 20 64 61 74 61 20 | 66 69 6c 65 73 2e 20 44 |en data |files. D|
|00001ed0| 42 4d 20 69 73 20 67 6c | 6f 62 61 6c 2c 20 73 6f |BM is gl|obal, so|
|00001ee0| 20 77 68 61 74 20 74 68 | 65 20 68 65 79 20 2a 2f | what th|e hey */|
|00001ef0| 0a 09 69 66 20 28 64 62 | 6d 69 6e 69 74 28 64 62 |..if (db|minit(db|
|00001f00| 66 69 6c 65 29 20 3c 20 | 30 29 20 7b 0a 09 09 28 |file) < |0) {...(|
|00001f10| 76 6f 69 64 29 66 70 72 | 69 6e 74 66 28 73 74 64 |void)fpr|intf(std|
|00001f20| 65 72 72 2c 22 63 61 6e | 6e 6f 74 20 6f 70 65 6e |err,"can|not open|
|00001f30| 20 64 61 74 61 62 61 73 | 65 20 25 73 5c 6e 22 2c | databas|e %s\n",|
|00001f40| 64 62 66 69 6c 65 29 3b | 0a 09 09 65 78 69 74 28 |dbfile);|...exit(|
|00001f50| 31 29 3b 0a 09 7d 0a 23 | 65 6e 64 69 66 0a 0a 23 |1);..}.#|endif..#|
|00001f60| 69 66 64 65 66 09 4e 44 | 42 4d 0a 09 69 66 28 28 |ifdef.ND|BM..if((|
|00001f70| 64 62 66 20 3d 20 64 62 | 6d 5f 6f 70 65 6e 28 64 |dbf = db|m_open(d|
|00001f80| 62 66 69 6c 65 2c 4f 5f | 52 44 57 52 7c 4f 5f 43 |bfile,O_|RDWR|O_C|
|00001f90| 52 45 41 54 2c 30 36 30 | 30 29 29 20 3d 3d 20 4e |REAT,060|0)) == N|
|00001fa0| 55 4c 4c 29 20 7b 0a 09 | 09 28 76 6f 69 64 29 66 |ULL) {..|.(void)f|
|00001fb0| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 22 63 |printf(s|tderr,"c|
|00001fc0| 61 6e 6e 6f 74 20 6f 70 | 65 6e 20 64 61 74 61 62 |annot op|en datab|
|00001fd0| 61 73 65 20 25 73 5c 6e | 22 2c 64 62 66 69 6c 65 |ase %s\n|",dbfile|
|00001fe0| 29 3b 0a 09 09 65 78 69 | 74 28 31 29 3b 0a 09 7d |);...exi|t(1);..}|
|00001ff0| 0a 23 65 6e 64 69 66 0a | 0a 0a 09 2f 2a 20 6d 61 |.#endif.|.../* ma|
|00002000| 69 6e 20 6c 6f 6f 70 2e | 20 72 65 61 64 20 69 6e |in loop.| read in|
|00002010| 70 75 74 20 61 6e 64 20 | 65 69 74 68 65 72 20 73 |put and |either s|
|00002020| 74 6f 72 65 20 69 74 20 | 6f 72 20 63 68 65 63 6b |tore it |or check|
|00002030| 20 69 74 20 2a 2f 0a 09 | 77 68 69 6c 65 28 66 67 | it */..|while(fg|
|00002040| 65 74 73 28 62 75 66 2c | 42 55 46 53 49 5a 2c 69 |ets(buf,|BUFSIZ,i|
|00002050| 6e 66 29 20 21 3d 20 4e | 55 4c 4c 29 20 7b 0a 09 |nf) != N|ULL) {..|
|00002060| 09 63 68 61 72 09 2a 70 | 3b 0a 0a 09 09 2f 2a 20 |.char.*p|;..../* |
|00002070| 64 72 6f 70 20 74 68 65 | 20 6e 65 77 6c 69 6e 65 |drop the| newline|
|00002080| 20 2a 2f 0a 09 09 69 66 | 28 28 70 20 3d 20 72 69 | */...if|((p = ri|
|00002090| 6e 64 65 78 28 62 75 66 | 2c 27 5c 6e 27 29 29 20 |ndex(buf|,'\n')) |
|000020a0| 21 3d 20 4e 55 4c 4c 29 | 0a 09 09 09 2a 70 20 3d |!= NULL)|....*p =|
|000020b0| 20 27 5c 30 27 3b 0a 0a | 09 09 69 66 28 64 6f 63 | '\0';..|..if(doc|
|000020c0| 68 65 63 6b 69 6e 29 0a | 09 09 09 65 72 72 63 6e |heckin).|...errcn|
|000020d0| 74 20 2b 3d 20 73 63 61 | 6e 5f 73 74 6f 72 65 28 |t += sca|n_store(|
|000020e0| 62 75 66 2c 30 29 3b 0a | 09 09 65 6c 73 65 0a 09 |buf,0);.|..else..|
|000020f0| 09 09 65 72 72 63 6e 74 | 20 2b 3d 20 73 63 61 6e |..errcnt| += scan|
|00002100| 5f 63 68 65 63 6b 28 62 | 75 66 2c 26 77 61 72 63 |_check(b|uf,&warc|
|00002110| 6e 74 29 3b 0a 09 7d 0a | 0a 09 2f 2a 20 65 78 69 |nt);..}.|../* exi|
|00002120| 74 20 77 69 74 68 20 64 | 69 66 66 65 72 65 6e 74 |t with d|ifferent|
|00002130| 20 76 61 6c 75 65 73 20 | 64 65 70 65 6e 64 69 6e | values |dependin|
|00002140| 67 20 6f 6e 20 72 65 71 | 75 65 73 74 20 2a 2f 0a |g on req|uest */.|
|00002150| 23 69 66 64 65 66 09 44 | 42 4d 0a 09 28 76 6f 69 |#ifdef.D|BM..(voi|
|00002160| 64 29 64 62 6d 63 6c 6f | 73 65 28 29 3b 0a 23 65 |d)dbmclo|se();.#e|
|00002170| 6e 64 69 66 0a 23 69 66 | 64 65 66 09 4e 44 42 4d |ndif.#if|def.NDBM|
|00002180| 0a 09 28 76 6f 69 64 29 | 64 62 6d 5f 63 6c 6f 73 |..(void)|dbm_clos|
|00002190| 65 28 64 62 66 29 3b 0a | 23 65 6e 64 69 66 0a 09 |e(dbf);.|#endif..|
|000021a0| 65 78 69 74 28 77 66 6c | 67 20 3f 20 77 61 72 63 |exit(wfl|g ? warc|
|000021b0| 6e 74 20 3a 20 65 72 72 | 63 6e 74 29 3b 0a 7d 0a |nt : err|cnt);.}.|
|000021c0| 0a 73 63 61 6e 5f 73 74 | 6f 72 65 28 66 69 6c 2c |.scan_st|ore(fil,|
|000021d0| 73 70 65 63 29 0a 63 68 | 61 72 09 2a 66 69 6c 3b |spec).ch|ar.*fil;|
|000021e0| 0a 63 68 61 72 09 73 70 | 65 63 3b 09 2f 2a 20 6f |.char.sp|ec;./* o|
|000021f0| 76 65 72 72 69 64 65 20 | 2d 20 6d 61 6b 65 20 73 |verride |- make s|
|00002200| 75 72 65 20 63 68 65 63 | 6b 73 75 6d 20 69 73 20 |ure chec|ksum is |
|00002210| 64 6f 6e 65 20 66 6f 72 | 20 75 70 64 61 74 65 20 |done for| update |
|00002220| 2a 2f 0a 7b 0a 09 73 74 | 72 75 63 74 09 73 65 63 |*/.{..st|ruct.sec|
|00002230| 72 65 63 09 73 62 75 66 | 3b 0a 09 64 61 74 75 6d |rec.sbuf|;..datum|
|00002240| 09 6b 65 79 3b 0a 09 64 | 61 74 75 6d 09 63 6f 6e |.key;..d|atum.con|
|00002250| 74 65 6e 74 3b 0a 0a 09 | 69 66 28 73 74 61 74 28 |tent;...|if(stat(|
|00002260| 66 69 6c 2c 26 73 62 75 | 66 2e 73 29 29 20 7b 0a |fil,&sbu|f.s)) {.|
|00002270| 09 09 77 61 72 6e 28 22 | 63 61 6e 6e 6f 74 20 73 |..warn("|cannot s|
|00002280| 74 61 74 22 2c 66 69 6c | 29 3b 0a 09 09 72 65 74 |tat",fil|);...ret|
|00002290| 75 72 6e 28 31 29 3b 0a | 09 7d 0a 0a 09 69 66 28 |urn(1);.|.}...if(|
|000022a0| 73 75 6d 66 6c 67 20 7c | 7c 20 73 70 65 63 29 20 |sumflg ||| spec) |
|000022b0| 7b 0a 09 09 73 62 75 66 | 2e 73 75 6d 20 3d 20 73 |{...sbuf|.sum = s|
|000022c0| 75 6d 69 74 28 66 69 6c | 29 3b 0a 09 09 73 62 75 |umit(fil|);...sbu|
|000022d0| 66 2e 73 75 6d 66 20 3d | 20 31 3b 0a 09 7d 20 65 |f.sumf =| 1;..} e|
|000022e0| 6c 73 65 0a 09 09 73 62 | 75 66 2e 73 75 6d 66 20 |lse...sb|uf.sumf |
|000022f0| 3d 20 30 3b 0a 0a 09 6b | 65 79 2e 64 73 69 7a 65 |= 0;...k|ey.dsize|
|00002300| 20 3d 20 73 74 72 6c 65 | 6e 28 66 69 6c 29 3b 0a | = strle|n(fil);.|
|00002310| 09 6b 65 79 2e 64 70 74 | 72 20 3d 20 66 69 6c 3b |.key.dpt|r = fil;|
|00002320| 0a 09 63 6f 6e 74 65 6e | 74 2e 64 73 69 7a 65 20 |..conten|t.dsize |
|00002330| 3d 20 73 69 7a 65 6f 66 | 28 73 62 75 66 29 3b 0a |= sizeof|(sbuf);.|
|00002340| 09 63 6f 6e 74 65 6e 74 | 2e 64 70 74 72 20 3d 20 |.content|.dptr = |
|00002350| 28 63 68 61 72 20 2a 29 | 26 73 62 75 66 3b 0a 0a |(char *)|&sbuf;..|
|00002360| 23 69 66 64 65 66 09 44 | 42 4d 0a 09 69 66 28 73 |#ifdef.D|BM..if(s|
|00002370| 74 6f 72 65 28 6b 65 79 | 2c 20 63 6f 6e 74 65 6e |tore(key|, conten|
|00002380| 74 29 29 20 7b 0a 09 09 | 77 61 72 6e 28 22 63 61 |t)) {...|warn("ca|
|00002390| 6e 6e 6f 74 20 73 74 6f | 72 65 22 2c 66 69 6c 29 |nnot sto|re",fil)|
|000023a0| 3b 0a 09 09 72 65 74 75 | 72 6e 28 31 29 3b 0a 09 |;...retu|rn(1);..|
|000023b0| 7d 0a 23 65 6e 64 69 66 | 0a 23 69 66 64 65 66 09 |}.#endif|.#ifdef.|
|000023c0| 4e 44 42 4d 0a 09 69 66 | 28 64 62 6d 5f 73 74 6f |NDBM..if|(dbm_sto|
|000023d0| 72 65 28 64 62 66 2c 6b | 65 79 2c 20 63 6f 6e 74 |re(dbf,k|ey, cont|
|000023e0| 65 6e 74 2c 44 42 4d 5f | 52 45 50 4c 41 43 45 29 |ent,DBM_|REPLACE)|
|000023f0| 29 20 7b 0a 09 09 77 61 | 72 6e 28 22 63 61 6e 6e |) {...wa|rn("cann|
|00002400| 6f 74 20 73 74 6f 72 65 | 22 2c 66 69 6c 29 3b 0a |ot store|",fil);.|
|00002410| 09 09 72 65 74 75 72 6e | 28 31 29 3b 0a 09 7d 0a |..return|(1);..}.|
|00002420| 23 65 6e 64 69 66 0a 09 | 72 65 74 75 72 6e 28 30 |#endif..|return(0|
|00002430| 29 3b 0a 7d 0a 0a 73 63 | 61 6e 5f 63 68 65 63 6b |);.}..sc|an_check|
|00002440| 28 66 69 6c 2c 77 61 72 | 6e 69 6e 67 73 29 0a 63 |(fil,war|nings).c|
|00002450| 68 61 72 09 2a 66 69 6c | 3b 0a 69 6e 74 09 2a 77 |har.*fil|;.int.*w|
|00002460| 61 72 6e 69 6e 67 73 3b | 0a 7b 0a 09 73 74 72 75 |arnings;|.{..stru|
|00002470| 63 74 09 73 65 63 72 65 | 63 09 73 70 74 72 3b 0a |ct.secre|c.sptr;.|
|00002480| 09 73 74 72 75 63 74 09 | 73 65 63 72 65 63 09 73 |.struct.|secrec.s|
|00002490| 62 75 66 3b 0a 09 64 61 | 74 75 6d 09 6b 65 79 3b |buf;..da|tum.key;|
|000024a0| 0a 09 64 61 74 75 6d 09 | 63 6f 6e 74 65 6e 74 3b |..datum.|content;|
|000024b0| 0a 09 69 6e 74 09 73 74 | 61 74 65 20 3d 20 30 3b |..int.st|ate = 0;|
|000024c0| 0a 0a 09 69 66 28 73 74 | 61 74 28 66 69 6c 2c 26 |...if(st|at(fil,&|
|000024d0| 73 62 75 66 2e 73 29 29 | 20 7b 0a 09 09 77 61 72 |sbuf.s))| {...war|
|000024e0| 6e 28 22 63 61 6e 6e 6f | 74 20 73 74 61 74 22 2c |n("canno|t stat",|
|000024f0| 66 69 6c 29 3b 0a 09 09 | 2a 77 61 72 6e 69 6e 67 |fil);...|*warning|
|00002500| 73 2b 2b 3b 0a 09 09 72 | 65 74 75 72 6e 28 31 29 |s++;...r|eturn(1)|
|00002510| 3b 0a 09 7d 0a 0a 09 6b | 65 79 2e 64 70 74 72 20 |;..}...k|ey.dptr |
|00002520| 3d 20 66 69 6c 3b 0a 09 | 6b 65 79 2e 64 73 69 7a |= fil;..|key.dsiz|
|00002530| 65 20 3d 20 73 74 72 6c | 65 6e 28 66 69 6c 29 3b |e = strl|en(fil);|
|00002540| 0a 0a 23 69 66 64 65 66 | 09 44 42 4d 0a 09 63 6f |..#ifdef|.DBM..co|
|00002550| 6e 74 65 6e 74 20 3d 20 | 66 65 74 63 68 28 6b 65 |ntent = |fetch(ke|
|00002560| 79 29 3b 0a 23 65 6e 64 | 69 66 0a 23 69 66 64 65 |y);.#end|if.#ifde|
|00002570| 66 09 4e 44 42 4d 0a 09 | 63 6f 6e 74 65 6e 74 20 |f.NDBM..|content |
|00002580| 3d 20 64 62 6d 5f 66 65 | 74 63 68 28 64 62 66 2c |= dbm_fe|tch(dbf,|
|00002590| 6b 65 79 29 3b 0a 23 65 | 6e 64 69 66 0a 0a 09 2f |key);.#e|ndif.../|
|000025a0| 2a 20 69 20 73 75 70 70 | 6f 73 65 20 74 68 61 74 |* i supp|ose that|
|000025b0| 20 6e 6f 74 20 62 65 69 | 6e 67 20 69 6e 20 74 68 | not bei|ng in th|
|000025c0| 65 20 64 61 74 61 62 61 | 73 65 20 69 73 20 61 6e |e databa|se is an|
|000025d0| 20 65 72 72 6f 72 2c 20 | 2a 2f 0a 09 2f 2a 20 6e | error, |*/../* n|
|000025e0| 6f 74 20 61 20 73 65 63 | 75 72 69 74 79 20 76 69 |ot a sec|urity vi|
|000025f0| 6f 6c 61 74 69 6f 6e 2c | 20 69 6e 20 61 73 20 6d |olation,| in as m|
|00002600| 61 6e 79 20 77 6f 72 64 | 73 20 2a 2f 0a 09 69 66 |any word|s */..if|
|00002610| 20 28 63 6f 6e 74 65 6e | 74 2e 64 70 74 72 20 3d | (conten|t.dptr =|
|00002620| 3d 20 30 29 20 7b 0a 09 | 09 77 61 72 6e 28 22 6e |= 0) {..|.warn("n|
|00002630| 6f 20 65 6e 74 72 79 20 | 69 6e 20 64 61 74 61 62 |o entry |in datab|
|00002640| 61 73 65 22 2c 66 69 6c | 29 3b 0a 0a 09 09 2f 2a |ase",fil|);..../*|
|00002650| 20 75 70 64 61 74 65 20 | 63 68 61 6e 67 65 73 20 | update |changes |
|00002660| 2a 2f 0a 09 09 69 66 28 | 75 70 64 66 6c 67 29 20 |*/...if(|updflg) |
|00002670| 7b 0a 09 09 09 2f 2a 20 | 61 20 63 68 65 63 6b 73 |{..../* |a checks|
|00002680| 75 6d 20 77 69 6c 6c 20 | 62 65 20 64 6f 6e 65 20 |um will |be done |
|00002690| 6f 6e 6c 79 20 69 66 20 | 73 75 6d 66 6c 67 20 69 |only if |sumflg i|
|000026a0| 73 20 73 65 74 20 2a 2f | 0a 09 09 09 28 76 6f 69 |s set */|....(voi|
|000026b0| 64 29 73 63 61 6e 5f 73 | 74 6f 72 65 28 66 69 6c |d)scan_s|tore(fil|
|000026c0| 2c 30 29 3b 0a 09 09 7d | 0a 09 09 72 65 74 75 72 |,0);...}|...retur|
|000026d0| 6e 28 31 29 3b 0a 09 7d | 0a 0a 09 28 76 6f 69 64 |n(1);..}|...(void|
|000026e0| 29 62 63 6f 70 79 28 63 | 6f 6e 74 65 6e 74 2e 64 |)bcopy(c|ontent.d|
|000026f0| 70 74 72 2c 28 63 68 61 | 72 20 2a 29 26 73 70 74 |ptr,(cha|r *)&spt|
|00002700| 72 2c 73 69 7a 65 6f 66 | 28 73 70 74 72 29 29 3b |r,sizeof|(sptr));|
|00002710| 0a 0a 09 2f 2a 20 63 68 | 65 63 6b 20 77 68 61 74 |.../* ch|eck what|
|00002720| 20 77 65 20 64 65 65 6d | 20 69 6d 70 6f 72 74 61 | we deem| importa|
|00002730| 6e 74 20 2a 2f 0a 09 69 | 66 28 73 70 74 72 2e 73 |nt */..i|f(sptr.s|
|00002740| 75 6d 66 20 21 3d 20 30 | 29 20 7b 0a 09 09 73 62 |umf != 0|) {...sb|
|00002750| 75 66 2e 73 75 6d 20 3d | 20 73 75 6d 69 74 28 66 |uf.sum =| sumit(f|
|00002760| 69 6c 29 3b 0a 09 09 69 | 66 28 73 70 74 72 2e 73 |il);...i|f(sptr.s|
|00002770| 75 6d 20 21 3d 20 73 62 | 75 66 2e 73 75 6d 29 20 |um != sb|uf.sum) |
|00002780| 7b 0a 09 09 09 77 61 72 | 6e 28 22 63 68 65 63 6b |{....war|n("check|
|00002790| 73 75 6d 20 64 6f 65 73 | 20 6e 6f 74 20 6d 61 74 |sum does| not mat|
|000027a0| 63 68 22 2c 66 69 6c 29 | 3b 0a 09 09 09 73 74 61 |ch",fil)|;....sta|
|000027b0| 74 65 2b 2b 3b 0a 09 09 | 7d 0a 09 7d 0a 09 69 66 |te++;...|}..}..if|
|000027c0| 28 73 70 74 72 2e 73 2e | 73 74 5f 73 69 7a 65 20 |(sptr.s.|st_size |
|000027d0| 21 3d 20 73 62 75 66 2e | 73 2e 73 74 5f 73 69 7a |!= sbuf.|s.st_siz|
|000027e0| 65 29 20 7b 0a 09 09 77 | 61 72 6e 28 22 66 69 6c |e) {...w|arn("fil|
|000027f0| 65 20 73 69 7a 65 20 68 | 61 73 20 63 68 61 6e 67 |e size h|as chang|
|00002800| 65 64 22 2c 66 69 6c 29 | 3b 0a 09 09 73 74 61 74 |ed",fil)|;...stat|
|00002810| 65 2b 2b 3b 0a 09 7d 0a | 09 69 66 28 73 70 74 72 |e++;..}.|.if(sptr|
|00002820| 2e 73 2e 73 74 5f 75 69 | 64 20 21 3d 20 73 62 75 |.s.st_ui|d != sbu|
|00002830| 66 2e 73 2e 73 74 5f 75 | 69 64 29 20 7b 0a 09 09 |f.s.st_u|id) {...|
|00002840| 77 61 72 6e 28 22 6f 77 | 6e 65 72 20 75 69 64 20 |warn("ow|ner uid |
|00002850| 68 61 73 20 63 68 61 6e | 67 65 64 22 2c 66 69 6c |has chan|ged",fil|
|00002860| 29 3b 0a 09 09 73 74 61 | 74 65 2b 2b 3b 0a 09 7d |);...sta|te++;..}|
|00002870| 0a 09 69 66 28 73 70 74 | 72 2e 73 2e 73 74 5f 75 |..if(spt|r.s.st_u|
|00002880| 69 64 20 21 3d 20 73 62 | 75 66 2e 73 2e 73 74 5f |id != sb|uf.s.st_|
|00002890| 75 69 64 29 20 7b 0a 09 | 09 77 61 72 6e 28 22 6f |uid) {..|.warn("o|
|000028a0| 77 6e 65 72 20 67 69 64 | 20 68 61 73 20 63 68 61 |wner gid| has cha|
|000028b0| 6e 67 65 64 22 2c 66 69 | 6c 29 3b 0a 09 09 73 74 |nged",fi|l);...st|
|000028c0| 61 74 65 2b 2b 3b 0a 09 | 7d 0a 09 69 66 28 73 70 |ate++;..|}..if(sp|
|000028d0| 74 72 2e 73 2e 73 74 5f | 6d 6f 64 65 20 21 3d 20 |tr.s.st_|mode != |
|000028e0| 73 62 75 66 2e 73 2e 73 | 74 5f 6d 6f 64 65 29 20 |sbuf.s.s|t_mode) |
|000028f0| 7b 0a 09 09 77 61 72 6e | 28 22 70 65 72 6d 69 73 |{...warn|("permis|
|00002900| 73 69 6f 6e 73 20 68 61 | 76 65 20 63 68 61 6e 67 |sions ha|ve chang|
|00002910| 65 64 22 2c 66 69 6c 29 | 3b 0a 09 09 73 74 61 74 |ed",fil)|;...stat|
|00002920| 65 2b 2b 3b 0a 09 7d 0a | 09 69 66 28 73 70 74 72 |e++;..}.|.if(sptr|
|00002930| 2e 73 2e 73 74 5f 6d 74 | 69 6d 65 20 21 3d 20 73 |.s.st_mt|ime != s|
|00002940| 62 75 66 2e 73 2e 73 74 | 5f 6d 74 69 6d 65 29 20 |buf.s.st|_mtime) |
|00002950| 7b 0a 09 09 77 61 72 6e | 28 22 6d 6f 64 69 66 69 |{...warn|("modifi|
|00002960| 63 61 74 69 6f 6e 20 74 | 69 6d 65 20 68 61 73 20 |cation t|ime has |
|00002970| 63 68 61 6e 67 65 64 22 | 2c 66 69 6c 29 3b 0a 09 |changed"|,fil);..|
|00002980| 09 73 74 61 74 65 2b 2b | 3b 0a 09 7d 0a 09 69 66 |.state++|;..}..if|
|00002990| 28 73 70 74 72 2e 73 2e | 73 74 5f 63 74 69 6d 65 |(sptr.s.|st_ctime|
|000029a0| 20 21 3d 20 73 62 75 66 | 2e 73 2e 73 74 5f 63 74 | != sbuf|.s.st_ct|
|000029b0| 69 6d 65 29 20 7b 0a 09 | 09 77 61 72 6e 28 22 63 |ime) {..|.warn("c|
|000029c0| 72 65 61 74 69 6f 6e 20 | 74 69 6d 65 20 68 61 73 |reation |time has|
|000029d0| 20 63 68 61 6e 67 65 64 | 22 2c 66 69 6c 29 3b 0a | changed|",fil);.|
|000029e0| 09 09 73 74 61 74 65 2b | 2b 3b 0a 09 7d 0a 0a 09 |..state+|+;..}...|
|000029f0| 2f 2a 20 75 70 64 61 74 | 65 20 63 68 61 6e 67 65 |/* updat|e change|
|00002a00| 73 20 2a 2f 0a 09 69 66 | 28 75 70 64 66 6c 67 20 |s */..if|(updflg |
|00002a10| 26 26 20 73 74 61 74 65 | 20 21 3d 20 30 29 0a 09 |&& state| != 0)..|
|00002a20| 09 2f 2a 20 63 68 65 63 | 6b 73 75 6d 20 77 69 6c |./* chec|ksum wil|
|00002a30| 6c 20 62 65 20 64 6f 6e | 65 20 69 66 20 73 75 6d |l be don|e if sum|
|00002a40| 66 6c 67 20 6f 72 20 74 | 68 65 20 66 69 6c 65 20 |flg or t|he file |
|00002a50| 66 6c 61 67 20 69 73 20 | 73 65 74 20 2a 2f 0a 09 |flag is |set */..|
|00002a60| 09 28 76 6f 69 64 29 73 | 63 61 6e 5f 73 74 6f 72 |.(void)s|can_stor|
|00002a70| 65 28 66 69 6c 2c 73 70 | 74 72 2e 73 75 6d 66 29 |e(fil,sp|tr.sumf)|
|00002a80| 3b 0a 0a 09 72 65 74 75 | 72 6e 28 73 74 61 74 65 |;...retu|rn(state|
|00002a90| 29 3b 0a 7d 0a 0a 75 73 | 61 67 65 28 29 0a 7b 0a |);.}..us|age().{.|
|00002aa0| 09 28 76 6f 69 64 29 66 | 70 72 69 6e 74 66 28 73 |.(void)f|printf(s|
|00002ab0| 74 64 65 72 72 2c 22 75 | 73 61 67 65 3a 5c 6e 22 |tderr,"u|sage:\n"|
|00002ac0| 29 3b 0a 09 28 76 6f 69 | 64 29 66 70 72 69 6e 74 |);..(voi|d)fprint|
|00002ad0| 66 28 73 74 64 65 72 72 | 2c 22 66 69 6c 65 73 63 |f(stderr|,"filesc|
|00002ae0| 61 6e 20 2d 64 20 64 61 | 74 61 62 61 73 65 20 5b |an -d da|tabase [|
|00002af0| 2d 61 20 28 61 70 70 65 | 6e 64 20 74 6f 20 6c 6f |-a (appe|nd to lo|
|00002b00| 67 29 5d 20 5b 2d 73 20 | 28 70 65 72 66 6f 72 6d |g)] [-s |(perform|
|00002b10| 20 63 68 65 63 6b 73 75 | 6d 73 29 5d 5c 6e 22 29 | checksu|ms)]\n")|
|00002b20| 3b 0a 23 69 66 64 65 66 | 09 4e 44 42 4d 0a 09 28 |;.#ifdef|.NDBM..(|
|00002b30| 76 6f 69 64 29 66 70 72 | 69 6e 74 66 28 73 74 64 |void)fpr|intf(std|
|00002b40| 65 72 72 2c 22 5c 74 5b | 2d 77 20 28 65 78 69 74 |err,"\t[|-w (exit|
|00002b50| 20 77 69 74 68 20 77 61 | 72 6e 69 6e 67 73 29 5d | with wa|rnings)]|
|00002b60| 20 5b 2d 63 20 28 6c 6f | 61 64 20 64 61 74 61 62 | [-c (lo|ad datab|
|00002b70| 61 73 65 29 5d 5c 6e 22 | 29 3b 0a 23 65 6e 64 69 |ase)]\n"|);.#endi|
|00002b80| 66 0a 23 69 66 64 65 66 | 09 44 42 4d 0a 09 28 76 |f.#ifdef|.DBM..(v|
|00002b90| 6f 69 64 29 66 70 72 69 | 6e 74 66 28 73 74 64 65 |oid)fpri|ntf(stde|
|00002ba0| 72 72 2c 22 5c 74 5b 2d | 77 20 28 65 78 69 74 20 |rr,"\t[-|w (exit |
|00002bb0| 77 69 74 68 20 77 61 72 | 6e 69 6e 67 73 29 5d 20 |with war|nings)] |
|00002bc0| 5b 2d 63 20 28 6c 6f 61 | 64 20 64 61 74 61 62 61 |[-c (loa|d databa|
|00002bd0| 73 65 29 5d 20 5b 2d 43 | 20 28 63 72 65 61 74 65 |se)] [-C| (create|
|00002be0| 20 64 61 74 61 62 61 73 | 65 29 5d 5c 6e 22 29 3b | databas|e)]\n");|
|00002bf0| 0a 23 65 6e 64 69 66 0a | 09 28 76 6f 69 64 29 66 |.#endif.|.(void)f|
|00002c00| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 22 5c |printf(s|tderr,"\|
|00002c10| 74 5b 2d 69 20 66 69 6c | 65 6e 61 6d 65 20 28 72 |t[-i fil|ename (r|
|00002c20| 65 61 64 20 6c 69 73 74 | 20 66 72 6f 6d 20 66 69 |ead list| from fi|
|00002c30| 6c 65 29 5d 20 5b 2d 6f | 20 66 69 6c 65 6e 61 6d |le)] [-o| filenam|
|00002c40| 65 20 28 6c 6f 67 20 66 | 69 6c 65 29 5d 5c 6e 22 |e (log f|ile)]\n"|
|00002c50| 29 3b 0a 09 28 76 6f 69 | 64 29 66 70 72 69 6e 74 |);..(voi|d)fprint|
|00002c60| 66 28 73 74 64 65 72 72 | 2c 22 5c 74 5b 2d 75 20 |f(stderr|,"\t[-u |
|00002c70| 28 75 70 64 61 74 65 20 | 61 6e 79 20 63 68 61 6e |(update |any chan|
|00002c80| 67 65 73 20 66 6f 75 6e | 64 29 5d 5c 6e 22 29 3b |ges foun|d)]\n");|
|00002c90| 0a 09 72 65 74 75 72 6e | 28 31 29 3b 0a 7d 0a 0a |..return|(1);.}..|
|00002ca0| 73 74 61 74 69 63 09 76 | 6f 69 64 0a 77 61 72 6e |static.v|oid.warn|
|00002cb0| 28 73 31 2c 73 32 29 0a | 63 68 61 72 09 2a 73 31 |(s1,s2).|char.*s1|
|00002cc0| 3b 0a 63 68 61 72 09 2a | 73 32 3b 0a 7b 0a 09 65 |;.char.*|s2;.{..e|
|00002cd0| 78 74 65 72 6e 09 69 6e | 74 09 65 72 72 6e 6f 3b |xtern.in|t.errno;|
|00002ce0| 0a 09 65 78 74 65 72 6e | 09 63 68 61 72 09 2a 73 |..extern|.char.*s|
|00002cf0| 79 73 5f 65 72 72 6c 69 | 73 74 5b 5d 3b 0a 0a 09 |ys_errli|st[];...|
|00002d00| 69 66 28 65 72 72 6e 6f | 29 20 0a 09 09 28 76 6f |if(errno|) ...(vo|
|00002d10| 69 64 29 66 70 72 69 6e | 74 66 28 6f 75 74 66 2c |id)fprin|tf(outf,|
|00002d20| 22 25 73 3a 25 73 28 25 | 73 29 5c 6e 22 2c 73 32 |"%s:%s(%|s)\n",s2|
|00002d30| 2c 73 31 2c 73 79 73 5f | 65 72 72 6c 69 73 74 5b |,s1,sys_|errlist[|
|00002d40| 65 72 72 6e 6f 5d 29 3b | 0a 09 65 6c 73 65 0a 09 |errno]);|..else..|
|00002d50| 09 28 76 6f 69 64 29 66 | 70 72 69 6e 74 66 28 6f |.(void)f|printf(o|
|00002d60| 75 74 66 2c 22 25 73 3a | 25 73 5c 6e 22 2c 73 32 |utf,"%s:|%s\n",s2|
|00002d70| 2c 73 31 29 3b 0a 7d 0a | 0a 0a 73 75 6d 69 74 28 |,s1);.}.|..sumit(|
|00002d80| 66 69 6c 29 0a 63 68 61 | 72 09 2a 66 69 6c 3b 0a |fil).cha|r.*fil;.|
|00002d90| 7b 0a 09 69 6e 74 09 73 | 75 6d 20 3d 20 30 3b 0a |{..int.s|um = 0;.|
|00002da0| 09 69 6e 74 09 66 64 3b | 0a 09 69 6e 74 09 63 6e |.int.fd;|..int.cn|
|00002db0| 74 3b 0a 09 63 68 61 72 | 09 62 75 66 5b 42 55 46 |t;..char|.buf[BUF|
|00002dc0| 53 49 5a 5d 3b 0a 0a 09 | 69 66 28 28 66 64 20 3d |SIZ];...|if((fd =|
|00002dd0| 20 6f 70 65 6e 28 66 69 | 6c 2c 4f 5f 52 44 4f 4e | open(fi|l,O_RDON|
|00002de0| 4c 59 29 29 20 3c 20 30 | 29 20 7b 0a 09 09 77 61 |LY)) < 0|) {...wa|
|00002df0| 72 6e 28 22 63 61 6e 6e | 6f 74 20 72 65 61 64 20 |rn("cann|ot read |
|00002e00| 66 6f 72 20 73 75 6d 22 | 2c 66 69 6c 29 3b 0a 09 |for sum"|,fil);..|
|00002e10| 7d 20 65 6c 73 65 20 7b | 0a 09 09 77 68 69 6c 65 |} else {|...while|
|00002e20| 28 28 63 6e 74 20 3d 20 | 72 65 61 64 28 66 64 2c |((cnt = |read(fd,|
|00002e30| 62 75 66 2c 42 55 46 53 | 49 5a 29 29 20 3e 20 30 |buf,BUFS|IZ)) > 0|
|00002e40| 29 0a 09 09 09 73 75 6d | 20 2b 3d 20 69 6e 5f 63 |)....sum| += in_c|
|00002e50| 6b 73 75 6d 28 28 75 5f | 73 68 6f 72 74 20 2a 29 |ksum((u_|short *)|
|00002e60| 62 75 66 2c 63 6e 74 29 | 3b 0a 09 09 28 76 6f 69 |buf,cnt)|;...(voi|
|00002e70| 64 29 63 6c 6f 73 65 28 | 66 64 29 3b 0a 09 7d 0a |d)close(|fd);..}.|
|00002e80| 09 72 65 74 75 72 6e 28 | 73 75 6d 29 3b 0a 7d 0a |.return(|sum);.}.|
|00002e90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003000| 66 69 6c 65 73 63 61 6e | 2f 69 6e 5f 63 6b 73 75 |filescan|/in_cksu|
|00003010| 6d 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |m.c.....|........|
|00003020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003060| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00003070| 34 33 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |43 . | 0 . |
|00003080| 20 20 20 31 34 37 36 20 | 20 34 35 30 36 34 36 37 | 1476 | 4506467|
|00003090| 34 33 31 20 20 20 37 36 | 33 37 00 20 00 00 00 00 |431 76|37. ....|
|000030a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003200| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 74 79 |#include| <sys/ty|
|00003210| 70 65 73 2e 68 3e 0a 0a | 2f 2a 0a 20 2a 20 49 6e |pes.h>..|/*. * In|
|00003220| 74 65 72 6e 65 74 20 50 | 72 6f 74 6f 63 6f 6c 20 |ternet P|rotocol |
|00003230| 63 68 65 63 6b 73 75 6d | 20 72 6f 75 74 69 6e 65 |checksum| routine|
|00003240| 2c 20 73 74 6f 6c 65 6e | 20 66 72 6f 6d 20 70 69 |, stolen| from pi|
|00003250| 6e 67 2e 63 0a 20 2a 2f | 0a 0a 69 6e 5f 63 6b 73 |ng.c. */|..in_cks|
|00003260| 75 6d 28 61 64 64 72 2c | 20 6c 65 6e 29 0a 09 75 |um(addr,| len)..u|
|00003270| 5f 73 68 6f 72 74 09 2a | 61 64 64 72 3b 0a 09 69 |_short.*|addr;..i|
|00003280| 6e 74 09 6c 65 6e 3b 0a | 7b 0a 09 72 65 67 69 73 |nt.len;.|{..regis|
|00003290| 74 65 72 20 69 6e 74 20 | 6e 6c 65 66 74 20 3d 20 |ter int |nleft = |
|000032a0| 6c 65 6e 3b 0a 09 72 65 | 67 69 73 74 65 72 20 75 |len;..re|gister u|
|000032b0| 5f 73 68 6f 72 74 20 2a | 77 20 3d 20 61 64 64 72 |_short *|w = addr|
|000032c0| 3b 0a 09 72 65 67 69 73 | 74 65 72 20 75 5f 73 68 |;..regis|ter u_sh|
|000032d0| 6f 72 74 20 61 6e 73 77 | 65 72 3b 0a 09 72 65 67 |ort answ|er;..reg|
|000032e0| 69 73 74 65 72 20 69 6e | 74 20 73 75 6d 20 3d 20 |ister in|t sum = |
|000032f0| 30 3b 0a 0a 09 2f 2a 0a | 09 20 2a 20 20 4f 75 72 |0;.../*.|. * Our|
|00003300| 20 61 6c 67 6f 72 69 74 | 68 6d 20 69 73 20 73 69 | algorit|hm is si|
|00003310| 6d 70 6c 65 2c 20 75 73 | 69 6e 67 20 61 20 33 32 |mple, us|ing a 32|
|00003320| 20 62 69 74 20 61 63 63 | 75 6d 75 6c 61 74 6f 72 | bit acc|umulator|
|00003330| 20 28 73 75 6d 29 2c 0a | 09 20 2a 20 20 77 65 20 | (sum),.|. * we |
|00003340| 61 64 64 20 73 65 71 75 | 65 6e 74 69 61 6c 20 31 |add sequ|ential 1|
|00003350| 36 20 62 69 74 20 77 6f | 72 64 73 20 74 6f 20 69 |6 bit wo|rds to i|
|00003360| 74 2c 20 61 6e 64 20 61 | 74 20 74 68 65 20 65 6e |t, and a|t the en|
|00003370| 64 2c 20 66 6f 6c 64 0a | 09 20 2a 20 20 62 61 63 |d, fold.|. * bac|
|00003380| 6b 20 61 6c 6c 20 74 68 | 65 20 63 61 72 72 79 20 |k all th|e carry |
|00003390| 62 69 74 73 20 66 72 6f | 6d 20 74 68 65 20 74 6f |bits fro|m the to|
|000033a0| 70 20 31 36 20 62 69 74 | 73 20 69 6e 74 6f 20 74 |p 16 bit|s into t|
|000033b0| 68 65 20 6c 6f 77 65 72 | 0a 09 20 2a 20 20 31 36 |he lower|.. * 16|
|000033c0| 20 62 69 74 73 2e 0a 09 | 20 2a 2f 0a 09 77 68 69 | bits...| */..whi|
|000033d0| 6c 65 28 20 6e 6c 65 66 | 74 20 3e 20 31 20 29 20 |le( nlef|t > 1 ) |
|000033e0| 20 7b 0a 09 09 73 75 6d | 20 2b 3d 20 2a 77 2b 2b | {...sum| += *w++|
|000033f0| 3b 0a 09 09 6e 6c 65 66 | 74 20 2d 3d 20 32 3b 0a |;...nlef|t -= 2;.|
|00003400| 09 7d 0a 0a 09 2f 2a 20 | 6d 6f 70 20 75 70 20 61 |.}.../* |mop up a|
|00003410| 6e 20 6f 64 64 20 62 79 | 74 65 2c 20 69 66 20 6e |n odd by|te, if n|
|00003420| 65 63 65 73 73 61 72 79 | 20 2a 2f 0a 09 69 66 28 |ecessary| */..if(|
|00003430| 20 6e 6c 65 66 74 20 3d | 3d 20 31 20 29 0a 09 09 | nleft =|= 1 )...|
|00003440| 73 75 6d 20 2b 3d 20 2a | 28 75 5f 63 68 61 72 20 |sum += *|(u_char |
|00003450| 2a 29 77 3b 0a 0a 09 2f | 2a 0a 09 20 2a 20 61 64 |*)w;.../|*.. * ad|
|00003460| 64 20 62 61 63 6b 20 63 | 61 72 72 79 20 6f 75 74 |d back c|arry out|
|00003470| 73 20 66 72 6f 6d 20 74 | 6f 70 20 31 36 20 62 69 |s from t|op 16 bi|
|00003480| 74 73 20 74 6f 20 6c 6f | 77 20 31 36 20 62 69 74 |ts to lo|w 16 bit|
|00003490| 73 0a 09 20 2a 2f 0a 09 | 73 75 6d 20 3d 20 28 73 |s.. */..|sum = (s|
|000034a0| 75 6d 20 3e 3e 20 31 36 | 29 20 2b 20 28 73 75 6d |um >> 16|) + (sum|
|000034b0| 20 26 20 30 78 66 66 66 | 66 29 3b 09 2f 2a 20 61 | & 0xfff|f);./* a|
|000034c0| 64 64 20 68 69 20 31 36 | 20 74 6f 20 6c 6f 77 20 |dd hi 16| to low |
|000034d0| 31 36 20 2a 2f 0a 09 73 | 75 6d 20 2b 3d 20 28 73 |16 */..s|um += (s|
|000034e0| 75 6d 20 3e 3e 20 31 36 | 29 3b 09 09 09 2f 2a 20 |um >> 16|);.../* |
|000034f0| 61 64 64 20 63 61 72 72 | 79 20 2a 2f 0a 09 61 6e |add carr|y */..an|
|00003500| 73 77 65 72 20 3d 20 7e | 73 75 6d 3b 09 09 09 09 |swer = ~|sum;....|
|00003510| 2f 2a 20 74 72 75 6e 63 | 61 74 65 20 74 6f 20 31 |/* trunc|ate to 1|
|00003520| 36 20 62 69 74 73 20 2a | 2f 0a 09 72 65 74 75 72 |6 bits *|/..retur|
|00003530| 6e 20 28 61 6e 73 77 65 | 72 29 3b 0a 7d 0a 3b 0a |n (answe|r);.}.;.|
|00003540| 09 63 6f 6e 74 65 6e 74 | 2e 64 70 74 72 20 3d 20 |.content|.dptr = |
|00003550| 28 63 68 61 72 20 2a 29 | 26 73 62 75 66 3b 0a 0a |(char *)|&sbuf;..|
|00003560| 23 69 66 64 65 66 09 44 | 42 4d 0a 09 69 66 28 73 |#ifdef.D|BM..if(s|
|00003570| 74 6f 72 65 28 6b 65 79 | 2c 20 63 6f 6e 74 65 6e |tore(key|, conten|
|00003580| 74 29 29 20 7b 0a 09 09 | 77 61 72 6e 28 22 63 61 |t)) {...|warn("ca|
|00003590| 6e 6e 6f 74 20 73 74 6f | 72 65 22 2c 66 69 6c 29 |nnot sto|re",fil)|
|000035a0| 3b 0a 09 09 72 65 74 75 | 72 6e 28 31 29 3b 0a 09 |;...retu|rn(1);..|
|000035b0| 7d 0a 23 65 6e 64 69 66 | 0a 23 69 66 64 65 66 09 |}.#endif|.#ifdef.|
|000035c0| 4e 44 42 4d 0a 09 69 66 | 28 64 62 6d 5f 73 74 6f |NDBM..if|(dbm_sto|
|000035d0| 72 65 28 64 62 66 2c 6b | 65 79 2c 20 63 6f 6e 74 |re(dbf,k|ey, cont|
|000035e0| 65 6e 74 2c 44 42 4d 5f | 52 45 50 4c 41 43 45 29 |ent,DBM_|REPLACE)|
|000035f0| 29 20 7b 0a 09 09 77 61 | 72 6e 28 22 63 61 6e 6e |) {...wa|rn("cann|
|00003600| 66 69 6c 65 73 63 61 6e | 2f 66 69 6c 65 73 63 61 |filescan|/filesca|
|00003610| 6e 2e 38 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |n.8.....|........|
|00003620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003660| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00003670| 34 33 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |43 . | 0 . |
|00003680| 20 20 20 37 35 35 35 20 | 20 34 35 30 36 34 36 37 | 7555 | 4506467|
|00003690| 34 33 32 20 20 20 37 35 | 34 35 00 20 00 00 00 00 |432 75|45. ....|
|000036a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003800| 2e 5c 22 20 24 48 65 61 | 64 65 72 3a 20 66 69 6c |.\" $Hea|der: fil|
|00003810| 65 73 63 61 6e 2e 38 2c | 76 20 31 2e 31 20 38 39 |escan.8,|v 1.1 89|
|00003820| 2f 30 39 2f 31 33 20 31 | 35 3a 34 38 3a 33 34 20 |/09/13 1|5:48:34 |
|00003830| 6d 6a 72 20 45 78 70 20 | 24 0a 2e 54 48 20 46 49 |mjr Exp |$..TH FI|
|00003840| 4c 45 53 43 41 4e 20 31 | 20 22 31 33 20 53 65 70 |LESCAN 1| "13 Sep|
|00003850| 74 65 6d 62 65 72 20 31 | 39 38 39 22 0a 2e 53 48 |tember 1|989"..SH|
|00003860| 20 4e 41 4d 45 0a 66 69 | 6c 65 73 63 61 6e 20 5c | NAME.fi|lescan \|
|00003870| 2d 20 70 72 69 6d 69 74 | 69 76 65 20 74 72 6f 6a |- primit|ive troj|
|00003880| 61 6e 20 68 6f 72 73 65 | 20 64 65 74 65 63 74 6f |an horse| detecto|
|00003890| 72 2f 70 65 72 6d 69 73 | 73 69 6f 6e 73 20 63 68 |r/permis|sions ch|
|000038a0| 65 63 6b 65 72 0a 2e 53 | 48 20 53 59 4e 4f 50 53 |ecker..S|H SYNOPS|
|000038b0| 49 53 0a 2e 42 20 66 69 | 6c 65 73 63 61 6e 0a 2e |IS..B fi|lescan..|
|000038c0| 52 42 20 22 20 5c 2d 64 | 20 64 61 74 61 62 61 73 |RB " \-d| databas|
|000038d0| 65 20 22 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 61 20 |e "..RB |[ " \-a |
|000038e0| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 43 20 |" ]..RB |[ " \-C |
|000038f0| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 63 20 |" ]..RB |[ " \-c |
|00003900| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 73 20 |" ]..RB |[ " \-s |
|00003910| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 75 20 |" ]..RB |[ " \-u |
|00003920| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 77 20 |" ]..RB |[ " \-w |
|00003930| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 69 20 |" ]..RB |[ " \-i |
|00003940| 69 6e 70 75 74 22 20 5d | 0a 2e 52 42 20 5b 20 22 |input" ]|..RB [ "|
|00003950| 20 5c 2d 6f 20 6f 75 74 | 70 75 74 22 20 5d 0a 2e | \-o out|put" ]..|
|00003960| 53 48 20 44 45 53 43 52 | 49 50 54 49 4f 4e 0a 2e |SH DESCR|IPTION..|
|00003970| 4c 50 0a 2e 42 20 66 69 | 6c 65 73 63 61 6e 0a 72 |LP..B fi|lescan.r|
|00003980| 65 61 64 73 20 61 20 6c | 69 73 74 20 6f 66 20 66 |eads a l|ist of f|
|00003990| 69 6c 65 20 6e 61 6d 65 | 73 20 66 72 6f 6d 20 69 |ile name|s from i|
|000039a0| 74 73 20 73 74 61 6e 64 | 61 72 64 20 69 6e 70 75 |ts stand|ard inpu|
|000039b0| 74 20 6f 72 20 66 69 6c | 65 2c 20 61 6e 64 20 63 |t or fil|e, and c|
|000039c0| 68 65 63 6b 73 0a 74 68 | 65 20 6c 69 73 74 20 66 |hecks.th|e list f|
|000039d0| 6f 72 20 70 65 72 6d 69 | 73 73 69 6f 6e 73 20 63 |or permi|ssions c|
|000039e0| 68 61 6e 67 65 73 2c 20 | 6d 6f 64 69 66 69 63 61 |hanges, |modifica|
|000039f0| 74 69 6f 6e 2c 20 63 68 | 61 6e 67 65 20 6f 66 20 |tion, ch|ange of |
|00003a00| 73 69 7a 65 2c 20 65 74 | 63 2e 20 0a 54 68 65 20 |size, et|c. .The |
|00003a10| 69 6e 74 65 6e 74 20 69 | 73 20 74 6f 20 6d 61 6b |intent i|s to mak|
|00003a20| 65 20 69 74 20 5c 66 49 | 73 6f 6d 65 77 68 61 74 |e it \fI|somewhat|
|00003a30| 5c 66 52 20 68 61 72 64 | 65 72 20 74 6f 20 69 6e |\fR hard|er to in|
|00003a40| 73 65 72 74 20 61 20 74 | 72 6f 6a 61 6e 20 68 6f |sert a t|rojan ho|
|00003a50| 72 73 65 20 69 6e 74 6f | 0a 61 20 73 79 73 74 65 |rse into|.a syste|
|00003a60| 6d 2e 20 49 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 61 |m. Infor|mation a|
|00003a70| 62 6f 75 74 20 74 68 65 | 20 66 69 6c 65 73 20 69 |bout the| files i|
|00003a80| 73 20 73 74 6f 72 65 64 | 20 69 6e 20 61 0a 2e 42 |s stored| in a..B|
|00003a90| 20 64 62 6d 28 33 29 0a | 68 61 73 68 20 74 61 62 | dbm(3).|hash tab|
|00003aa0| 6c 65 2c 20 66 6f 72 20 | 71 75 69 63 6b 20 6c 6f |le, for |quick lo|
|00003ab0| 6f 6b 75 70 2e 20 57 61 | 72 6e 69 6e 67 73 20 61 |okup. Wa|rnings a|
|00003ac0| 62 6f 75 74 20 69 6e 74 | 65 72 65 73 74 69 6e 67 |bout int|eresting|
|00003ad0| 20 66 69 6e 64 69 6e 67 | 73 20 63 61 6e 0a 62 65 | finding|s can.be|
|00003ae0| 20 65 69 74 68 65 72 20 | 61 70 70 65 6e 64 65 64 | either |appended|
|00003af0| 20 74 6f 20 61 20 6c 6f | 67 20 66 69 6c 65 2c 20 | to a lo|g file, |
|00003b00| 6d 61 69 6c 65 64 20 74 | 6f 20 73 79 73 74 65 6d |mailed t|o system|
|00003b10| 73 20 61 64 6d 69 6e 69 | 73 74 72 61 74 6f 72 73 |s admini|strators|
|00003b20| 2c 20 61 6e 64 0a 73 6f | 20 6f 6e 2e 0a 2e 4c 50 |, and.so| on...LP|
|00003b30| 0a 2e 42 20 66 69 6c 65 | 73 63 61 6e 0a 69 73 20 |..B file|scan.is |
|00003b40| 6e 6f 74 20 67 6f 69 6e | 67 20 74 6f 20 6d 61 6b |not goin|g to mak|
|00003b50| 65 20 69 74 20 69 6d 70 | 6f 73 73 69 62 6c 65 20 |e it imp|ossible |
|00003b60| 66 6f 72 20 73 6f 6d 65 | 6f 6e 65 20 74 6f 20 69 |for some|one to i|
|00003b70| 6e 73 65 72 74 20 61 20 | 74 72 6f 6a 61 6e 20 69 |nsert a |trojan i|
|00003b80| 6e 74 6f 0a 61 20 73 79 | 73 74 65 6d 2c 20 62 79 |nto.a sy|stem, by|
|00003b90| 20 61 6e 79 20 6d 65 61 | 6e 73 2e 20 52 75 6e 6e | any mea|ns. Runn|
|00003ba0| 69 6e 67 20 61 20 63 6f | 6d 70 6c 65 74 65 20 63 |ing a co|mplete c|
|00003bb0| 68 65 63 6b 73 75 6d 20 | 6f 6e 20 61 6c 6c 20 74 |hecksum |on all t|
|00003bc0| 68 65 20 66 69 6c 65 73 | 0a 69 6e 20 74 68 65 20 |he files|.in the |
|00003bd0| 64 61 74 61 62 61 73 65 | 20 63 61 6e 20 63 68 65 |database| can che|
|00003be0| 77 20 75 70 20 61 20 6c | 6f 74 20 6f 66 20 43 50 |w up a l|ot of CP|
|00003bf0| 55 20 74 69 6d 65 2c 20 | 79 65 74 20 72 65 73 6f |U time, |yet reso|
|00003c00| 72 74 69 6e 67 20 74 6f | 20 73 69 6d 70 6c 79 0a |rting to| simply.|
|00003c10| 63 68 65 63 6b 69 6e 67 | 20 66 69 6c 65 20 73 69 |checking| file si|
|00003c20| 7a 65 73 2c 20 70 65 72 | 6d 69 73 73 69 6f 6e 73 |zes, per|missions|
|00003c30| 20 61 6e 64 20 6d 6f 64 | 69 66 69 63 61 74 69 6f | and mod|ificatio|
|00003c40| 6e 20 74 69 6d 65 73 20 | 69 73 20 6e 6f 74 20 31 |n times |is not 1|
|00003c50| 30 30 25 0a 72 65 6c 69 | 61 62 6c 65 2c 20 65 69 |00%.reli|able, ei|
|00003c60| 74 68 65 72 2e 20 41 6e | 20 61 64 64 69 74 69 6f |ther. An| additio|
|00003c70| 6e 61 6c 20 77 65 61 6b | 6e 65 73 73 20 6f 66 20 |nal weak|ness of |
|00003c80| 73 75 63 68 20 61 20 73 | 79 73 74 65 6d 20 69 73 |such a s|ystem is|
|00003c90| 20 74 68 65 20 0a 64 61 | 74 61 62 61 73 65 20 69 | the .da|tabase i|
|00003ca0| 74 73 65 6c 66 2e 20 49 | 6e 20 74 68 69 73 20 69 |tself. I|n this i|
|00003cb0| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 2c 20 74 |mplement|ation, t|
|00003cc0| 68 65 72 65 20 69 73 20 | 6e 6f 20 70 72 6f 74 65 |here is |no prote|
|00003cd0| 63 74 69 6f 6e 20 66 6f | 72 0a 74 68 65 20 64 61 |ction fo|r.the da|
|00003ce0| 74 61 62 61 73 65 2c 20 | 74 68 6f 75 67 68 20 65 |tabase, |though e|
|00003cf0| 6e 63 72 79 70 74 69 6e | 67 20 74 68 65 20 68 61 |ncryptin|g the ha|
|00003d00| 73 68 20 74 61 62 6c 65 | 27 73 20 64 69 72 65 63 |sh table|'s direc|
|00003d10| 74 6f 72 79 20 77 6f 75 | 6c 64 0a 6d 61 6b 65 20 |tory wou|ld.make |
|00003d20| 69 74 20 68 61 72 64 20 | 74 6f 20 6d 6f 64 69 66 |it hard |to modif|
|00003d30| 79 2e 20 4f 62 76 69 6f | 75 73 6c 79 2c 20 61 20 |y. Obvio|usly, a |
|00003d40| 77 72 6f 6e 67 64 6f 65 | 72 20 63 6f 75 6c 64 20 |wrongdoe|r could |
|00003d50| 66 6c 61 74 2d 6f 75 74 | 20 72 65 6d 6f 76 65 0a |flat-out| remove.|
|00003d60| 74 68 65 20 64 61 74 61 | 62 61 73 65 20 2d 20 62 |the data|base - b|
|00003d70| 75 74 20 74 68 65 6e 20 | 74 68 65 79 20 63 6f 75 |ut then |they cou|
|00003d80| 6c 64 20 72 65 66 6f 72 | 6d 61 74 20 74 68 65 20 |ld refor|mat the |
|00003d90| 64 69 73 6b 73 2c 20 74 | 6f 6f 2e 0a 2e 42 20 66 |disks, t|oo...B f|
|00003da0| 69 6c 65 73 63 61 6e 0a | 73 68 6f 75 6c 64 20 62 |ilescan.|should b|
|00003db0| 65 20 73 6f 6d 65 77 68 | 61 74 20 65 66 66 65 63 |e somewh|at effec|
|00003dc0| 74 69 76 65 20 61 67 61 | 69 6e 73 74 20 62 61 73 |tive aga|inst bas|
|00003dd0| 69 63 20 6d 69 73 63 68 | 65 66 2e 0a 2e 53 48 20 |ic misch|ef...SH |
|00003de0| 4f 50 54 49 4f 4e 53 0a | 2e 54 50 0a 2e 42 20 5c |OPTIONS.|.TP..B \|
|00003df0| 2d 43 0a 49 66 20 74 68 | 65 20 64 61 74 61 62 61 |-C.If th|e databa|
|00003e00| 73 65 20 73 79 73 74 65 | 6d 20 69 73 20 62 61 73 |se syste|m is bas|
|00003e10| 65 64 20 6f 6e 0a 2e 42 | 20 64 62 6d 28 33 29 0a |ed on..B| dbm(3).|
|00003e20| 72 61 74 68 65 72 20 74 | 68 61 6e 0a 2e 42 20 6e |rather t|han..B n|
|00003e30| 64 62 6d 28 33 29 0a 74 | 68 69 73 20 6f 70 74 69 |dbm(3).t|his opti|
|00003e40| 6f 6e 20 77 69 6c 6c 20 | 63 72 65 61 74 65 20 74 |on will |create t|
|00003e50| 68 65 20 64 61 74 61 62 | 61 73 65 20 66 69 6c 65 |he datab|ase file|
|00003e60| 73 2c 20 6f 72 20 77 69 | 6c 6c 20 74 72 75 6e 63 |s, or wi|ll trunc|
|00003e70| 61 74 65 20 65 78 69 73 | 74 69 6e 67 0a 6f 6e 65 |ate exis|ting.one|
|00003e80| 73 2e 0a 2e 54 50 0a 2e | 42 20 5c 2d 63 0a 49 6e |s...TP..|B \-c.In|
|00003e90| 64 69 63 61 74 65 73 20 | 74 68 61 74 20 74 68 65 |dicates |that the|
|00003ea0| 20 6c 69 73 74 20 62 65 | 69 6e 67 20 72 65 61 64 | list be|ing read|
|00003eb0| 20 73 68 6f 75 6c 64 20 | 62 65 20 0a 65 6e 74 65 | should |be .ente|
|00003ec0| 72 65 64 20 69 6e 74 6f | 20 74 68 65 20 64 61 74 |red into| the dat|
|00003ed0| 61 62 61 73 65 2e 20 50 | 72 65 73 75 6d 61 62 6c |abase. P|resumabl|
|00003ee0| 79 2c 20 74 68 69 73 20 | 6f 70 74 69 6f 6e 20 77 |y, this |option w|
|00003ef0| 69 6c 6c 20 62 65 20 72 | 75 6e 20 6f 6e 63 65 2c |ill be r|un once,|
|00003f00| 0a 77 68 65 6e 20 74 68 | 65 20 64 61 74 61 62 61 |.when th|e databa|
|00003f10| 73 65 20 69 73 20 69 6e | 69 74 69 61 6c 69 7a 65 |se is in|itialize|
|00003f20| 64 2e 0a 2e 54 50 0a 2e | 42 20 5c 2d 73 0a 49 6e |d...TP..|B \-s.In|
|00003f30| 64 69 63 61 74 65 73 20 | 74 68 61 74 20 61 20 63 |dicates |that a c|
|00003f40| 68 65 63 6b 73 75 6d 20 | 73 68 6f 75 6c 64 20 62 |hecksum |should b|
|00003f50| 65 20 70 65 72 66 6f 72 | 6d 65 64 20 6f 6e 20 61 |e perfor|med on a|
|00003f60| 6c 6c 20 66 69 6c 65 73 | 20 74 68 61 74 20 61 72 |ll files| that ar|
|00003f70| 65 0a 62 65 69 6e 67 20 | 73 74 6f 72 65 64 20 6f |e.being |stored o|
|00003f80| 72 20 75 70 64 61 74 65 | 64 20 69 6e 20 74 68 65 |r update|d in the|
|00003f90| 20 64 61 74 61 62 61 73 | 65 2e 20 57 68 65 6e 20 | databas|e. When |
|00003fa0| 61 20 66 69 6c 65 20 69 | 73 20 73 74 6f 72 65 64 |a file i|s stored|
|00003fb0| 2c 20 61 0a 66 6c 61 67 | 20 69 73 20 73 74 6f 72 |, a.flag| is stor|
|00003fc0| 65 64 20 77 69 74 68 20 | 69 74 2c 20 69 6e 64 69 |ed with |it, indi|
|00003fd0| 63 61 74 69 6e 67 20 74 | 68 61 74 20 74 68 65 20 |cating t|hat the |
|00003fe0| 66 69 6c 65 20 69 73 20 | 74 6f 20 62 65 20 73 75 |file is |to be su|
|00003ff0| 6d 6d 65 64 2c 0a 61 6e | 64 20 69 74 20 69 73 20 |mmed,.an|d it is |
|00004000| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 20 63 68 |automati|cally ch|
|00004010| 65 63 6b 65 64 20 77 68 | 65 6e 20 74 68 65 20 64 |ecked wh|en the d|
|00004020| 61 74 61 62 61 73 65 20 | 69 73 20 73 63 61 6e 6e |atabase |is scann|
|00004030| 65 64 2e 0a 2e 54 50 0a | 2e 42 20 5c 2d 75 0a 49 |ed...TP.|.B \-u.I|
|00004040| 6e 64 69 63 61 74 65 73 | 20 74 68 61 74 20 74 68 |ndicates| that th|
|00004050| 65 20 6c 69 73 74 20 62 | 65 69 6e 67 20 72 65 61 |e list b|eing rea|
|00004060| 64 20 73 68 6f 75 6c 64 | 20 62 65 20 63 68 65 63 |d should| be chec|
|00004070| 6b 65 64 20 66 6f 72 20 | 75 70 64 61 74 65 20 61 |ked for |update a|
|00004080| 67 61 69 6e 73 74 20 74 | 68 65 0a 63 6f 6e 74 65 |gainst t|he.conte|
|00004090| 6e 74 73 20 6f 66 20 74 | 68 65 20 64 61 74 61 62 |nts of t|he datab|
|000040a0| 61 73 65 2e 20 49 66 20 | 61 6e 79 20 63 68 61 6e |ase. If |any chan|
|000040b0| 67 65 73 20 61 72 65 20 | 64 65 74 65 63 74 65 64 |ges are |detected|
|000040c0| 2c 20 77 61 72 6e 69 6e | 67 73 20 61 72 65 0a 69 |, warnin|gs are.i|
|000040d0| 73 73 75 65 64 2c 20 61 | 6e 64 20 74 68 65 20 63 |ssued, a|nd the c|
|000040e0| 68 61 6e 67 65 73 20 61 | 72 65 20 75 70 64 61 74 |hanges a|re updat|
|000040f0| 65 64 20 69 6e 20 74 68 | 65 20 64 61 74 61 62 61 |ed in th|e databa|
|00004100| 73 65 2e 20 49 66 20 74 | 68 69 73 20 6f 70 74 69 |se. If t|his opti|
|00004110| 6f 6e 20 69 73 0a 6e 6f | 74 20 73 65 6c 65 63 74 |on is.no|t select|
|00004120| 65 64 20 28 74 68 65 20 | 64 65 66 61 75 6c 74 20 |ed (the |default |
|00004130| 69 73 20 6e 6f 20 75 70 | 64 61 74 65 29 2c 20 74 |is no up|date), t|
|00004140| 68 65 20 77 61 72 6e 69 | 6e 67 20 77 69 6c 6c 20 |he warni|ng will |
|00004150| 62 65 20 72 65 70 65 61 | 74 65 64 0a 65 76 65 72 |be repea|ted.ever|
|00004160| 79 20 74 69 6d 65 20 74 | 68 65 20 66 69 6c 65 20 |y time t|he file |
|00004170| 69 73 20 63 68 65 63 6b | 65 64 2e 0a 2e 54 50 0a |is check|ed...TP.|
|00004180| 2e 42 20 5c 2d 77 0a 49 | 6e 64 69 63 61 74 65 73 |.B \-w.I|ndicates|
|00004190| 20 74 68 61 74 20 74 68 | 65 20 65 78 69 74 20 73 | that th|e exit s|
|000041a0| 74 61 74 75 73 20 6f 66 | 20 74 68 65 20 70 72 6f |tatus of| the pro|
|000041b0| 67 72 61 6d 20 73 68 6f | 75 6c 64 20 62 65 20 74 |gram sho|uld be t|
|000041c0| 68 65 20 74 6f 74 61 6c | 20 0a 6e 75 6d 62 65 72 |he total| .number|
|000041d0| 20 6f 66 20 77 61 72 6e | 69 6e 67 73 20 61 6e 64 | of warn|ings and|
|000041e0| 20 65 72 72 6f 72 73 2e | 20 54 68 65 20 64 65 66 | errors.| The def|
|000041f0| 61 75 6c 74 20 69 73 20 | 74 68 65 20 6e 75 6d 62 |ault is |the numb|
|00004200| 65 72 20 6f 66 20 65 72 | 72 6f 72 73 0a 28 61 20 |er of er|rors.(a |
|00004210| 66 69 6c 65 20 6e 6f 74 | 20 65 78 69 73 74 69 6e |file not| existin|
|00004220| 67 20 61 74 20 61 6c 6c | 20 77 68 65 6e 20 69 74 |g at all| when it|
|00004230| 20 73 68 6f 75 6c 64 20 | 69 73 20 61 6e 20 65 72 | should |is an er|
|00004240| 72 6f 72 2c 20 72 61 74 | 68 65 72 20 74 68 61 6e |ror, rat|her than|
|00004250| 0a 6a 75 73 74 20 61 20 | 77 61 72 6e 69 6e 67 29 |.just a |warning)|
|00004260| 2e 0a 2e 54 50 0a 2e 42 | 20 22 5c 2d 69 20 66 69 |...TP..B| "\-i fi|
|00004270| 6c 65 6e 61 6d 65 22 0a | 49 6e 64 69 63 61 74 65 |lename".|Indicate|
|00004280| 73 20 74 68 61 74 20 0a | 2e 42 20 66 69 6c 65 73 |s that .|.B files|
|00004290| 63 61 6e 0a 73 68 6f 75 | 6c 64 20 72 65 61 64 20 |can.shou|ld read |
|000042a0| 69 74 73 20 66 69 6c 65 | 20 6c 69 73 74 20 66 72 |its file| list fr|
|000042b0| 6f 6d 20 74 68 65 20 6e | 61 6d 65 64 20 66 69 6c |om the n|amed fil|
|000042c0| 65 2e 20 4f 6e 6c 79 20 | 6f 6e 65 20 66 69 6c 65 |e. Only |one file|
|000042d0| 20 63 61 6e 20 62 65 0a | 6e 61 6d 65 64 20 69 6e | can be.|named in|
|000042e0| 20 74 68 69 73 20 6d 61 | 6e 6e 65 72 2e 0a 2e 54 | this ma|nner...T|
|000042f0| 50 0a 2e 42 20 22 5c 2d | 6f 20 66 69 6c 65 6e 61 |P..B "\-|o filena|
|00004300| 6d 65 22 0a 49 6e 64 69 | 63 61 74 65 73 20 74 68 |me".Indi|cates th|
|00004310| 61 74 20 0a 2e 42 20 66 | 69 6c 65 73 63 61 6e 0a |at ..B f|ilescan.|
|00004320| 73 68 6f 75 6c 64 20 73 | 65 6e 64 20 69 74 73 20 |should s|end its |
|00004330| 77 61 72 6e 69 6e 67 20 | 6d 65 73 73 61 67 65 73 |warning |messages|
|00004340| 20 74 6f 20 74 68 65 20 | 6e 61 6d 65 64 20 6c 6f | to the |named lo|
|00004350| 67 66 69 6c 65 2e 20 4f | 6e 6c 79 20 6f 6e 65 20 |gfile. O|nly one |
|00004360| 66 69 6c 65 20 63 61 6e | 20 62 65 0a 6e 61 6d 65 |file can| be.name|
|00004370| 64 20 69 6e 20 74 68 69 | 73 20 6d 61 6e 6e 65 72 |d in thi|s manner|
|00004380| 2e 0a 2e 54 50 0a 2e 42 | 20 5c 2d 61 0a 49 6e 64 |...TP..B| \-a.Ind|
|00004390| 69 63 61 74 65 73 20 74 | 68 61 74 20 74 68 65 20 |icates t|hat the |
|000043a0| 6c 6f 67 66 69 6c 65 20 | 73 68 6f 75 6c 64 20 62 |logfile |should b|
|000043b0| 65 20 6f 70 65 6e 65 64 | 20 66 6f 72 20 61 70 70 |e opened| for app|
|000043c0| 65 6e 64 20 6d 6f 64 65 | 2c 20 72 61 74 68 65 72 |end mode|, rather|
|000043d0| 20 74 68 61 6e 0a 74 72 | 75 6e 63 61 74 65 64 2e | than.tr|uncated.|
|000043e0| 0a 2e 53 48 20 45 58 41 | 4d 50 4c 45 0a 2e 4c 50 |..SH EXA|MPLE..LP|
|000043f0| 0a 49 6e 69 74 69 61 6c | 69 7a 69 6e 67 20 61 20 |.Initial|izing a |
|00004400| 73 61 6d 70 6c 65 20 64 | 61 74 61 62 61 73 65 3a |sample d|atabase:|
|00004410| 0a 2e 62 72 0a 66 69 6e | 64 20 2f 75 73 72 2f 6c |..br.fin|d /usr/l|
|00004420| 6f 63 61 6c 2f 62 69 6e | 20 2d 74 79 70 65 20 66 |ocal/bin| -type f|
|00004430| 20 2d 70 72 69 6e 74 20 | 7c 20 66 69 6c 65 73 63 | -print || filesc|
|00004440| 61 6e 20 2d 64 20 73 61 | 6d 70 6c 65 20 2d 63 20 |an -d sa|mple -c |
|00004450| 2d 73 0a 2e 4c 50 0a 53 | 63 61 6e 6e 69 6e 67 20 |-s..LP.S|canning |
|00004460| 61 6e 64 20 75 70 64 61 | 74 69 6e 67 20 74 68 65 |and upda|ting the|
|00004470| 20 64 61 74 61 62 61 73 | 65 3a 0a 2e 62 72 0a 66 | databas|e:..br.f|
|00004480| 69 6e 64 20 2f 75 73 72 | 2f 6c 6f 63 61 6c 2f 62 |ind /usr|/local/b|
|00004490| 69 6e 20 2d 74 79 70 65 | 20 66 20 2d 70 72 69 6e |in -type| f -prin|
|000044a0| 74 20 7c 20 66 69 6c 65 | 73 63 61 6e 20 2d 64 20 |t | file|scan -d |
|000044b0| 73 61 6d 70 6c 65 0a 2e | 66 69 0a 2e 61 64 0a 2e |sample..|fi..ad..|
|000044c0| 53 48 20 22 53 45 45 20 | 41 4c 53 4f 22 0a 2e 42 |SH "SEE |ALSO"..B|
|000044d0| 52 20 73 75 6d 20 28 31 | 29 0a 2e 42 52 20 66 69 |R sum (1|)..BR fi|
|000044e0| 6e 64 20 28 31 29 0a 2e | 53 48 20 42 55 47 53 0a |nd (1)..|SH BUGS.|
|000044f0| 2e 4c 50 0a 54 68 65 20 | 6c 69 6d 69 74 65 64 20 |.LP.The |limited |
|00004500| 6f 70 74 69 6f 6e 73 20 | 61 6e 64 20 66 61 69 6c |options |and fail|
|00004510| 75 72 65 20 74 6f 20 65 | 6e 73 75 72 65 20 73 65 |ure to e|nsure se|
|00004520| 63 75 72 69 74 79 20 6f | 66 20 74 68 65 20 64 61 |curity o|f the da|
|00004530| 74 61 20 62 61 73 65 0a | 63 6f 75 6c 64 20 62 65 |ta base.|could be|
|00004540| 20 63 6f 6e 73 69 64 65 | 72 65 64 20 61 20 62 75 | conside|red a bu|
|00004550| 67 2e 20 49 64 65 61 6c | 6c 79 2c 20 74 68 65 72 |g. Ideal|ly, ther|
|00004560| 65 20 73 68 6f 75 6c 64 | 20 62 65 20 61 6e 20 6f |e should| be an o|
|00004570| 70 74 69 6f 6e 20 77 68 | 65 72 65 62 79 0a 61 20 |ption wh|ereby.a |
|00004580| 64 69 66 66 65 72 65 6e | 74 20 63 68 65 63 6b 73 |differen|t checks|
|00004590| 75 6d 20 63 6f 75 6c 64 | 20 62 65 20 75 73 65 64 |um could| be used|
|000045a0| 2c 20 6f 72 20 73 6f 6d | 65 20 6b 69 6e 64 20 6f |, or som|e kind o|
|000045b0| 66 20 6b 65 79 69 6e 67 | 20 73 63 68 65 6d 65 0a |f keying| scheme.|
|000045c0| 73 68 6f 75 6c 64 20 62 | 65 20 62 75 69 6c 74 20 |should b|e built |
|000045d0| 69 6e 74 6f 20 74 68 65 | 20 63 68 65 63 6b 73 75 |into the| checksu|
|000045e0| 6d 2e 20 28 70 6f 73 73 | 69 62 6c 79 2c 20 74 68 |m. (poss|ibly, th|
|000045f0| 65 20 70 72 6f 67 72 61 | 6d 20 73 68 6f 75 6c 64 |e progra|m should|
|00004600| 0a 72 65 61 64 20 61 6e | 20 6f 70 74 69 6f 6e 61 |.read an| optiona|
|00004610| 6c 20 63 68 65 63 6b 73 | 75 6d 20 61 6c 6f 6e 67 |l checks|um along|
|00004620| 20 77 69 74 68 20 74 68 | 65 20 66 69 6c 65 20 6e | with th|e file n|
|00004630| 61 6d 65 3f 29 0a 2e 4c | 50 0a 54 68 69 73 20 70 |ame?)..L|P.This p|
|00004640| 72 6f 67 72 61 6d 20 73 | 68 6f 75 6c 64 20 6e 6f |rogram s|hould no|
|00004650| 74 20 67 69 76 65 20 61 | 20 66 61 6c 73 65 20 73 |t give a| false s|
|00004660| 65 6e 73 65 20 6f 66 20 | 73 65 63 75 72 69 74 79 |ense of |security|
|00004670| 2e 0a 2e 53 48 20 57 41 | 52 4e 49 4e 47 0a 41 76 |...SH WA|RNING.Av|
|00004680| 6f 69 64 20 68 61 76 69 | 6e 67 20 2f 64 65 76 20 |oid havi|ng /dev |
|00004690| 69 6e 20 74 68 65 20 6c | 69 73 74 20 6f 66 20 66 |in the l|ist of f|
|000046a0| 69 6c 65 73 2c 20 73 69 | 6e 63 65 20 74 68 65 20 |iles, si|nce the |
|000046b0| 74 74 79 73 20 63 68 61 | 6e 67 65 20 70 65 72 6d |ttys cha|nge perm|
|000046c0| 69 73 73 69 6f 6e 0a 61 | 6e 64 20 6f 77 6e 65 72 |ission.a|nd owner|
|000046d0| 73 68 69 70 20 61 20 6c | 6f 74 2e 20 41 6c 73 6f |ship a l|ot. Also|
|000046e0| 20 61 76 6f 69 64 20 68 | 61 76 69 6e 67 20 79 6f | avoid h|aving yo|
|000046f0| 75 72 20 64 61 74 61 62 | 61 73 65 20 63 68 65 63 |ur datab|ase chec|
|00004700| 6b 20 6f 6e 20 69 74 73 | 65 6c 66 20 0a 69 6e 20 |k on its|elf .in |
|00004710| 75 70 64 61 74 65 20 6d | 6f 64 65 2c 20 6f 72 20 |update m|ode, or |
|00004720| 79 6f 75 20 77 69 6c 6c | 20 61 6c 77 61 79 73 20 |you will| always |
|00004730| 67 65 74 20 77 61 72 6e | 69 6e 67 73 2e 0a 2e 53 |get warn|ings...S|
|00004740| 48 20 41 55 54 48 4f 52 | 0a 4d 61 72 63 75 73 20 |H AUTHOR|.Marcus |
|00004750| 4a 2e 20 52 61 6e 75 6d | 20 2d 20 6d 6a 72 40 77 |J. Ranum| - mjr@w|
|00004760| 65 6c 63 68 2e 6a 68 75 | 2e 65 64 75 0a 20 61 72 |elch.jhu|.edu. ar|
|00004770| 65 0a 62 65 69 6e 67 20 | 73 74 6f 72 65 64 20 6f |e.being |stored o|
|00004780| 72 20 75 70 64 61 74 65 | 64 20 69 6e 20 74 68 65 |r update|d in the|
|00004790| 20 64 61 74 61 62 61 73 | 65 2e 20 57 68 65 6e 20 | databas|e. When |
|000047a0| 61 20 66 69 6c 65 20 69 | 73 20 73 74 6f 72 65 64 |a file i|s stored|
|000047b0| 2c 20 61 0a 66 6c 61 67 | 20 69 73 20 73 74 6f 72 |, a.flag| is stor|
|000047c0| 65 64 20 77 69 74 68 20 | 69 74 2c 20 69 6e 64 69 |ed with |it, indi|
|000047d0| 63 61 74 69 6e 67 20 74 | 68 61 74 20 74 68 65 20 |cating t|hat the |
|000047e0| 66 69 6c 65 20 69 73 20 | 74 6f 20 62 65 20 73 75 |file is |to be su|
|000047f0| 6d 6d 65 64 2c 0a 61 6e | 64 20 69 74 20 69 73 20 |mmed,.an|d it is |
|00004800| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004810| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004880| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004890| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c00| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 22 5c |printf(s|tderr,"\|
|00004c10| 74 5b 2d 69 20 66 69 6c | 65 6e 61 6d 65 20 28 72 |t[-i fil|ename (r|
|00004c20| 65 61 64 20 6c 69 73 74 | 20 66 72 6f 6d 20 66 69 |ead list| from fi|
|00004c30| 6c 65 29 5d 20 5b 2d 6f | 20 66 69 6c 65 6e 61 6d |le)] [-o| filenam|
|00004c40| 65 20 28 6c 6f 67 20 66 | 69 6c 65 29 5d 5c 6e 22 |e (log f|ile)]\n"|
|00004c50| 29 3b 0a 09 28 76 6f 69 | 64 29 66 70 72 69 6e 74 |);..(voi|d)fprint|
|00004c60| 66 28 73 74 64 65 72 72 | 2c 22 5c 74 5b 2d 75 20 |f(stderr|,"\t[-u |
|00004c70| 28 75 70 64 61 74 65 20 | 61 6e 79 20 63 68 61 6e |(update |any chan|
|00004c80| 67 65 73 20 66 6f 75 6e | 64 29 5d 5c 6e 22 29 3b |ges foun|d)]\n");|
|00004c90| 0a 09 72 65 74 75 72 6e | 28 31 29 3b 0a 7d 0a 0a |..return|(1);.}..|
|00004ca0| 73 74 61 74 69 63 09 76 | 6f 69 64 0a 77 61 72 6e |static.v|oid.warn|
|00004cb0| 28 73 31 2c 73 32 29 0a | 63 68 61 72 09 2a 73 31 |(s1,s2).|char.*s1|
|00004cc0| 3b 0a 63 68 61 72 09 2a | 73 32 3b 0a 7b 0a 09 65 |;.char.*|s2;.{..e|
|00004cd0| 78 74 65 72 6e 09 69 6e | 74 09 65 72 72 6e 6f 3b |xtern.in|t.errno;|
|00004ce0| 0a 09 65 78 74 65 72 6e | 09 63 68 61 72 09 2a 73 |..extern|.char.*s|
|00004cf0| 79 73 5f 65 72 72 6c 69 | 73 74 5b 5d 3b 0a 0a 09 |ys_errli|st[];...|
|00004d00| 69 66 28 65 72 72 6e 6f | 29 20 0a 09 09 28 76 6f |if(errno|) ...(vo|
|00004d10| 69 64 29 66 70 72 69 6e | 74 66 28 6f 75 74 66 2c |id)fprin|tf(outf,|
|00004d20| 22 25 73 3a 25 73 28 25 | 73 29 5c 6e 22 2c 73 32 |"%s:%s(%|s)\n",s2|
|00004d30| 2c 73 31 2c 73 79 73 5f | 65 72 72 6c 69 73 74 5b |,s1,sys_|errlist[|
|00004d40| 65 72 72 6e 6f 5d 29 3b | 0a 09 65 6c 73 65 0a 09 |errno]);|..else..|
|00004d50| 09 28 76 6f 69 64 29 66 | 70 72 69 6e 74 66 28 6f |.(void)f|printf(o|
|00004d60| 75 74 66 2c 22 25 73 3a | 25 73 5c 6e 22 2c 73 32 |utf,"%s:|%s\n",s2|
|00004d70| 2c 73 31 29 3b 0a 7d 0a | 0a 0a 73 75 6d 69 74 28 |,s1);.}.|..sumit(|
|00004d80| 66 69 6c 29 0a 63 68 61 | 72 09 2a 66 69 6c 3b 0a |fil).cha|r.*fil;.|
|00004d90| 7b 0a 09 69 6e 74 09 73 | 75 6d 20 3d 20 30 3b 0a |{..int.s|um = 0;.|
|00004da0| 09 69 6e 74 09 66 64 3b | 0a 09 69 6e 74 09 63 6e |.int.fd;|..int.cn|
|00004db0| 74 3b 0a 09 63 68 61 72 | 09 62 75 66 5b 42 55 46 |t;..char|.buf[BUF|
|00004dc0| 53 49 5a 5d 3b 0a 0a 09 | 69 66 28 28 66 64 20 3d |SIZ];...|if((fd =|
|00004dd0| 20 6f 70 65 6e 28 66 69 | 6c 2c 4f 5f 52 44 4f 4e | open(fi|l,O_RDON|
|00004de0| 4c 59 29 29 20 3c 20 30 | 29 20 7b 0a 09 09 77 61 |LY)) < 0|) {...wa|
|00004df0| 72 6e 28 22 63 61 6e 6e | 6f 74 20 72 65 61 64 20 |rn("cann|ot read |
|00004e00| 66 6f 72 20 73 75 6d 22 | 2c 66 69 6c 29 3b 0a 09 |for sum"|,fil);..|
|00004e10| 7d 20 65 6c 73 65 20 7b | 0a 09 09 77 68 69 6c 65 |} else {|...while|
|00004e20| 28 28 63 6e 74 20 3d 20 | 72 65 61 64 28 66 64 2c |((cnt = |read(fd,|
|00004e30| 62 75 66 2c 42 55 46 53 | 49 5a 29 29 20 3e 20 30 |buf,BUFS|IZ)) > 0|
|00004e40| 29 0a 09 09 09 73 75 6d | 20 2b 3d 20 69 6e 5f 63 |)....sum| += in_c|
|00004e50| 6b 73 75 6d 28 28 75 5f | 73 68 6f 72 74 20 2a 29 |ksum((u_|short *)|
|00004e60| 62 75 66 2c 63 6e 74 29 | 3b 0a 09 09 28 76 6f 69 |buf,cnt)|;...(voi|
|00004e70| 64 29 63 6c 6f 73 65 28 | 66 64 29 3b 0a 09 7d 0a |d)close(|fd);..}.|
|00004e80| 09 72 65 74 75 72 6e 28 | 73 75 6d 29 3b 0a 7d 0a |.return(|sum);.}.|
|00004e90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005000| 66 69 6c 65 73 63 61 6e | 2f 69 6e 5f 63 6b 73 75 |filescan|/in_cksu|
|00005010| 6d 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |m.c.....|........|
|00005020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005060| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00005070| 34 33 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |43 . | 0 . |
|00005080| 20 20 20 31 34 37 36 20 | 20 34 35 30 36 34 36 37 | 1476 | 4506467|
|00005090| 34 33 31 20 20 20 37 36 | 33 37 00 20 00 00 00 00 |431 76|37. ....|
|000050a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005200| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 74 79 |#include| <sys/ty|
|00005210| 70 65 73 2e 68 3e 0a 0a | 2f 2a 0a 20 2a 20 49 6e |pes.h>..|/*. * In|
|00005220| 74 65 72 6e 65 74 20 50 | 72 6f 74 6f 63 6f 6c 20 |ternet P|rotocol |
|00005230| 63 68 65 63 6b 73 75 6d | 20 72 6f 75 74 69 6e 65 |checksum| routine|
|00005240| 2c 20 73 74 6f 6c 65 6e | 20 66 72 6f 6d 20 70 69 |, stolen| from pi|
|00005250| 6e 67 2e 63 0a 20 2a 2f | 0a 0a 69 6e 5f 63 6b 73 |ng.c. */|..in_cks|
|00005260| 75 6d 28 61 64 64 72 2c | 20 6c 65 6e 29 0a 09 75 |um(addr,| len)..u|
|00005270| 5f 73 68 6f 72 74 09 2a | 61 64 64 72 3b 0a 09 69 |_short.*|addr;..i|
|00005280| 6e 74 09 6c 65 6e 3b 0a | 7b 0a 09 72 65 67 69 73 |nt.len;.|{..regis|
|00005290| 74 65 72 20 69 6e 74 20 | 6e 6c 65 66 74 20 3d 20 |ter int |nleft = |
|000052a0| 6c 65 6e 3b 0a 09 72 65 | 67 69 73 74 65 72 20 75 |len;..re|gister u|
|000052b0| 5f 73 68 6f 72 74 20 2a | 77 20 3d 20 61 64 64 72 |_short *|w = addr|
|000052c0| 3b 0a 09 72 65 67 69 73 | 74 65 72 20 75 5f 73 68 |;..regis|ter u_sh|
|000052d0| 6f 72 74 20 61 6e 73 77 | 65 72 3b 0a 09 72 65 67 |ort answ|er;..reg|
|000052e0| 69 73 74 65 72 20 69 6e | 74 20 73 75 6d 20 3d 20 |ister in|t sum = |
|000052f0| 30 3b 0a 0a 09 2f 2a 0a | 09 20 2a 20 20 4f 75 72 |0;.../*.|. * Our|
|00005300| 20 61 6c 67 6f 72 69 74 | 68 6d 20 69 73 20 73 69 | algorit|hm is si|
|00005310| 6d 70 6c 65 2c 20 75 73 | 69 6e 67 20 61 20 33 32 |mple, us|ing a 32|
|00005320| 20 62 69 74 20 61 63 63 | 75 6d 75 6c 61 74 6f 72 | bit acc|umulator|
|00005330| 20 28 73 75 6d 29 2c 0a | 09 20 2a 20 20 77 65 20 | (sum),.|. * we |
|00005340| 61 64 64 20 73 65 71 75 | 65 6e 74 69 61 6c 20 31 |add sequ|ential 1|
|00005350| 36 20 62 69 74 20 77 6f | 72 64 73 20 74 6f 20 69 |6 bit wo|rds to i|
|00005360| 74 2c 20 61 6e 64 20 61 | 74 20 74 68 65 20 65 6e |t, and a|t the en|
|00005370| 64 2c 20 66 6f 6c 64 0a | 09 20 2a 20 20 62 61 63 |d, fold.|. * bac|
|00005380| 6b 20 61 6c 6c 20 74 68 | 65 20 63 61 72 72 79 20 |k all th|e carry |
|00005390| 62 69 74 73 20 66 72 6f | 6d 20 74 68 65 20 74 6f |bits fro|m the to|
|000053a0| 70 20 31 36 20 62 69 74 | 73 20 69 6e 74 6f 20 74 |p 16 bit|s into t|
|000053b0| 68 65 20 6c 6f 77 65 72 | 0a 09 20 2a 20 20 31 36 |he lower|.. * 16|
|000053c0| 20 62 69 74 73 2e 0a 09 | 20 2a 2f 0a 09 77 68 69 | bits...| */..whi|
|000053d0| 6c 65 28 20 6e 6c 65 66 | 74 20 3e 20 31 20 29 20 |le( nlef|t > 1 ) |
|000053e0| 20 7b 0a 09 09 73 75 6d | 20 2b 3d 20 2a 77 2b 2b | {...sum| += *w++|
|000053f0| 3b 0a 09 09 6e 6c 65 66 | 74 20 2d 3d 20 32 3b 0a |;...nlef|t -= 2;.|
|00005400| 09 7d 0a 0a 09 2f 2a 20 | 6d 6f 70 20 75 70 20 61 |.}.../* |mop up a|
|00005410| 6e 20 6f 64 64 20 62 79 | 74 65 2c 20 69 66 20 6e |n odd by|te, if n|
|00005420| 65 63 65 73 73 61 72 79 | 20 2a 2f 0a 09 69 66 28 |ecessary| */..if(|
|00005430| 20 6e 6c 65 66 74 20 3d | 3d 20 31 20 29 0a 09 09 | nleft =|= 1 )...|
|00005440| 73 75 6d 20 2b 3d 20 2a | 28 75 5f 63 68 61 72 20 |sum += *|(u_char |
|00005450| 2a 29 77 3b 0a 0a 09 2f | 2a 0a 09 20 2a 20 61 64 |*)w;.../|*.. * ad|
|00005460| 64 20 62 61 63 6b 20 63 | 61 72 72 79 20 6f 75 74 |d back c|arry out|
|00005470| 73 20 66 72 6f 6d 20 74 | 6f 70 20 31 36 20 62 69 |s from t|op 16 bi|
|00005480| 74 73 20 74 6f 20 6c 6f | 77 20 31 36 20 62 69 74 |ts to lo|w 16 bit|
|00005490| 73 0a 09 20 2a 2f 0a 09 | 73 75 6d 20 3d 20 28 73 |s.. */..|sum = (s|
|000054a0| 75 6d 20 3e 3e 20 31 36 | 29 20 2b 20 28 73 75 6d |um >> 16|) + (sum|
|000054b0| 20 26 20 30 78 66 66 66 | 66 29 3b 09 2f 2a 20 61 | & 0xfff|f);./* a|
|000054c0| 64 64 20 68 69 20 31 36 | 20 74 6f 20 6c 6f 77 20 |dd hi 16| to low |
|000054d0| 31 36 20 2a 2f 0a 09 73 | 75 6d 20 2b 3d 20 28 73 |16 */..s|um += (s|
|000054e0| 75 6d 20 3e 3e 20 31 36 | 29 3b 09 09 09 2f 2a 20 |um >> 16|);.../* |
|000054f0| 61 64 64 20 63 61 72 72 | 79 20 2a 2f 0a 09 61 6e |add carr|y */..an|
|00005500| 73 77 65 72 20 3d 20 7e | 73 75 6d 3b 09 09 09 09 |swer = ~|sum;....|
|00005510| 2f 2a 20 74 72 75 6e 63 | 61 74 65 20 74 6f 20 31 |/* trunc|ate to 1|
|00005520| 36 20 62 69 74 73 20 2a | 2f 0a 09 72 65 74 75 72 |6 bits *|/..retur|
|00005530| 6e 20 28 61 6e 73 77 65 | 72 29 3b 0a 7d 0a 3b 0a |n (answe|r);.}.;.|
|00005540| 09 63 6f 6e 74 65 6e 74 | 2e 64 70 74 72 20 3d 20 |.content|.dptr = |
|00005550| 28 63 68 61 72 20 2a 29 | 26 73 62 75 66 3b 0a 0a |(char *)|&sbuf;..|
|00005560| 23 69 66 64 65 66 09 44 | 42 4d 0a 09 69 66 28 73 |#ifdef.D|BM..if(s|
|00005570| 74 6f 72 65 28 6b 65 79 | 2c 20 63 6f 6e 74 65 6e |tore(key|, conten|
|00005580| 74 29 29 20 7b 0a 09 09 | 77 61 72 6e 28 22 63 61 |t)) {...|warn("ca|
|00005590| 6e 6e 6f 74 20 73 74 6f | 72 65 22 2c 66 69 6c 29 |nnot sto|re",fil)|
|000055a0| 3b 0a 09 09 72 65 74 75 | 72 6e 28 31 29 3b 0a 09 |;...retu|rn(1);..|
|000055b0| 7d 0a 23 65 6e 64 69 66 | 0a 23 69 66 64 65 66 09 |}.#endif|.#ifdef.|
|000055c0| 4e 44 42 4d 0a 09 69 66 | 28 64 62 6d 5f 73 74 6f |NDBM..if|(dbm_sto|
|000055d0| 72 65 28 64 62 66 2c 6b | 65 79 2c 20 63 6f 6e 74 |re(dbf,k|ey, cont|
|000055e0| 65 6e 74 2c 44 42 4d 5f | 52 45 50 4c 41 43 45 29 |ent,DBM_|REPLACE)|
|000055f0| 29 20 7b 0a 09 09 77 61 | 72 6e 28 22 63 61 6e 6e |) {...wa|rn("cann|
|00005600| 66 69 6c 65 73 63 61 6e | 2f 66 69 6c 65 73 63 61 |filescan|/filesca|
|00005610| 6e 2e 38 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |n.8.....|........|
|00005620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005660| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00005670| 34 33 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |43 . | 0 . |
|00005680| 20 20 20 37 35 35 35 20 | 20 34 35 30 36 34 36 37 | 7555 | 4506467|
|00005690| 34 33 32 20 20 20 37 35 | 34 35 00 20 00 00 00 00 |432 75|45. ....|
|000056a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005800| 2e 5c 22 20 24 48 65 61 | 64 65 72 3a 20 66 69 6c |.\" $Hea|der: fil|
|00005810| 65 73 63 61 6e 2e 38 2c | 76 20 31 2e 31 20 38 39 |escan.8,|v 1.1 89|
|00005820| 2f 30 39 2f 31 33 20 31 | 35 3a 34 38 3a 33 34 20 |/09/13 1|5:48:34 |
|00005830| 6d 6a 72 20 45 78 70 20 | 24 0a 2e 54 48 20 46 49 |mjr Exp |$..TH FI|
|00005840| 4c 45 53 43 41 4e 20 31 | 20 22 31 33 20 53 65 70 |LESCAN 1| "13 Sep|
|00005850| 74 65 6d 62 65 72 20 31 | 39 38 39 22 0a 2e 53 48 |tember 1|989"..SH|
|00005860| 20 4e 41 4d 45 0a 66 69 | 6c 65 73 63 61 6e 20 5c | NAME.fi|lescan \|
|00005870| 2d 20 70 72 69 6d 69 74 | 69 76 65 20 74 72 6f 6a |- primit|ive troj|
|00005880| 61 6e 20 68 6f 72 73 65 | 20 64 65 74 65 63 74 6f |an horse| detecto|
|00005890| 72 2f 70 65 72 6d 69 73 | 73 69 6f 6e 73 20 63 68 |r/permis|sions ch|
|000058a0| 65 63 6b 65 72 0a 2e 53 | 48 20 53 59 4e 4f 50 53 |ecker..S|H SYNOPS|
|000058b0| 49 53 0a 2e 42 20 66 69 | 6c 65 73 63 61 6e 0a 2e |IS..B fi|lescan..|
|000058c0| 52 42 20 22 20 5c 2d 64 | 20 64 61 74 61 62 61 73 |RB " \-d| databas|
|000058d0| 65 20 22 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 61 20 |e "..RB |[ " \-a |
|000058e0| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 43 20 |" ]..RB |[ " \-C |
|000058f0| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 63 20 |" ]..RB |[ " \-c |
|00005900| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 73 20 |" ]..RB |[ " \-s |
|00005910| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 75 20 |" ]..RB |[ " \-u |
|00005920| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 77 20 |" ]..RB |[ " \-w |
|00005930| 22 20 5d 0a 2e 52 42 20 | 5b 20 22 20 5c 2d 69 20 |" ]..RB |[ " \-i |
|00005940| 69 6e 70 75 74 22 20 5d | 0a 2e 52 42 20 5b 20 22 |input" ]|..RB [ "|
|00005950| 20 5c 2d 6f 20 6f 75 74 | 70 75 74 22 20 5d 0a 2e | \-o out|put" ]..|
|00005960| 53 48 20 44 45 53 43 52 | 49 50 54 49 4f 4e 0a 2e |SH DESCR|IPTION..|
|00005970| 4c 50 0a 2e 42 20 66 69 | 6c 65 73 63 61 6e 0a 72 |LP..B fi|lescan.r|
|00005980| 65 61 64 73 20 61 20 6c | 69 73 74 20 6f 66 20 66 |eads a l|ist of f|
|00005990| 69 6c 65 20 6e 61 6d 65 | 73 20 66 72 6f 6d 20 69 |ile name|s from i|
|000059a0| 74 73 20 73 74 61 6e 64 | 61 72 64 20 69 6e 70 75 |ts stand|ard inpu|
|000059b0| 74 20 6f 72 20 66 69 6c | 65 2c 20 61 6e 64 20 63 |t or fil|e, and c|
|000059c0| 68 65 63 6b 73 0a 74 68 | 65 20 6c 69 73 74 20 66 |hecks.th|e list f|
|000059d0| 6f 72 20 70 65 72 6d 69 | 73 73 69 6f 6e 73 20 63 |or permi|ssions c|
|000059e0| 68 61 6e 67 65 73 2c 20 | 6d 6f 64 69 66 69 63 61 |hanges, |modifica|
|000059f0| 74 69 6f 6e 2c 20 63 68 | 61 6e 67 65 20 6f 66 20 |tion, ch|ange of |
|00005a00| 73 69 7a 65 2c 20 65 74 | 63 2e 20 0a 54 68 65 20 |size, et|c. .The |
|00005a10| 69 6e 74 65 6e 74 20 69 | 73 20 74 6f 20 6d 61 6b |intent i|s to mak|
|00005a20| 65 20 69 74 20 5c 66 49 | 73 6f 6d 65 77 68 61 74 |e it \fI|somewhat|
|00005a30| 5c 66 52 20 68 61 72 64 | 65 72 20 74 6f 20 69 6e |\fR hard|er to in|
|00005a40| 73 65 72 74 20 61 20 74 | 72 6f 6a 61 6e 20 68 6f |sert a t|rojan ho|
|00005a50| 72 73 65 20 69 6e 74 6f | 0a 61 20 73 79 73 74 65 |rse into|.a syste|
|00005a60| 6d 2e 20 49 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 61 |m. Infor|mation a|
|00005a70| 62 6f 75 74 20 74 68 65 | 20 66 69 6c 65 73 20 69 |bout the| files i|
|00005a80| 73 20 73 74 6f 72 65 64 | 20 69 6e 20 61 0a 2e 42 |s stored| in a..B|
|00005a90| 20 64 62 6d 28 33 29 0a | 68 61 73 68 20 74 61 62 | dbm(3).|hash tab|
|00005aa0| 6c 65 2c 20 66 6f 72 20 | 71 75 69 63 6b 20 6c 6f |le, for |quick lo|
|00005ab0| 6f 6b 75 70 2e 20 57 61 | 72 6e 69 6e 67 73 20 61 |okup. Wa|rnings a|
|00005ac0| 62 6f 75 74 20 69 6e 74 | 65 72 65 73 74 69 6e 67 |bout int|eresting|
|00005ad0| 20 66 69 6e 64 69 6e 67 | 73 20 63 61 6e 0a 62 65 | finding|s can.be|
|00005ae0| 20 65 69 74 68 65 72 20 | 61 70 70 65 6e 64 65 64 | either |appended|
|00005af0| 20 74 6f 20 61 20 6c 6f | 67 20 66 69 6c 65 2c 20 | to a lo|g file, |
|00005b00| 6d 61 69 6c 65 64 20 74 | 6f 20 73 79 73 74 65 6d |mailed t|o system|
|00005b10| 73 20 61 64 6d 69 6e 69 | 73 74 72 61 74 6f 72 73 |s admini|strators|
|00005b20| 2c 20 61 6e 64 0a 73 6f | 20 6f 6e 2e 0a 2e 4c 50 |, and.so| on...LP|
|00005b30| 0a 2e 42 20 66 69 6c 65 | 73 63 61 6e 0a 69 73 20 |..B file|scan.is |
|00005b40| 6e 6f 74 20 67 6f 69 6e | 67 20 74 6f 20 6d 61 6b |not goin|g to mak|
|00005b50| 65 20 69 74 20 69 6d 70 | 6f 73 73 69 62 6c 65 20 |e it imp|ossible |
|00005b60| 66 6f 72 20 73 6f 6d 65 | 6f 6e 65 20 74 6f 20 69 |for some|one to i|
|00005b70| 6e 73 65 72 74 20 61 20 | 74 72 6f 6a 61 6e 20 69 |nsert a |trojan i|
|00005b80| 6e 74 6f 0a 61 20 73 79 | 73 74 65 6d 2c 20 62 79 |nto.a sy|stem, by|
|00005b90| 20 61 6e 79 20 6d 65 61 | 6e 73 2e 20 52 75 6e 6e | any mea|ns. Runn|
|00005ba0| 69 6e 67 20 61 20 63 6f | 6d 70 6c 65 74 65 20 63 |ing a co|mplete c|
|00005bb0| 68 65 63 6b 73 75 6d 20 | 6f 6e 20 61 6c 6c 20 74 |hecksum |on all t|
|00005bc0| 68 65 20 66 69 6c 65 73 | 0a 69 6e 20 74 68 65 20 |he files|.in the |
|00005bd0| 64 61 74 61 62 61 73 65 | 20 63 61 6e 20 63 68 65 |database| can che|
|00005be0| 77 20 75 70 20 61 20 6c | 6f 74 20 6f 66 20 43 50 |w up a l|ot of CP|
|00005bf0| 55 20 74 69 6d 65 2c 20 | 79 65 74 20 72 65 73 6f |U time, |yet reso|
|00005c00| 72 74 69 6e 67 20 74 6f | 20 73 69 6d 70 6c 79 0a |rting to| simply.|
|00005c10| 63 68 65 63 6b 69 6e 67 | 20 66 69 6c 65 20 73 69 |checking| file si|
|00005c20| 7a 65 73 2c 20 70 65 72 | 6d 69 73 73 69 6f 6e 73 |zes, per|missions|
|00005c30| 20 61 6e 64 20 6d 6f 64 | 69 66 69 63 61 74 69 6f | and mod|ificatio|
|00005c40| 6e 20 74 69 6d 65 73 20 | 69 73 20 6e 6f 74 20 31 |n times |is not 1|
|00005c50| 30 30 25 0a 72 65 6c 69 | 61 62 6c 65 2c 20 65 69 |00%.reli|able, ei|
|00005c60| 74 68 65 72 2e 20 41 6e | 20 61 64 64 69 74 69 6f |ther. An| additio|
|00005c70| 6e 61 6c 20 77 65 61 6b | 6e 65 73 73 20 6f 66 20 |nal weak|ness of |
|00005c80| 73 75 63 68 20 61 20 73 | 79 73 74 65 6d 20 69 73 |such a s|ystem is|
|00005c90| 20 74 68 65 20 0a 64 61 | 74 61 62 61 73 65 20 69 | the .da|tabase i|
|00005ca0| 74 73 65 6c 66 2e 20 49 | 6e 20 74 68 69 73 20 69 |tself. I|n this i|
|00005cb0| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 2c 20 74 |mplement|ation, t|
|00005cc0| 68 65 72 65 20 69 73 20 | 6e 6f 20 70 72 6f 74 65 |here is |no prote|
|00005cd0| 63 74 69 6f 6e 20 66 6f | 72 0a 74 68 65 20 64 61 |ction fo|r.the da|
|00005ce0| 74 61 62 61 73 65 2c 20 | 74 68 6f 75 67 68 20 65 |tabase, |though e|
|00005cf0| 6e 63 72 79 70 74 69 6e | 67 20 74 68 65 20 68 61 |ncryptin|g the ha|
|00005d00| 73 68 20 74 61 62 6c 65 | 27 73 20 64 69 72 65 63 |sh table|'s direc|
|00005d10| 74 6f 72 79 20 77 6f 75 | 6c 64 0a 6d 61 6b 65 20 |tory wou|ld.make |
|00005d20| 69 74 20 68 61 72 64 20 | 74 6f 20 6d 6f 64 69 66 |it hard |to modif|
|00005d30| 79 2e 20 4f 62 76 69 6f | 75 73 6c 79 2c 20 61 20 |y. Obvio|usly, a |
|00005d40| 77 72 6f 6e 67 64 6f 65 | 72 20 63 6f 75 6c 64 20 |wrongdoe|r could |
|00005d50| 66 6c 61 74 2d 6f 75 74 | 20 72 65 6d 6f 76 65 0a |flat-out| remove.|
|00005d60| 74 68 65 20 64 61 74 61 | 62 61 73 65 20 2d 20 62 |the data|base - b|
|00005d70| 75 74 20 74 68 65 6e 20 | 74 68 65 79 20 63 6f 75 |ut then |they cou|
|00005d80| 6c 64 20 72 65 66 6f 72 | 6d 61 74 20 74 68 65 20 |ld refor|mat the |
|00005d90| 64 69 73 6b 73 2c 20 74 | 6f 6f 2e 0a 2e 42 20 66 |disks, t|oo...B f|
|00005da0| 69 6c 65 73 63 61 6e 0a | 73 68 6f 75 6c 64 20 62 |ilescan.|should b|
|00005db0| 65 20 73 6f 6d 65 77 68 | 61 74 20 65 66 66 65 63 |e somewh|at effec|
|00005dc0| 74 69 76 65 20 61 67 61 | 69 6e 73 74 20 62 61 73 |tive aga|inst bas|
|00005dd0| 69 63 20 6d 69 73 63 68 | 65 66 2e 0a 2e 53 48 20 |ic misch|ef...SH |
|00005de0| 4f 50 54 49 4f 4e 53 0a | 2e 54 50 0a 2e 42 20 5c |OPTIONS.|.TP..B \|
|00005df0| 2d 43 0a 49 66 20 74 68 | 65 20 64 61 74 61 62 61 |-C.If th|e databa|
|00005e00| 73 65 20 73 79 73 74 65 | 6d 20 69 73 20 62 61 73 |se syste|m is bas|
|00005e10| 65 64 20 6f 6e 0a 2e 42 | 20 64 62 6d 28 33 29 0a |ed on..B| dbm(3).|
|00005e20| 72 61 74 68 65 72 20 74 | 68 61 6e 0a 2e 42 20 6e |rather t|han..B n|
|00005e30| 64 62 6d 28 33 29 0a 74 | 68 69 73 20 6f 70 74 69 |dbm(3).t|his opti|
|00005e40| 6f 6e 20 77 69 6c 6c 20 | 63 72 65 61 74 65 20 74 |on will |create t|
|00005e50| 68 65 20 64 61 74 61 62 | 61 73 65 20 66 69 6c 65 |he datab|ase file|
|00005e60| 73 2c 20 6f 72 20 77 69 | 6c 6c 20 74 72 75 6e 63 |s, or wi|ll trunc|
|00005e70| 61 74 65 20 65 78 69 73 | 74 69 6e 67 0a 6f 6e 65 |ate exis|ting.one|
|00005e80| 73 2e 0a 2e 54 50 0a 2e | 42 20 5c 2d 63 0a 49 6e |s...TP..|B \-c.In|
|00005e90| 64 69 63 61 74 65 73 20 | 74 68 61 74 20 74 68 65 |dicates |that the|
|00005ea0| 20 6c 69 73 74 20 62 65 | 69 6e 67 20 72 65 61 64 | list be|ing read|
|00005eb0| 20 73 68 6f 75 6c 64 20 | 62 65 20 0a 65 6e 74 65 | should |be .ente|
|00005ec0| 72 65 64 20 69 6e 74 6f | 20 74 68 65 20 64 61 74 |red into| the dat|
|00005ed0| 61 62 61 73 65 2e 20 50 | 72 65 73 75 6d 61 62 6c |abase. P|resumabl|
|00005ee0| 79 2c 20 74 68 69 73 20 | 6f 70 74 69 6f 6e 20 77 |y, this |option w|
|00005ef0| 69 6c 6c 20 62 65 20 72 | 75 6e 20 6f 6e 63 65 2c |ill be r|un once,|
|00005f00| 0a 77 68 65 6e 20 74 68 | 65 20 64 61 74 61 62 61 |.when th|e databa|
|00005f10| 73 65 20 69 73 20 69 6e | 69 74 69 61 6c 69 7a 65 |se is in|itialize|
|00005f20| 64 2e 0a 2e 54 50 0a 2e | 42 20 5c 2d 73 0a 49 6e |d...TP..|B \-s.In|
|00005f30| 64 69 63 61 74 65 73 20 | 74 68 61 74 20 61 20 63 |dicates |that a c|
|00005f40| 68 65 63 6b 73 75 6d 20 | 73 68 6f 75 6c 64 20 62 |hecksum |should b|
|00005f50| 65 20 70 65 72 66 6f 72 | 6d 65 64 20 6f 6e 20 61 |e perfor|med on a|
|00005f60| 6c 6c 20 66 69 6c 65 73 | 20 74 68 61 74 20 61 72 |ll files| that ar|
|00005f70| 65 0a 62 65 69 6e 67 20 | 73 74 6f 72 65 64 20 6f |e.being |stored o|
|00005f80| 72 20 75 70 64 61 74 65 | 64 20 69 6e 20 74 68 65 |r update|d in the|
|00005f90| 20 64 61 74 61 62 61 73 | 65 2e 20 57 68 65 6e 20 | databas|e. When |
|00005fa0| 61 20 66 69 6c 65 20 69 | 73 20 73 74 6f 72 65 64 |a file i|s stored|
|00005fb0| 2c 20 61 0a 66 6c 61 67 | 20 69 73 20 73 74 6f 72 |, a.flag| is stor|
|00005fc0| 65 64 20 77 69 74 68 20 | 69 74 2c 20 69 6e 64 69 |ed with |it, indi|
|00005fd0| 63 61 74 69 6e 67 20 74 | 68 61 74 20 74 68 65 20 |cating t|hat the |
|00005fe0| 66 69 6c 65 20 69 73 20 | 74 6f 20 62 65 20 73 75 |file is |to be su|
|00005ff0| 6d 6d 65 64 2c 0a 61 6e | 64 20 69 74 20 69 73 20 |mmed,.an|d it is |
+--------+-------------------------+-------------------------+--------+--------+