Re: Strange sfid numbers
"Ger Hobbelt" <[email protected]>
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <[email protected]> |
Okay, just brushed my mouth after saying some very ugly things when I saw those FFFFFFF's again. Anyway, why I send quick mail: you may want to improve your hack beyond the shadow of doubt by looking for _FFFFFFFF[8-9A-F] and only _then_ replace the 8 'F's. Why? Because such a regex (with '_' prefix and [8-9A-F] postcheck) would pick EXACTLY those units which would have the F's due to some [censored] sign-bit extension and would prevent the hack from incorrectly being triggered in the ~ 1:2E9 chance where the actual hash itself produces a true FFFFFFFF (which would then become FFFFFFFFFFFFFFFF). Kuddos for that hack anyhow! Just anal ol' me chiming in, while I shortly take a break from banging my head against the wall working on some large but ever so slightly corrupted data loads in SQL server. Ren&Stimpy say: Oohhhhh, JOY! On Sat, Aug 16, 2008 at 5:12 PM, Thomas Spahni <[email protected]> wrote: > On Fri, 15 Aug 2008, Paolo wrote: > >> On Fri, Aug 15, 2008 at 03:25:13PM +0200, Thomas Spahni wrote: >> > While testing my setup (BlameTheSegfault) on 64-bit SuSE-10.2 with Ger's >> ... >> > 20080815_120057_566189_FFFFFFFFE5355632 >> > 20080815_120347_761063_FFFFFFFFCD92D59C >> > 20080815_120624_778819_4ABD55BB >> ... >> > Why does it put in these blocks of FFFFFFFF ? I suspect a bug in >> > maillib.crm. >> >> nope, that a 64bit issue - see Gerrit's post/thread on this ML with >> subject >> >> "Ger-138 on line ..." (circa) >> >> Message-ID: <46BEA27B.5020005-mY+prNg7MjwFYqu4Ip00tEEOCMrvLtNR@public.gmane.org> >> Date: Sun, 12 Aug 2007 08:02:35 +0200 > > Hi > > First of all: thanks for the pointer. > > I understand this is an issue with the hash function shifting in high bits > on 64-bit OS'es and I suspect that I should not 'fix' that because it > could break other things. > > However, I need consistent sfid numbers, because they are reused in other > applications, namely database storage. So what's about this quick and > (very) dirty hack in maillib.crm? > > [BlameTheSegfault maillib.crm lines 466 -] > > # > # Put some text into the cache; > # side effect: > # variable :reaver_cacheid: to the filename (no directory) > # variable :long_cacheid: is set to the file alone (no directory) name > # > :reavercache_store: (:text:) > { > match [:text_cache:] /./ # Don't store it if no reavercache desired > isolate (:system_time: :msg_hash:) // > syscall () (:system_time:) /date +%Y%m%d_%H%M%S_%N / > match [:system_time:] ( :: :cacheid: ) /([[:graph:]]+)..../ > hash (:msg_hash:) /:*:text:/ > # Hack by tsp: added next 4 lines to yank bogus FFFFFFFF > { > match [:msg_hash:] ( :: :bogus_ffff: ) /(FFFFFFFF)......../ > alter (:bogus_ffff:) // > } > isolate (:cacheid:) /:*:cacheid:/ > # It's unclear if the following increases security at all. > isolate (:cacheid:) /:*:cacheid:_:*:msg_hash:/ > isolate (:long_cacheid:) /:*:text_cache:\/texts\/:*:cacheid:/ > output [:*:long_cacheid:] /:*:text:/ > } > return > > > This seems to work for me without breaking other things. > > Cheers > Thomas > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Crm114-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/crm114-general > > -- Met vriendelijke groeten / Best regards, Ger Hobbelt -------------------------------------------------- web: http://www.hobbelt.com/ http://www.hebbut.net/ mail: [email protected] mobile: +31-6-11 120 978 -------------------------------------------------- ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/