home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / unix / crontabn.txt < prev    next >
Mailbox/MIME Entity  |  2003-06-11  |  10.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: crontabn.txt

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Swift 3D 3D Graphic (poly/swift3D3DGraphic) ext Unsupported
1% dexvert Boost Text serialization (other/boostTextSerialization) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail, ASCII text default
100% TrID E-Mail message (Var. 4) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% gt2 Textdatei (UNIX) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 54 6f 3a 20 6c 69 6e 75 | 78 2d 73 65 63 75 72 69 |To: linu|x-securi|
|00000010| 74 79 40 74 61 72 73 69 | 65 72 2e 63 76 2e 6e 72 |ty@tarsi|er.cv.nr|
|00000020| 61 6f 2e 65 64 75 2c 20 | 62 65 73 74 2d 6f 66 2d |ao.edu, |best-of-|
|00000030| 73 65 63 75 72 69 74 79 | 40 73 75 62 75 72 62 69 |security|@suburbi|
|00000040| 61 2e 6e 65 74 0a 44 61 | 74 65 3a 20 54 75 65 2c |a.net.Da|te: Tue,|
|00000050| 20 32 31 20 4d 61 79 20 | 31 39 39 36 20 31 33 3a | 21 May |1996 13:|
|00000060| 31 30 3a 33 36 20 2d 30 | 34 30 30 20 28 45 44 54 |10:36 -0|400 (EDT|
|00000070| 29 0a 58 2d 4d 61 69 6c | 65 72 3a 20 45 4c 4d 20 |).X-Mail|er: ELM |
|00000080| 5b 76 65 72 73 69 6f 6e | 20 32 2e 34 20 50 4c 32 |[version| 2.4 PL2|
|00000090| 34 5d 0a 4d 49 4d 45 2d | 56 65 72 73 69 6f 6e 3a |4].MIME-|Version:|
|000000a0| 20 31 2e 30 0a 43 6f 6e | 74 65 6e 74 2d 54 79 70 | 1.0.Con|tent-Typ|
|000000b0| 65 3a 20 74 65 78 74 2f | 70 6c 61 69 6e 3b 20 63 |e: text/|plain; c|
|000000c0| 68 61 72 73 65 74 3d 55 | 53 2d 41 53 43 49 49 0a |harset=U|S-ASCII.|
|000000d0| 43 6f 6e 74 65 6e 74 2d | 54 72 61 6e 73 66 65 72 |Content-|Transfer|
|000000e0| 2d 45 6e 63 6f 64 69 6e | 67 3a 20 37 62 69 74 0a |-Encodin|g: 7bit.|
|000000f0| 52 65 73 65 6e 74 2d 4d | 65 73 73 61 67 65 2d 49 |Resent-M|essage-I|
|00000100| 44 3a 20 3c 22 78 37 79 | 37 44 32 2e 30 2e 78 73 |D: <"x7y|7D2.0.xs|
|00000110| 34 2e 6d 61 56 65 6e 22 | 40 73 75 62 75 72 62 69 |4.maVen"|@suburbi|
|00000120| 61 3e 0a 52 65 73 65 6e | 74 2d 46 72 6f 6d 3a 20 |a>.Resen|t-From: |
|00000130| 62 65 73 74 2d 6f 66 2d | 73 65 63 75 72 69 74 79 |best-of-|security|
|00000140| 40 73 75 62 75 72 62 69 | 61 2e 6e 65 74 0a 58 2d |@suburbi|a.net.X-|
|00000150| 4d 61 69 6c 69 6e 67 2d | 4c 69 73 74 3a 20 3c 62 |Mailing-|List: <b|
|00000160| 65 73 74 2d 6f 66 2d 73 | 65 63 75 72 69 74 79 40 |est-of-s|ecurity@|
|00000170| 73 75 62 75 72 62 69 61 | 2e 6e 65 74 3e 20 61 72 |suburbia|.net> ar|
|00000180| 63 68 69 76 65 2f 6c 61 | 74 65 73 74 2f 35 37 0a |chive/la|test/57.|
|00000190| 58 2d 4c 6f 6f 70 3a 20 | 62 65 73 74 2d 6f 66 2d |X-Loop: |best-of-|
|000001a0| 73 65 63 75 72 69 74 79 | 40 73 75 62 75 72 62 69 |security|@suburbi|
|000001b0| 61 2e 6e 65 74 0a 50 72 | 65 63 65 64 65 6e 63 65 |a.net.Pr|ecedence|
|000001c0| 3a 20 6c 69 73 74 0a 52 | 65 73 65 6e 74 2d 53 65 |: list.R|esent-Se|
|000001d0| 6e 64 65 72 3a 20 62 65 | 73 74 2d 6f 66 2d 73 65 |nder: be|st-of-se|
|000001e0| 63 75 72 69 74 79 2d 72 | 65 71 75 65 73 74 40 73 |curity-r|equest@s|
|000001f0| 75 62 75 72 62 69 61 2e | 6e 65 74 0a 53 75 62 6a |uburbia.|net.Subj|
|00000200| 65 63 74 3a 20 42 6f 53 | 3a 20 54 68 69 6e 67 73 |ect: BoS|: Things|
|00000210| 20 4e 4f 54 20 74 6f 20 | 70 75 74 20 69 6e 20 72 | NOT to |put in r|
|00000220| 6f 6f 74 27 73 20 63 72 | 6f 6e 74 61 62 0a 0a 53 |oot's cr|ontab..S|
|00000230| 69 67 68 2e 20 20 48 65 | 72 65 20 61 72 65 20 73 |igh. He|re are s|
|00000240| 65 76 65 72 61 6c 20 74 | 68 69 6e 67 73 20 49 27 |everal t|hings I'|
|00000250| 76 65 20 6a 75 73 74 20 | 72 65 6d 6f 76 65 64 20 |ve just |removed |
|00000260| 66 72 6f 6d 20 2f 65 74 | 63 2f 63 72 6f 6e 74 61 |from /et|c/cronta|
|00000270| 62 20 6f 6e 0a 65 76 65 | 72 79 20 52 65 64 48 61 |b on.eve|ry RedHa|
|00000280| 74 20 4c 69 6e 75 78 20 | 73 79 73 74 65 6d 20 49 |t Linux |system I|
|00000290| 20 63 61 6e 20 67 65 74 | 20 6d 79 20 68 61 6e 64 | can get| my hand|
|000002a0| 73 20 6f 6e 2e 20 20 54 | 68 65 79 20 63 6f 6e 74 |s on. T|hey cont|
|000002b0| 61 69 6e 20 73 65 63 75 | 72 69 74 79 0a 68 6f 6c |ain secu|rity.hol|
|000002c0| 65 73 20 72 65 6c 61 74 | 65 64 20 74 6f 20 74 68 |es relat|ed to th|
|000002d0| 65 20 75 73 65 20 6f 66 | 20 27 66 69 6e 64 27 20 |e use of| 'find' |
|000002e0| 61 6e 64 20 27 72 6d 27 | 20 74 6f 20 65 78 70 69 |and 'rm'| to expi|
|000002f0| 72 65 20 6f 6c 64 20 66 | 69 6c 65 73 20 69 6e 20 |re old f|iles in |
|00000300| 2f 74 6d 70 0a 61 6e 64 | 20 6f 74 68 65 72 20 70 |/tmp.and| other p|
|00000310| 6c 61 63 65 73 2e 0a 0a | 49 74 20 73 65 65 6d 73 |laces...|It seems|
|00000320| 20 74 68 61 74 20 61 77 | 61 72 65 6e 65 73 73 20 | that aw|areness |
|00000330| 6f 66 20 74 68 69 73 20 | 74 79 70 65 20 6f 66 20 |of this |type of |
|00000340| 73 65 63 75 72 69 74 79 | 20 70 72 6f 62 6c 65 6d |security| problem|
|00000350| 20 69 73 20 72 61 74 68 | 65 72 20 6c 6f 77 2c 0a | is rath|er low,.|
|00000360| 73 6f 20 49 27 6c 6c 20 | 65 78 70 6c 61 69 6e 20 |so I'll |explain |
|00000370| 74 68 65 20 63 6c 61 73 | 73 20 6f 66 20 70 72 6f |the clas|s of pro|
|00000380| 62 6c 65 6d 20 61 6e 64 | 20 68 6f 77 20 74 6f 20 |blem and| how to |
|00000390| 66 69 78 20 69 74 2e 0a | 0a 3e 46 72 6f 6d 20 52 |fix it..|.>From R|
|000003a0| 65 64 68 61 74 27 73 20 | 2f 65 74 63 2f 63 72 6f |edhat's |/etc/cro|
|000003b0| 6e 74 61 62 20 66 69 6c | 65 3a 0a 3e 23 20 52 65 |ntab fil|e:.># Re|
|000003c0| 6d 6f 76 65 20 2f 76 61 | 72 2f 74 6d 70 20 66 69 |move /va|r/tmp fi|
|000003d0| 6c 65 73 20 6e 6f 74 20 | 61 63 63 65 73 73 65 64 |les not |accessed|
|000003e0| 20 69 6e 20 31 30 20 64 | 61 79 73 0a 3e 34 33 20 | in 10 d|ays.>43 |
|000003f0| 30 32 20 2a 20 2a 20 2a | 20 72 6f 6f 74 20 66 69 |02 * * *| root fi|
|00000400| 6e 64 20 2f 76 61 72 2f | 74 6d 70 2f 2a 20 2d 61 |nd /var/|tmp/* -a|
|00000410| 74 69 6d 65 20 2b 33 20 | 2d 65 78 65 63 20 72 6d |time +3 |-exec rm|
|00000420| 20 2d 66 20 7b 7d 20 5c | 3b 20 32 3e 20 2f 64 65 | -f {} \|; 2> /de|
|00000430| 76 2f 6e 75 6c 6c 0a 3e | 0a 3e 23 20 52 65 6d 6f |v/null.>|.># Remo|
|00000440| 76 65 20 2f 74 6d 70 20 | 66 69 6c 65 73 20 6e 6f |ve /tmp |files no|
|00000450| 74 20 61 63 63 65 73 73 | 65 64 20 69 6e 20 31 30 |t access|ed in 10|
|00000460| 20 64 61 79 73 0a 3e 23 | 20 49 20 63 6f 6d 6d 65 | days.>#| I comme|
|00000470| 6e 74 65 64 20 6f 75 74 | 20 74 68 69 73 20 6c 69 |nted out| this li|
|00000480| 6e 65 20 62 65 63 61 75 | 73 65 20 49 20 74 65 6e |ne becau|se I ten|
|00000490| 64 20 74 6f 20 22 73 74 | 6f 72 65 22 20 73 74 75 |d to "st|ore" stu|
|000004a0| 66 66 20 69 6e 20 2f 74 | 6d 70 0a 3e 23 20 34 31 |ff in /t|mp.># 41|
|000004b0| 20 30 32 20 2a 20 2a 20 | 2a 20 72 6f 6f 74 20 66 | 02 * * |* root f|
|000004c0| 69 6e 64 20 2f 74 6d 70 | 2f 2a 20 2d 61 74 69 6d |ind /tmp|/* -atim|
|000004d0| 65 20 2b 31 30 20 2d 65 | 78 65 63 20 72 6d 20 2d |e +10 -e|xec rm -|
|000004e0| 66 20 7b 7d 20 5c 3b 20 | 32 3e 20 2f 64 65 76 2f |f {} \; |2> /dev/|
|000004f0| 6e 75 6c 6c 0a 3e 0a 3e | 23 20 52 65 6d 6f 76 65 |null.>.>|# Remove|
|00000500| 20 66 6f 72 6d 61 74 74 | 65 64 20 6d 61 6e 20 70 | formatt|ed man p|
|00000510| 61 67 65 73 20 6e 6f 74 | 20 61 63 63 65 73 73 65 |ages not| accesse|
|00000520| 64 20 69 6e 20 31 30 20 | 64 61 79 73 0a 3e 33 39 |d in 10 |days.>39|
|00000530| 20 30 32 20 2a 20 2a 20 | 2a 20 72 6f 6f 74 20 66 | 02 * * |* root f|
|00000540| 69 6e 64 20 2f 76 61 72 | 2f 63 61 74 6d 61 6e 2f |ind /var|/catman/|
|00000550| 63 61 74 3f 2f 2a 20 2d | 61 74 69 6d 65 20 2b 31 |cat?/* -|atime +1|
|00000560| 30 20 2d 65 78 65 63 20 | 72 6d 20 2d 66 20 7b 7d |0 -exec |rm -f {}|
|00000570| 20 5c 3b 20 32 3e 20 2f | 64 65 76 2f 6e 75 6c 6c | \; 2> /|dev/null|
|00000580| 0a 3e 0a 3e 23 20 52 65 | 6d 6f 76 65 20 61 6e 64 |.>.># Re|move and|
|00000590| 20 54 65 58 20 66 6f 6e | 74 73 20 6e 6f 74 20 75 | TeX fon|ts not u|
|000005a0| 73 65 64 20 69 6e 20 31 | 30 20 64 61 79 73 0a 3e |sed in 1|0 days.>|
|000005b0| 33 35 20 30 32 20 2a 20 | 2a 20 2a 20 72 6f 6f 74 |35 02 * |* * root|
|000005c0| 20 66 69 6e 64 20 2f 76 | 61 72 2f 6c 69 62 2f 74 | find /v|ar/lib/t|
|000005d0| 65 78 6d 66 2f 2a 20 2d | 74 79 70 65 20 66 20 2d |exmf/* -|type f -|
|000005e0| 61 74 69 6d 65 20 2b 31 | 30 20 2d 65 78 65 63 20 |atime +1|0 -exec |
|000005f0| 72 6d 20 2d 66 20 7b 7d | 20 5c 3b 20 32 3e 20 2f |rm -f {}| \; 2> /|
|00000600| 64 65 76 2f 6e 75 6c 6c | 0a 0a 46 6f 6c 6b 73 2c |dev/null|..Folks,|
|00000610| 20 64 6f 20 4e 4f 54 20 | 75 73 65 20 27 66 69 6e | do NOT |use 'fin|
|00000620| 64 27 20 6f 6e 20 61 20 | 70 75 62 6c 69 63 20 64 |d' on a |public d|
|00000630| 69 72 65 63 74 6f 72 79 | 20 77 69 74 68 20 27 2d |irectory| with '-|
|00000640| 65 78 65 63 20 72 6d 20 | 2d 66 27 20 61 73 20 72 |exec rm |-f' as r|
|00000650| 6f 6f 74 2e 0a 50 65 72 | 69 6f 64 2e 20 20 45 76 |oot..Per|iod. Ev|
|00000660| 65 72 2e 20 20 44 65 6c | 65 74 65 20 69 74 20 66 |er. Del|ete it f|
|00000670| 72 6f 6d 20 79 6f 75 72 | 20 63 72 6f 6e 74 61 62 |rom your| crontab|
|00000680| 20 2a 6e 6f 77 2a 20 61 | 6e 64 20 66 69 6e 69 73 | *now* a|nd finis|
|00000690| 68 20 72 65 61 64 69 6e | 67 20 74 68 65 0a 72 65 |h readin|g the.re|
|000006a0| 73 74 20 6f 66 20 74 68 | 69 73 20 6d 65 73 73 61 |st of th|is messa|
|000006b0| 67 65 20 6c 61 74 65 72 | 2e 0a 0a 2a 20 50 52 4f |ge later|...* PRO|
|000006c0| 42 4c 45 4d 20 44 49 53 | 43 55 53 53 49 4f 4e 20 |BLEM DIS|CUSSION |
|000006d0| 41 4e 44 20 45 58 50 4c | 4f 49 54 41 54 49 4f 4e |AND EXPL|OITATION|
|000006e0| 0a 0a 54 68 65 20 69 6d | 6d 65 64 69 61 74 65 20 |..The im|mediate |
|000006f0| 73 65 63 75 72 69 74 79 | 20 70 72 6f 62 6c 65 6d |security| problem|
|00000700| 20 69 73 20 74 68 61 74 | 20 27 72 6d 27 20 64 6f | is that| 'rm' do|
|00000710| 65 73 6e 27 74 20 63 68 | 65 63 6b 20 74 68 61 74 |esn't ch|eck that|
|00000720| 0a 63 6f 6d 70 6f 6e 65 | 6e 74 73 20 6f 66 20 74 |.compone|nts of t|
|00000730| 68 65 20 64 69 72 65 63 | 74 6f 72 79 20 6e 61 6d |he direc|tory nam|
|00000740| 65 20 61 72 65 20 6e 6f | 74 20 73 79 6d 6c 69 6e |e are no|t symlin|
|00000750| 6b 73 2e 20 20 54 68 69 | 73 20 6d 65 61 6e 73 20 |ks. Thi|s means |
|00000760| 74 68 61 74 20 79 6f 75 | 0a 63 61 6e 20 64 65 6c |that you|.can del|
|00000770| 65 74 65 20 61 6e 79 20 | 66 69 6c 65 20 6f 6e 20 |ete any |file on |
|00000780| 74 68 65 20 73 79 73 74 | 65 6d 3b 20 69 6e 64 65 |the syst|em; inde|
|00000790| 65 64 2c 20 77 69 74 68 | 20 61 20 6c 69 74 74 6c |ed, with| a littl|
|000007a0| 65 20 77 6f 72 6b 20 79 | 6f 75 20 63 61 6e 0a 64 |e work y|ou can.d|
|000007b0| 65 6c 65 74 65 20 2a 65 | 76 65 72 79 2a 20 66 69 |elete *e|very* fi|
|000007c0| 6c 65 20 6f 6e 20 74 68 | 65 20 73 79 73 74 65 6d |le on th|e system|
|000007d0| 2c 20 70 72 6f 76 69 64 | 65 64 20 74 68 61 74 20 |, provid|ed that |
|000007e0| 79 6f 75 20 63 61 6e 20 | 64 65 74 65 72 6d 69 6e |you can |determin|
|000007f0| 65 20 74 68 65 0a 66 69 | 6c 65 20 6e 61 6d 65 73 |e the.fi|le names|
|00000800| 20 28 74 68 6f 75 67 68 | 20 79 6f 75 20 6d 69 67 | (though| you mig|
|00000810| 68 74 20 62 65 20 6c 69 | 6d 69 74 65 64 20 74 6f |ht be li|mited to|
|00000820| 20 64 65 6c 65 74 69 6e | 67 20 66 69 6c 65 73 20 | deletin|g files |
|00000830| 6d 6f 72 65 20 74 68 61 | 6e 20 74 65 6e 0a 64 61 |more tha|n ten.da|
|00000840| 79 73 20 6f 6c 64 29 2e | 0a 0a 46 69 72 73 74 2c |ys old).|..First,|
|00000850| 20 63 72 65 61 74 65 20 | 74 68 65 20 64 69 72 65 | create |the dire|
|00000860| 63 74 6f 72 69 65 73 20 | 61 6e 64 20 66 69 6c 65 |ctories |and file|
|00000870| 3a 0a 0a 09 2f 74 6d 70 | 2f 68 61 63 6b 65 72 2d |:.../tmp|/hacker-|
|00000880| 66 65 73 74 2f 73 6f 6d | 65 2f 61 72 62 69 74 72 |fest/som|e/arbitr|
|00000890| 61 72 79 2f 73 65 74 2f | 6f 66 2f 70 61 74 68 2f |ary/set/|of/path/|
|000008a0| 6e 61 6d 65 73 2f 65 74 | 63 2f 70 61 73 73 77 64 |names/et|c/passwd|
|000008b0| 0a 0a 77 68 65 72 65 20 | 61 6c 6c 20 62 75 74 20 |..where |all but |
|000008c0| 74 68 65 20 6c 61 73 74 | 20 63 6f 6d 70 6f 6e 65 |the last| compone|
|000008d0| 6e 74 20 69 73 20 61 20 | 64 69 72 65 63 74 6f 72 |nt is a |director|
|000008e0| 79 2e 20 20 42 65 20 72 | 65 61 64 79 20 74 6f 20 |y. Be r|eady to |
|000008f0| 0a 72 65 70 6c 61 63 65 | 20 27 65 74 63 27 20 77 |.replace| 'etc' w|
|00000900| 69 74 68 20 61 20 73 79 | 6d 6c 69 6e 6b 20 74 6f |ith a sy|mlink to|
|00000910| 20 27 2f 65 74 63 27 2c | 20 73 6f 20 74 68 61 74 | '/etc',| so that|
|00000920| 3a 0a 09 0a 09 2f 74 6d | 70 2f 68 61 63 6b 65 72 |:..../tm|p/hacker|
|00000930| 2d 66 65 73 74 2f 73 6f | 6d 65 2f 61 72 62 69 74 |-fest/so|me/arbit|
|00000940| 72 61 72 79 2f 73 65 74 | 2f 6f 66 2f 70 61 74 68 |rary/set|/of/path|
|00000950| 2f 6e 61 6d 65 73 2f 65 | 74 63 20 2d 3e 20 2f 65 |/names/e|tc -> /e|
|00000960| 74 63 0a 0a 69 2e 65 2e | 20 74 68 65 20 70 61 74 |tc..i.e.| the pat|
|00000970| 68 20 63 6f 6d 70 6f 6e | 65 6e 74 73 20 6f 66 20 |h compon|ents of |
|00000980| 74 68 65 20 66 69 6c 65 | 20 6e 61 6d 65 20 77 69 |the file| name wi|
|00000990| 6c 6c 20 70 6f 69 6e 74 | 20 74 6f 20 61 20 66 69 |ll point| to a fi|
|000009a0| 6c 65 20 6e 61 6d 65 64 | 0a 27 70 61 73 73 77 64 |le named|.'passwd|
|000009b0| 27 20 69 6e 20 61 20 64 | 69 66 66 65 72 65 6e 74 |' in a d|ifferent|
|000009c0| 20 64 69 72 65 63 74 6f | 72 79 2e 0a 0a 49 66 20 | directo|ry...If |
|000009d0| 74 68 65 20 72 65 70 6c | 61 63 65 6d 65 6e 74 20 |the repl|acement |
|000009e0| 6f 70 65 72 61 74 69 6f | 6e 20 6f 63 63 75 72 73 |operatio|n occurs|
|000009f0| 20 62 65 74 77 65 65 6e | 20 77 68 65 6e 20 27 66 | between| when 'f|
|00000a00| 69 6e 64 27 20 73 65 74 | 73 20 7b 7d 20 74 6f 0a |ind' set|s {} to.|
|00000a10| 22 2f 74 6d 70 2f 68 61 | 63 6b 65 72 2e 2e 2e 65 |"/tmp/ha|cker...e|
|00000a20| 74 63 2f 70 61 73 73 77 | 64 22 20 61 6e 64 20 77 |tc/passw|d" and w|
|00000a30| 68 65 6e 20 27 72 6d 27 | 20 63 61 6c 6c 73 20 75 |hen 'rm'| calls u|
|00000a40| 6e 6c 69 6e 6b 20 6f 6e | 0a 22 2f 74 6d 70 2f 68 |nlink on|."/tmp/h|
|00000a50| 61 63 6b 65 72 2e 2e 2e | 65 74 63 2f 70 61 73 73 |acker...|etc/pass|
|00000a60| 77 64 22 2c 20 74 68 65 | 6e 20 72 6d 20 77 69 6c |wd", the|n rm wil|
|00000a70| 6c 20 69 6e 20 66 61 63 | 74 20 64 65 6c 65 74 65 |l in fac|t delete|
|00000a80| 20 27 2f 65 74 63 2f 70 | 61 73 73 77 64 27 2c 0a | '/etc/p|asswd',.|
|00000a90| 61 6e 64 20 6e 6f 74 20 | 61 20 66 69 6c 65 20 69 |and not |a file i|
|00000aa0| 6e 20 2f 74 6d 70 2e 20 | 20 44 65 6c 65 74 69 6e |n /tmp. | Deletin|
|00000ab0| 67 20 6f 74 68 65 72 20 | 66 69 6c 65 73 20 69 73 |g other |files is|
|00000ac0| 20 6c 65 66 74 20 61 73 | 20 61 6e 20 65 78 65 72 | left as| an exer|
|00000ad0| 63 69 73 65 2e 0a 0a 54 | 68 65 20 72 61 63 65 20 |cise...T|he race |
|00000ae0| 63 6f 6e 64 69 74 69 6f | 6e 20 69 73 20 72 65 61 |conditio|n is rea|
|00000af0| 6c 6c 79 20 65 61 73 79 | 20 74 6f 20 77 69 6e 2e |lly easy| to win.|
|00000b00| 20 20 43 72 65 61 74 65 | 20 61 20 64 69 72 65 63 | Create| a direc|
|00000b10| 74 6f 72 79 20 77 69 74 | 68 20 34 30 30 0a 70 61 |tory wit|h 400.pa|
|00000b20| 74 68 20 63 6f 6d 70 6f | 6e 65 6e 74 73 2c 20 6c |th compo|nents, l|
|00000b30| 69 6b 65 20 74 68 69 73 | 3a 0a 0a 09 2f 74 6d 70 |ike this|:.../tmp|
|00000b40| 2f 68 61 63 6b 65 72 2d | 66 65 73 74 2f 61 2f 61 |/hacker-|fest/a/a|
|00000b50| 2f 61 2f 61 2f 61 2f 61 | 2f 61 2e 2e 2e 2f 61 2f |/a/a/a/a|/a.../a/|
|00000b60| 61 2f 61 2f 65 74 63 2f | 70 61 73 73 77 64 09 28 |a/a/etc/|passwd.(|
|00000b70| 31 29 0a 0a 54 68 65 6e | 20 61 72 72 61 6e 67 65 |1)..Then| arrange|
|00000b80| 20 66 6f 72 20 65 61 63 | 68 20 6f 66 20 74 68 65 | for eac|h of the|
|00000b90| 20 27 61 27 20 63 6f 6d | 70 6f 6e 65 6e 74 73 20 | 'a' com|ponents |
|00000ba0| 74 6f 20 62 65 20 61 20 | 73 79 6d 6c 69 6e 6b 20 |to be a |symlink |
|00000bb0| 74 6f 20 61 0a 64 69 72 | 65 63 74 6f 72 79 20 73 |to a.dir|ectory s|
|00000bc0| 6f 6d 65 77 68 65 72 65 | 20 6e 65 61 72 20 74 68 |omewhere| near th|
|00000bd0| 65 20 62 6f 74 74 6f 6d | 20 6f 66 20 61 20 73 69 |e bottom| of a si|
|00000be0| 6d 69 6c 61 72 20 74 72 | 65 65 2e 20 20 46 6f 72 |milar tr|ee. For|
|00000bf0| 20 65 78 61 6d 70 6c 65 | 2c 0a 0a 09 2f 74 6d 70 | example|,.../tmp|
|00000c00| 2f 68 61 63 6b 65 72 2d | 66 65 73 74 2f 61 0a 0a |/hacker-|fest/a..|
|00000c10| 63 6f 75 6c 64 20 62 65 | 20 61 20 73 79 6d 6c 69 |could be| a symli|
|00000c20| 6e 6b 20 74 6f 0a 0a 09 | 2f 74 6d 70 2f 68 61 63 |nk to...|/tmp/hac|
|00000c30| 6b 65 72 2d 66 65 73 74 | 2f 62 2f 62 2f 62 2f 62 |ker-fest|/b/b/b/b|
|00000c40| 2f 62 2f 62 2f 62 2f 62 | 2f 62 2f 2e 2e 2e 2f 62 |/b/b/b/b|/b/.../b|
|00000c50| 2f 62 2f 62 2f 62 2f 62 | 2f 62 2f 61 0a 0a 77 68 |/b/b/b/b|/b/a..wh|
|00000c60| 69 63 68 20 63 6f 75 6c | 64 20 62 65 20 61 20 73 |ich coul|d be a s|
|00000c70| 79 6d 6c 69 6e 6b 20 74 | 6f 0a 0a 09 2f 74 6d 70 |ymlink t|o.../tmp|
|00000c80| 2f 68 61 63 6b 65 72 2d | 66 65 73 74 2f 63 2f 63 |/hacker-|fest/c/c|
|00000c90| 2f 63 2f 63 2f 63 2f 63 | 2f 2e 2e 2e 2f 63 2f 63 |/c/c/c/c|/.../c/c|
|00000ca0| 2f 63 2f 63 2f 63 2f 63 | 2f 63 0a 0a 61 6e 64 20 |/c/c/c/c|/c..and |
|00000cb0| 73 6f 20 6f 6e 2e 20 20 | 49 6e 20 66 61 63 74 2c |so on. |In fact,|
|00000cc0| 20 2a 65 61 63 68 2a 20 | 70 61 74 68 20 63 6f 6d | *each* |path com|
|00000cd0| 70 6f 6e 65 6e 74 20 63 | 61 6e 20 62 65 20 61 20 |ponent c|an be a |
|00000ce0| 73 79 6d 6c 69 6e 6b 20 | 75 70 20 74 6f 20 61 62 |symlink |up to ab|
|00000cf0| 6f 75 74 0a 38 20 6c 65 | 76 65 6c 73 20 6f 72 20 |out.8 le|vels or |
|00000d00| 73 6f 2e 20 20 41 6e 79 | 20 6f 70 65 72 61 74 69 |so. Any| operati|
|00000d10| 6f 6e 20 73 75 63 68 20 | 61 73 20 73 74 61 74 28 |on such |as stat(|
|00000d20| 29 2c 20 6f 70 65 6e 28 | 29 2c 20 6c 73 74 61 74 |), open(|), lstat|
|00000d30| 28 29 2c 20 65 74 63 2e | 0a 6f 6e 20 6f 6e 65 20 |(), etc.|.on one |
|00000d40| 6f 66 20 74 68 65 73 65 | 20 70 61 74 68 6e 61 6d |of these| pathnam|
|00000d50| 65 73 20 77 69 6c 6c 20 | 63 61 75 73 65 20 74 68 |es will |cause th|
|00000d60| 65 20 6b 65 72 6e 65 6c | 20 74 6f 20 66 6f 6c 6c |e kernel| to foll|
|00000d70| 6f 77 20 65 61 63 68 20 | 61 6e 64 20 65 76 65 72 |ow each |and ever|
|00000d80| 79 0a 73 79 6d 6c 69 6e | 6b 2e 20 20 54 68 65 20 |y.symlin|k. The |
|00000d90| 64 69 66 66 65 72 65 6e | 63 65 20 62 65 74 77 65 |differen|ce betwe|
|00000da0| 65 6e 20 6c 73 74 61 74 | 28 29 20 61 6e 64 20 73 |en lstat|() and s|
|00000db0| 74 61 74 28 29 20 69 6e | 20 74 68 69 73 20 63 61 |tat() in| this ca|
|00000dc0| 73 65 20 69 73 20 74 68 | 61 74 0a 6c 73 74 61 74 |se is th|at.lstat|
|00000dd0| 28 29 20 77 69 6c 6c 20 | 6e 6f 74 20 66 6f 6c 6c |() will |not foll|
|00000de0| 6f 77 20 74 68 65 20 2a | 6c 61 73 74 2a 20 73 79 |ow the *|last* sy|
|00000df0| 6d 6c 69 6e 6b 2e 0a 0a | 54 68 69 73 20 77 69 6c |mlink...|This wil|
|00000e00| 6c 20 6d 61 6b 65 20 6c | 73 74 61 74 28 29 20 61 |l make l|stat() a|
|00000e10| 6e 64 20 66 72 69 65 6e | 64 73 20 2a 65 78 74 72 |nd frien|ds *extr|
|00000e20| 65 6d 65 6c 79 2a 20 73 | 6c 6f 77 2c 20 6f 6e 20 |emely* s|low, on |
|00000e30| 74 68 65 20 6f 72 64 65 | 72 20 6f 66 0a 73 65 76 |the orde|r of.sev|
|00000e40| 65 72 61 6c 20 2a 6d 69 | 6e 75 74 65 73 2a 20 70 |eral *mi|nutes* p|
|00000e50| 65 72 20 6c 73 74 61 74 | 28 29 20 6f 70 65 72 61 |er lstat|() opera|
|00000e60| 74 69 6f 6e 2c 20 62 65 | 63 61 75 73 65 20 65 61 |tion, be|cause ea|
|00000e70| 63 68 20 6c 73 74 61 74 | 28 29 20 69 73 20 6e 6f |ch lstat|() is no|
|00000e80| 77 0a 72 65 61 64 69 6e | 67 20 69 6e 20 73 65 76 |w.readin|g in sev|
|00000e90| 65 72 61 6c 20 74 68 6f | 75 73 61 6e 64 20 69 6e |eral tho|usand in|
|00000ea0| 6f 64 65 73 20 61 6e 64 | 20 64 69 73 6b 20 62 6c |odes and| disk bl|
|00000eb0| 6f 63 6b 73 2e 20 20 49 | 66 20 79 6f 75 20 66 69 |ocks. I|f you fi|
|00000ec0| 6c 6c 20 65 61 63 68 0a | 64 69 72 65 63 74 6f 72 |ll each.|director|
|00000ed0| 79 20 77 69 74 68 20 73 | 65 76 65 72 61 6c 20 68 |y with s|everal h|
|00000ee0| 75 6e 64 72 65 64 20 65 | 6e 74 72 69 65 73 2c 20 |undred e|ntries, |
|00000ef0| 74 68 65 6e 20 63 72 65 | 61 74 65 20 74 68 65 20 |then cre|ate the |
|00000f00| 65 6e 74 72 79 20 79 6f | 75 20 77 61 6e 74 2c 0a |entry yo|u want,.|
|00000f10| 74 68 65 6e 20 64 65 6c | 65 74 65 20 74 68 65 20 |then del|ete the |
|00000f20| 6f 74 68 65 72 73 2c 20 | 79 6f 75 20 66 6f 72 63 |others, |you forc|
|00000f30| 65 20 74 68 65 20 6b 65 | 72 6e 65 6c 20 74 6f 20 |e the ke|rnel to |
|00000f40| 77 61 73 74 65 20 69 74 | 73 20 74 69 6d 65 20 72 |waste it|s time r|
|00000f50| 65 61 64 69 6e 67 0a 6b | 69 6c 6f 62 79 74 65 73 |eading.k|ilobytes|
|00000f60| 20 6f 66 20 65 6d 70 74 | 79 20 64 69 72 65 63 74 | of empt|y direct|
|00000f70| 6f 72 79 20 62 6c 6f 63 | 6b 73 2d 2d 69 6e 20 66 |ory bloc|ks--in f|
|00000f80| 61 63 74 2c 20 79 6f 75 | 20 63 61 6e 20 6d 61 6b |act, you| can mak|
|00000f90| 65 20 6f 6e 65 20 73 74 | 61 74 28 29 20 6f 72 0a |e one st|at() or.|
|00000fa0| 75 6e 6c 69 6e 6b 28 29 | 20 6f 70 65 72 61 74 69 |unlink()| operati|
|00000fb0| 6f 6e 20 72 65 61 64 20 | 61 6c 6d 6f 73 74 20 74 |on read |almost t|
|00000fc0| 68 65 20 65 6e 74 69 72 | 65 20 64 69 73 6b 20 69 |he entir|e disk i|
|00000fd0| 6e 20 61 6e 20 6f 72 64 | 65 72 20 64 65 73 69 67 |n an ord|er desig|
|00000fe0| 6e 65 64 20 74 6f 0a 6d | 61 78 69 6d 69 7a 65 20 |ned to.m|aximize |
|00000ff0| 64 69 73 6b 20 68 65 61 | 64 20 6d 6f 74 69 6f 6e |disk hea|d motion|
|00001000| 20 69 66 20 79 6f 75 20 | 6b 6e 6f 77 20 77 68 61 | if you |know wha|
|00001010| 74 20 79 6f 75 27 72 65 | 20 64 6f 69 6e 67 2e 20 |t you're| doing. |
|00001020| 20 49 66 20 79 6f 75 20 | 68 61 76 65 20 61 6e 0a | If you |have an.|
|00001030| 4e 46 53 2c 20 43 44 52 | 4f 4d 2c 20 6f 72 20 66 |NFS, CDR|OM, or f|
|00001040| 6c 6f 70 70 79 2d 64 69 | 73 6b 20 66 69 6c 65 73 |loppy-di|sk files|
|00001050| 79 73 74 65 6d 20 68 61 | 6e 64 79 2c 20 79 6f 75 |ystem ha|ndy, you|
|00001060| 20 63 61 6e 20 67 65 74 | 20 2a 77 65 65 6b 73 2a | can get| *weeks*|
|00001070| 20 70 65 72 0a 6c 73 74 | 61 74 28 29 2e 20 20 0a | per.lst|at(). .|
|00001080| 0a 4f 66 20 63 6f 75 72 | 73 65 2c 20 27 66 69 6e |.Of cour|se, 'fin|
|00001090| 64 27 20 77 69 6c 6c 20 | 6e 6f 72 6d 61 6c 6c 79 |d' will |normally|
|000010a0| 20 73 65 65 20 74 68 65 | 20 66 69 72 73 74 20 73 | see the| first s|
|000010b0| 79 6d 6c 69 6e 6b 20 61 | 6e 64 20 73 74 6f 70 2e |ymlink a|nd stop.|
|000010c0| 20 20 54 6f 0a 70 72 65 | 76 65 6e 74 20 74 68 69 | To.pre|vent thi|
|000010d0| 73 2c 20 79 6f 75 20 72 | 65 6e 61 6d 65 20 74 68 |s, you r|ename th|
|000010e0| 65 20 6f 72 69 67 69 6e | 61 6c 20 64 69 72 65 63 |e origin|al direc|
|000010f0| 74 6f 72 79 20 28 61 74 | 20 28 31 29 20 61 62 6f |tory (at| (1) abo|
|00001100| 76 65 29 20 61 6e 64 0a | 63 72 65 61 74 65 20 61 |ve) and.|create a|
|00001110| 6e 6f 74 68 65 72 20 64 | 69 72 65 63 74 6f 72 79 |nother d|irectory|
|00001120| 20 77 69 74 68 20 74 68 | 65 20 73 61 6d 65 20 6e | with th|e same n|
|00001130| 61 6d 65 20 61 6e 64 20 | 61 62 6f 75 74 20 35 30 |ame and |about 50|
|00001140| 30 30 20 65 6d 70 74 79 | 20 66 69 6c 65 73 2c 0a |00 empty| files,.|
|00001150| 73 6f 6d 65 20 6f 66 20 | 77 68 69 63 68 20 68 61 |some of |which ha|
|00001160| 76 65 20 74 68 65 20 73 | 61 6d 65 20 6e 61 6d 65 |ve the s|ame name|
|00001170| 20 61 73 20 66 69 6c 65 | 73 20 79 6f 75 20 77 61 | as file|s you wa|
|00001180| 6e 74 20 74 6f 20 64 65 | 6c 65 74 65 2e 20 20 4e |nt to de|lete. N|
|00001190| 6f 74 65 20 74 68 61 74 | 0a 74 68 65 73 65 20 35 |ote that|.these 5|
|000011a0| 30 30 30 20 65 6d 70 74 | 79 20 66 69 6c 65 73 20 |000 empt|y files |
|000011b0| 63 61 6e 20 61 6c 6c 20 | 62 65 20 68 61 72 64 20 |can all |be hard |
|000011c0| 6c 69 6e 6b 73 20 74 6f | 20 74 68 65 20 73 61 6d |links to| the sam|
|000011d0| 65 20 66 69 6c 65 2c 20 | 74 6f 20 73 61 76 65 0a |e file, |to save.|
|000011e0| 70 72 65 63 69 6f 75 73 | 20 69 6e 6f 64 65 73 20 |precious| inodes |
|000011f0| 66 6f 72 20 6d 6f 72 65 | 20 6f 66 20 74 68 6f 73 |for more| of thos|
|00001200| 65 20 73 79 6d 6c 69 6e | 6b 73 2e 0a 0a 27 66 69 |e symlin|ks...'fi|
|00001210| 6e 64 27 20 77 69 6c 6c | 20 73 70 65 6e 64 20 63 |nd' will| spend c|
|00001220| 6f 6e 73 69 64 65 72 61 | 62 6c 65 20 74 69 6d 65 |onsidera|ble time|
|00001230| 20 69 74 65 72 61 74 69 | 6e 67 20 74 68 72 6f 75 | iterati|ng throu|
|00001240| 67 68 20 74 68 65 73 65 | 20 35 30 30 30 20 66 69 |gh these| 5000 fi|
|00001250| 6c 65 73 2e 0a 57 68 65 | 6e 20 69 74 20 64 6f 65 |les..Whe|n it doe|
|00001260| 73 20 28 79 6f 75 27 6c | 6c 20 62 65 20 61 62 6c |s (you'l|l be abl|
|00001270| 65 20 74 6f 20 74 65 6c | 6c 20 62 65 63 61 75 73 |e to tel|l becaus|
|00001280| 65 20 74 68 65 20 61 74 | 69 6d 65 20 6f 66 20 74 |e the at|ime of t|
|00001290| 68 65 20 64 69 72 65 63 | 74 6f 72 79 0a 63 68 61 |he direc|tory.cha|
|000012a0| 6e 67 65 73 20 61 73 20 | 66 69 6e 64 20 72 65 61 |nges as |find rea|
|000012b0| 64 73 20 69 74 29 2c 20 | 70 75 74 20 74 68 65 20 |ds it), |put the |
|000012c0| 64 69 72 65 63 74 6f 72 | 79 20 77 69 74 68 20 74 |director|y with t|
|000012d0| 68 65 20 6d 69 6c 6c 69 | 6f 6e 73 20 6f 66 0a 73 |he milli|ons of.s|
|000012e0| 79 6d 6c 69 6e 6b 73 20 | 61 74 20 28 31 29 20 62 |ymlinks |at (1) b|
|000012f0| 61 63 6b 20 77 69 74 68 | 20 61 20 63 6f 75 70 6c |ack with| a coupl|
|00001300| 65 20 6f 66 20 72 65 6e | 61 6d 65 20 6f 70 65 72 |e of ren|ame oper|
|00001310| 61 74 69 6f 6e 73 2e 20 | 20 53 6f 6d 65 20 76 65 |ations. | Some ve|
|00001320| 72 73 69 6f 6e 73 0a 6f | 66 20 27 66 69 6e 64 27 |rsions.o|f 'find'|
|00001330| 20 77 69 6c 6c 20 6e 6f | 74 20 62 65 20 61 64 76 | will no|t be adv|
|00001340| 65 72 73 65 6c 79 20 69 | 6d 70 61 63 74 65 64 20 |ersely i|mpacted |
|00001350| 62 79 20 74 68 69 73 2c | 20 62 75 74 20 27 72 6d |by this,| but 'rm|
|00001360| 27 20 64 65 66 69 6e 69 | 74 65 6c 79 0a 77 69 6c |' defini|tely.wil|
|00001370| 6c 2e 0a 0a 49 74 20 69 | 73 20 75 73 75 61 6c 6c |l...It i|s usuall|
|00001380| 79 20 73 75 66 66 69 63 | 69 65 6e 74 20 74 6f 20 |y suffic|ient to |
|00001390| 73 69 6d 70 6c 79 20 63 | 72 65 61 74 65 20 74 68 |simply c|reate th|
|000013a0| 65 20 34 30 30 2d 63 6f | 6d 70 6f 6e 65 6e 74 2d |e 400-co|mponent-|
|000013b0| 6c 6f 6e 67 0a 64 69 72 | 65 63 74 6f 72 79 2c 20 |long.dir|ectory, |
|000013c0| 70 75 74 20 35 30 30 30 | 20 66 69 6c 65 73 20 69 |put 5000| files i|
|000013d0| 6e 20 69 74 2c 20 77 61 | 69 74 20 66 6f 72 20 74 |n it, wa|it for t|
|000013e0| 68 65 20 61 74 69 6d 65 | 20 6f 66 20 74 68 65 20 |he atime| of the |
|000013f0| 64 69 72 65 63 74 6f 72 | 79 20 74 6f 0a 63 68 61 |director|y to.cha|
|00001400| 6e 67 65 2c 20 74 68 65 | 6e 20 64 6f 20 74 68 65 |nge, the|n do the|
|00001410| 20 72 65 6e 61 6d 65 20 | 73 6f 20 74 68 61 74 20 | rename |so that |
|00001420| 27 72 6d 27 20 66 6f 6c | 6c 6f 77 73 20 61 20 73 |'rm' fol|lows a s|
|00001430| 79 6d 6c 69 6e 6b 2e 20 | 20 49 20 75 73 65 64 20 |ymlink. | I used |
|00001440| 74 68 69 73 0a 74 65 63 | 68 6e 69 71 75 65 20 74 |this.tec|hnique t|
|00001450| 6f 20 72 65 6d 6f 76 65 | 20 2f 65 74 63 2f 63 72 |o remove| /etc/cr|
|00001460| 6f 6e 74 61 62 20 61 73 | 20 61 20 74 65 73 74 20 |ontab as| a test |
|00001470| 63 61 73 65 2e 20 20 0a | 0a 49 66 20 79 6f 75 20 |case. .|.If you |
|00001480| 68 61 76 65 3a 0a 0a 09 | 2f 74 6d 70 2f 68 61 63 |have:...|/tmp/hac|
|00001490| 6b 65 72 2d 66 65 73 74 | 2f 61 2f 61 2f 61 2f 61 |ker-fest|/a/a/a/a|
|000014a0| 2f 61 2f 2e 2e 2e 2f 61 | 2f 65 74 63 2f 70 61 73 |/a/.../a|/etc/pas|
|000014b0| 73 77 64 20 28 61 6e 64 | 20 35 30 30 30 2b 20 6f |swd (and| 5000+ o|
|000014c0| 74 68 65 72 20 66 69 6c | 65 73 29 0a 09 2f 74 6d |ther fil|es)../tm|
|000014d0| 70 2f 68 61 63 6b 65 72 | 2d 66 65 73 74 2f 61 2f |p/hacker|-fest/a/|
|000014e0| 61 2f 61 2f 61 2f 61 2f | 2e 2e 2e 2f 61 2f 75 73 |a/a/a/a/|.../a/us|
|000014f0| 72 0a 0a 77 68 65 72 65 | 20 27 75 73 72 27 20 69 |r..where| 'usr' i|
|00001500| 73 20 61 20 73 79 6d 6c | 69 6e 6b 20 74 6f 20 27 |s a syml|ink to '|
|00001510| 2f 75 73 72 27 2c 20 79 | 6f 75 20 63 61 6e 20 67 |/usr', y|ou can g|
|00001520| 65 74 20 73 6f 6d 65 20 | 69 6d 70 6c 65 6d 65 6e |et some |implemen|
|00001530| 74 61 74 69 6f 6e 73 20 | 6f 66 0a 66 69 6e 64 20 |tations |of.find |
|00001540| 74 6f 20 73 74 61 72 74 | 20 72 65 63 75 72 73 69 |to start| recursi|
|00001550| 6e 67 20 74 68 72 6f 75 | 67 68 20 2f 75 73 72 20 |ng throu|gh /usr |
|00001560| 61 73 20 77 65 6c 6c 2e | 0a 0a 2a 20 4f 54 48 45 |as well.|..* OTHE|
|00001570| 52 20 50 52 4f 42 4c 45 | 4d 53 20 57 49 54 48 20 |R PROBLE|MS WITH |
|00001580| 54 48 49 53 20 43 52 4f | 4e 54 41 42 0a 0a 41 20 |THIS CRO|NTAB..A |
|00001590| 75 73 65 72 20 63 61 6e | 20 73 65 74 20 74 68 65 |user can| set the|
|000015a0| 20 61 74 69 6d 65 20 6f | 66 20 61 6e 79 20 66 69 | atime o|f any fi|
|000015b0| 6c 65 20 74 68 65 79 20 | 6f 77 6e 20 74 6f 20 61 |le they |own to a|
|000015c0| 6e 20 61 72 62 69 74 72 | 61 72 79 20 76 61 6c 75 |n arbitr|ary valu|
|000015d0| 65 2c 20 61 6e 64 0a 74 | 68 61 74 20 70 72 6f 67 |e, and.t|hat prog|
|000015e0| 72 61 6d 73 20 6c 69 6b | 65 20 7a 69 70 2c 20 74 |rams lik|e zip, t|
|000015f0| 61 72 2c 20 61 6e 64 20 | 63 70 69 6f 20 77 69 6c |ar, and |cpio wil|
|00001600| 6c 20 64 6f 20 74 68 69 | 73 20 66 6f 72 20 79 6f |l do thi|s for yo|
|00001610| 75 0a 61 75 74 6f 6d 61 | 74 69 63 61 6c 6c 79 3b |u.automa|tically;|
|00001620| 20 74 68 69 73 20 6d 61 | 6b 65 73 20 27 61 74 69 | this ma|kes 'ati|
|00001630| 6d 65 27 20 61 6e 20 61 | 6c 6d 6f 73 74 20 75 73 |me' an a|lmost us|
|00001640| 65 6c 65 73 73 20 69 6e | 64 69 63 61 74 6f 72 20 |eless in|dicator |
|00001650| 6f 66 20 77 68 65 6e 20 | 61 0a 66 69 6c 65 20 77 |of when |a.file w|
|00001660| 61 73 20 6c 61 73 74 20 | 75 73 65 64 20 28 27 6d |as last |used ('m|
|00001670| 74 69 6d 65 27 20 68 61 | 73 20 74 68 65 20 73 61 |time' ha|s the sa|
|00001680| 6d 65 20 70 72 6f 62 6c | 65 6d 29 2e 20 20 45 69 |me probl|em). Ei|
|00001690| 74 68 65 72 20 74 68 65 | 20 66 69 6c 65 20 77 69 |ther the| file wi|
|000016a0| 6c 6c 0a 62 65 20 64 65 | 6c 65 74 65 64 20 74 6f |ll.be de|leted to|
|000016b0| 6f 20 65 61 72 6c 79 2c | 20 62 65 63 61 75 73 65 |o early,| because|
|000016c0| 20 69 74 20 77 61 73 20 | 65 78 74 72 61 63 74 65 | it was |extracte|
|000016d0| 64 20 66 72 6f 6d 20 61 | 6e 20 61 72 63 68 69 76 |d from a|n archiv|
|000016e0| 65 20 75 73 69 6e 67 20 | 61 0a 70 72 6f 67 72 61 |e using |a.progra|
|000016f0| 6d 20 74 68 61 74 20 70 | 72 65 73 65 72 76 65 73 |m that p|reserves|
|00001700| 20 74 69 6d 65 73 74 61 | 6d 70 73 2c 20 6f 72 20 | timesta|mps, or |
|00001710| 75 73 65 72 73 20 63 61 | 6e 20 73 65 74 20 74 68 |users ca|n set th|
|00001720| 65 20 61 74 69 6d 65 20 | 74 6f 20 77 65 6c 6c 0a |e atime |to well.|
|00001730| 69 6e 74 6f 20 74 68 65 | 20 66 75 74 75 72 65 20 |into the| future |
|00001740| 61 6e 64 20 75 73 65 20 | 2f 74 6d 70 20 73 70 61 |and use |/tmp spa|
|00001750| 63 65 20 69 6e 64 65 66 | 69 6e 69 74 65 6c 79 2e |ce indef|initely.|
|00001760| 20 20 54 68 65 20 6c 61 | 74 65 72 20 6f 66 20 63 | The la|ter of c|
|00001770| 74 69 6d 65 20 28 74 6f | 0a 64 65 74 65 63 74 20 |time (to|.detect |
|00001780| 77 72 69 74 65 73 29 20 | 61 6e 64 20 61 74 69 6d |writes) |and atim|
|00001790| 65 20 28 74 6f 20 64 65 | 74 65 63 74 20 72 65 61 |e (to de|tect rea|
|000017a0| 64 73 3b 20 6d 75 73 74 | 20 63 68 65 63 6b 20 74 |ds; must| check t|
|000017b0| 68 61 74 20 61 74 69 6d | 65 20 69 73 20 6e 6f 74 |hat atim|e is not|
|000017c0| 0a 69 6e 20 74 68 65 20 | 66 75 74 75 72 65 29 20 |.in the |future) |
|000017d0| 69 73 20 61 20 67 6f 6f | 64 20 69 6e 64 69 63 61 |is a goo|d indica|
|000017e0| 74 6f 72 20 6f 66 20 77 | 68 65 6e 20 61 20 66 69 |tor of w|hen a fi|
|000017f0| 6c 65 20 77 61 73 20 6c | 61 73 74 20 75 73 65 64 |le was l|ast used|
|00001800| 2e 0a 0a 4d 69 73 63 65 | 6c 6c 61 6e 65 6f 75 73 |...Misce|llaneous|
|00001810| 20 62 75 67 73 3a 20 20 | 74 68 65 20 75 73 65 20 | bugs: |the use |
|00001820| 6f 66 20 27 2a 27 20 6d | 65 61 6e 73 20 74 68 61 |of '*' m|eans tha|
|00001830| 74 20 66 69 6c 65 73 20 | 69 6e 20 61 20 64 69 72 |t files |in a dir|
|00001840| 65 63 74 6f 72 79 0a 6e | 61 6d 65 64 20 27 2e 66 |ectory.n|amed '.f|
|00001850| 6f 6f 27 20 77 69 6c 6c | 20 6e 65 76 65 72 20 62 |oo' will| never b|
|00001860| 65 20 63 6c 65 61 6e 65 | 64 20 28 61 6e 64 20 79 |e cleane|d (and y|
|00001870| 6f 75 20 63 61 6e 20 70 | 72 65 76 65 6e 74 20 27 |ou can p|revent '|
|00001880| 66 69 6e 64 27 20 66 72 | 6f 6d 0a 77 6f 72 6b 69 |find' fr|om.worki|
|00001890| 6e 67 20 61 74 20 61 6c | 6c 20 62 79 20 70 75 74 |ng at al|l by put|
|000018a0| 74 69 6e 67 20 6d 6f 72 | 65 20 74 68 61 6e 20 31 |ting mor|e than 1|
|000018b0| 30 32 30 20 66 69 6c 65 | 73 20 69 6e 20 2f 74 6d |020 file|s in /tm|
|000018c0| 70 29 2e 20 20 54 68 65 | 72 65 20 61 72 65 0a 73 |p). The|re are.s|
|000018d0| 75 62 64 69 72 65 63 74 | 6f 72 69 65 73 20 6f 66 |ubdirect|ories of|
|000018e0| 20 2f 76 61 72 2f 63 61 | 74 6d 61 6e 20 74 68 61 | /var/ca|tman tha|
|000018f0| 74 20 61 72 65 6e 27 74 | 20 70 72 6f 70 65 72 6c |t aren't| properl|
|00001900| 79 20 68 61 6e 64 6c 65 | 64 20 62 79 20 74 68 65 |y handle|d by the|
|00001910| 20 27 66 69 6e 64 27 0a | 63 6f 6d 6d 61 6e 64 20 | 'find'.|command |
|00001920| 67 69 76 65 6e 20 28 6c | 6f 63 61 6c 20 61 6e 64 |given (l|ocal and|
|00001930| 20 58 31 31 29 2e 20 20 | 59 6f 75 20 63 61 6e 27 | X11). |You can'|
|00001940| 74 20 64 65 6c 65 74 65 | 20 61 20 64 69 72 65 63 |t delete| a direc|
|00001950| 74 6f 72 79 20 77 69 74 | 68 0a 27 72 6d 20 2d 66 |tory wit|h.'rm -f|
|00001960| 27 2e 0a 0a 49 6e 20 6f | 74 68 65 72 20 77 6f 72 |'...In o|ther wor|
|00001970| 64 73 2c 20 6e 6f 74 20 | 6f 6e 6c 79 20 69 73 20 |ds, not |only is |
|00001980| 52 65 64 48 61 74 27 73 | 20 2f 65 74 63 2f 63 72 |RedHat's| /etc/cr|
|00001990| 6f 6e 74 61 62 20 61 20 | 6d 61 6a 6f 72 20 73 65 |ontab a |major se|
|000019a0| 63 75 72 69 74 79 20 68 | 6f 6c 65 2c 0a 69 74 20 |curity h|ole,.it |
|000019b0| 64 6f 65 73 6e 27 74 20 | 61 63 74 75 61 6c 6c 79 |doesn't |actually|
|000019c0| 20 77 6f 72 6b 20 70 72 | 6f 70 65 72 6c 79 2c 20 | work pr|operly, |
|000019d0| 65 69 74 68 65 72 2e 20 | 20 3a 28 0a 0a 2a 20 46 |either. | :(..* F|
|000019e0| 49 58 45 53 0a 0a 54 68 | 65 20 65 61 73 69 65 73 |IXES..Th|e easies|
|000019f0| 74 20 77 61 79 20 74 6f | 20 66 69 78 20 74 68 69 |t way to| fix thi|
|00001a00| 73 20 69 73 20 74 6f 20 | 67 65 74 20 72 69 64 20 |s is to |get rid |
|00001a10| 6f 66 20 74 68 65 20 66 | 69 6e 64 2f 72 6d 20 73 |of the f|ind/rm s|
|00001a20| 74 75 66 66 0a 63 6f 6d | 70 6c 65 74 65 6c 79 2e |tuff.com|pletely.|
|00001a30| 20 20 49 66 20 79 6f 75 | 20 6e 65 65 64 20 61 20 | If you| need a |
|00001a40| 67 61 72 62 61 67 65 20 | 63 6f 6c 6c 65 63 74 6f |garbage |collecto|
|00001a50| 72 2c 20 74 72 79 20 6f | 75 72 20 4c 52 55 20 67 |r, try o|ur LRU g|
|00001a60| 61 72 62 61 67 65 0a 63 | 6f 6c 6c 65 63 74 69 6f |arbage.c|ollectio|
|00001a70| 6e 20 64 61 65 6d 6f 6e | 20 61 74 20 74 68 65 20 |n daemon| at the |
|00001a80| 55 52 4c 20 67 69 76 65 | 6e 20 62 65 6c 6f 77 2e |URL give|n below.|
|00001a90| 0a 0a 41 64 64 69 6e 67 | 20 61 20 73 79 73 74 65 |..Adding| a syste|
|00001aa0| 6d 20 63 61 6c 6c 20 74 | 68 61 74 20 73 65 74 73 |m call t|hat sets|
|00001ab0| 20 61 20 66 6c 61 67 20 | 74 68 61 74 20 70 72 65 | a flag |that pre|
|00001ac0| 76 65 6e 74 73 20 61 20 | 70 72 6f 63 65 73 73 20 |vents a |process |
|00001ad0| 66 72 6f 6d 20 62 65 69 | 6e 67 0a 61 62 6c 65 20 |from bei|ng.able |
|00001ae0| 74 6f 20 65 76 65 72 20 | 66 6f 6c 6c 6f 77 20 61 |to ever |follow a|
|00001af0| 20 73 79 6d 6c 69 6e 6b | 20 77 6f 75 6c 64 20 62 | symlink| would b|
|00001b00| 65 20 6e 6f 6e 2d 70 6f | 72 74 61 62 6c 65 2c 20 |e non-po|rtable, |
|00001b10| 62 75 74 20 65 66 66 69 | 63 69 65 6e 74 20 61 6e |but effi|cient an|
|00001b20| 64 0a 65 66 66 65 63 74 | 69 76 65 2e 0a 0a 54 68 |d.effect|ive...Th|
|00001b30| 65 20 6e 65 78 74 20 65 | 61 73 69 65 73 74 20 77 |e next e|asiest w|
|00001b40| 61 79 20 74 6f 20 66 69 | 78 20 74 68 69 73 20 69 |ay to fi|x this i|
|00001b50| 73 20 74 6f 20 72 65 70 | 6c 61 63 65 20 27 72 6d |s to rep|lace 'rm|
|00001b60| 27 20 77 69 74 68 20 61 | 20 70 72 6f 67 72 61 6d |' with a| program|
|00001b70| 20 74 68 61 74 0a 64 6f | 65 73 20 6e 6f 74 20 66 | that.do|es not f|
|00001b80| 6f 6c 6c 6f 77 20 73 79 | 6d 6c 69 6e 6b 73 2e 20 |ollow sy|mlinks. |
|00001b90| 20 49 74 20 6d 75 73 74 | 20 63 68 65 63 6b 20 74 | It must| check t|
|00001ba0| 68 61 74 20 65 61 63 68 | 20 66 69 6c 65 6e 61 6d |hat each| filenam|
|00001bb0| 65 20 63 6f 6d 70 6f 6e | 65 6e 74 20 69 6e 0a 74 |e compon|ent in.t|
|00001bc0| 75 72 6e 20 62 79 20 64 | 6f 69 6e 67 20 61 6e 20 |urn by d|oing an |
|00001bd0| 6c 73 74 61 74 28 29 20 | 6f 66 20 74 68 65 20 64 |lstat() |of the d|
|00001be0| 69 72 65 63 74 6f 72 79 | 2c 20 63 68 64 69 72 28 |irectory|, chdir(|
|00001bf0| 29 20 69 6e 74 6f 20 74 | 68 65 20 64 69 72 65 63 |) into t|he direc|
|00001c00| 74 6f 72 79 2c 0a 61 6e | 64 20 66 75 72 74 68 65 |tory,.an|d furthe|
|00001c10| 72 20 6c 73 74 61 74 28 | 29 73 20 74 6f 20 63 68 |r lstat(|)s to ch|
|00001c20| 65 63 6b 20 74 68 61 74 | 20 74 68 65 20 64 65 76 |eck that| the dev|
|00001c30| 69 63 65 2f 69 6e 6f 64 | 65 20 6e 75 6d 62 65 72 |ice/inod|e number|
|00001c40| 20 6f 66 20 27 2e 27 20 | 69 73 0a 74 68 65 20 73 | of '.' |is.the s|
|00001c50| 61 6d 65 20 61 73 20 74 | 68 65 20 64 69 72 65 63 |ame as t|he direc|
|00001c60| 74 6f 72 79 27 73 20 64 | 65 76 69 63 65 2f 69 6e |tory's d|evice/in|
|00001c70| 6f 64 65 20 6e 75 6d 62 | 65 72 20 62 65 66 6f 72 |ode numb|er befor|
|00001c80| 65 20 63 68 64 69 72 28 | 29 2e 20 20 54 68 65 0a |e chdir(|). The.|
|00001c90| 70 61 72 61 6d 65 74 65 | 72 20 6f 66 20 74 68 65 |paramete|r of the|
|00001ca0| 20 27 75 6e 6c 69 6e 6b | 27 20 6f 72 20 27 72 6d | 'unlink|' or 'rm|
|00001cb0| 64 69 72 27 20 73 79 73 | 74 65 6d 20 63 61 6c 6c |dir' sys|tem call|
|00001cc0| 20 6d 75 73 74 20 6e 6f | 74 20 63 6f 6e 74 61 69 | must no|t contai|
|00001cd0| 6e 20 61 0a 73 6c 61 73 | 68 3b 20 69 66 20 69 74 |n a.slas|h; if it|
|00001ce0| 20 64 6f 65 73 2c 20 74 | 68 65 6e 20 74 68 65 20 | does, t|hen the |
|00001cf0| 64 69 72 65 63 74 6f 72 | 79 20 6e 61 6d 65 20 62 |director|y name b|
|00001d00| 65 66 6f 72 65 20 74 68 | 65 20 73 6c 61 73 68 20 |efore th|e slash |
|00001d10| 63 61 6e 20 62 65 0a 72 | 65 70 6c 61 63 65 64 20 |can be.r|eplaced |
|00001d20| 62 79 20 61 20 73 79 6d | 6c 69 6e 6b 20 74 6f 20 |by a sym|link to |
|00001d30| 61 20 64 69 66 66 65 72 | 65 6e 74 20 64 69 72 65 |a differ|ent dire|
|00001d40| 63 74 6f 72 79 20 62 65 | 74 77 65 65 6e 20 76 65 |ctory be|tween ve|
|00001d50| 72 69 66 69 63 61 74 69 | 6f 6e 20 6f 66 0a 70 61 |rificati|on of.pa|
|00001d60| 74 68 20 63 6f 6d 70 6f | 6e 65 6e 74 73 20 61 6e |th compo|nents an|
|00001d70| 64 20 74 68 65 20 61 63 | 74 75 61 6c 20 75 6e 6c |d the ac|tual unl|
|00001d80| 69 6e 6b 28 29 20 63 61 | 6c 6c 2e 0a 0a 41 6e 6f |ink() ca|ll...Ano|
|00001d90| 74 68 65 72 20 77 61 79 | 20 74 6f 20 66 69 78 20 |ther way| to fix |
|00001da0| 74 68 69 73 20 69 73 20 | 77 69 74 68 20 61 20 73 |this is |with a s|
|00001db0| 6d 61 72 74 65 72 20 76 | 65 72 73 69 6f 6e 20 6f |marter v|ersion o|
|00001dc0| 66 20 66 69 6e 64 2e 20 | 20 41 20 73 6d 61 72 74 |f find. | A smart|
|00001dd0| 0a 66 69 6e 64 20 64 6f | 65 73 20 74 68 65 20 63 |.find do|es the c|
|00001de0| 68 64 69 72 28 29 20 61 | 6e 64 20 6c 73 74 61 74 |hdir() a|nd lstat|
|00001df0| 28 29 20 63 68 65 63 6b | 73 20 74 6f 20 6d 61 6b |() check|s to mak|
|00001e00| 65 20 73 75 72 65 20 74 | 68 61 74 20 69 74 20 6e |e sure t|hat it n|
|00001e10| 65 76 65 72 0a 63 72 6f | 73 73 65 73 20 61 20 73 |ever.cro|sses a s|
|00001e20| 79 6d 6c 69 6e 6b 2c 20 | 61 6e 64 20 63 61 6c 6c |ymlink, |and call|
|00001e30| 73 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 69 6e |s the pr|ogram in|
|00001e40| 20 27 65 78 65 63 27 20 | 75 73 69 6e 67 20 61 20 | 'exec' |using a |
|00001e50| 66 69 6c 65 6e 61 6d 65 | 0a 77 69 74 68 20 6e 6f |filename|.with no|
|00001e60| 20 64 69 72 65 63 74 6f | 72 79 20 63 6f 6d 70 6f | directo|ry compo|
|00001e70| 6e 65 6e 74 73 2c 20 72 | 65 6c 61 74 69 76 65 20 |nents, r|elative |
|00001e80| 74 6f 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 64 |to the c|urrent d|
|00001e90| 69 72 65 63 74 6f 72 79 | 2e 20 20 0a 54 68 75 73 |irectory|. .Thus|
|00001ea0| 2c 20 74 6f 20 64 65 6c | 65 74 65 3a 0a 0a 09 2f |, to del|ete:.../|
|00001eb0| 74 6d 70 2f 68 61 63 6b | 65 72 2d 66 65 73 74 2f |tmp/hack|er-fest/|
|00001ec0| 61 2f 61 2f 61 2f 61 2f | 61 2f 2e 2e 2e 2f 65 74 |a/a/a/a/|a/.../et|
|00001ed0| 63 2f 70 61 73 73 77 64 | 0a 0a 66 69 6e 64 20 66 |c/passwd|..find f|
|00001ee0| 69 72 73 74 20 63 61 72 | 65 66 75 6c 6c 79 20 28 |irst car|efully (|
|00001ef0| 63 68 65 63 6b 69 6e 67 | 20 66 6f 72 20 61 74 74 |checking| for att|
|00001f00| 65 6d 70 74 73 20 74 6f | 20 65 78 70 6c 6f 69 74 |empts to| exploit|
|00001f10| 20 72 61 63 65 20 63 6f | 6e 64 69 74 69 6f 6e 73 | race co|nditions|
|00001f20| 0a 62 65 66 6f 72 65 20 | 61 6e 64 20 2a 61 66 74 |.before |and *aft|
|00001f30| 65 72 2a 20 65 61 63 68 | 20 63 68 64 69 72 28 29 |er* each| chdir()|
|00001f40| 29 20 63 68 64 69 72 28 | 29 73 20 69 6e 74 6f 0a |) chdir(|)s into.|
|00001f50| 09 0a 09 2f 74 6d 70 2f | 68 61 63 6b 65 72 2d 66 |.../tmp/|hacker-f|
|00001f60| 65 73 74 2f 61 2f 61 2f | 61 2f 61 2f 61 2f 2e 2e |est/a/a/|a/a/a/..|
|00001f70| 2e 2f 65 74 63 0a 0a 61 | 6e 64 20 77 69 6c 6c 20 |./etc..a|nd will |
|00001f80| 66 61 69 6c 20 69 66 20 | 61 6e 79 20 6f 66 20 74 |fail if |any of t|
|00001f90| 68 65 20 63 6f 6d 70 6f | 6e 65 6e 74 73 20 69 73 |he compo|nents is|
|00001fa0| 20 61 20 73 79 6d 6c 69 | 6e 6b 2c 20 70 6c 75 67 | a symli|nk, plug|
|00001fb0| 67 69 6e 67 20 74 68 65 | 20 68 6f 6c 65 0a 64 65 |ging the| hole.de|
|00001fc0| 73 63 72 69 62 65 64 20 | 61 62 6f 76 65 2e 20 20 |scribed |above. |
|00001fd0| 41 66 74 65 72 20 76 65 | 72 69 66 79 69 6e 67 20 |After ve|rifying |
|00001fe0| 74 68 61 74 20 74 68 65 | 20 27 2e 2e 2e 2f 65 74 |that the| '.../et|
|00001ff0| 63 27 20 69 73 20 72 65 | 61 6c 6c 79 20 61 0a 73 |c' is re|ally a.s|
|00002000| 75 62 64 69 72 65 63 74 | 6f 72 79 20 6f 66 20 2f |ubdirect|ory of /|
|00002010| 74 6d 70 2c 20 61 6e 64 | 20 6e 6f 74 20 73 6f 6d |tmp, and| not som|
|00002020| 65 20 72 61 6e 64 6f 6d | 20 70 6f 69 6e 74 20 6f |e random| point o|
|00002030| 6e 20 74 68 65 20 66 69 | 6c 65 73 79 73 74 65 6d |n the fi|lesystem|
|00002040| 2c 20 66 69 6e 64 0a 65 | 78 65 63 27 73 20 74 68 |, find.e|xec's th|
|00002050| 65 20 63 6f 6d 6d 61 6e | 64 3a 0a 0a 09 72 6d 20 |e comman|d:...rm |
|00002060| 2d 66 20 2e 2f 70 61 73 | 73 77 64 0a 0a 77 68 69 |-f ./pas|swd..whi|
|00002070| 63 68 20 69 73 20 73 65 | 63 75 72 65 20 61 73 20 |ch is se|cure as |
|00002080| 6c 6f 6e 67 20 61 73 20 | 27 2e 27 20 69 73 6e 27 |long as |'.' isn'|
|00002090| 74 20 69 6e 20 79 6f 75 | 72 20 50 41 54 48 2e 20 |t in you|r PATH. |
|000020a0| 20 4e 6f 74 65 20 74 68 | 65 20 6c 65 61 64 69 6e | Note th|e leadin|
|000020b0| 67 0a 27 2e 2f 27 20 74 | 6f 20 70 72 65 76 65 6e |g.'./' t|o preven|
|000020c0| 74 20 72 6d 20 66 72 6f | 6d 20 69 6e 74 65 72 70 |t rm fro|m interp|
|000020d0| 72 65 74 69 6e 67 20 74 | 68 65 20 66 69 6c 65 6e |reting t|he filen|
|000020e0| 61 6d 65 20 61 73 20 61 | 20 70 61 72 61 6d 65 74 |ame as a| paramet|
|000020f0| 65 72 2e 0a 0a 4e 6f 74 | 65 3a 20 74 68 69 73 20 |er...Not|e: this |
|00002100| 69 73 20 69 6e 20 2a 61 | 64 64 69 74 69 6f 6e 2a |is in *a|ddition*|
|00002110| 20 74 6f 20 74 68 65 20 | 63 68 65 63 6b 73 20 74 | to the |checks t|
|00002120| 68 61 74 20 66 69 6e 64 | 20 61 6c 72 65 61 64 79 |hat find| already|
|00002130| 20 6d 61 6b 65 73 20 74 | 6f 0a 64 65 74 65 72 6d | makes t|o.determ|
|00002140| 69 6e 65 20 77 68 65 74 | 68 65 72 20 61 20 66 69 |ine whet|her a fi|
|00002150| 6c 65 20 69 73 20 61 20 | 73 79 6d 6c 69 6e 6b 20 |le is a |symlink |
|00002160| 2a 62 65 66 6f 72 65 2a | 20 63 68 64 69 72 28 29 |*before*| chdir()|
|00002170| 69 6e 67 20 69 6e 74 6f | 20 69 74 2e 20 20 49 74 |ing into| it. It|
|00002180| 20 6d 75 73 74 0a 6d 61 | 6b 65 20 73 75 72 65 20 | must.ma|ke sure |
|00002190| 74 68 61 74 20 63 6f 6d | 70 6f 6e 65 6e 74 73 20 |that com|ponents |
|000021a0| 6f 66 20 74 68 65 20 70 | 61 74 68 20 74 68 61 74 |of the p|ath that|
|000021b0| 20 68 61 76 65 20 2a 61 | 6c 72 65 61 64 79 2a 20 | have *a|lready* |
|000021c0| 62 65 65 6e 20 74 65 73 | 74 65 64 0a 61 72 65 20 |been tes|ted.are |
|000021d0| 6e 6f 74 20 72 65 70 6c | 61 63 65 64 20 77 69 74 |not repl|aced wit|
|000021e0| 68 20 73 79 6d 6c 69 6e | 6b 73 20 6f 72 20 72 65 |h symlin|ks or re|
|000021f0| 6e 61 6d 65 64 20 64 69 | 72 65 63 74 6f 72 69 65 |named di|rectorie|
|00002200| 73 20 2a 61 66 74 65 72 | 2a 20 66 69 6e 64 20 68 |s *after|* find h|
|00002210| 61 73 0a 73 74 61 72 74 | 65 64 20 70 72 6f 63 65 |as.start|ed proce|
|00002220| 73 73 69 6e 67 20 73 75 | 62 64 69 72 65 63 74 6f |ssing su|bdirecto|
|00002230| 72 69 65 73 20 6f 66 20 | 74 68 65 6d 2e 0a 0a 4e |ries of |them...N|
|00002240| 6f 74 65 20 74 68 61 74 | 20 74 68 65 20 27 73 6d |ote that| the 'sm|
|00002250| 61 72 74 27 20 66 69 6e | 64 20 77 69 74 68 6f 75 |art' fin|d withou|
|00002260| 74 20 74 68 65 20 70 6f | 73 74 2d 63 68 64 69 72 |t the po|st-chdir|
|00002270| 20 73 79 6d 6c 69 6e 6b | 20 74 65 73 74 73 20 77 | symlink| tests w|
|00002280| 6f 6e 27 74 0a 77 6f 72 | 6b 2e 20 20 57 68 69 6c |on't.wor|k. Whil|
|00002290| 65 20 73 6d 61 72 74 2d | 66 69 6e 64 20 69 73 20 |e smart-|find is |
|000022a0| 70 72 6f 63 65 73 73 69 | 6e 67 3a 0a 0a 09 2f 74 |processi|ng:.../t|
|000022b0| 6d 70 2f 68 61 63 6b 65 | 72 2d 66 65 73 74 2f 61 |mp/hacke|r-fest/a|
|000022c0| 2f 61 2f 61 2f 61 2f 2a | 0a 0a 79 6f 75 20 63 61 |/a/a/a/*|..you ca|
|000022d0| 6e 20 72 65 6e 61 6d 65 | 0a 0a 09 2f 74 6d 70 2f |n rename|.../tmp/|
|000022e0| 68 61 63 6b 65 72 2d 66 | 65 73 74 2f 61 2f 61 2f |hacker-f|est/a/a/|
|000022f0| 61 2f 61 0a 0a 74 6f 0a | 0a 09 2f 74 6d 70 2f 68 |a/a..to.|../tmp/h|
|00002300| 61 63 6b 65 72 2d 66 65 | 73 74 2f 61 2f 61 2f 62 |acker-fe|st/a/a/b|
|00002310| 09 28 6e 6f 74 65 3a 20 | 6f 6e 65 20 6c 65 73 73 |.(note: |one less|
|00002320| 20 70 61 74 68 6e 61 6d | 65 20 63 6f 6d 70 6f 6e | pathnam|e compon|
|00002330| 65 6e 74 29 0a 0a 61 6e | 64 20 65 76 65 6e 74 75 |ent)..an|d eventu|
|00002340| 61 6c 6c 79 20 73 6d 61 | 72 74 2d 66 69 6e 64 20 |ally sma|rt-find |
|00002350| 77 69 6c 6c 20 27 63 64 | 20 2e 2e 27 2c 20 62 75 |will 'cd| ..', bu|
|00002360| 74 20 73 69 6e 63 65 20 | 74 68 65 20 63 75 72 72 |t since |the curr|
|00002370| 65 6e 74 20 64 69 72 65 | 63 74 6f 72 79 0a 6f 66 |ent dire|ctory.of|
|00002380| 20 66 69 6e 64 20 68 61 | 73 20 6d 6f 76 65 64 2c | find ha|s moved,|
|00002390| 20 27 2e 2e 27 20 77 69 | 6c 6c 20 6d 6f 76 65 20 | '..' wi|ll move |
|000023a0| 61 73 20 77 65 6c 6c 2c | 20 61 6e 64 20 65 76 65 |as well,| and eve|
|000023b0| 6e 74 75 61 6c 6c 79 20 | 73 6d 61 72 74 2d 66 69 |ntually |smart-fi|
|000023c0| 6e 64 0a 77 69 6c 6c 20 | 62 65 20 6f 6e 65 20 6c |nd.will |be one l|
|000023d0| 65 76 65 6c 20 74 6f 6f | 20 68 69 67 68 20 61 6e |evel too| high an|
|000023e0| 64 20 63 61 6e 20 73 74 | 61 72 74 20 64 65 73 63 |d can st|art desc|
|000023f0| 65 6e 64 69 6e 67 20 69 | 6e 74 6f 20 6f 74 68 65 |ending i|nto othe|
|00002400| 72 0a 73 75 62 64 69 72 | 65 63 74 6f 72 69 65 73 |r.subdir|ectories|
|00002410| 20 6f 66 20 27 2f 27 2e | 20 20 54 6f 20 68 65 6c | of '/'.| To hel|
|00002420| 70 20 74 68 69 73 20 61 | 6c 6f 6e 67 20 79 6f 75 |p this a|long you|
|00002430| 20 6d 61 79 20 6e 65 65 | 64 20 74 6f 20 63 72 65 | may nee|d to cre|
|00002440| 61 74 65 3a 0a 0a 09 2f | 74 6d 70 2f 68 61 63 6b |ate:.../|tmp/hack|
|00002450| 65 72 2d 66 65 73 74 2f | 75 73 72 0a 09 2f 74 6d |er-fest/|usr../tm|
|00002460| 70 2f 68 61 63 6b 65 72 | 2d 66 65 73 74 2f 76 61 |p/hacker|-fest/va|
|00002470| 72 0a 09 65 74 63 2e 0a | 0a 2a 20 53 41 46 45 20 |r..etc..|.* SAFE |
|00002480| 4c 52 55 20 47 41 52 42 | 41 47 45 20 43 4f 4c 4c |LRU GARB|AGE COLL|
|00002490| 45 43 54 49 4f 4e 0a 0a | 4f 75 72 20 4c 52 55 20 |ECTION..|Our LRU |
|000024a0| 2f 74 6d 70 20 67 61 72 | 62 61 67 65 20 63 6f 6c |/tmp gar|bage col|
|000024b0| 6c 65 63 74 6f 72 20 64 | 61 65 6d 6f 6e 20 69 73 |lector d|aemon is|
|000024c0| 20 61 76 61 69 6c 61 62 | 6c 65 20 61 74 0a 3c 55 | availab|le at.<U|
|000024d0| 52 4c 3a 68 74 74 70 3a | 2f 2f 77 77 77 2e 75 6c |RL:http:|//www.ul|
|000024e0| 74 72 61 74 65 63 68 2e | 6e 65 74 2f 7e 7a 62 6c |tratech.|net/~zbl|
|000024f0| 61 78 65 6c 6c 2f 61 64 | 6d 69 6e 5f 75 74 69 6c |axell/ad|min_util|
|00002500| 73 2f 66 69 6c 65 72 65 | 61 70 65 72 2e 74 78 74 |s/filere|aper.txt|
|00002510| 3e 2e 20 20 49 74 0a 69 | 73 20 69 6d 70 6c 65 6d |>. It.i|s implem|
|00002520| 65 6e 74 65 64 20 69 6e | 20 70 65 72 6c 35 2e 20 |ented in| perl5. |
|00002530| 20 49 74 20 64 65 70 65 | 6e 64 73 20 6f 6e 20 61 | It depe|nds on a|
|00002540| 20 4c 69 6e 75 78 2d 73 | 70 65 63 69 66 69 63 20 | Linux-s|pecific |
|00002550| 27 73 74 61 74 66 73 28 | 29 27 0a 73 79 73 74 65 |'statfs(|)'.syste|
|00002560| 6d 20 63 61 6c 6c 20 74 | 6f 20 6d 6f 6e 69 74 6f |m call t|o monito|
|00002570| 72 20 61 76 61 69 6c 61 | 62 6c 65 20 66 72 65 65 |r availa|ble free|
|00002580| 20 73 70 61 63 65 2c 20 | 73 6f 20 6e 6f 6e 2d 4c | space, |so non-L|
|00002590| 69 6e 75 78 20 70 65 6f | 70 6c 65 20 77 69 6c 6c |inux peo|ple will|
|000025a0| 0a 6e 65 65 64 20 74 6f | 20 64 6f 20 61 20 70 6f |.need to| do a po|
|000025b0| 72 74 20 28 73 65 6e 64 | 20 6d 65 20 70 61 74 63 |rt (send| me patc|
|000025c0| 68 65 73 20 61 6e 64 20 | 49 27 6c 6c 20 69 6e 63 |hes and |I'll inc|
|000025d0| 6f 72 70 6f 72 61 74 65 | 20 74 68 65 6d 29 2e 0a |orporate| them)..|
|000025e0| 0a 4f 75 72 20 67 61 72 | 62 61 67 65 20 63 6f 6c |.Our gar|bage col|
|000025f0| 6c 65 63 74 6f 72 3a 0a | 09 68 61 6e 64 6c 65 73 |lector:.|.handles|
|00002600| 20 74 68 65 20 61 62 6f | 76 65 20 73 65 63 75 72 | the abo|ve secur|
|00002610| 69 74 79 20 70 72 6f 62 | 6c 65 6d 73 20 63 6f 72 |ity prob|lems cor|
|00002620| 72 65 63 74 6c 79 2c 0a | 09 68 61 6e 64 6c 65 73 |rectly,.|.handles|
|00002630| 20 70 61 74 68 6e 61 6d | 65 73 20 6d 6f 72 65 20 | pathnam|es more |
|00002640| 74 68 61 6e 20 31 30 32 | 34 20 63 68 61 72 61 63 |than 102|4 charac|
|00002650| 74 65 72 73 2c 20 0a 09 | 75 73 65 73 20 73 6d 61 |ters, ..|uses sma|
|00002660| 72 74 65 72 20 6c 61 73 | 74 2d 61 63 63 65 73 73 |rter las|t-access|
|00002670| 20 65 73 74 69 6d 61 74 | 65 73 20 74 68 61 6e 20 | estimat|es than |
|00002680| 6a 75 73 74 20 61 74 69 | 6d 65 20 6f 72 20 63 74 |just ati|me or ct|
|00002690| 69 6d 65 2c 0a 09 63 61 | 6e 20 73 75 70 70 6f 72 |ime,..ca|n suppor|
|000026a0| 74 20 22 70 65 72 6d 61 | 6e 65 6e 74 22 20 73 75 |t "perma|nent" su|
|000026b0| 62 64 69 72 65 63 74 6f | 72 69 65 73 2c 0a 09 68 |bdirecto|ries,..h|
|000026c0| 61 6e 64 6c 65 73 20 66 | 69 6c 65 73 2c 20 73 79 |andles f|iles, sy|
|000026d0| 6d 6c 69 6e 6b 73 2c 20 | 64 69 72 65 63 74 6f 72 |mlinks, |director|
|000026e0| 69 65 73 2c 20 64 65 76 | 69 63 65 73 2c 20 6d 6f |ies, dev|ices, mo|
|000026f0| 75 6e 74 20 70 6f 69 6e | 74 73 20 63 6f 72 72 65 |unt poin|ts corre|
|00002700| 63 74 6c 79 2c 0a 09 63 | 61 6e 20 73 75 70 70 6f |ctly,..c|an suppo|
|00002710| 72 74 20 6d 69 6e 69 6d | 75 6d 20 61 67 65 20 6f |rt minim|um age o|
|00002720| 66 20 66 69 6c 65 73 20 | 28 65 2e 67 2e 20 6e 6f |f files |(e.g. no|
|00002730| 20 66 69 6c 65 73 20 3c | 20 31 20 64 61 79 20 6f | files <| 1 day o|
|00002740| 6c 64 29 2c 0a 09 64 65 | 6c 65 74 65 73 20 6f 6c |ld),..de|letes ol|
|00002750| 64 65 73 74 20 66 69 6c | 65 73 20 66 69 72 73 74 |dest fil|es first|
|00002760| 2c 0a 09 64 65 6c 65 74 | 65 73 20 66 69 6c 65 73 |,..delet|es files|
|00002770| 20 6f 6e 6c 79 20 77 68 | 65 6e 20 64 69 73 6b 20 | only wh|en disk |
|00002780| 73 70 61 63 65 20 69 73 | 20 6c 6f 77 2c 0a 09 61 |space is| low,..a|
|00002790| 6e 64 20 72 65 73 70 6f | 6e 64 73 20 69 6e 20 6c |nd respo|nds in l|
|000027a0| 65 73 73 20 74 68 61 6e | 20 74 65 6e 20 73 65 63 |ess than| ten sec|
|000027b0| 6f 6e 64 73 20 74 6f 20 | 6c 6f 77 20 64 69 73 6b |onds to |low disk|
|000027c0| 20 73 70 61 63 65 20 63 | 6f 6e 64 69 74 69 6f 6e | space c|ondition|
|000027d0| 73 2e 0a 0a 4f 75 72 20 | 67 61 72 62 61 67 65 20 |s...Our |garbage |
|000027e0| 63 6f 6c 6c 65 63 74 6f | 72 20 77 6f 72 6b 73 20 |collecto|r works |
|000027f0| 6f 6e 20 61 6e 79 20 64 | 69 72 65 63 74 6f 72 79 |on any d|irectory|
|00002800| 20 77 68 65 72 65 20 66 | 69 6c 65 73 20 63 61 6e | where f|iles can|
|00002810| 20 67 72 61 63 65 66 75 | 6c 6c 79 0a 64 69 73 61 | gracefu|lly.disa|
|00002820| 70 70 65 61 72 20 61 74 | 20 61 72 62 69 74 72 61 |ppear at| arbitra|
|00002830| 72 79 20 74 69 6d 65 73 | 2c 20 73 75 63 68 20 61 |ry times|, such a|
|00002840| 73 20 2f 76 61 72 2f 63 | 61 74 6d 61 6e 2c 20 2f |s /var/c|atman, /|
|00002850| 74 6d 70 2c 20 2f 76 61 | 72 2f 74 6d 70 2c 0a 54 |tmp, /va|r/tmp,.T|
|00002860| 65 58 20 66 6f 6e 74 20 | 64 69 72 65 63 74 6f 72 |eX font |director|
|00002870| 69 65 73 2c 20 61 6e 64 | 20 6f 75 72 20 48 54 54 |ies, and| our HTT|
|00002880| 50 20 70 72 6f 78 79 20 | 63 61 63 68 65 2e 20 20 |P proxy |cache. |
|00002890| 4f 6e 65 20 64 69 72 65 | 63 74 6f 72 79 20 77 68 |One dire|ctory wh|
|000028a0| 65 72 65 0a 74 68 65 20 | 67 61 72 62 61 67 65 20 |ere.the |garbage |
|000028b0| 63 6f 6c 6c 65 63 74 6f | 72 20 64 6f 65 73 6e 27 |collecto|r doesn'|
|000028c0| 74 20 77 6f 72 6b 20 76 | 65 72 79 20 77 65 6c 6c |t work v|ery well|
|000028d0| 20 69 73 20 2f 76 61 72 | 2f 73 70 6f 6f 6c 2f 6e | is /var|/spool/n|
|000028e0| 65 77 73 3b 20 77 65 0a | 68 61 64 20 74 6f 20 68 |ews; we.|had to h|
|000028f0| 61 63 6b 20 74 68 69 6e | 67 73 20 75 70 20 61 20 |ack thin|gs up a |
|00002900| 62 69 74 20 74 6f 20 66 | 69 78 20 74 68 65 20 61 |bit to f|ix the a|
|00002910| 72 74 69 63 6c 65 20 64 | 61 74 61 62 61 73 65 73 |rticle d|atabases|
|00002920| 20 77 68 65 6e 20 61 72 | 74 69 63 6c 65 0a 66 69 | when ar|ticle.fi|
|00002930| 6c 65 73 20 64 69 73 61 | 70 70 65 61 72 2e 0a 0a |les disa|ppear...|
|00002940| 2d 2d 20 0a 5a 79 67 6f | 20 42 6c 61 78 65 6c 6c |-- .Zygo| Blaxell|
|00002950| 2e 20 20 46 6f 72 6d 65 | 72 20 55 6e 69 78 2f 73 |. Forme|r Unix/s|
|00002960| 6f 66 74 2f 68 61 72 64 | 77 61 72 65 20 67 75 72 |oft/hard|ware gur|
|00002970| 75 2c 20 55 20 6f 66 20 | 57 61 74 65 72 6c 6f 6f |u, U of |Waterloo|
|00002980| 20 43 6f 6d 70 75 74 65 | 72 20 53 63 69 65 6e 63 | Compute|r Scienc|
|00002990| 65 20 0a 43 6c 75 62 2e | 20 20 43 75 72 72 65 6e |e .Club.| Curren|
|000029a0| 74 20 73 79 73 61 64 6d | 69 6e 20 66 6f 72 20 4d |t sysadm|in for M|
|000029b0| 79 72 75 73 20 44 65 73 | 69 67 6e 2c 20 49 6e 63 |yrus Des|ign, Inc|
|000029c0| 2e 20 20 31 30 74 68 20 | 70 6c 61 63 65 2c 20 41 |. 10th |place, A|
|000029d0| 43 4d 20 49 6e 74 6c 20 | 43 6f 6c 6c 65 67 69 61 |CM Intl |Collegia|
|000029e0| 74 65 0a 50 72 6f 67 72 | 61 6d 6d 69 6e 67 20 43 |te.Progr|amming C|
|000029f0| 6f 6e 74 65 73 74 20 46 | 69 6e 61 6c 73 2c 20 31 |ontest F|inals, 1|
|00002a00| 39 39 34 2e 20 20 41 64 | 6d 69 6e 69 73 74 65 72 |994. Ad|minister|
|00002a10| 20 4c 69 6e 75 78 20 6e | 65 74 73 20 66 6f 72 20 | Linux n|ets for |
|00002a20| 66 6f 6f 64 2c 20 63 6c | 6f 74 68 69 6e 67 2c 20 |food, cl|othing, |
|00002a30| 0a 61 6e 64 20 61 6e 69 | 6d 65 2e 20 20 22 49 20 |.and ani|me. "I |
|00002a40| 67 61 76 65 20 75 70 20 | 24 31 30 30 30 20 74 6f |gave up |$1000 to|
|00002a50| 20 61 76 6f 69 64 20 77 | 6f 72 6b 69 6e 67 20 6f | avoid w|orking o|
|00002a60| 6e 20 77 69 6e 64 6f 7a | 65 2e 2e 2e 20 2a 73 69 |n windoz|e... *si|
|00002a70| 67 68 2a 22 20 2d 20 41 | 6d 79 20 46 6f 6e 67 0a |gh*" - A|my Fong.|
|00002a80| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+