diff options
-rw-r--r-- | source3/smbd/open.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index d5fba4db19..7708833f97 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -777,11 +777,9 @@ static NTSTATUS open_file(files_struct *fsp, fsp->file_pid = req ? req->smbpid : 0; fsp->can_lock = True; fsp->can_read = ((access_mask & FILE_READ_DATA) != 0); - if (!CAN_WRITE(conn)) { - fsp->can_write = False; - } else { - fsp->can_write = ((access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) != 0); - } + fsp->can_write = + CAN_WRITE(conn) && + ((access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) != 0); fsp->print_file = NULL; fsp->modified = False; fsp->sent_oplock_break = NO_BREAK_SENT; |