s3: smbd: Create and use a common function for generating a fileid - create_clock_iti...
commit23fbf0bad0332a0ae0d4dc3c8f6df6e7ec46b88b
authorJeremy Allison <jra@samba.org>
Wed, 5 Jan 2022 19:40:46 +0000 (5 11:40 -0800)
committerJeremy Allison <jra@samba.org>
Sat, 8 Jan 2022 06:35:22 +0000 (8 06:35 +0000)
tree1aed3d1f6a307bbe39dad65a1c357238486a66d7
parent29d69c22a0d945193ce3dac27e1083dbc5c53f03
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
selftest/knownfail.d/fileid-unique [deleted file]
source3/include/proto.h
source3/lib/system.c
source3/smbd/open.c