Re: Strange sfid numbers
Thomas Spahni <[email protected]>
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <[email protected]> |
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=/