summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-11-15 16:22:09 -0800
committerJeremy Allison <jra@samba.org>2011-11-15 17:01:58 -0800
commitedaa7479edd9c6472dacb3642fe6d2a6869e4719 (patch)
tree8f1467fabcab18c30ea4b2fd4f42c03b53c76ccc
parentc6a62f60a23fdadb99da4d4b47694b273342f2a7 (diff)
downloadsamba-edaa7479edd9c6472dacb3642fe6d2a6869e4719.tar.gz
samba-edaa7479edd9c6472dacb3642fe6d2a6869e4719.tar.bz2
samba-edaa7479edd9c6472dacb3642fe6d2a6869e4719.zip
Move handle-based access check into handle codepath.
-rw-r--r--source3/smbd/trans2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 05c180fc5d..843092d7d9 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -5615,10 +5615,6 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
- if (fsp && !(fsp->access_mask & FILE_WRITE_DATA)) {
- return NT_STATUS_ACCESS_DENIED;
- }
-
DEBUG(6,("smb_set_file_size: size: %.0f ", (double)size));
if (size == get_file_size_stat(psbuf)) {
@@ -5630,6 +5626,10 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
if (fsp && fsp->fh->fd != -1) {
/* Handle based call. */
+ if (!(fsp->access_mask & FILE_WRITE_DATA)) {
+ return NT_STATUS_ACCESS_DENIED;
+ }
+
if (vfs_set_filelen(fsp, size) == -1) {
return map_nt_error_from_unix(errno);
}