The branch, master has been updated via 4544c52 s3: For read-only shares, filter out write bits from conn->access_mask via 4666dec s3: Fix rejecting mkdir on read-only shares from 3bdca92 smb.conf(5): Add basic documentation for 'rpc bigendian'.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 4544c52fc432c4eb5ba45389519d00923d9698ca Author: Volker Lendecke <v...@samba.org> Date: Wed Sep 26 15:26:35 2012 -0700 s3: For read-only shares, filter out write bits from conn->access_mask Signed-off-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Thu Sep 27 02:51:42 CEST 2012 on sn-devel-104 commit 4666dec4160d09a6d87349c5521fe5751eb5e764 Author: Volker Lendecke <v...@samba.org> Date: Wed Sep 26 14:53:59 2012 -0700 s3: Fix rejecting mkdir on read-only shares Signed-off-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: source3/smbd/open.c | 2 +- source3/smbd/service.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 10c855c..40a6411 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; diff --git a/source3/smbd/service.c b/source3/smbd/service.c index b2d3d4d..b74192c 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; } -- Samba Shared Repository