From: Volker Lendecke Date: Thu, 25 Jul 2019 13:01:37 +0000 (+0200) Subject: smbd: Pass share_access/access_mask explicitly to set_share_mode() X-Git-Tag: tdb-1.4.2~296 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41ab2b8ec5d398ef6187562c7620c359837f3899;p=thirdparty%2Fsamba.git smbd: Pass share_access/access_mask explicitly to set_share_mode() Makes the interface more obvious to me. Also, I want to remove fsp->share_access, which is not really used anywhere after the fsp has been fully established. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/locking/locking.c b/source3/locking/locking.c index d87a882d14f..45399b65f1f 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -794,6 +794,8 @@ bool set_share_mode(struct share_mode_lock *lck, uid_t uid, uint64_t mid, uint16_t op_type, + uint32_t share_access, + uint32_t access_mask, const struct GUID *client_guid, const struct smb2_lease_key *lease_key) { @@ -812,9 +814,9 @@ bool set_share_mode(struct share_mode_lock *lck, ZERO_STRUCTP(e); e->pid = messaging_server_id(fsp->conn->sconn->msg_ctx); - e->share_access = fsp->share_access; + e->share_access = share_access; e->private_options = fsp->fh->private_options; - e->access_mask = fsp->access_mask; + e->access_mask = access_mask; e->op_mid = mid; e->op_type = op_type; diff --git a/source3/locking/proto.h b/source3/locking/proto.h index 3a086fa0516..3eb928ab12e 100644 --- a/source3/locking/proto.h +++ b/source3/locking/proto.h @@ -160,6 +160,8 @@ bool set_share_mode(struct share_mode_lock *lck, uid_t uid, uint64_t mid, uint16_t op_type, + uint32_t share_access, + uint32_t access_mask, const struct GUID *client_guid, const struct smb2_lease_key *lease_key); void remove_stale_share_mode_entries(struct share_mode_data *d); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index a194fbbb71f..e376cb8c836 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2354,6 +2354,8 @@ static NTSTATUS grant_fsp_oplock_type(struct smb_request *req, get_current_uid(fsp->conn), req ? req->mid : 0, fsp->oplock_type, + fsp->share_access, + fsp->access_mask, client_guid, lease_key); if (!ok) { @@ -4200,6 +4202,8 @@ static NTSTATUS open_directory(connection_struct *conn, get_current_uid(conn), req ? req->mid : 0, NO_OPLOCK, + fsp->share_access, + fsp->access_mask, NULL, NULL); if (!ok) {