s3:smbd: try to make fsp->fh->gen_id as globally unique as possible
authorStefan Metzmacher <metze@samba.org>
Wed, 13 Jun 2012 10:11:51 +0000 (12:11 +0200)
committerKarolin Seeger <kseeger@samba.org>
Sun, 17 Jun 2012 19:01:24 +0000 (21:01 +0200)
commit8c1159461a0c5a948cd04cdf969e54e1fa83387e
tree912c57ce85ad6400a4bcda493d46537693f000eb
parenta41122337cb72fdc3f16d77396a3e68bf53c1c03
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

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/smbd/files.c