diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/service.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c index b2d3d4ddc1..b74192cec8 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -524,6 +524,13 @@ static void create_share_access_mask(connection_struct *conn, int snum) MAXIMUM_ALLOWED_ACCESS, &conn->share_access); + if (!CAN_WRITE(conn)) { + conn->share_access &= + ~(SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA | + SEC_FILE_WRITE_EA | SEC_FILE_WRITE_ATTRIBUTE | + SEC_DIR_DELETE_CHILD ); + } + if (security_token_has_privilege(token, SEC_PRIV_SECURITY)) { conn->share_access |= SEC_FLAG_SYSTEM_SECURITY; } |