s3:smbd/close remove filesystem lock before removing sharemode
authorChristian Ambach <ambi@samba.org>
Thu, 13 Jun 2013 13:23:07 +0000 (15:23 +0200)
committerChristian Ambach <ambi@samba.org>
Tue, 25 Jun 2013 12:48:44 +0000 (14:48 +0200)
commit4ee73fd97b63c65cdb8d4fcbe3287a746d667de0
treef4c211b11e2df4ebdfcd3f97b971bf2840571897
parent935992fc5502ac63cc0c1ebf00089e7f39558c82
s3:smbd/close remove filesystem lock before removing sharemode

otherwise we are open for a race condition:

opener 1 opens file and closes it
- during the close, the share mode entry will be removed from
  locking.tdb, but share mode in the file system will be dropped later
  after delete_on_close and write time updates have been done

opener 2 requests open of same file with file overwrite
- locking.tdb does not list original entry, but file system share mode
  is still around
- VFS_FTRUNCATE will fail and error was converted to STATUS_ACCESS_DENIED

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Tue Jun 25 14:48:44 CEST 2013 on sn-devel-104
source3/smbd/close.c