s3:smbd: try to make fsp->fh->gen_id as globally unique as possible
commitc7c351b8171ee5536090a04b61fb1566a6092af5
authorStefan Metzmacher <metze@samba.org>
Wed, 13 Jun 2012 10:11:51 +0000 (13 12:11 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Jun 2012 16:13:31 +0000 (14 18:13 +0200)
tree38e73d7f8200ab850187f4ed262c28c28ab72577
parent2fd28dc4cf4f40a690adfd846911e4da1a776bf2
s3:smbd: try to make fsp->fh->gen_id as globally unique as possible

This makes sure the value is never 0, it's between 1 and UINT32_MAX.

While fsp->fh->gen_id is 'unsigned long' currently (which might by 8 bytes),
there's some oplock code which truncates it to uint32_t (using IVAL()).

Which means we could reuse fsp->fh->gen_id as persistent file id
until we have a final fix, which uses database.

See bug #8995 for more details.

Based on code from Ira Cooper. Ensure fsp->fh->gen_id starts from
a random point. We will use this as the SMB2 persistent_id.

metze
source3/smbd/files.c