s3: smbd: change file_set_dosmode() to use get_file_handle_for_metadata() instead...
authorJeremy Allison <jra@samba.org>
Thu, 1 May 2014 18:07:44 +0000 (11:07 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 2 May 2014 19:27:07 +0000 (21:27 +0200)
commite6e40842d15850de35d00d5138fcaac858e37adc
tree487aa8ff2009cf8a850a601b6e57b2b67a76b323
parent580eb9424c5a9645c44b933e2ef144301af035cb
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