summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-11-15 16:14:16 -0800
committerJeremy Allison <jra@samba.org>2011-11-15 17:01:58 -0800
commitc27551b1631eff0c91d79fbcadce703eadc3efc1 (patch)
treef8b8ce78ba5cef1064c271734bae278481489125 /source3
parentdd504b1899f437a4b877475bba3b5b2b04f400e1 (diff)
downloadsamba-c27551b1631eff0c91d79fbcadce703eadc3efc1.tar.gz
samba-c27551b1631eff0c91d79fbcadce703eadc3efc1.tar.bz2
samba-c27551b1631eff0c91d79fbcadce703eadc3efc1.zip
Move handle based access check into handle code path.
Diffstat (limited to 'source3')
-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 f6e62ef7db..2da3ed0c12 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -6626,16 +6626,16 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
allocation_size = smb_roundup(conn, allocation_size);
}
- if (fsp && !(fsp->access_mask & FILE_WRITE_DATA)) {
- return NT_STATUS_ACCESS_DENIED;
- }
-
DEBUG(10,("smb_set_file_allocation_info: file %s : setting new "
"allocation size to %.0f\n", smb_fname_str_dbg(smb_fname),
(double)allocation_size));
if (fsp && fsp->fh->fd != -1) {
/* Open file handle. */
+ if (!(fsp->access_mask & FILE_WRITE_DATA)) {
+ return NT_STATUS_ACCESS_DENIED;
+ }
+
/* Only change if needed. */
if (allocation_size != get_file_size_stat(&smb_fname->st)) {
if (vfs_allocate_file_space(fsp, allocation_size) == -1) {