summaryrefslogtreecommitdiff
path: root/source3/smbd/dosmode.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-12-28 16:25:16 -0800
committerJeremy Allison <jra@samba.org>2010-12-29 02:15:23 +0100
commit9b31f6ab6cce55824f3e62f59061085abc1240db (patch)
treed9112d0bbc55a1bcb0858a096da2ecd8730ec2fe /source3/smbd/dosmode.c
parent4622812a41eb5ce07dd8f74534217e858743883f (diff)
downloadsamba-9b31f6ab6cce55824f3e62f59061085abc1240db.tar.gz
samba-9b31f6ab6cce55824f3e62f59061085abc1240db.tar.bz2
samba-9b31f6ab6cce55824f3e62f59061085abc1240db.zip
Fix bug #7892 - open_file_fchmod() leaves a stale lock.
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Dec 29 02:15:23 CET 2010 on sn-devel-104
Diffstat (limited to 'source3/smbd/dosmode.c')
-rw-r--r--source3/smbd/dosmode.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index cf95348583..838dec035e 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -415,7 +415,7 @@ static bool set_ea_dos_attribute(connection_struct *conn,
* are not violating security in doing the setxattr.
*/
- if (!NT_STATUS_IS_OK(open_file_fchmod(NULL, conn, smb_fname,
+ if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname,
&fsp)))
return ret;
become_root();
@@ -425,7 +425,7 @@ static bool set_ea_dos_attribute(connection_struct *conn,
ret = true;
}
unbecome_root();
- close_file_fchmod(NULL, fsp);
+ close_file(NULL, fsp, NORMAL_CLOSE);
return ret;
}
DEBUG(10,("set_ea_dos_attribute: set EA 0x%x on file %s\n",
@@ -823,18 +823,15 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
* We need to open the file with write access whilst
* still in our current user context. This ensures we
* are not violating security in doing the fchmod.
- * This file open does *not* break any oplocks we are
- * holding. We need to review this.... may need to
- * break batch oplocks open by others. JRA.
*/
files_struct *fsp;
- if (!NT_STATUS_IS_OK(open_file_fchmod(NULL, conn, smb_fname,
+ if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname,
&fsp)))
return -1;
become_root();
ret = SMB_VFS_FCHMOD(fsp, unixmode);
unbecome_root();
- close_file_fchmod(NULL, fsp);
+ close_file(NULL, fsp, NORMAL_CLOSE);
if (!newfile) {
notify_fname(conn, NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_ATTRIBUTES,