From 926d9307f789e2ca752ee2dab6b6e653dc7de628 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Jan 2013 11:43:10 -0800 Subject: Change API for create_share_access_mask() to pass in the token. Don't automatically use the one from conn->session_info->security_token. Signed-off-by: Jeremy Allison Reviewed-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source3/smbd/proto.h | 4 +++- source3/smbd/service.c | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index abc6b289c0..bfaaf6d639 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -979,7 +979,9 @@ 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(connection_struct *conn, + int snum, + const struct security_token *token); bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir); void load_registry_shares(void); int add_home_service(const char *service, const char *username, const char *homedir); diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 1cd12a6fdc..3e1d87f1f0 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -515,9 +515,10 @@ 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(connection_struct *conn, + int snum, + const struct security_token *token) { - const struct security_token *token = conn->session_info->security_token; uint32_t share_access = 0; share_access_check(token, @@ -657,7 +658,9 @@ 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(conn, + snum, + conn->session_info->security_token); if ((conn->share_access & FILE_WRITE_DATA) == 0) { if ((conn->share_access & FILE_READ_DATA) == 0) { -- cgit