From edaa7479edd9c6472dacb3642fe6d2a6869e4719 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 15 Nov 2011 16:22:09 -0800 Subject: Move handle-based access check into handle codepath. --- source3/smbd/trans2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3') 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); } -- cgit