summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 487a8a71a8..1e34e0c9fe 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -683,10 +683,10 @@ files_struct *open_file_shared(connection_struct *conn,char *fname, SMB_STRUCT_S
return NULL;
}
- if (GET_FILE_CREATE_DISPOSITION(ofun) == FILE_CREATE_IF_NOT_EXIST)
+ if (CAN_WRITE(conn) && (GET_FILE_CREATE_DISPOSITION(ofun) == FILE_CREATE_IF_NOT_EXIST))
flags2 |= O_CREAT;
- if (GET_FILE_OPEN_DISPOSITION(ofun) == FILE_EXISTS_TRUNCATE)
+ if (CAN_WRITE(conn) && (GET_FILE_OPEN_DISPOSITION(ofun) == FILE_EXISTS_TRUNCATE))
flags2 |= O_TRUNC;
if (GET_FILE_OPEN_DISPOSITION(ofun) == FILE_EXISTS_FAIL)