Comment 0 for bug 1185342

Revision history for this message
Daniel Hammerschmidt (redneck) wrote :

If we store attachments (ir.attachment) in the filesystem the physical filename is generated from the SHA-1 hash of the files content. This is good if we save attachments with the same (binary) content to save space.

But SHA-1 is not collision free. So, two different files could have the same hash. Nobody detected a SHA-1 collision yet, AFAIK. Probably this would never happen. But if it happens assuredly we overwrite a very important document with am unimportant ad.

I added some code to check for and handle this case. Please take a look.