From 865bc0c0ace0a4f8e5eb0277def2315867273071 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 15 Nov 2011 17:41:48 -0800 Subject: 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. --- source3/smbd/reply.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/smbd/reply.c') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 541789d846..18ebca1ce2 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); -- cgit