summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-02-22 16:38:42 -0800
committerJeremy Allison <jra@samba.org>2011-02-23 02:17:21 +0100
commit7464793c9d00ac2aee40b1377477eb1e2b7c8251 (patch)
tree2c9c198ed1dfcee68c7ac736f36549ce5e8ffb20
parent67e72f52047a69050235f9ed1b85d87712b494f7 (diff)
downloadsamba-7464793c9d00ac2aee40b1377477eb1e2b7c8251.tar.gz
samba-7464793c9d00ac2aee40b1377477eb1e2b7c8251.tar.bz2
samba-7464793c9d00ac2aee40b1377477eb1e2b7c8251.zip
Fix bug found against the new Mac client @ Connectathon. Mac clients
don't open with FILE_WRITE_ATTRIBUTES when just doing a write, so updating the write time on close fails as smb_set_file_time() now (correctly) checks for FILE_WRITE_ATTRIBUTES in the access_mask before allowing client time update. This is an internal time update being done on a close, not a handle-based client request.
-rw-r--r--source3/smbd/close.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 0efa36f9a9..4234f32b7f 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -572,8 +572,16 @@ static NTSTATUS update_write_time_on_close(struct files_struct *fsp)
}
ft.mtime = fsp->close_write_time;
- status = smb_set_file_time(fsp->conn, fsp, fsp->fsp_name, &ft, false);
+ /* We must use NULL for the fsp handle here, as smb_set_file_time()
+ checks the fsp access_mask, which may not include FILE_WRITE_ATTRIBUTES.
+ As this is a close based update, we are not directly changing the
+ file attributes from a client call, but indirectly from a write. */
+ status = smb_set_file_time(fsp->conn, NULL, fsp->fsp_name, &ft, false);
if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(10,("update_write_time_on_close: smb_set_file_time "
+ "on file %s returned %s\n",
+ fsp_str_dbg(fsp),
+ nt_errstr(status)));
return status;
}