s3: smbd: Create and use a common function for generating a fileid - create_clock_iti...
authorJeremy Allison <jra@samba.org>
Wed, 5 Jan 2022 19:40:46 +0000 (11:40 -0800)
committerAndreas Schneider <asn@samba.org>
Wed, 10 Jan 2024 08:31:27 +0000 (09:31 +0100)
commitbf16fdfd82d41570b2d85468d6b093552fbe50dc
treec7439254a309bd7300429205f6a082c5147124ce
parent97fb687af0d0fcc471a700259a1d7f8ad0d002d0
s3: smbd: Create and use a common function for generating a fileid - create_clock_itime().

This first gets the clock_gettime_mono() value, converts to an NTTIME (as
this is what is stored in the dos attribute EA), then mixes in 8 bits of
randomness shifted up by 55 bits to cope with poor resolution clocks to
avoid duplicate inodes.

Using 8 bits of randomness on top of an NTTIME gives us around 114
years headroom. We can now guarentee returning a itime-based
fileid in a normal share (storing dos attributes in an EA).

Remove knownfail.d/fileid-unique

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14928

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jan  8 06:35:22 UTC 2022 on sn-devel-184

(cherry picked from commit 23fbf0bad0332a0ae0d4dc3c8f6df6e7ec46b88b)
selftest/knownfail.d/fileid-unique [deleted file]
source3/include/proto.h
source3/lib/system.c
source3/smbd/open.c