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: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: 1976
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news or mail, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 6b 61 | 72 6c 40 73 75 67 61 72 |From: ka|rl@sugar|
|00000010| 2e 68 61 63 6b 65 72 63 | 6f 72 70 2e 63 6f 6d 20 |.hackerc|orp.com |
|00000020| 28 4b 61 72 6c 20 4c 65 | 68 65 6e 62 61 75 65 72 |(Karl Le|henbauer|
|00000030| 29 0a 4e 65 77 73 67 72 | 6f 75 70 73 3a 20 61 6c |).Newsgr|oups: al|
|00000040| 74 2e 73 6f 75 72 63 65 | 73 0a 53 75 62 6a 65 63 |t.source|s.Subjec|
|00000050| 74 3a 20 63 6f 6f 6b 69 | 65 20 2d 20 43 20 66 6f |t: cooki|e - C fo|
|00000060| 72 74 75 6e 65 20 63 6f | 6f 6b 69 65 20 70 72 6f |rtune co|okie pro|
|00000070| 67 72 61 6d 20 66 6f 72 | 20 75 73 65 20 77 69 74 |gram for| use wit|
|00000080| 68 20 22 25 25 22 20 63 | 6f 6f 6b 69 65 20 66 69 |h "%%" c|ookie fi|
|00000090| 6c 65 73 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |les.Mess|age-ID: |
|000000a0| 3c 36 38 34 34 40 73 75 | 67 61 72 2e 68 61 63 6b |<6844@su|gar.hack|
|000000b0| 65 72 63 6f 72 70 2e 63 | 6f 6d 3e 0a 44 61 74 65 |ercorp.c|om>.Date|
|000000c0| 3a 20 32 30 20 4f 63 74 | 20 39 30 20 31 38 3a 31 |: 20 Oct| 90 18:1|
|000000d0| 30 3a 33 35 20 47 4d 54 | 0a 0a 43 6f 6f 6b 69 65 |0:35 GMT|..Cookie|
|000000e0| 20 69 73 20 61 20 70 72 | 6f 67 72 61 6d 20 74 6f | is a pr|ogram to|
|000000f0| 20 72 61 6e 64 6f 6d 6c | 79 20 72 65 74 72 69 65 | randoml|y retrie|
|00000100| 76 65 20 63 6f 6f 6b 69 | 65 73 20 66 72 6f 6d 20 |ve cooki|es from |
|00000110| 61 20 66 6f 72 74 75 6e | 65 20 63 6f 6f 6b 69 65 |a fortun|e cookie|
|00000120| 20 66 69 6c 65 2e 0a 45 | 61 63 68 20 63 6f 6f 6b | file..E|ach cook|
|00000130| 69 65 20 63 61 6e 20 63 | 6f 6e 74 61 69 6e 20 61 |ie can c|ontain a|
|00000140| 6e 20 61 72 62 69 74 72 | 61 72 79 20 6e 75 6d 62 |n arbitr|ary numb|
|00000150| 65 72 20 6f 66 20 6c 69 | 6e 65 73 20 6f 66 20 74 |er of li|nes of t|
|00000160| 65 78 74 2e 20 20 42 79 | 20 67 65 6e 65 72 61 74 |ext. By| generat|
|00000170| 69 6e 67 0a 61 20 73 6d | 61 6c 6c 20 22 68 61 73 |ing.a sm|all "has|
|00000180| 68 22 20 66 69 6c 65 20 | 63 6f 6e 74 61 69 6e 69 |h" file |containi|
|00000190| 6e 67 20 74 68 65 20 61 | 64 64 72 65 73 73 65 73 |ng the a|ddresses|
|000001a0| 20 6f 66 20 65 61 63 68 | 20 63 6f 6f 6b 69 65 20 | of each| cookie |
|000001b0| 69 6e 20 74 68 65 20 63 | 6f 6f 6b 69 65 0a 66 69 |in the c|ookie.fi|
|000001c0| 6c 65 2c 20 63 6f 6f 6b | 69 65 20 68 61 73 20 61 |le, cook|ie has a|
|000001d0| 20 68 69 67 68 2d 70 65 | 72 66 6f 72 6d 61 6e 63 | high-pe|rformanc|
|000001e0| 65 20 77 61 79 20 74 6f | 20 6c 6f 6f 6b 20 75 70 |e way to| look up|
|000001f0| 20 63 6f 6f 6b 69 65 73 | 2c 20 70 6c 75 73 20 69 | cookies|, plus i|
|00000200| 74 20 69 73 20 22 66 61 | 69 72 2c 22 0a 77 68 69 |t is "fa|ir,".whi|
|00000210| 63 68 20 69 73 20 74 6f | 20 73 61 79 20 74 68 61 |ch is to| say tha|
|00000220| 74 20 73 68 6f 72 74 20 | 63 6f 6f 6b 69 65 73 20 |t short |cookies |
|00000230| 61 72 65 20 65 71 75 61 | 6c 6c 79 20 61 73 20 6c |are equa|lly as l|
|00000240| 69 6b 65 6c 79 20 74 6f | 20 62 65 20 73 65 6c 65 |ikely to| be sele|
|00000250| 63 74 65 64 20 61 73 20 | 0a 6c 6f 6e 67 20 6f 6e |cted as |.long on|
|00000260| 65 73 2e 0a 0a 54 68 65 | 20 63 6f 64 65 20 69 73 |es...The| code is|
|00000270| 20 61 67 61 69 6e 20 72 | 65 6c 65 61 73 65 64 20 | again r|eleased |
|00000280| 69 6e 74 6f 20 74 68 65 | 20 70 75 62 6c 69 63 20 |into the| public |
|00000290| 64 6f 6d 61 69 6e 20 77 | 69 74 68 6f 75 74 20 72 |domain w|ithout r|
|000002a0| 65 73 74 72 69 63 74 69 | 6f 6e 2e 0a 0a 23 21 20 |estricti|on...#! |
|000002b0| 2f 62 69 6e 2f 73 68 0a | 23 20 54 68 69 73 20 69 |/bin/sh.|# This i|
|000002c0| 73 20 61 20 73 68 65 6c | 6c 20 61 72 63 68 69 76 |s a shel|l archiv|
|000002d0| 65 2e 20 20 52 65 6d 6f | 76 65 20 61 6e 79 74 68 |e. Remo|ve anyth|
|000002e0| 69 6e 67 20 62 65 66 6f | 72 65 20 74 68 69 73 20 |ing befo|re this |
|000002f0| 6c 69 6e 65 2c 20 74 68 | 65 6e 20 66 65 65 64 20 |line, th|en feed |
|00000300| 69 74 0a 23 20 69 6e 74 | 6f 20 61 20 73 68 65 6c |it.# int|o a shel|
|00000310| 6c 20 76 69 61 20 22 73 | 68 20 66 69 6c 65 22 20 |l via "s|h file" |
|00000320| 6f 72 20 73 69 6d 69 6c | 61 72 2e 20 20 54 6f 20 |or simil|ar. To |
|00000330| 6f 76 65 72 77 72 69 74 | 65 20 65 78 69 73 74 69 |overwrit|e existi|
|00000340| 6e 67 20 66 69 6c 65 73 | 2c 0a 23 20 74 79 70 65 |ng files|,.# type|
|00000350| 20 22 73 68 20 66 69 6c | 65 20 2d 63 22 2e 0a 23 | "sh fil|e -c"..#|
|00000360| 20 54 68 65 20 74 6f 6f | 6c 20 74 68 61 74 20 67 | The too|l that g|
|00000370| 65 6e 65 72 61 74 65 64 | 20 74 68 69 73 20 61 70 |enerated| this ap|
|00000380| 70 65 61 72 65 64 20 69 | 6e 20 74 68 65 20 63 6f |peared i|n the co|
|00000390| 6d 70 2e 73 6f 75 72 63 | 65 73 2e 75 6e 69 78 20 |mp.sourc|es.unix |
|000003a0| 6e 65 77 73 67 72 6f 75 | 70 3b 0a 23 20 73 65 6e |newsgrou|p;.# sen|
|000003b0| 64 20 6d 61 69 6c 20 74 | 6f 20 63 6f 6d 70 2d 73 |d mail t|o comp-s|
|000003c0| 6f 75 72 63 65 73 2d 75 | 6e 69 78 40 75 75 6e 65 |ources-u|nix@uune|
|000003d0| 74 2e 75 75 2e 6e 65 74 | 20 69 66 20 79 6f 75 20 |t.uu.net| if you |
|000003e0| 77 61 6e 74 20 74 68 61 | 74 20 74 6f 6f 6c 2e 0a |want tha|t tool..|
|000003f0| 23 20 49 66 20 74 68 69 | 73 20 61 72 63 68 69 76 |# If thi|s archiv|
|00000400| 65 20 69 73 20 63 6f 6d | 70 6c 65 74 65 2c 20 79 |e is com|plete, y|
|00000410| 6f 75 20 77 69 6c 6c 20 | 73 65 65 20 74 68 65 20 |ou will |see the |
|00000420| 66 6f 6c 6c 6f 77 69 6e | 67 20 6d 65 73 73 61 67 |followin|g messag|
|00000430| 65 20 61 74 20 74 68 65 | 20 65 6e 64 3a 0a 23 09 |e at the| end:.#.|
|00000440| 09 22 45 6e 64 20 6f 66 | 20 73 68 65 6c 6c 20 61 |."End of| shell a|
|00000450| 72 63 68 69 76 65 2e 22 | 0a 23 20 43 6f 6e 74 65 |rchive."|.# Conte|
|00000460| 6e 74 73 3a 20 20 52 45 | 41 44 4d 45 20 63 6f 6f |nts: RE|ADME coo|
|00000470| 6b 69 65 2e 31 20 4d 61 | 6b 65 66 69 6c 65 20 63 |kie.1 Ma|kefile c|
|00000480| 6f 6f 6b 69 65 2e 68 20 | 63 6f 6f 6b 69 65 2e 63 |ookie.h |cookie.c|
|00000490| 20 63 6f 6f 6b 68 61 73 | 68 2e 63 0a 23 20 57 72 | cookhas|h.c.# Wr|
|000004a0| 61 70 70 65 64 20 62 79 | 20 6b 61 72 6c 40 73 75 |apped by| karl@su|
|000004b0| 67 61 72 20 6f 6e 20 53 | 61 74 20 4f 63 74 20 32 |gar on S|at Oct 2|
|000004c0| 30 20 31 33 3a 30 36 3a | 30 38 20 31 39 39 30 0a |0 13:06:|08 1990.|
|000004d0| 50 41 54 48 3d 2f 62 69 | 6e 3a 2f 75 73 72 2f 62 |PATH=/bi|n:/usr/b|
|000004e0| 69 6e 3a 2f 75 73 72 2f | 75 63 62 20 3b 20 65 78 |in:/usr/|ucb ; ex|
|000004f0| 70 6f 72 74 20 50 41 54 | 48 0a 69 66 20 74 65 73 |port PAT|H.if tes|
|00000500| 74 20 2d 66 20 27 52 45 | 41 44 4d 45 27 20 2d 61 |t -f 'RE|ADME' -a|
|00000510| 20 22 24 7b 31 7d 22 20 | 21 3d 20 22 2d 63 22 20 | "${1}" |!= "-c" |
|00000520| 3b 20 74 68 65 6e 20 0a | 20 20 65 63 68 6f 20 73 |; then .| echo s|
|00000530| 68 61 72 3a 20 57 69 6c | 6c 20 6e 6f 74 20 63 6c |har: Wil|l not cl|
|00000540| 6f 62 62 65 72 20 65 78 | 69 73 74 69 6e 67 20 66 |obber ex|isting f|
|00000550| 69 6c 65 20 5c 22 27 52 | 45 41 44 4d 45 27 5c 22 |ile \"'R|EADME'\"|
|00000560| 0a 65 6c 73 65 0a 65 63 | 68 6f 20 73 68 61 72 3a |.else.ec|ho shar:|
|00000570| 20 45 78 74 72 61 63 74 | 69 6e 67 20 5c 22 27 52 | Extract|ing \"'R|
|00000580| 45 41 44 4d 45 27 5c 22 | 20 5c 28 33 38 35 38 20 |EADME'\"| \(3858 |
|00000590| 63 68 61 72 61 63 74 65 | 72 73 5c 29 0a 73 65 64 |characte|rs\).sed|
|000005a0| 20 22 73 2f 5e 58 2f 2f | 22 20 3e 27 52 45 41 44 | "s/^X//|" >'READ|
|000005b0| 4d 45 27 20 3c 3c 27 45 | 4e 44 5f 4f 46 5f 46 49 |ME' <<'E|ND_OF_FI|
|000005c0| 4c 45 27 0a 58 0a 58 54 | 68 65 20 74 68 69 72 64 |LE'.X.XT|he third|
|000005d0| 20 72 65 6c 65 61 73 65 | 20 6f 66 20 22 63 6f 6f | release| of "coo|
|000005e0| 6b 69 65 22 20 20 20 32 | 30 2d 4f 63 74 2d 31 39 |kie" 2|0-Oct-19|
|000005f0| 39 30 0a 58 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |90.X----|--------|
|00000600| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000610| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0a |--------|-------.|
|00000620| 58 0a 58 43 6f 6f 6b 69 | 65 20 69 73 20 61 20 70 |X.XCooki|e is a p|
|00000630| 72 6f 67 72 61 6d 20 74 | 6f 20 72 61 6e 64 6f 6d |rogram t|o random|
|00000640| 6c 79 20 72 65 74 72 69 | 65 76 65 20 63 6f 6f 6b |ly retri|eve cook|
|00000650| 69 65 73 20 66 72 6f 6d | 20 61 20 66 6f 72 74 75 |ies from| a fortu|
|00000660| 6e 65 20 63 6f 6f 6b 69 | 65 20 66 69 6c 65 2e 0a |ne cooki|e file..|
|00000670| 58 45 61 63 68 20 63 6f | 6f 6b 69 65 20 63 61 6e |XEach co|okie can|
|00000680| 20 63 6f 6e 74 61 69 6e | 20 61 6e 20 61 72 62 69 | contain| an arbi|
|00000690| 74 72 61 72 79 20 6e 75 | 6d 62 65 72 20 6f 66 20 |trary nu|mber of |
|000006a0| 6c 69 6e 65 73 20 6f 66 | 20 74 65 78 74 2e 20 20 |lines of| text. |
|000006b0| 42 79 20 67 65 6e 65 72 | 61 74 69 6e 67 0a 58 61 |By gener|ating.Xa|
|000006c0| 20 73 6d 61 6c 6c 20 22 | 68 61 73 68 22 20 66 69 | small "|hash" fi|
|000006d0| 6c 65 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 74 68 |le conta|ining th|
|000006e0| 65 20 61 64 64 72 65 73 | 73 65 73 20 6f 66 20 65 |e addres|ses of e|
|000006f0| 61 63 68 20 63 6f 6f 6b | 69 65 20 69 6e 20 74 68 |ach cook|ie in th|
|00000700| 65 20 63 6f 6f 6b 69 65 | 0a 58 66 69 6c 65 2c 20 |e cookie|.Xfile, |
|00000710| 63 6f 6f 6b 69 65 20 68 | 61 73 20 61 20 68 69 67 |cookie h|as a hig|
|00000720| 68 2d 70 65 72 66 6f 72 | 6d 61 6e 63 65 20 77 61 |h-perfor|mance wa|
|00000730| 79 20 74 6f 20 6c 6f 6f | 6b 20 75 70 20 63 6f 6f |y to loo|k up coo|
|00000740| 6b 69 65 73 2c 20 70 6c | 75 73 20 69 74 20 69 73 |kies, pl|us it is|
|00000750| 20 22 66 61 69 72 2c 22 | 0a 58 77 68 69 63 68 20 | "fair,"|.Xwhich |
|00000760| 69 73 20 74 6f 20 73 61 | 79 20 74 68 61 74 20 73 |is to sa|y that s|
|00000770| 68 6f 72 74 20 63 6f 6f | 6b 69 65 73 20 61 72 65 |hort coo|kies are|
|00000780| 20 65 71 75 61 6c 6c 79 | 20 61 73 20 6c 69 6b 65 | equally| as like|
|00000790| 6c 79 20 74 6f 20 62 65 | 20 73 65 6c 65 63 74 65 |ly to be| selecte|
|000007a0| 64 20 61 73 20 0a 58 6c | 6f 6e 67 20 6f 6e 65 73 |d as .Xl|ong ones|
|000007b0| 2e 20 20 28 54 68 65 20 | 74 65 63 68 6e 69 71 75 |. (The |techniqu|
|000007c0| 65 20 6f 66 20 73 69 6d | 70 6c 79 20 72 61 6e 64 |e of sim|ply rand|
|000007d0| 6f 6d 6c 79 20 73 65 65 | 6b 69 6e 67 20 69 6e 74 |omly see|king int|
|000007e0| 6f 20 74 68 65 20 63 6f | 6f 6b 69 65 20 66 69 6c |o the co|okie fil|
|000007f0| 65 0a 58 61 6e 64 20 6c | 6f 6f 6b 69 6e 67 20 62 |e.Xand l|ooking b|
|00000800| 61 63 6b 77 61 72 64 73 | 20 61 6e 64 20 66 6f 72 |ackwards| and for|
|00000810| 77 61 72 64 73 20 66 72 | 6f 6d 20 74 68 65 72 65 |wards fr|om there|
|00000820| 20 74 6f 20 66 69 6e 64 | 20 74 68 65 20 62 65 67 | to find| the beg|
|00000830| 69 6e 6e 69 6e 67 20 61 | 6e 64 0a 58 65 6e 64 20 |inning a|nd.Xend |
|00000840| 6f 66 20 74 68 65 20 63 | 6f 6f 6b 69 65 20 74 65 |of the c|ookie te|
|00000850| 78 74 20 77 6f 75 6c 64 | 20 62 69 61 73 20 74 68 |xt would| bias th|
|00000860| 65 20 63 6f 6f 6b 69 65 | 20 70 72 6f 67 72 61 6d |e cookie| program|
|00000870| 20 74 6f 77 61 72 64 20 | 6c 61 72 67 65 20 63 6f | toward |large co|
|00000880| 6f 6b 69 65 73 2e 29 0a | 58 0a 58 54 68 69 73 20 |okies.).|X.XThis |
|00000890| 69 73 20 74 68 65 20 73 | 61 6d 65 20 63 6f 64 65 |is the s|ame code|
|000008a0| 20 61 73 20 69 6e 20 6d | 79 20 73 65 63 6f 6e 64 | as in m|y second|
|000008b0| 20 72 65 6c 65 61 73 65 | 2c 20 62 75 74 20 69 74 | release|, but it|
|000008c0| 27 73 20 62 65 65 6e 20 | 61 6c 6d 6f 73 74 20 74 |'s been |almost t|
|000008d0| 77 6f 20 79 65 61 72 73 | 0a 58 73 69 6e 63 65 20 |wo years|.Xsince |
|000008e0| 74 68 61 74 20 72 65 6c | 65 61 73 65 20 61 6e 64 |that rel|ease and|
|000008f0| 20 49 27 76 65 20 67 6f | 74 74 65 6e 20 6e 75 6d | I've go|tten num|
|00000900| 65 72 6f 75 73 20 72 65 | 71 75 65 73 74 73 20 66 |erous re|quests f|
|00000910| 6f 72 20 74 68 65 20 70 | 72 6f 67 72 61 6d 2c 20 |or the p|rogram, |
|00000920| 70 6c 75 73 0a 58 49 27 | 6d 20 61 62 6f 75 74 20 |plus.XI'|m about |
|00000930| 74 6f 20 70 75 6d 70 20 | 6f 75 74 20 61 20 62 61 |to pump |out a ba|
|00000940| 74 63 68 20 6f 66 20 6e | 65 77 20 63 6f 6f 6b 69 |tch of n|ew cooki|
|00000950| 65 73 2c 20 70 6c 75 73 | 20 74 68 65 72 65 20 77 |es, plus| there w|
|00000960| 65 72 6e 27 74 20 61 6c | 74 2e 73 6f 75 72 63 65 |ern't al|t.source|
|00000970| 73 0a 58 61 72 63 68 69 | 76 65 73 20 28 74 68 61 |s.Xarchi|ves (tha|
|00000980| 74 20 49 27 6d 20 61 77 | 61 72 65 20 6f 66 29 20 |t I'm aw|are of) |
|00000990| 74 68 65 6e 2c 20 70 6c | 75 73 20 74 68 65 72 65 |then, pl|us there|
|000009a0| 27 73 20 61 20 6d 61 6e | 70 61 67 65 20 6e 6f 77 |'s a man|page now|
|000009b0| 2c 20 62 6c 61 68 20 62 | 6c 61 68 0a 58 62 6c 61 |, blah b|lah.Xbla|
|000009c0| 68 2e 20 20 46 6c 61 6d | 65 73 20 76 69 61 20 65 |h. Flam|es via e|
|000009d0| 6d 61 69 6c 20 6f 72 20 | 61 6c 74 2e 73 6f 75 72 |mail or |alt.sour|
|000009e0| 63 65 73 2e 64 20 69 66 | 20 79 6f 75 20 6d 75 73 |ces.d if| you mus|
|000009f0| 74 2e 2e 2e 0a 58 0a 58 | 54 68 65 20 63 6f 64 65 |t....X.X|The code|
|00000a00| 20 69 73 20 61 67 61 69 | 6e 20 72 65 6c 65 61 73 | is agai|n releas|
|00000a10| 65 64 20 69 6e 74 6f 20 | 74 68 65 20 70 75 62 6c |ed into |the publ|
|00000a20| 69 63 20 64 6f 6d 61 69 | 6e 20 77 69 74 68 6f 75 |ic domai|n withou|
|00000a30| 74 20 72 65 73 74 72 69 | 63 74 69 6f 6e 2e 0a 58 |t restri|ction..X|
|00000a40| 49 20 61 73 6b 20 74 68 | 61 74 20 79 6f 75 20 72 |I ask th|at you r|
|00000a50| 65 74 61 69 6e 20 6d 79 | 20 6e 61 6d 65 20 69 6e |etain my| name in|
|00000a60| 20 74 68 65 20 73 6f 75 | 72 63 65 20 63 6f 64 65 | the sou|rce code|
|00000a70| 20 69 66 20 79 6f 75 20 | 72 65 64 69 73 74 72 69 | if you |redistri|
|00000a80| 62 75 74 65 20 74 68 69 | 73 20 73 74 75 66 66 2c |bute thi|s stuff,|
|00000a90| 0a 58 61 6e 64 20 74 68 | 61 74 20 79 6f 75 20 72 |.Xand th|at you r|
|00000aa0| 65 64 69 73 74 72 69 62 | 75 74 65 20 73 6f 75 72 |edistrib|ute sour|
|00000ab0| 63 65 20 61 6c 6f 6e 67 | 20 77 69 74 68 20 62 69 |ce along| with bi|
|00000ac0| 6e 61 72 69 65 73 2e 0a | 58 0a 58 4e 6f 20 77 61 |naries..|X.XNo wa|
|00000ad0| 72 72 61 6e 74 69 65 73 | 20 61 72 65 20 65 78 70 |rranties| are exp|
|00000ae0| 72 65 73 73 65 64 20 6f | 72 20 69 6d 70 6c 69 65 |ressed o|r implie|
|00000af0| 64 20 2d 2d 20 74 68 69 | 73 20 69 73 20 66 72 65 |d -- thi|s is fre|
|00000b00| 65 20 63 6f 64 65 2e 20 | 20 57 65 20 64 6f 20 6e |e code. | We do n|
|00000b10| 6f 74 20 68 61 76 65 0a | 58 61 20 63 6f 6e 74 72 |ot have.|Xa contr|
|00000b20| 61 63 74 2e 0a 58 0a 58 | 54 68 65 20 63 6f 64 65 |act..X.X|The code|
|00000b30| 20 69 73 20 77 72 69 74 | 74 65 6e 20 66 6f 72 20 | is writ|ten for |
|00000b40| 53 79 73 74 65 6d 20 56 | 20 62 75 74 20 74 68 65 |System V| but the|
|00000b50| 20 6f 6e 6c 79 20 61 72 | 65 61 20 6f 66 20 69 6e | only ar|ea of in|
|00000b60| 63 6f 6d 70 61 74 69 62 | 69 6c 69 74 79 20 73 68 |compatib|ility sh|
|00000b70| 6f 75 6c 64 20 62 65 0a | 58 74 68 65 20 72 61 6e |ould be.|Xthe ran|
|00000b80| 64 28 29 20 66 75 6e 63 | 74 69 6f 6e 2e 20 20 4f |d() func|tion. O|
|00000b90| 6e 6c 79 20 6d 69 6e 6f | 72 20 68 61 63 6b 69 6e |nly mino|r hackin|
|00000ba0| 67 20 73 68 6f 75 6c 64 | 20 62 65 20 6e 65 63 65 |g should| be nece|
|00000bb0| 73 73 61 72 79 20 74 6f | 20 70 6f 72 74 20 74 6f |ssary to| port to|
|00000bc0| 20 42 53 44 2c 0a 58 66 | 6f 72 20 65 78 61 6d 70 | BSD,.Xf|or examp|
|00000bd0| 6c 65 2e 20 20 28 49 66 | 20 73 6f 6d 65 6f 6e 65 |le. (If| someone|
|00000be0| 20 67 65 74 73 20 74 68 | 65 20 75 72 67 65 2c 20 | gets th|e urge, |
|00000bf0| 70 6c 65 61 73 65 20 6d | 61 6b 65 20 61 20 76 65 |please m|ake a ve|
|00000c00| 72 73 69 6f 6e 20 74 68 | 61 74 20 77 6f 72 6b 73 |rsion th|at works|
|00000c10| 0a 58 77 69 74 68 20 23 | 69 66 64 65 66 73 20 66 |.Xwith #|ifdefs f|
|00000c20| 6f 72 20 62 6f 74 68 2c | 20 74 65 73 74 20 74 68 |or both,| test th|
|00000c30| 65 20 42 53 44 20 76 65 | 72 73 69 6f 6e 20 61 6e |e BSD ve|rsion an|
|00000c40| 64 20 66 6f 72 77 61 72 | 64 20 69 74 20 62 61 63 |d forwar|d it bac|
|00000c50| 6b 20 74 6f 20 6d 65 2c | 20 4f 4b 3f 29 0a 58 0a |k to me,| OK?).X.|
|00000c60| 58 49 74 20 73 68 6f 75 | 6c 64 20 62 65 20 70 6f |XIt shou|ld be po|
|00000c70| 73 73 69 62 6c 65 20 74 | 6f 20 6d 61 6b 65 20 63 |ssible t|o make c|
|00000c80| 6f 6f 6b 69 65 20 77 6f | 72 6b 20 70 72 65 74 74 |ookie wo|rk prett|
|00000c90| 79 20 70 61 69 6e 6c 65 | 73 73 6c 79 20 6f 6e 20 |y painle|ssly on |
|00000ca0| 4d 53 2d 44 4f 53 2c 20 | 4d 69 6e 69 78 2c 0a 58 |MS-DOS, |Minix,.X|
|00000cb0| 65 74 63 2e 20 20 54 65 | 73 74 65 64 20 75 70 64 |etc. Te|sted upd|
|00000cc0| 61 74 65 73 20 66 6f 72 | 20 70 6f 70 75 6c 61 72 |ates for| popular|
|00000cd0| 20 61 6e 64 20 6e 6f 74 | 2d 6f 76 65 72 77 68 65 | and not|-overwhe|
|00000ce0| 6c 6d 69 6e 67 6c 79 2d | 74 77 69 73 74 65 64 20 |lmingly-|twisted |
|00000cf0| 73 79 73 74 65 6d 73 2c | 20 77 69 74 68 0a 58 23 |systems,| with.X#|
|00000d00| 69 66 64 65 66 73 2c 20 | 61 72 65 20 73 6f 6c 69 |ifdefs, |are soli|
|00000d10| 63 69 74 65 64 2e 20 20 | 49 20 73 65 65 6d 20 74 |cited. |I seem t|
|00000d20| 6f 20 72 65 63 61 6c 6c | 20 74 68 61 74 20 63 6f |o recall| that co|
|00000d30| 6f 6b 69 65 20 77 6f 72 | 6b 73 20 61 73 2d 69 73 |okie wor|ks as-is|
|00000d40| 20 6f 6e 20 74 68 65 20 | 41 6d 69 67 61 2e 0a 58 | on the |Amiga..X|
|00000d50| 0a 58 54 6f 20 75 73 65 | 2c 20 75 6e 73 68 61 72 |.XTo use|, unshar|
|00000d60| 20 74 68 69 73 20 61 72 | 63 68 69 76 65 20 61 6e | this ar|chive an|
|00000d70| 64 20 64 6f 20 61 20 27 | 6d 61 6b 65 27 20 74 6f |d do a '|make' to|
|00000d80| 20 63 6f 6d 70 69 6c 65 | 20 27 63 6f 6f 6b 69 65 | compile| 'cookie|
|00000d90| 27 20 61 6e 64 20 27 63 | 6f 6f 6b 68 61 73 68 27 |' and 'c|ookhash'|
|00000da0| 2e 0a 58 0a 58 54 68 65 | 6e 20 63 6f 6c 6c 65 63 |..X.XThe|n collec|
|00000db0| 74 20 61 20 62 75 6e 63 | 68 20 6f 66 20 63 6f 6f |t a bunc|h of coo|
|00000dc0| 6b 69 65 73 2e 20 20 45 | 72 69 63 20 54 6f 77 6e |kies. E|ric Town|
|00000dd0| 73 65 6e 64 20 6a 75 73 | 74 20 70 6f 73 74 65 64 |send jus|t posted|
|00000de0| 20 71 75 69 74 65 20 61 | 20 66 65 77 20 74 6f 0a | quite a| few to.|
|00000df0| 58 61 6c 74 2e 73 6f 75 | 72 63 65 73 2e 20 20 49 |Xalt.sou|rces. I|
|00000e00| 20 77 69 6c 6c 20 62 65 | 20 70 6f 73 74 69 6e 67 | will be| posting|
|00000e10| 20 61 20 63 6f 75 70 6c | 65 20 6f 66 20 6e 65 77 | a coupl|e of new|
|00000e20| 20 62 61 74 63 68 65 73 | 2e 20 20 49 20 68 6f 70 | batches|. I hop|
|00000e30| 65 20 74 6f 20 70 6f 73 | 74 0a 58 69 6e 66 6f 72 |e to pos|t.Xinfor|
|00000e40| 6d 61 74 69 6f 6e 20 73 | 6f 6f 6e 20 74 6f 20 61 |mation s|oon to a|
|00000e50| 6c 74 2e 73 6f 75 72 63 | 65 73 2e 64 20 61 73 20 |lt.sourc|es.d as |
|00000e60| 74 6f 20 77 68 65 72 65 | 20 61 6e 20 61 72 63 68 |to where| an arch|
|00000e70| 69 76 65 20 73 69 74 65 | 20 66 6f 72 20 61 6c 6c |ive site| for all|
|00000e80| 20 6d 79 0a 58 63 6f 6f | 6b 69 65 73 20 28 70 75 | my.Xcoo|kies (pu|
|00000e90| 73 68 69 6e 67 20 35 30 | 30 20 4b 42 29 20 63 61 |shing 50|0 KB) ca|
|00000ea0| 6e 20 62 65 20 66 6f 75 | 6e 64 2e 0a 58 0a 58 43 |n be fou|nd..X.XC|
|00000eb0| 6f 6f 6b 69 65 73 20 61 | 72 65 20 73 65 70 61 72 |ookies a|re separ|
|00000ec0| 61 74 65 64 20 62 79 20 | 6c 69 6e 65 73 20 63 6f |ated by |lines co|
|00000ed0| 6e 74 61 69 6e 69 6e 67 | 20 74 77 6f 20 70 65 72 |ntaining| two per|
|00000ee0| 63 65 6e 74 2d 73 69 67 | 6e 73 20 61 6e 64 20 6e |cent-sig|ns and n|
|00000ef0| 6f 74 68 69 6e 67 0a 58 | 65 6c 73 65 2c 20 66 6f |othing.X|else, fo|
|00000f00| 72 20 65 78 61 6d 70 6c | 65 3a 0a 58 0a 58 22 49 |r exampl|e:.X.X"I|
|00000f10| 20 6a 75 73 74 20 74 68 | 6f 75 67 68 74 20 6f 66 | just th|ought of|
|00000f20| 20 73 6f 6d 65 74 68 69 | 6e 67 20 66 75 6e 6e 79 | somethi|ng funny|
|00000f30| 2c 20 79 6f 75 72 20 6d | 6f 74 68 65 72 2e 22 0a |, your m|other.".|
|00000f40| 58 2d 2d 20 43 68 65 65 | 63 68 20 4d 61 72 69 6e |X-- Chee|ch Marin|
|00000f50| 0a 58 25 25 0a 58 22 48 | 65 20 63 61 6e 20 73 68 |.X%%.X"H|e can sh|
|00000f60| 6f 75 74 2c 20 64 6f 6e | 27 74 20 68 65 61 72 20 |out, don|'t hear |
|00000f70| 79 6f 75 2e 22 0a 58 2d | 2d 20 54 68 65 20 46 69 |you.".X-|- The Fi|
|00000f80| 72 65 73 69 67 6e 20 54 | 68 65 61 74 72 65 0a 58 |resign T|heatre.X|
|00000f90| 25 25 0a 58 0a 58 2e 2e | 2e 61 6e 64 20 73 6f 20 |%%.X.X..|.and so |
|00000fa0| 66 6f 72 74 68 2e 0a 58 | 0a 58 54 68 65 20 69 6e |forth..X|.XThe in|
|00000fb0| 63 6c 75 64 65 20 66 69 | 6c 65 20 22 63 6f 6f 6b |clude fi|le "cook|
|00000fc0| 69 65 2e 68 22 20 64 65 | 66 69 6e 65 73 20 74 68 |ie.h" de|fines th|
|00000fd0| 65 20 6c 6f 63 61 74 69 | 6f 6e 20 6f 66 20 74 68 |e locati|on of th|
|00000fe0| 65 20 63 6f 6f 6b 69 65 | 20 66 69 6c 65 20 61 73 |e cookie| file as|
|00000ff0| 20 62 65 69 6e 67 0a 58 | 22 2f 75 73 72 2f 6c 6f | being.X|"/usr/lo|
|00001000| 63 61 6c 2f 6c 69 62 2f | 73 61 79 69 6e 67 73 22 |cal/lib/|sayings"|
|00001010| 2e 20 20 49 66 20 79 6f | 75 20 77 61 6e 74 20 74 |. If yo|u want t|
|00001020| 6f 20 70 75 74 20 69 74 | 20 65 6c 73 65 77 68 65 |o put it| elsewhe|
|00001030| 72 65 2c 20 63 68 61 6e | 67 65 20 63 6f 6f 6b 69 |re, chan|ge cooki|
|00001040| 65 2e 68 0a 58 61 6e 64 | 20 72 65 62 75 69 6c 64 |e.h.Xand| rebuild|
|00001050| 20 27 63 6f 6f 6b 69 65 | 27 2e 20 20 0a 58 0a 58 | 'cookie|'. .X.X|
|00001060| 43 6f 6f 6b 69 65 20 6e | 65 65 64 73 20 61 20 68 |Cookie n|eeds a h|
|00001070| 61 73 68 20 66 69 6c 65 | 20 66 6f 72 20 74 68 65 |ash file| for the|
|00001080| 20 63 6f 6f 6b 69 65 20 | 66 69 6c 65 2c 20 62 79 | cookie |file, by|
|00001090| 20 64 65 66 61 75 6c 74 | 20 63 61 6c 6c 65 64 0a | default| called.|
|000010a0| 58 22 2f 75 73 72 2f 6c | 6f 63 61 6c 2f 6c 69 62 |X"/usr/l|ocal/lib|
|000010b0| 2f 73 61 79 68 61 73 68 | 22 2e 20 20 54 68 69 73 |/sayhash|". This|
|000010c0| 20 69 73 20 63 72 65 61 | 74 65 64 20 62 79 20 74 | is crea|ted by t|
|000010d0| 68 65 20 27 63 6f 6f 6b | 68 61 73 68 27 20 70 72 |he 'cook|hash' pr|
|000010e0| 6f 67 72 61 6d 2e 0a 58 | 43 6f 6f 6b 68 61 73 68 |ogram..X|Cookhash|
|000010f0| 20 69 73 20 73 69 6d 70 | 6c 79 20 61 20 66 69 6c | is simp|ly a fil|
|00001100| 74 65 72 20 74 68 61 74 | 20 72 65 61 64 73 20 61 |ter that| reads a|
|00001110| 20 63 6f 6f 6b 69 65 20 | 66 69 6c 65 20 69 6e 20 | cookie |file in |
|00001120| 61 73 20 73 74 64 69 6e | 20 61 6e 64 20 77 72 69 |as stdin| and wri|
|00001130| 74 65 73 0a 58 61 20 63 | 6f 6f 6b 69 65 20 68 61 |tes.Xa c|ookie ha|
|00001140| 73 68 20 66 69 6c 65 20 | 74 6f 20 73 74 64 6f 75 |sh file |to stdou|
|00001150| 74 2e 20 20 54 68 75 73 | 2c 20 69 66 20 79 6f 75 |t. Thus|, if you|
|00001160| 27 76 65 20 6d 6f 76 65 | 64 20 74 68 65 20 63 6f |'ve move|d the co|
|00001170| 6f 6b 69 65 20 66 69 6c | 65 20 74 6f 0a 58 2f 75 |okie fil|e to.X/u|
|00001180| 73 72 2f 6c 6f 63 61 6c | 2f 6c 69 62 2c 20 27 63 |sr/local|/lib, 'c|
|00001190| 64 27 20 74 68 65 72 65 | 20 61 6e 64 20 64 6f 20 |d' there| and do |
|000011a0| 61 20 22 63 6f 6f 6b 68 | 61 73 68 20 3c 73 61 79 |a "cookh|ash <say|
|000011b0| 69 6e 67 73 20 3e 73 61 | 79 68 61 73 68 22 20 74 |ings >sa|yhash" t|
|000011c0| 6f 20 63 72 65 61 74 65 | 20 74 68 65 20 0a 58 68 |o create| the .Xh|
|000011d0| 61 73 68 20 66 69 6c 65 | 2e 0a 58 0a 58 41 66 74 |ash file|..X.XAft|
|000011e0| 65 72 20 74 68 61 74 2c | 20 27 63 6f 6f 6b 69 65 |er that,| 'cookie|
|000011f0| 27 20 73 68 6f 75 6c 64 | 20 70 72 6f 64 75 63 65 |' should| produce|
|00001200| 20 61 20 63 6f 6f 6b 69 | 65 2e 20 20 43 6f 6f 6b | a cooki|e. Cook|
|00001210| 69 65 20 63 61 6e 20 61 | 6c 73 6f 20 62 65 20 65 |ie can a|lso be e|
|00001220| 78 65 63 75 74 65 64 0a | 58 77 69 74 68 20 74 77 |xecuted.|Xwith tw|
|00001230| 6f 20 61 72 67 75 6d 65 | 6e 74 73 2c 20 74 68 65 |o argume|nts, the|
|00001240| 20 6e 61 6d 65 20 6f 66 | 20 61 20 63 6f 6f 6b 69 | name of| a cooki|
|00001250| 65 20 66 69 6c 65 20 66 | 6f 6c 6c 6f 77 65 64 20 |e file f|ollowed |
|00001260| 62 79 20 74 68 65 20 6e | 61 6d 65 20 6f 66 0a 58 |by the n|ame of.X|
|00001270| 69 74 73 20 68 61 73 68 | 20 66 69 6c 65 2c 20 75 |its hash| file, u|
|00001280| 73 65 66 75 6c 20 66 6f | 72 20 63 72 65 61 74 69 |seful fo|r creati|
|00001290| 6e 67 20 61 6c 69 61 73 | 65 73 20 66 6f 72 20 61 |ng alias|es for a|
|000012a0| 6c 74 65 72 6e 61 74 65 | 20 63 6f 6f 6b 69 65 20 |lternate| cookie |
|000012b0| 66 69 6c 65 73 20 73 6f | 0a 58 79 6f 75 20 63 61 |files so|.Xyou ca|
|000012c0| 6e 20 67 65 74 20 6a 75 | 73 74 20 5a 69 70 70 79 |n get ju|st Zippy|
|000012d0| 20 74 68 65 20 50 69 6e | 68 65 61 64 20 71 75 6f | the Pin|head quo|
|000012e0| 74 65 73 2c 20 66 6f 72 | 20 65 78 61 6d 70 6c 65 |tes, for| example|
|000012f0| 2e 0a 58 0a 58 49 66 20 | 79 6f 75 20 66 69 6e 64 |..X.XIf |you find|
|00001300| 20 71 75 6f 74 65 73 20 | 69 6e 20 74 68 65 20 66 | quotes |in the f|
|00001310| 69 6c 65 20 74 68 61 74 | 20 61 72 65 20 75 6e 61 |ile that| are una|
|00001320| 74 74 72 69 62 75 74 65 | 64 20 61 6e 64 20 79 6f |ttribute|d and yo|
|00001330| 75 20 6b 6e 6f 77 20 74 | 68 65 0a 58 61 74 74 72 |u know t|he.Xattr|
|00001340| 69 62 75 74 69 6f 6e 73 | 2c 20 70 6c 65 61 73 65 |ibutions|, please|
|00001350| 20 6d 61 69 6c 20 74 68 | 65 6d 20 74 6f 20 6b 61 | mail th|em to ka|
|00001360| 72 6c 40 73 75 67 61 72 | 2e 68 61 63 6b 65 72 63 |rl@sugar|.hackerc|
|00001370| 6f 72 70 2e 63 6f 6d 20 | 6f 72 0a 58 75 75 6e 65 |orp.com |or.Xuune|
|00001380| 74 21 73 75 67 61 72 21 | 6b 61 72 6c 0a 58 0a 58 |t!sugar!|karl.X.X|
|00001390| 49 20 61 6c 73 6f 20 63 | 6f 6c 6c 65 63 74 20 63 |I also c|ollect c|
|000013a0| 6f 6f 6b 69 65 73 2e 20 | 20 49 66 20 79 6f 75 20 |ookies. | If you |
|000013b0| 73 65 65 20 67 6f 6f 64 | 20 6f 6e 65 73 2c 20 70 |see good| ones, p|
|000013c0| 6c 65 61 73 65 20 66 6f | 72 77 61 72 64 20 74 68 |lease fo|rward th|
|000013d0| 65 6d 2e 20 20 28 49 66 | 20 79 6f 75 0a 58 67 6f |em. (If| you.Xgo|
|000013e0| 74 20 74 68 65 6d 20 66 | 72 6f 6d 20 6d 65 2c 20 |t them f|rom me, |
|000013f0| 70 6c 65 61 73 65 20 64 | 6f 6e 27 74 21 29 0a 58 |please d|on't!).X|
|00001400| 0a 58 41 20 6c 6f 74 20 | 6f 66 20 70 65 6f 70 6c |.XA lot |of peopl|
|00001410| 65 20 74 68 69 6e 6b 20 | 69 74 27 73 20 66 75 6e |e think |it's fun|
|00001420| 20 74 6f 20 67 65 74 20 | 61 20 63 6f 6f 6b 69 65 | to get |a cookie|
|00001430| 20 65 76 65 72 79 20 74 | 69 6d 65 20 74 68 65 79 | every t|ime they|
|00001440| 20 6c 6f 67 20 69 6e 2c | 20 73 6f 20 0a 58 74 68 | log in,| so .Xth|
|00001450| 65 79 20 70 75 74 20 22 | 63 6f 6f 6b 69 65 22 20 |ey put "|cookie" |
|00001460| 69 6e 20 74 68 65 69 72 | 20 2e 70 72 6f 66 69 6c |in their| .profil|
|00001470| 65 20 6f 72 20 2e 6c 6f | 67 69 6e 20 66 69 6c 65 |e or .lo|gin file|
|00001480| 2e 0a 58 0a 58 52 65 67 | 61 72 64 73 2c 0a 58 4b |..X.XReg|ards,.XK|
|00001490| 61 72 6c 20 28 6b 61 72 | 6c 40 73 75 67 61 72 2e |arl (kar|l@sugar.|
|000014a0| 68 61 63 6b 65 72 63 6f | 72 70 2e 63 6f 6d 29 20 |hackerco|rp.com) |
|000014b0| 40 20 54 68 65 20 48 61 | 63 6b 65 72 27 73 20 48 |@ The Ha|cker's H|
|000014c0| 61 76 65 6e 2c 20 4d 69 | 73 73 6f 75 72 69 20 43 |aven, Mi|ssouri C|
|000014d0| 69 74 79 2c 20 54 65 78 | 61 73 20 0a 58 28 54 68 |ity, Tex|as .X(Th|
|000014e0| 65 20 6e 61 6d 65 20 77 | 69 6c 6c 20 62 65 20 63 |e name w|ill be c|
|000014f0| 68 61 6e 67 69 6e 67 20 | 62 65 63 61 75 73 65 20 |hanging |because |
|00001500| 68 61 63 6b 65 72 20 68 | 61 73 20 6c 6f 73 74 20 |hacker h|as lost |
|00001510| 69 74 73 20 6f 6c 64 20 | 6d 65 61 6e 69 6e 67 20 |its old |meaning |
|00001520| 2d 2d 20 73 69 67 68 29 | 0a 45 4e 44 5f 4f 46 5f |-- sigh)|.END_OF_|
|00001530| 46 49 4c 45 0a 69 66 20 | 74 65 73 74 20 33 38 35 |FILE.if |test 385|
|00001540| 38 20 2d 6e 65 20 60 77 | 63 20 2d 63 20 3c 27 52 |8 -ne `w|c -c <'R|
|00001550| 45 41 44 4d 45 27 60 3b | 20 74 68 65 6e 0a 20 20 |EADME'`;| then. |
|00001560| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 5c 22 27 | echo s|har: \"'|
|00001570| 52 45 41 44 4d 45 27 5c | 22 20 75 6e 70 61 63 6b |README'\|" unpack|
|00001580| 65 64 20 77 69 74 68 20 | 77 72 6f 6e 67 20 73 69 |ed with |wrong si|
|00001590| 7a 65 21 0a 66 69 0a 23 | 20 65 6e 64 20 6f 66 20 |ze!.fi.#| end of |
|000015a0| 27 52 45 41 44 4d 45 27 | 0a 66 69 0a 69 66 20 74 |'README'|.fi.if t|
|000015b0| 65 73 74 20 2d 66 20 27 | 63 6f 6f 6b 69 65 2e 31 |est -f '|cookie.1|
|000015c0| 27 20 2d 61 20 22 24 7b | 31 7d 22 20 21 3d 20 22 |' -a "${|1}" != "|
|000015d0| 2d 63 22 20 3b 20 74 68 | 65 6e 20 0a 20 20 65 63 |-c" ; th|en . ec|
|000015e0| 68 6f 20 73 68 61 72 3a | 20 57 69 6c 6c 20 6e 6f |ho shar:| Will no|
|000015f0| 74 20 63 6c 6f 62 62 65 | 72 20 65 78 69 73 74 69 |t clobbe|r existi|
|00001600| 6e 67 20 66 69 6c 65 20 | 5c 22 27 63 6f 6f 6b 69 |ng file |\"'cooki|
|00001610| 65 2e 31 27 5c 22 0a 65 | 6c 73 65 0a 65 63 68 6f |e.1'\".e|lse.echo|
|00001620| 20 73 68 61 72 3a 20 45 | 78 74 72 61 63 74 69 6e | shar: E|xtractin|
|00001630| 67 20 5c 22 27 63 6f 6f | 6b 69 65 2e 31 27 5c 22 |g \"'coo|kie.1'\"|
|00001640| 20 5c 28 31 30 33 33 20 | 63 68 61 72 61 63 74 65 | \(1033 |characte|
|00001650| 72 73 5c 29 0a 73 65 64 | 20 22 73 2f 5e 58 2f 2f |rs\).sed| "s/^X//|
|00001660| 22 20 3e 27 63 6f 6f 6b | 69 65 2e 31 27 20 3c 3c |" >'cook|ie.1' <<|
|00001670| 27 45 4e 44 5f 4f 46 5f | 46 49 4c 45 27 0a 58 2e |'END_OF_|FILE'.X.|
|00001680| 54 48 20 43 4f 4f 4b 49 | 45 20 36 0a 58 2e 53 48 |TH COOKI|E 6.X.SH|
|00001690| 20 4e 41 4d 45 0a 58 63 | 6f 6f 6b 69 65 20 5c 2d | NAME.Xc|ookie \-|
|000016a0| 20 73 68 6f 77 20 61 20 | 66 6f 72 74 75 6e 65 20 | show a |fortune |
|000016b0| 63 6f 6f 6b 69 65 0a 58 | 2e 53 48 20 53 59 4e 4f |cookie.X|.SH SYNO|
|000016c0| 50 53 49 53 0a 58 2e 42 | 20 63 6f 6f 6b 69 65 0a |PSIS.X.B| cookie.|
|000016d0| 58 5b 20 63 6f 6f 6b 69 | 65 2d 66 69 6c 65 20 68 |X[ cooki|e-file h|
|000016e0| 61 73 68 2d 66 69 6c 65 | 20 5d 0a 58 2e 73 70 0a |ash-file| ].X.sp.|
|000016f0| 58 2e 42 20 2f 75 73 72 | 2f 6c 6f 63 61 6c 2f 6c |X.B /usr|/local/l|
|00001700| 69 62 2f 63 6f 6f 6b 68 | 61 73 68 0a 58 3c 20 73 |ib/cookh|ash.X< s|
|00001710| 61 79 69 6e 67 73 20 3e | 20 68 61 73 68 2d 66 69 |ayings >| hash-fi|
|00001720| 6c 65 0a 58 2e 53 48 20 | 44 45 53 43 52 49 50 54 |le.X.SH |DESCRIPT|
|00001730| 49 4f 4e 0a 58 2e 49 20 | 43 6f 6f 6b 69 65 0a 58 |ION.X.I |Cookie.X|
|00001740| 73 68 6f 77 73 20 74 68 | 65 20 75 73 65 72 20 61 |shows th|e user a|
|00001750| 20 72 61 6e 64 6f 6d 6c | 79 20 63 68 6f 73 65 6e | randoml|y chosen|
|00001760| 20 71 75 6f 74 65 20 66 | 72 6f 6d 20 61 20 66 69 | quote f|rom a fi|
|00001770| 6c 65 20 63 6f 6e 74 61 | 69 6e 69 6e 67 0a 58 66 |le conta|ining.Xf|
|00001780| 6f 72 74 75 6e 65 20 63 | 6f 6f 6b 69 65 73 2c 20 |ortune c|ookies, |
|00001790| 73 61 79 69 6e 67 73 2c | 20 6a 6f 6b 65 73 2c 20 |sayings,| jokes, |
|000017a0| 61 70 68 6f 72 69 73 6d | 73 2c 20 71 75 6f 74 65 |aphorism|s, quote|
|000017b0| 73 20 61 6e 64 20 73 6f | 20 6f 6e 2e 0a 58 2e 50 |s and so| on..X.P|
|000017c0| 0a 58 43 6f 6f 6b 69 65 | 20 63 61 6e 20 61 6c 73 |.XCookie| can als|
|000017d0| 6f 20 62 65 20 65 78 65 | 63 75 74 65 64 20 77 69 |o be exe|cuted wi|
|000017e0| 74 68 20 74 77 6f 20 61 | 72 67 75 6d 65 6e 74 73 |th two a|rguments|
|000017f0| 2c 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 61 20 |, the na|me of a |
|00001800| 63 6f 6f 6b 69 65 20 66 | 69 6c 65 0a 58 66 6f 6c |cookie f|ile.Xfol|
|00001810| 6c 6f 77 65 64 20 62 79 | 20 74 68 65 20 6e 61 6d |lowed by| the nam|
|00001820| 65 20 6f 66 20 69 74 73 | 20 68 61 73 68 20 66 69 |e of its| hash fi|
|00001830| 6c 65 2e 0a 58 2e 50 0a | 58 54 6f 20 63 72 65 61 |le..X.P.|XTo crea|
|00001840| 74 65 20 74 68 65 20 68 | 61 73 68 20 66 69 6c 65 |te the h|ash file|
|00001850| 2c 20 75 73 65 0a 58 2e | 49 20 2f 75 73 72 2f 6c |, use.X.|I /usr/l|
|00001860| 6f 63 61 6c 2f 6c 69 62 | 2f 63 6f 6f 6b 68 61 73 |ocal/lib|/cookhas|
|00001870| 68 0a 58 77 68 69 63 68 | 20 72 65 61 64 73 20 74 |h.Xwhich| reads t|
|00001880| 68 65 20 73 61 79 69 6e | 67 73 20 66 72 6f 6d 20 |he sayin|gs from |
|00001890| 73 74 61 6e 64 61 72 64 | 20 69 6e 70 75 74 20 61 |standard| input a|
|000018a0| 6e 64 20 77 72 69 74 65 | 73 20 74 68 65 20 68 61 |nd write|s the ha|
|000018b0| 73 68 20 76 61 6c 75 65 | 73 20 74 6f 0a 58 73 74 |sh value|s to.Xst|
|000018c0| 61 6e 64 61 72 64 20 6f | 75 74 70 75 74 2e 20 28 |andard o|utput. (|
|000018d0| 54 68 65 20 68 61 73 68 | 20 66 69 6c 65 20 63 6f |The hash| file co|
|000018e0| 6e 74 61 69 6e 73 20 74 | 68 65 20 41 53 43 49 49 |ntains t|he ASCII|
|000018f0| 2d 66 6f 72 6d 61 74 74 | 65 64 20 61 64 64 72 65 |-formatt|ed addre|
|00001900| 73 73 65 73 20 6f 66 0a | 58 74 68 65 20 63 6f 6f |sses of.|Xthe coo|
|00001910| 6b 69 65 73 20 66 6f 75 | 6e 64 20 69 6e 20 74 68 |kies fou|nd in th|
|00001920| 65 20 63 6f 6f 6b 69 65 | 20 66 69 6c 65 2e 20 20 |e cookie| file. |
|00001930| 49 74 20 69 73 20 75 73 | 65 64 20 62 79 20 0a 58 |It is us|ed by .X|
|00001940| 2e 49 20 63 6f 6f 6b 69 | 65 0a 58 74 6f 20 6c 6f |.I cooki|e.Xto lo|
|00001950| 6f 6b 20 75 70 20 63 6f | 6f 6b 69 65 73 20 71 75 |ok up co|okies qu|
|00001960| 69 63 6b 6c 79 20 61 6e | 64 20 74 6f 20 68 65 6c |ickly an|d to hel|
|00001970| 70 20 74 6f 20 69 6e 73 | 75 72 65 20 74 68 61 74 |p to ins|ure that|
|00001980| 20 61 6c 6c 20 63 6f 6f | 6b 69 65 73 20 61 72 65 | all coo|kies are|
|00001990| 0a 58 65 71 75 61 6c 6c | 79 20 6c 69 6b 65 6c 79 |.Xequall|y likely|
|000019a0| 20 74 6f 20 62 65 20 63 | 68 6f 73 65 6e 2e 29 0a | to be c|hosen.).|
|000019b0| 58 2e 50 0a 58 53 61 79 | 69 6e 67 73 20 77 69 74 |X.P.XSay|ings wit|
|000019c0| 68 69 6e 20 74 68 65 20 | 69 6e 70 75 74 20 66 69 |hin the |input fi|
|000019d0| 6c 65 20 61 72 65 20 73 | 65 70 61 72 61 74 65 64 |le are s|eparated|
|000019e0| 20 62 79 20 6c 69 6e 65 | 73 20 63 6f 6e 74 61 69 | by line|s contai|
|000019f0| 6e 69 6e 67 20 0a 58 2e | 42 20 25 25 20 2e 0a 58 |ning .X.|B %% ..X|
|00001a00| 2e 53 48 20 53 45 45 20 | 41 4c 53 4f 0a 58 66 6f |.SH SEE |ALSO.Xfo|
|00001a10| 72 74 75 6e 65 28 36 29 | 0a 58 2e 53 48 20 46 49 |rtune(6)|.X.SH FI|
|00001a20| 4c 45 53 0a 58 2f 75 73 | 72 2f 6c 6f 63 61 6c 2f |LES.X/us|r/local/|
|00001a30| 6c 69 62 2f 73 61 79 69 | 6e 67 73 2c 20 2f 75 73 |lib/sayi|ngs, /us|
|00001a40| 72 2f 6c 6f 63 61 6c 2f | 6c 69 62 2f 73 61 79 68 |r/local/|lib/sayh|
|00001a50| 61 73 68 0a 58 2e 53 48 | 20 41 55 54 48 4f 52 0a |ash.X.SH| AUTHOR.|
|00001a60| 58 4b 61 72 6c 20 4c 65 | 68 65 6e 62 61 75 65 72 |XKarl Le|henbauer|
|00001a70| 20 28 6b 61 72 6c 40 73 | 75 67 61 72 2e 68 61 63 | (karl@s|ugar.hac|
|00001a80| 6b 65 72 63 6f 72 70 2e | 63 6f 6d 29 2c 0a 58 4d |kercorp.|com),.XM|
|00001a90| 69 73 73 6f 75 72 69 20 | 43 69 74 79 2c 20 54 65 |issouri |City, Te|
|00001aa0| 78 61 73 2c 20 55 53 41 | 0a 58 0a 45 4e 44 5f 4f |xas, USA|.X.END_O|
|00001ab0| 46 5f 46 49 4c 45 0a 69 | 66 20 74 65 73 74 20 31 |F_FILE.i|f test 1|
|00001ac0| 30 33 33 20 2d 6e 65 20 | 60 77 63 20 2d 63 20 3c |033 -ne |`wc -c <|
|00001ad0| 27 63 6f 6f 6b 69 65 2e | 31 27 60 3b 20 74 68 65 |'cookie.|1'`; the|
|00001ae0| 6e 0a 20 20 20 20 65 63 | 68 6f 20 73 68 61 72 3a |n. ec|ho shar:|
|00001af0| 20 5c 22 27 63 6f 6f 6b | 69 65 2e 31 27 5c 22 20 | \"'cook|ie.1'\" |
|00001b00| 75 6e 70 61 63 6b 65 64 | 20 77 69 74 68 20 77 72 |unpacked| with wr|
|00001b10| 6f 6e 67 20 73 69 7a 65 | 21 0a 66 69 0a 23 20 65 |ong size|!.fi.# e|
|00001b20| 6e 64 20 6f 66 20 27 63 | 6f 6f 6b 69 65 2e 31 27 |nd of 'c|ookie.1'|
|00001b30| 0a 66 69 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |.fi.if t|est -f '|
|00001b40| 4d 61 6b 65 66 69 6c 65 | 27 20 2d 61 20 22 24 7b |Makefile|' -a "${|
|00001b50| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|00001b60| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|00001b70| 20 57 69 6c 6c 20 6e 6f | 74 20 63 6c 6f 62 62 65 | Will no|t clobbe|
|00001b80| 72 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |r existi|ng file |
|00001b90| 5c 22 27 4d 61 6b 65 66 | 69 6c 65 27 5c 22 0a 65 |\"'Makef|ile'\".e|
|00001ba0| 6c 73 65 0a 65 63 68 6f | 20 73 68 61 72 3a 20 45 |lse.echo| shar: E|
|00001bb0| 78 74 72 61 63 74 69 6e | 67 20 5c 22 27 4d 61 6b |xtractin|g \"'Mak|
|00001bc0| 65 66 69 6c 65 27 5c 22 | 20 5c 28 32 30 30 20 63 |efile'\"| \(200 c|
|00001bd0| 68 61 72 61 63 74 65 72 | 73 5c 29 0a 73 65 64 20 |haracter|s\).sed |
|00001be0| 22 73 2f 5e 58 2f 2f 22 | 20 3e 27 4d 61 6b 65 66 |"s/^X//"| >'Makef|
|00001bf0| 69 6c 65 27 20 3c 3c 27 | 45 4e 44 5f 4f 46 5f 46 |ile' <<'|END_OF_F|
|00001c00| 49 4c 45 27 0a 58 23 20 | 6d 61 6b 65 66 69 6c 65 |ILE'.X# |makefile|
|00001c10| 20 66 6f 72 20 6b 61 72 | 6c 27 73 20 50 44 20 66 | for kar|l's PD f|
|00001c20| 6f 72 74 75 6e 65 20 63 | 6f 6f 6b 69 65 20 70 72 |ortune c|ookie pr|
|00001c30| 6f 67 72 61 6d 0a 58 0a | 58 61 6c 6c 3a 09 63 6f |ogram.X.|Xall:.co|
|00001c40| 6f 6b 69 65 20 63 6f 6f | 6b 68 61 73 68 0a 58 0a |okie coo|khash.X.|
|00001c50| 58 63 6f 6f 6b 69 65 3a | 09 63 6f 6f 6b 69 65 2e |Xcookie:|.cookie.|
|00001c60| 68 0a 58 09 63 63 20 2d | 4f 20 2d 6f 20 63 6f 6f |h.X.cc -|O -o coo|
|00001c70| 6b 69 65 20 63 6f 6f 6b | 69 65 2e 63 0a 58 0a 58 |kie cook|ie.c.X.X|
|00001c80| 63 6f 6f 6b 68 61 73 68 | 3a 0a 58 09 63 63 20 2d |cookhash|:.X.cc -|
|00001c90| 4f 20 2d 6f 20 63 6f 6f | 6b 68 61 73 68 20 63 6f |O -o coo|khash co|
|00001ca0| 6f 6b 68 61 73 68 2e 63 | 0a 58 0a 58 69 6e 73 74 |okhash.c|.X.Xinst|
|00001cb0| 61 6c 6c 3a 0a 58 09 63 | 70 20 63 6f 6f 6b 69 65 |all:.X.c|p cookie|
|00001cc0| 20 63 6f 6f 6b 68 61 73 | 68 20 2f 75 73 72 2f 6c | cookhas|h /usr/l|
|00001cd0| 6f 63 61 6c 2f 62 69 6e | 0a 45 4e 44 5f 4f 46 5f |ocal/bin|.END_OF_|
|00001ce0| 46 49 4c 45 0a 69 66 20 | 74 65 73 74 20 32 30 30 |FILE.if |test 200|
|00001cf0| 20 2d 6e 65 20 60 77 63 | 20 2d 63 20 3c 27 4d 61 | -ne `wc| -c <'Ma|
|00001d00| 6b 65 66 69 6c 65 27 60 | 3b 20 74 68 65 6e 0a 20 |kefile'`|; then. |
|00001d10| 20 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 5c 22 | echo |shar: \"|
|00001d20| 27 4d 61 6b 65 66 69 6c | 65 27 5c 22 20 75 6e 70 |'Makefil|e'\" unp|
|00001d30| 61 63 6b 65 64 20 77 69 | 74 68 20 77 72 6f 6e 67 |acked wi|th wrong|
|00001d40| 20 73 69 7a 65 21 0a 66 | 69 0a 23 20 65 6e 64 20 | size!.f|i.# end |
|00001d50| 6f 66 20 27 4d 61 6b 65 | 66 69 6c 65 27 0a 66 69 |of 'Make|file'.fi|
|00001d60| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 63 6f 6f |.if test| -f 'coo|
|00001d70| 6b 69 65 2e 68 27 20 2d | 61 20 22 24 7b 31 7d 22 |kie.h' -|a "${1}"|
|00001d80| 20 21 3d 20 22 2d 63 22 | 20 3b 20 74 68 65 6e 20 | != "-c"| ; then |
|00001d90| 0a 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 57 69 |. echo |shar: Wi|
|00001da0| 6c 6c 20 6e 6f 74 20 63 | 6c 6f 62 62 65 72 20 65 |ll not c|lobber e|
|00001db0| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 5c 22 27 |xisting |file \"'|
|00001dc0| 63 6f 6f 6b 69 65 2e 68 | 27 5c 22 0a 65 6c 73 65 |cookie.h|'\".else|
|00001dd0| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 45 78 74 72 |.echo sh|ar: Extr|
|00001de0| 61 63 74 69 6e 67 20 5c | 22 27 63 6f 6f 6b 69 65 |acting \|"'cookie|
|00001df0| 2e 68 27 5c 22 20 5c 28 | 32 36 33 20 63 68 61 72 |.h'\" \(|263 char|
|00001e00| 61 63 74 65 72 73 5c 29 | 0a 73 65 64 20 22 73 2f |acters\)|.sed "s/|
|00001e10| 5e 58 2f 2f 22 20 3e 27 | 63 6f 6f 6b 69 65 2e 68 |^X//" >'|cookie.h|
|00001e20| 27 20 3c 3c 27 45 4e 44 | 5f 4f 46 5f 46 49 4c 45 |' <<'END|_OF_FILE|
|00001e30| 27 0a 58 2f 2a 20 63 6f | 6f 6b 69 65 2e 68 20 2d |'.X/* co|okie.h -|
|00001e40| 20 69 6e 63 6c 75 64 65 | 20 66 69 6c 65 20 66 6f | include| file fo|
|00001e50| 72 20 6b 61 72 6c 27 73 | 20 50 44 20 66 6f 72 74 |r karl's| PD fort|
|00001e60| 75 6e 65 20 63 6f 6f 6b | 69 65 20 70 72 6f 67 72 |une cook|ie progr|
|00001e70| 61 6d 20 0a 58 20 2a 20 | 62 79 20 4b 61 72 6c 20 |am .X * |by Karl |
|00001e80| 4c 65 68 65 6e 62 61 75 | 65 72 20 28 6b 61 72 6c |Lehenbau|er (karl|
|00001e90| 40 73 75 67 61 72 2e 75 | 75 2e 6e 65 74 2c 20 75 |@sugar.u|u.net, u|
|00001ea0| 75 6e 65 74 21 73 75 67 | 61 72 21 6b 61 72 6c 29 |unet!sug|ar!karl)|
|00001eb0| 0a 58 20 2a 20 63 6f 6f | 6b 69 65 2e 68 20 31 2e |.X * coo|kie.h 1.|
|00001ec0| 31 20 31 2f 31 32 2f 38 | 39 0a 58 20 2a 2f 0a 58 |1 1/12/8|9.X */.X|
|00001ed0| 0a 58 23 64 65 66 69 6e | 65 20 43 4f 4f 4b 49 45 |.X#defin|e COOKIE|
|00001ee0| 46 49 4c 45 20 22 2f 75 | 73 72 2f 6c 6f 63 61 6c |FILE "/u|sr/local|
|00001ef0| 2f 6c 69 62 2f 73 61 79 | 69 6e 67 73 22 0a 58 23 |/lib/say|ings".X#|
|00001f00| 64 65 66 69 6e 65 20 48 | 41 53 48 46 49 4c 45 20 |define H|ASHFILE |
|00001f10| 22 2f 75 73 72 2f 6c 6f | 63 61 6c 2f 6c 69 62 2f |"/usr/lo|cal/lib/|
|00001f20| 73 61 79 68 61 73 68 22 | 0a 58 0a 58 2f 2a 20 65 |sayhash"|.X.X/* e|
|00001f30| 6e 64 20 6f 66 20 63 6f | 6f 6b 69 65 2e 68 20 2a |nd of co|okie.h *|
|00001f40| 2f 0a 45 4e 44 5f 4f 46 | 5f 46 49 4c 45 0a 69 66 |/.END_OF|_FILE.if|
|00001f50| 20 74 65 73 74 20 32 36 | 33 20 2d 6e 65 20 60 77 | test 26|3 -ne `w|
|00001f60| 63 20 2d 63 20 3c 27 63 | 6f 6f 6b 69 65 2e 68 27 |c -c <'c|ookie.h'|
|00001f70| 60 3b 20 74 68 65 6e 0a | 20 20 20 20 65 63 68 6f |`; then.| echo|
|00001f80| 20 73 68 61 72 3a 20 5c | 22 27 63 6f 6f 6b 69 65 | shar: \|"'cookie|
|00001f90| 2e 68 27 5c 22 20 75 6e | 70 61 63 6b 65 64 20 77 |.h'\" un|packed w|
|00001fa0| 69 74 68 20 77 72 6f 6e | 67 20 73 69 7a 65 21 0a |ith wron|g size!.|
|00001fb0| 66 69 0a 23 20 65 6e 64 | 20 6f 66 20 27 63 6f 6f |fi.# end| of 'coo|
|00001fc0| 6b 69 65 2e 68 27 0a 66 | 69 0a 69 66 20 74 65 73 |kie.h'.f|i.if tes|
|00001fd0| 74 20 2d 66 20 27 63 6f | 6f 6b 69 65 2e 63 27 20 |t -f 'co|okie.c' |
|00001fe0| 2d 61 20 22 24 7b 31 7d | 22 20 21 3d 20 22 2d 63 |-a "${1}|" != "-c|
|00001ff0| 22 20 3b 20 74 68 65 6e | 20 0a 20 20 65 63 68 6f |" ; then| . echo|
|00002000| 20 73 68 61 72 3a 20 57 | 69 6c 6c 20 6e 6f 74 20 | shar: W|ill not |
|00002010| 63 6c 6f 62 62 65 72 20 | 65 78 69 73 74 69 6e 67 |clobber |existing|
|00002020| 20 66 69 6c 65 20 5c 22 | 27 63 6f 6f 6b 69 65 2e | file \"|'cookie.|
|00002030| 63 27 5c 22 0a 65 6c 73 | 65 0a 65 63 68 6f 20 73 |c'\".els|e.echo s|
|00002040| 68 61 72 3a 20 45 78 74 | 72 61 63 74 69 6e 67 20 |har: Ext|racting |
|00002050| 5c 22 27 63 6f 6f 6b 69 | 65 2e 63 27 5c 22 20 5c |\"'cooki|e.c'\" \|
|00002060| 28 32 37 30 32 20 63 68 | 61 72 61 63 74 65 72 73 |(2702 ch|aracters|
|00002070| 5c 29 0a 73 65 64 20 22 | 73 2f 5e 58 2f 2f 22 20 |\).sed "|s/^X//" |
|00002080| 3e 27 63 6f 6f 6b 69 65 | 2e 63 27 20 3c 3c 27 45 |>'cookie|.c' <<'E|
|00002090| 4e 44 5f 4f 46 5f 46 49 | 4c 45 27 0a 58 2f 2a 20 |ND_OF_FI|LE'.X/* |
|000020a0| 63 6f 6f 6b 69 65 20 2d | 20 70 72 69 6e 74 20 6f |cookie -| print o|
|000020b0| 75 74 20 61 6e 20 65 6e | 74 72 79 20 66 72 6f 6d |ut an en|try from|
|000020c0| 20 74 68 65 20 73 61 79 | 69 6e 67 73 20 66 69 6c | the say|ings fil|
|000020d0| 65 0a 58 20 2a 20 62 79 | 20 4b 61 72 6c 20 4c 65 |e.X * by| Karl Le|
|000020e0| 68 65 6e 62 61 75 65 72 | 20 28 6b 61 72 6c 40 73 |henbauer| (karl@s|
|000020f0| 75 67 61 72 2e 75 75 2e | 6e 65 74 2c 20 75 75 6e |ugar.uu.|net, uun|
|00002100| 65 74 21 73 75 67 61 72 | 21 6b 61 72 6c 29 0a 58 |et!sugar|!karl).X|
|00002110| 20 2a 20 20 63 6f 6f 6b | 69 65 2e 63 20 20 31 2e | * cook|ie.c 1.|
|00002120| 31 20 20 31 2f 31 32 2f | 38 39 0a 58 20 2a 2f 0a |1 1/12/|89.X */.|
|00002130| 58 0a 58 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |X.X#incl|ude <std|
|00002140| 69 6f 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |io.h>.X#|include |
|00002150| 22 63 6f 6f 6b 69 65 2e | 68 22 0a 58 0a 58 23 64 |"cookie.|h".X.X#d|
|00002160| 65 66 69 6e 65 20 45 4e | 54 53 49 5a 45 20 37 4c |efine EN|TSIZE 7L|
|00002170| 0a 58 23 64 65 66 69 6e | 65 20 4d 45 54 41 43 48 |.X#defin|e METACH|
|00002180| 41 52 20 27 25 27 0a 58 | 23 64 65 66 69 6e 65 20 |AR '%'.X|#define |
|00002190| 59 45 53 20 31 0a 58 23 | 64 65 66 69 6e 65 20 4e |YES 1.X#|define N|
|000021a0| 4f 20 30 0a 58 0a 58 63 | 68 61 72 20 2a 73 63 63 |O 0.X.Xc|har *scc|
|000021b0| 73 5f 69 64 20 3d 20 22 | 40 28 23 29 20 66 6f 72 |s_id = "|@(#) for|
|000021c0| 74 75 6e 65 20 63 6f 6f | 6b 69 65 20 70 72 6f 67 |tune coo|kie prog|
|000021d0| 72 61 6d 20 31 2e 31 20 | 31 2f 31 32 2f 38 39 20 |ram 1.1 |1/12/89 |
|000021e0| 62 79 20 4b 2e 20 4c 65 | 68 65 6e 62 61 75 65 72 |by K. Le|henbauer|
|000021f0| 22 3b 0a 58 0a 58 65 78 | 74 65 72 6e 20 6c 6f 6e |";.X.Xex|tern lon|
|00002200| 67 20 6c 73 65 65 6b 28 | 29 2c 20 74 69 6d 65 28 |g lseek(|), time(|
|00002210| 29 3b 0a 58 65 78 74 65 | 72 6e 20 69 6e 74 20 72 |);.Xexte|rn int r|
|00002220| 61 6e 64 28 29 3b 0a 58 | 0a 58 63 68 61 72 20 2a |and();.X|.Xchar *|
|00002230| 63 6f 6f 6b 69 65 6e 61 | 6d 65 20 3d 20 43 4f 4f |cookiena|me = COO|
|00002240| 4b 49 45 46 49 4c 45 3b | 0a 58 63 68 61 72 20 2a |KIEFILE;|.Xchar *|
|00002250| 68 61 73 68 6e 61 6d 65 | 20 3d 20 48 41 53 48 46 |hashname| = HASHF|
|00002260| 49 4c 45 3b 0a 58 0a 58 | 2f 2a 20 72 65 61 6c 6c |ILE;.X.X|/* reall|
|00002270| 79 5f 72 61 6e 64 6f 6d | 20 2d 20 69 6e 73 75 72 |y_random| - insur|
|00002280| 65 20 61 20 67 6f 6f 64 | 20 72 61 6e 64 6f 6d 20 |e a good| random |
|00002290| 72 65 74 75 72 6e 20 66 | 6f 72 20 61 20 72 61 6e |return f|or a ran|
|000022a0| 67 65 2c 20 75 6e 6c 69 | 6b 65 20 61 6e 20 61 72 |ge, unli|ke an ar|
|000022b0| 62 69 74 72 61 72 79 0a | 58 20 2a 20 72 61 6e 64 |bitrary.|X * rand|
|000022c0| 6f 6d 28 29 20 25 20 6e | 2c 20 74 68 61 6e 6b 73 |om() % n|, thanks|
|000022d0| 20 74 6f 20 4b 65 6e 20 | 41 72 6e 6f 6c 64 2c 20 | to Ken |Arnold, |
|000022e0| 55 6e 69 78 20 52 65 76 | 69 65 77 2c 20 4f 63 74 |Unix Rev|iew, Oct|
|000022f0| 6f 62 65 72 20 31 39 38 | 37 0a 58 20 2a 20 2e 2e |ober 198|7.X * ..|
|00002300| 2e 6c 69 6b 65 6c 79 20 | 6e 65 65 64 73 20 61 20 |.likely |needs a |
|00002310| 6c 69 74 74 6c 65 20 68 | 61 63 6b 69 6e 67 20 74 |little h|acking t|
|00002320| 6f 20 72 75 6e 20 75 6e | 64 65 72 20 42 65 72 6b |o run un|der Berk|
|00002330| 65 6c 79 0a 58 20 2a 2f | 0a 58 23 64 65 66 69 6e |ely.X */|.X#defin|
|00002340| 65 20 52 41 4e 44 4f 4d | 5f 52 41 4e 47 45 20 28 |e RANDOM|_RANGE (|
|00002350| 28 31 20 3c 3c 20 31 35 | 29 20 2d 20 31 29 0a 58 |(1 << 15|) - 1).X|
|00002360| 69 6e 74 20 72 65 61 6c | 6c 79 5f 72 61 6e 64 6f |int real|ly_rando|
|00002370| 6d 28 6d 79 5f 72 61 6e | 67 65 29 0a 58 69 6e 74 |m(my_ran|ge).Xint|
|00002380| 20 6d 79 5f 72 61 6e 67 | 65 3b 0a 58 7b 0a 58 09 | my_rang|e;.X{.X.|
|00002390| 69 6e 74 20 6d 61 78 5f | 6d 75 6c 74 69 70 6c 65 |int max_|multiple|
|000023a0| 2c 20 72 6e 75 6d 3b 0a | 58 0a 58 09 6d 61 78 5f |, rnum;.|X.X.max_|
|000023b0| 6d 75 6c 74 69 70 6c 65 | 20 3d 20 52 41 4e 44 4f |multiple| = RANDO|
|000023c0| 4d 5f 52 41 4e 47 45 20 | 2f 20 6d 79 5f 72 61 6e |M_RANGE |/ my_ran|
|000023d0| 67 65 3b 0a 58 09 6d 61 | 78 5f 6d 75 6c 74 69 70 |ge;.X.ma|x_multip|
|000023e0| 6c 65 20 2a 3d 20 6d 79 | 5f 72 61 6e 67 65 3b 0a |le *= my|_range;.|
|000023f0| 58 09 77 68 69 6c 65 20 | 28 28 72 6e 75 6d 20 3d |X.while |((rnum =|
|00002400| 20 72 61 6e 64 28 29 29 | 20 3e 3d 20 6d 61 78 5f | rand())| >= max_|
|00002410| 6d 75 6c 74 69 70 6c 65 | 29 0a 58 09 09 63 6f 6e |multiple|).X..con|
|00002420| 74 69 6e 75 65 3b 0a 58 | 09 72 65 74 75 72 6e 28 |tinue;.X|.return(|
|00002430| 72 6e 75 6d 20 25 20 6d | 79 5f 72 61 6e 67 65 29 |rnum % m|y_range)|
|00002440| 3b 0a 58 7d 0a 58 0a 58 | 6d 61 69 6e 28 61 72 67 |;.X}.X.X|main(arg|
|00002450| 63 2c 61 72 67 76 29 0a | 58 69 6e 74 20 61 72 67 |c,argv).|Xint arg|
|00002460| 63 3b 0a 58 63 68 61 72 | 20 2a 61 72 67 76 5b 5d |c;.Xchar| *argv[]|
|00002470| 3b 0a 58 7b 0a 58 09 69 | 6e 74 20 6e 65 6e 74 72 |;.X{.X.i|nt nentr|
|00002480| 69 65 73 2c 20 6f 6e 65 | 69 77 61 6e 74 2c 20 63 |ies, one|iwant, c|
|00002490| 2c 20 73 61 77 6d 65 74 | 61 20 3d 20 30 3b 0a 58 |, sawmet|a = 0;.X|
|000024a0| 09 46 49 4c 45 20 2a 68 | 61 73 68 66 2c 20 2a 63 |.FILE *h|ashf, *c|
|000024b0| 6f 6f 6b 69 65 66 3b 0a | 58 09 6c 6f 6e 67 20 63 |ookief;.|X.long c|
|000024c0| 6f 6f 6b 69 65 70 6f 73 | 3b 0a 58 0a 58 09 2f 2a |ookiepos|;.X.X./*|
|000024d0| 20 69 66 20 77 65 20 67 | 6f 74 20 65 78 61 63 74 | if we g|ot exact|
|000024e0| 6c 79 20 74 68 72 65 65 | 20 61 72 67 75 6d 65 6e |ly three| argumen|
|000024f0| 74 73 2c 20 75 73 65 20 | 74 68 65 20 63 6f 6f 6b |ts, use |the cook|
|00002500| 69 65 20 61 6e 64 20 68 | 61 73 68 0a 58 09 20 2a |ie and h|ash.X. *|
|00002510| 20 66 69 6c 65 73 20 73 | 70 65 63 69 66 69 65 64 | files s|pecified|
|00002520| 0a 58 09 20 2a 2f 0a 58 | 09 69 66 20 28 61 72 67 |.X. */.X|.if (arg|
|00002530| 63 20 3d 3d 20 33 29 0a | 58 09 7b 0a 58 09 09 63 |c == 3).|X.{.X..c|
|00002540| 6f 6f 6b 69 65 6e 61 6d | 65 20 3d 20 61 72 67 76 |ookienam|e = argv|
|00002550| 5b 31 5d 3b 0a 58 09 09 | 68 61 73 68 6e 61 6d 65 |[1];.X..|hashname|
|00002560| 20 3d 20 61 72 67 76 5b | 32 5d 3b 0a 58 09 7d 0a | = argv[|2];.X.}.|
|00002570| 58 09 2f 2a 20 6f 74 68 | 65 72 77 69 73 65 20 69 |X./* oth|erwise i|
|00002580| 66 20 61 72 67 63 20 69 | 73 6e 27 74 20 6f 6e 65 |f argc i|sn't one|
|00002590| 20 28 6e 6f 20 61 72 67 | 75 6d 65 6e 74 73 2c 20 | (no arg|uments, |
|000025a0| 73 70 65 63 69 66 79 69 | 6e 67 20 74 68 65 0a 58 |specifyi|ng the.X|
|000025b0| 09 20 2a 20 64 65 66 61 | 75 6c 74 20 63 6f 6f 6b |. * defa|ult cook|
|000025c0| 69 65 20 66 69 6c 65 29 | 2c 20 62 61 72 66 0a 58 |ie file)|, barf.X|
|000025d0| 09 20 2a 2f 0a 58 09 65 | 6c 73 65 20 69 66 20 28 |. */.X.e|lse if (|
|000025e0| 61 72 67 63 20 21 3d 20 | 31 29 0a 58 09 7b 0a 58 |argc != |1).X.{.X|
|000025f0| 09 09 66 70 75 74 73 28 | 22 75 73 61 67 65 3a 20 |..fputs(|"usage: |
|00002600| 63 6f 6f 6b 69 65 20 63 | 6f 6f 6b 69 65 66 69 6c |cookie c|ookiefil|
|00002610| 65 20 68 61 73 68 66 69 | 6c 65 5c 6e 22 2c 73 74 |e hashfi|le\n",st|
|00002620| 64 65 72 72 29 3b 0a 58 | 09 09 65 78 69 74 28 31 |derr);.X|..exit(1|
|00002630| 29 3b 0a 58 09 7d 0a 58 | 0a 58 09 2f 2a 20 6f 70 |);.X.}.X|.X./* op|
|00002640| 65 6e 20 74 68 65 20 63 | 6f 6f 6b 69 65 20 66 69 |en the c|ookie fi|
|00002650| 6c 65 20 66 6f 72 20 72 | 65 61 64 20 2a 2f 0a 58 |le for r|ead */.X|
|00002660| 09 69 66 20 28 28 63 6f | 6f 6b 69 65 66 20 3d 20 |.if ((co|okief = |
|00002670| 66 6f 70 65 6e 28 63 6f | 6f 6b 69 65 6e 61 6d 65 |fopen(co|okiename|
|00002680| 2c 22 72 22 29 29 20 3d | 3d 20 4e 55 4c 4c 29 0a |,"r")) =|= NULL).|
|00002690| 58 09 7b 0a 58 09 09 70 | 65 72 72 6f 72 28 63 6f |X.{.X..p|error(co|
|000026a0| 6f 6b 69 65 6e 61 6d 65 | 29 3b 0a 58 09 09 65 78 |okiename|);.X..ex|
|000026b0| 69 74 28 32 29 3b 0a 58 | 09 7d 0a 58 0a 58 09 2f |it(2);.X|.}.X.X./|
|000026c0| 2a 20 6f 70 65 6e 20 74 | 68 65 20 68 61 73 68 20 |* open t|he hash |
|000026d0| 66 69 6c 65 20 66 6f 72 | 20 72 65 61 64 20 2a 2f |file for| read */|
|000026e0| 0a 58 09 69 66 20 28 28 | 68 61 73 68 66 20 3d 20 |.X.if ((|hashf = |
|000026f0| 66 6f 70 65 6e 28 68 61 | 73 68 6e 61 6d 65 2c 22 |fopen(ha|shname,"|
|00002700| 72 22 29 29 20 3d 3d 20 | 4e 55 4c 4c 29 0a 58 09 |r")) == |NULL).X.|
|00002710| 7b 0a 58 09 09 70 65 72 | 72 6f 72 28 68 61 73 68 |{.X..per|ror(hash|
|00002720| 6e 61 6d 65 29 3b 0a 58 | 09 09 65 78 69 74 28 32 |name);.X|..exit(2|
|00002730| 29 3b 0a 58 09 7d 0a 58 | 0a 58 09 2f 2a 20 63 6f |);.X.}.X|.X./* co|
|00002740| 6d 70 75 74 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |mpute nu|mber of |
|00002750| 63 6f 6f 6b 69 65 20 61 | 64 64 72 65 73 73 65 73 |cookie a|ddresses|
|00002760| 20 69 6e 20 74 68 65 20 | 68 61 73 68 20 66 69 6c | in the |hash fil|
|00002770| 65 20 62 79 0a 58 09 20 | 2a 20 64 69 76 69 64 69 |e by.X. |* dividi|
|00002780| 6e 67 20 74 68 65 20 66 | 69 6c 65 20 6c 65 6e 67 |ng the f|ile leng|
|00002790| 74 68 20 62 79 20 74 68 | 65 20 73 69 7a 65 20 6f |th by th|e size o|
|000027a0| 66 20 61 20 63 6f 6f 6b | 69 65 20 61 64 64 72 65 |f a cook|ie addre|
|000027b0| 73 73 0a 58 09 20 2a 2f | 0a 58 09 69 66 20 28 66 |ss.X. */|.X.if (f|
|000027c0| 73 65 65 6b 28 68 61 73 | 68 66 2c 30 4c 2c 32 29 |seek(has|hf,0L,2)|
|000027d0| 20 21 3d 20 30 29 0a 58 | 09 7b 0a 58 09 09 70 65 | != 0).X|.{.X..pe|
|000027e0| 72 72 6f 72 28 68 61 73 | 68 6e 61 6d 65 29 3b 0a |rror(has|hname);.|
|000027f0| 58 09 09 65 78 69 74 28 | 33 29 3b 0a 58 09 7d 0a |X..exit(|3);.X.}.|
|00002800| 58 09 6e 65 6e 74 72 69 | 65 73 20 3d 20 66 74 65 |X.nentri|es = fte|
|00002810| 6c 6c 28 68 61 73 68 66 | 29 20 2f 20 37 4c 3b 0a |ll(hashf|) / 7L;.|
|00002820| 58 0a 58 09 2f 2a 20 73 | 65 65 64 20 74 68 65 20 |X.X./* s|eed the |
|00002830| 72 61 6e 64 6f 6d 20 6e | 75 6d 62 65 72 20 67 65 |random n|umber ge|
|00002840| 6e 65 72 61 74 6f 72 20 | 77 69 74 68 20 74 69 6d |nerator |with tim|
|00002850| 65 20 69 6e 20 73 65 63 | 6f 6e 64 73 20 70 6c 75 |e in sec|onds plu|
|00002860| 73 0a 58 09 20 2a 20 74 | 68 65 20 70 72 6f 67 72 |s.X. * t|he progr|
|00002870| 61 6d 27 73 20 70 72 6f | 63 65 73 73 20 49 44 20 |am's pro|cess ID |
|00002880| 2d 20 69 74 20 79 69 65 | 6c 64 73 20 61 20 70 72 |- it yie|lds a pr|
|00002890| 65 74 74 79 20 67 6f 6f | 64 20 73 65 65 64 0a 58 |etty goo|d seed.X|
|000028a0| 09 20 2a 20 61 67 61 69 | 6e 2c 20 74 68 61 6e 6b |. * agai|n, thank|
|000028b0| 73 20 74 6f 20 4b 65 6e | 20 41 72 6e 6f 6c 64 0a |s to Ken| Arnold.|
|000028c0| 58 09 20 2a 2f 0a 58 09 | 73 72 61 6e 64 28 67 65 |X. */.X.|srand(ge|
|000028d0| 74 70 69 64 28 29 20 2b | 20 74 69 6d 65 28 4e 55 |tpid() +| time(NU|
|000028e0| 4c 4c 29 29 3b 0a 58 0a | 58 09 2f 2a 20 67 65 6e |LL));.X.|X./* gen|
|000028f0| 65 72 61 74 65 20 61 20 | 6e 6f 74 20 72 65 61 6c |erate a |not real|
|00002900| 6c 79 20 72 61 6e 64 6f | 6d 20 6e 75 6d 62 65 72 |ly rando|m number|
|00002910| 20 2a 2f 0a 58 09 6f 6e | 65 69 77 61 6e 74 20 3d | */.X.on|eiwant =|
|00002920| 20 72 65 61 6c 6c 79 5f | 72 61 6e 64 6f 6d 28 6e | really_|random(n|
|00002930| 65 6e 74 72 69 65 73 29 | 3b 0a 58 0a 58 09 2f 2a |entries)|;.X.X./*|
|00002940| 20 6c 6f 63 61 74 65 20 | 74 68 65 20 6f 6e 65 20 | locate |the one |
|00002950| 49 20 77 61 6e 74 20 69 | 6e 20 74 68 65 20 68 61 |I want i|n the ha|
|00002960| 73 68 20 66 69 6c 65 20 | 61 6e 64 20 72 65 61 64 |sh file |and read|
|00002970| 20 74 68 65 0a 58 09 20 | 2a 20 61 64 64 72 65 73 | the.X. |* addres|
|00002980| 73 20 66 6f 75 6e 64 20 | 74 68 65 72 65 0a 58 09 |s found |there.X.|
|00002990| 20 2a 2f 0a 58 09 66 73 | 65 65 6b 28 68 61 73 68 | */.X.fs|eek(hash|
|000029a0| 66 2c 28 6c 6f 6e 67 29 | 6f 6e 65 69 77 61 6e 74 |f,(long)|oneiwant|
|000029b0| 20 2a 20 45 4e 54 53 49 | 5a 45 2c 20 30 29 3b 0a | * ENTSI|ZE, 0);.|
|000029c0| 58 09 66 73 63 61 6e 66 | 28 68 61 73 68 66 2c 22 |X.fscanf|(hashf,"|
|000029d0| 25 6c 78 22 2c 26 63 6f | 6f 6b 69 65 70 6f 73 29 |%lx",&co|okiepos)|
|000029e0| 3b 0a 58 0a 58 09 2f 2a | 20 73 65 65 6b 20 63 6f |;.X.X./*| seek co|
|000029f0| 6f 6b 69 65 20 66 69 6c | 65 20 74 6f 20 63 6f 6f |okie fil|e to coo|
|00002a00| 6b 69 65 20 73 74 61 72 | 74 69 6e 67 20 61 74 20 |kie star|ting at |
|00002a10| 61 64 64 72 65 73 73 20 | 72 65 61 64 20 66 72 6f |address |read fro|
|00002a20| 6d 20 68 61 73 68 20 2a | 2f 0a 58 09 66 73 65 65 |m hash *|/.X.fsee|
|00002a30| 6b 28 63 6f 6f 6b 69 65 | 66 2c 63 6f 6f 6b 69 65 |k(cookie|f,cookie|
|00002a40| 70 6f 73 2c 30 29 3b 0a | 58 0a 58 09 2f 2a 20 67 |pos,0);.|X.X./* g|
|00002a50| 65 74 20 63 68 61 72 61 | 63 74 65 72 73 20 66 72 |et chara|cters fr|
|00002a60| 6f 6d 20 74 68 65 20 63 | 6f 6f 6b 69 65 20 66 69 |om the c|ookie fi|
|00002a70| 6c 65 20 61 6e 64 20 77 | 72 69 74 65 20 74 68 65 |le and w|rite the|
|00002a80| 6d 20 6f 75 74 0a 58 09 | 20 2a 20 75 6e 74 69 6c |m out.X.| * until|
|00002a90| 20 66 69 6e 64 69 6e 67 | 20 74 68 65 20 65 6e 64 | finding| the end|
|00002aa0| 2d 6f 66 2d 66 6f 72 74 | 75 6e 65 20 73 65 71 75 |-of-fort|une sequ|
|00002ab0| 65 6e 63 65 2c 20 27 25 | 25 27 0a 58 09 20 2a 2f |ence, '%|%'.X. */|
|00002ac0| 0a 58 09 77 68 69 6c 65 | 20 28 28 63 20 3d 20 66 |.X.while| ((c = f|
|00002ad0| 67 65 74 63 28 63 6f 6f | 6b 69 65 66 29 29 20 21 |getc(coo|kief)) !|
|00002ae0| 3d 20 45 4f 46 20 26 26 | 20 73 61 77 6d 65 74 61 |= EOF &&| sawmeta|
|00002af0| 20 3c 20 32 29 0a 58 09 | 7b 0a 58 09 09 69 66 20 | < 2).X.|{.X..if |
|00002b00| 28 63 20 21 3d 20 4d 45 | 54 41 43 48 41 52 29 0a |(c != ME|TACHAR).|
|00002b10| 58 09 09 7b 0a 58 09 09 | 09 69 66 20 28 73 61 77 |X..{.X..|.if (saw|
|00002b20| 6d 65 74 61 29 0a 58 09 | 09 09 09 70 75 74 63 68 |meta).X.|...putch|
|00002b30| 61 72 28 4d 45 54 41 43 | 48 41 52 29 3b 0a 58 09 |ar(METAC|HAR);.X.|
|00002b40| 09 09 70 75 74 63 68 61 | 72 28 63 29 3b 0a 58 09 |..putcha|r(c);.X.|
|00002b50| 09 09 73 61 77 6d 65 74 | 61 20 3d 20 30 3b 0a 58 |..sawmet|a = 0;.X|
|00002b60| 09 09 7d 0a 58 09 09 65 | 6c 73 65 0a 58 09 09 09 |..}.X..e|lse.X...|
|00002b70| 73 61 77 6d 65 74 61 2b | 2b 3b 0a 58 09 7d 0a 58 |sawmeta+|+;.X.}.X|
|00002b80| 09 65 78 69 74 28 30 29 | 3b 0a 58 7d 0a 58 0a 58 |.exit(0)|;.X}.X.X|
|00002b90| 2f 2a 20 65 6e 64 20 6f | 66 20 63 6f 6f 6b 69 65 |/* end o|f cookie|
|00002ba0| 2e 63 20 2a 2f 0a 45 4e | 44 5f 4f 46 5f 46 49 4c |.c */.EN|D_OF_FIL|
|00002bb0| 45 0a 69 66 20 74 65 73 | 74 20 32 37 30 32 20 2d |E.if tes|t 2702 -|
|00002bc0| 6e 65 20 60 77 63 20 2d | 63 20 3c 27 63 6f 6f 6b |ne `wc -|c <'cook|
|00002bd0| 69 65 2e 63 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |ie.c'`; |then. |
|00002be0| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 63 | echo sh|ar: \"'c|
|00002bf0| 6f 6f 6b 69 65 2e 63 27 | 5c 22 20 75 6e 70 61 63 |ookie.c'|\" unpac|
|00002c00| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|00002c10| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|00002c20| 20 27 63 6f 6f 6b 69 65 | 2e 63 27 0a 66 69 0a 69 | 'cookie|.c'.fi.i|
|00002c30| 66 20 74 65 73 74 20 2d | 66 20 27 63 6f 6f 6b 68 |f test -|f 'cookh|
|00002c40| 61 73 68 2e 63 27 20 2d | 61 20 22 24 7b 31 7d 22 |ash.c' -|a "${1}"|
|00002c50| 20 21 3d 20 22 2d 63 22 | 20 3b 20 74 68 65 6e 20 | != "-c"| ; then |
|00002c60| 0a 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 57 69 |. echo |shar: Wi|
|00002c70| 6c 6c 20 6e 6f 74 20 63 | 6c 6f 62 62 65 72 20 65 |ll not c|lobber e|
|00002c80| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 5c 22 27 |xisting |file \"'|
|00002c90| 63 6f 6f 6b 68 61 73 68 | 2e 63 27 5c 22 0a 65 6c |cookhash|.c'\".el|
|00002ca0| 73 65 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 45 78 |se.echo |shar: Ex|
|00002cb0| 74 72 61 63 74 69 6e 67 | 20 5c 22 27 63 6f 6f 6b |tracting| \"'cook|
|00002cc0| 68 61 73 68 2e 63 27 5c | 22 20 5c 28 39 34 33 20 |hash.c'\|" \(943 |
|00002cd0| 63 68 61 72 61 63 74 65 | 72 73 5c 29 0a 73 65 64 |characte|rs\).sed|
|00002ce0| 20 22 73 2f 5e 58 2f 2f | 22 20 3e 27 63 6f 6f 6b | "s/^X//|" >'cook|
|00002cf0| 68 61 73 68 2e 63 27 20 | 3c 3c 27 45 4e 44 5f 4f |hash.c' |<<'END_O|
|00002d00| 46 5f 46 49 4c 45 27 0a | 58 2f 2a 20 63 6f 6f 6b |F_FILE'.|X/* cook|
|00002d10| 68 61 73 68 20 2d 20 72 | 65 61 64 20 61 20 73 61 |hash - r|ead a sa|
|00002d20| 79 69 6e 67 73 20 66 69 | 6c 65 20 61 6e 64 20 67 |yings fi|le and g|
|00002d30| 65 6e 65 72 61 74 65 20 | 61 6e 20 69 6e 64 65 78 |enerate |an index|
|00002d40| 20 66 69 6c 65 0a 58 20 | 2a 20 62 79 20 4b 61 72 | file.X |* by Kar|
|00002d50| 6c 20 4c 65 68 65 6e 62 | 61 75 65 72 20 28 6b 61 |l Lehenb|auer (ka|
|00002d60| 72 6c 40 73 75 67 61 72 | 2e 75 75 2e 6e 65 74 2c |rl@sugar|.uu.net,|
|00002d70| 20 75 75 6e 65 74 21 73 | 75 67 61 72 21 6b 61 72 | uunet!s|ugar!kar|
|00002d80| 6c 29 0a 58 20 2a 20 20 | 63 6f 6f 6b 68 61 73 68 |l).X * |cookhash|
|00002d90| 2e 63 20 20 31 2e 31 20 | 20 31 2f 31 32 2f 38 39 |.c 1.1 | 1/12/89|
|00002da0| 0a 58 20 2a 2f 0a 58 0a | 58 23 69 6e 63 6c 75 64 |.X */.X.|X#includ|
|00002db0| 65 20 3c 73 74 64 69 6f | 2e 68 3e 0a 58 0a 58 23 |e <stdio|.h>.X.X#|
|00002dc0| 64 65 66 69 6e 65 20 59 | 45 53 20 31 0a 58 23 64 |define Y|ES 1.X#d|
|00002dd0| 65 66 69 6e 65 20 4e 4f | 20 30 0a 58 23 64 65 66 |efine NO| 0.X#def|
|00002de0| 69 6e 65 20 4d 45 54 41 | 43 48 41 52 20 27 25 27 |ine META|CHAR '%'|
|00002df0| 0a 58 0a 58 6d 61 69 6e | 28 61 72 67 63 2c 61 72 |.X.Xmain|(argc,ar|
|00002e00| 67 76 29 0a 58 69 6e 74 | 20 61 72 67 63 3b 0a 58 |gv).Xint| argc;.X|
|00002e10| 63 68 61 72 20 2a 61 72 | 67 76 5b 5d 3b 0a 58 7b |char *ar|gv[];.X{|
|00002e20| 0a 58 09 69 6e 74 20 63 | 2c 20 73 61 77 6d 65 74 |.X.int c|, sawmet|
|00002e30| 61 3b 0a 58 09 6c 6f 6e | 67 20 63 68 61 72 70 6f |a;.X.lon|g charpo|
|00002e40| 73 20 3d 20 30 3b 0a 58 | 0a 58 09 69 66 20 28 61 |s = 0;.X|.X.if (a|
|00002e50| 72 67 63 20 21 3d 20 31 | 29 0a 58 09 7b 0a 58 09 |rgc != 1|).X.{.X.|
|00002e60| 09 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c |.fprintf|(stderr,|
|00002e70| 22 75 73 61 67 65 3a 20 | 63 6f 6f 6b 68 61 73 68 |"usage: |cookhash|
|00002e80| 20 3c 63 6f 6f 6b 69 65 | 66 69 6c 65 20 3e 68 61 | <cookie|file >ha|
|00002e90| 73 68 66 69 6c 65 5c 6e | 22 29 3b 0a 58 09 09 65 |shfile\n|");.X..e|
|00002ea0| 78 69 74 28 31 29 3b 0a | 58 09 7d 0a 58 0a 58 09 |xit(1);.|X.}.X.X.|
|00002eb0| 2f 2a 20 77 72 69 74 65 | 20 6f 75 74 20 74 68 65 |/* write| out the|
|00002ec0| 20 22 61 64 64 72 65 73 | 73 22 20 6f 66 20 74 68 | "addres|s" of th|
|00002ed0| 65 20 66 69 72 73 74 20 | 63 6f 6f 6b 69 65 20 2a |e first |cookie *|
|00002ee0| 2f 0a 58 09 70 75 74 73 | 28 22 30 30 30 30 30 30 |/.X.puts|("000000|
|00002ef0| 22 29 3b 0a 58 0a 58 09 | 2f 2a 20 72 65 61 64 20 |");.X.X.|/* read |
|00002f00| 74 68 65 20 63 6f 6f 6b | 69 65 20 75 6e 74 69 6c |the cook|ie until|
|00002f10| 20 74 68 65 20 65 6e 64 | 2c 0a 58 09 20 2a 20 20 | the end|,.X. * |
|00002f20| 20 77 68 65 6e 65 76 65 | 72 20 74 68 65 20 65 6e | wheneve|r the en|
|00002f30| 64 2d 6f 66 2d 63 6f 6f | 6b 69 65 20 28 22 25 25 |d-of-coo|kie ("%%|
|00002f40| 22 29 20 73 65 71 75 65 | 6e 63 65 20 69 73 20 66 |") seque|nce is f|
|00002f50| 6f 75 6e 64 2c 0a 58 09 | 20 2a 20 20 20 74 68 65 |ound,.X.| * the|
|00002f60| 20 22 61 64 64 72 65 73 | 73 22 20 28 66 69 6c 65 | "addres|s" (file|
|00002f70| 20 70 6f 73 69 74 69 6f | 6e 29 20 6f 66 20 74 68 | positio|n) of th|
|00002f80| 65 20 66 69 72 73 74 20 | 62 79 74 65 20 66 6f 6c |e first |byte fol|
|00002f90| 6c 6f 77 69 6e 67 0a 58 | 09 20 2a 20 20 20 69 74 |lowing.X|. * it|
|00002fa0| 20 28 73 74 61 72 74 20 | 6f 66 20 6e 65 78 74 20 | (start |of next |
|00002fb0| 63 6f 6f 6b 69 65 29 20 | 69 73 20 77 72 69 74 74 |cookie) |is writt|
|00002fc0| 65 6e 20 74 6f 20 74 68 | 65 20 69 6e 64 65 78 20 |en to th|e index |
|00002fd0| 28 68 61 73 68 29 20 66 | 69 6c 65 0a 58 09 20 2a |(hash) f|ile.X. *|
|00002fe0| 2f 0a 58 09 77 68 69 6c | 65 20 28 28 63 20 3d 20 |/.X.whil|e ((c = |
|00002ff0| 67 65 74 63 68 61 72 28 | 29 29 20 21 3d 20 45 4f |getchar(|)) != EO|
|00003000| 46 29 0a 58 09 7b 0a 58 | 09 09 69 66 20 28 63 20 |F).X.{.X|..if (c |
|00003010| 3d 3d 20 4d 45 54 41 43 | 48 41 52 29 0a 58 09 09 |== METAC|HAR).X..|
|00003020| 7b 0a 58 09 09 09 69 66 | 20 28 73 61 77 6d 65 74 |{.X...if| (sawmet|
|00003030| 61 29 0a 58 09 09 09 7b | 0a 58 09 09 09 09 70 72 |a).X...{|.X....pr|
|00003040| 69 6e 74 66 28 22 25 30 | 36 6c 78 5c 6e 22 2c 63 |intf("%0|6lx\n",c|
|00003050| 68 61 72 70 6f 73 2b 32 | 29 3b 0a 58 09 09 09 09 |harpos+2|);.X....|
|00003060| 73 61 77 6d 65 74 61 20 | 3d 20 4e 4f 3b 0a 58 09 |sawmeta |= NO;.X.|
|00003070| 09 09 7d 0a 58 09 09 09 | 65 6c 73 65 0a 58 09 09 |..}.X...|else.X..|
|00003080| 09 09 73 61 77 6d 65 74 | 61 20 3d 20 59 45 53 3b |..sawmet|a = YES;|
|00003090| 0a 58 09 09 7d 0a 58 09 | 09 65 6c 73 65 0a 58 09 |.X..}.X.|.else.X.|
|000030a0| 09 09 73 61 77 6d 65 74 | 61 20 3d 20 4e 4f 3b 0a |..sawmet|a = NO;.|
|000030b0| 58 09 09 63 68 61 72 70 | 6f 73 2b 2b 3b 0a 58 09 |X..charp|os++;.X.|
|000030c0| 7d 0a 58 09 65 78 69 74 | 28 30 29 3b 0a 58 7d 0a |}.X.exit|(0);.X}.|
|000030d0| 58 0a 58 2f 2a 20 65 6e | 64 20 6f 66 20 63 6f 6f |X.X/* en|d of coo|
|000030e0| 6b 68 61 73 68 2e 63 20 | 2a 2f 0a 45 4e 44 5f 4f |khash.c |*/.END_O|
|000030f0| 46 5f 46 49 4c 45 0a 69 | 66 20 74 65 73 74 20 39 |F_FILE.i|f test 9|
|00003100| 34 33 20 2d 6e 65 20 60 | 77 63 20 2d 63 20 3c 27 |43 -ne `|wc -c <'|
|00003110| 63 6f 6f 6b 68 61 73 68 | 2e 63 27 60 3b 20 74 68 |cookhash|.c'`; th|
|00003120| 65 6e 0a 20 20 20 20 65 | 63 68 6f 20 73 68 61 72 |en. e|cho shar|
|00003130| 3a 20 5c 22 27 63 6f 6f | 6b 68 61 73 68 2e 63 27 |: \"'coo|khash.c'|
|00003140| 5c 22 20 75 6e 70 61 63 | 6b 65 64 20 77 69 74 68 |\" unpac|ked with|
|00003150| 20 77 72 6f 6e 67 20 73 | 69 7a 65 21 0a 66 69 0a | wrong s|ize!.fi.|
|00003160| 23 20 65 6e 64 20 6f 66 | 20 27 63 6f 6f 6b 68 61 |# end of| 'cookha|
|00003170| 73 68 2e 63 27 0a 66 69 | 0a 65 63 68 6f 20 73 68 |sh.c'.fi|.echo sh|
|00003180| 61 72 3a 20 45 6e 64 20 | 6f 66 20 73 68 65 6c 6c |ar: End |of shell|
|00003190| 20 61 72 63 68 69 76 65 | 2e 0a 65 78 69 74 20 30 | archive|..exit 0|
|000031a0| 0a 2d 2d 20 0a 2d 2d 20 | 75 75 6e 65 74 21 73 75 |.-- .-- |uunet!su|
|000031b0| 67 61 72 21 6b 61 72 6c | 0a 2d 2d 20 55 73 65 6e |gar!karl|.-- Usen|
|000031c0| 65 74 20 61 63 63 65 73 | 73 3a 20 28 37 31 33 29 |et acces|s: (713)|
|000031d0| 20 34 33 38 2d 35 30 31 | 38 0a | 438-501|8. |
+--------+-------------------------+-------------------------+--------+--------+