summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-01-04 14:24:13 -0800
committerAndrew Bartlett <abartlet@samba.org>2013-01-09 15:29:08 +1100
commit5e9eebf5dec60177a680010e011b88ae0ecf26d2 (patch)
tree23c3b8eab40c00c149df8515099bbc26f63a2b84
parent926d9307f789e2ca752ee2dab6b6e653dc7de628 (diff)
downloadsamba-5e9eebf5dec60177a680010e011b88ae0ecf26d2.tar.gz
samba-5e9eebf5dec60177a680010e011b88ae0ecf26d2.tar.bz2
samba-5e9eebf5dec60177a680010e011b88ae0ecf26d2.zip
Change API for create_share_access_mask() - remove conn struct.
Eventually this will be indepentent of conn, just pass in the readonly flag. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source3/smbd/proto.h4
-rw-r--r--source3/smbd/service.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index bfaaf6d639..2198ccd3f7 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -979,8 +979,8 @@ void smbd_exit_server_cleanly(const char *const reason) _NORETURN_;
bool set_conn_connectpath(connection_struct *conn, const char *connectpath);
NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum);
-uint32_t create_share_access_mask(connection_struct *conn,
- int snum,
+uint32_t create_share_access_mask(int snum,
+ bool readonly_share,
const struct security_token *token);
bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir);
void load_registry_shares(void);
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 3e1d87f1f0..10f4b537db 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -515,8 +515,8 @@ NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum)
Setup the share access mask for a connection.
****************************************************************************/
-uint32_t create_share_access_mask(connection_struct *conn,
- int snum,
+uint32_t create_share_access_mask(int snum,
+ bool readonly_share,
const struct security_token *token)
{
uint32_t share_access = 0;
@@ -526,7 +526,7 @@ uint32_t create_share_access_mask(connection_struct *conn,
MAXIMUM_ALLOWED_ACCESS,
&share_access);
- if (!CAN_WRITE(conn)) {
+ if (readonly_share) {
share_access &=
~(SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA |
SEC_FILE_WRITE_EA | SEC_FILE_WRITE_ATTRIBUTE |
@@ -658,8 +658,8 @@ static NTSTATUS make_connection_snum(struct smbd_server_connection *sconn,
*
*/
- conn->share_access = create_share_access_mask(conn,
- snum,
+ conn->share_access = create_share_access_mask(snum,
+ !CAN_WRITE(conn),
conn->session_info->security_token);
if ((conn->share_access & FILE_WRITE_DATA) == 0) {