summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/open.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 10c855c225..40a64115e1 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2815,7 +2815,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
bool need_re_stat = false;
uint32_t access_mask = SEC_DIR_ADD_SUBDIR;
- if(access_mask & ~(conn->share_access)) {
+ if (!CAN_WRITE(conn) || (access_mask & ~(conn->share_access))) {
DEBUG(5,("mkdir_internal: failing share access "
"%s\n", lp_servicename(talloc_tos(), SNUM(conn))));
return NT_STATUS_ACCESS_DENIED;