summaryrefslogtreecommitdiffstats
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-11-15 17:41:48 -0800
committerJeremy Allison <jra@samba.org>2011-11-15 17:41:48 -0800
commit865bc0c0ace0a4f8e5eb0277def2315867273071 (patch)
tree2ab9337880684abf24e7cf7d89f4b53361c18fc9 /source3/smbd/reply.c
parent86c16092194836d8478144b97da9ca08aec7fac6 (diff)
downloadsamba-865bc0c0ace0a4f8e5eb0277def2315867273071.tar.gz
samba-865bc0c0ace0a4f8e5eb0277def2315867273071.tar.xz
samba-865bc0c0ace0a4f8e5eb0277def2315867273071.zip
Remove the check for FILE_WRITE_ATTRIBUTES from smb_set_file_time(). It
is called from places like fileio.c that need to update the write time on a file handle only open for write, without neccessarily having FILE_WRITE_ATTRIBUTES permission. Move all checks to before the smb_set_file_time() callers.
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 541789d846d..18ebca1ce2b 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -7952,6 +7952,11 @@ void reply_setattrE(struct smb_request *req)
goto out;
}
+ if (!(fsp->access_mask & FILE_WRITE_ATTRIBUTES)) {
+ reply_nterror(req, NT_STATUS_ACCESS_DENIED);
+ goto out;
+ }
+
status = smb_set_file_time(conn, fsp, fsp->fsp_name, &ft, true);
if (!NT_STATUS_IS_OK(status)) {
reply_nterror(req, status);