[MERGE] use a serial number and one random value for fileids

Robert Collins robertc at robertcollins.net
Fri May 19 03:44:33 BST 2006


This patch uses a serial number and a single random value for 'bzr add'
rather than brand new randomness each time.

Its clearly still unique within a single process.

Globally it still needs a collision on the timestamp and 64 bits of
entropy to have a collision.

The only hole I can see is someone doing fork() after calling add, and
then calling add in the child. We probably should add an atfork hook to
reset the seed in this case.

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-serial-number-and-unique-prefix.patch
Type: text/x-patch
Size: 5631 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060519/7b914ce5/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060519/7b914ce5/attachment.pgp 


More information about the bazaar mailing list