s3: smbd: change file_set_dosmode() to use get_file_handle_for_metadata() instead...
commit9b62ae8337aaf154c141e9eec016c8a98de0becf
authorJeremy Allison <jra@samba.org>
Thu, 1 May 2014 18:07:44 +0000 (1 11:07 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 19 May 2014 10:20:12 +0000 (19 12:20 +0200)
treed686635be00884c463f43c8362b0c15d8b1c9205
parentd3b81495c68ae06291929a0f878e3dbe2545cc99
s3: smbd: change file_set_dosmode() to use get_file_handle_for_metadata() instead of open_file_fchmod().

get_file_handle_for_metadata() is a new function that
finds an existing open handle (fsp->fh->fd != -1) for
a given dev/ino if there is one available, and uses
INTERNAL_OPEN_ONLY with WRITE_DATA access if not.

Allows open_file_fchmod() to be removed next.

Bug 10564 - Lock order violation and file lost

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
source3/smbd/dosmode.c