smbd: Pass share_access/access_mask explicitly to set_share_mode()
authorVolker Lendecke <vl@samba.org>
Thu, 25 Jul 2019 13:01:37 +0000 (15:01 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 6 Aug 2019 21:49:29 +0000 (21:49 +0000)
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 <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/locking.c
source3/locking/proto.h
source3/smbd/open.c

index d87a882d14fb8f180aa89506254a976b91fcb67b..45399b65f1f1c7efe4d84812446303dd19ce3965 100644 (file)
@@ -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;
 
index 3a086fa0516d94536f4d8b2afd1fe9663923529f..3eb928ab12e1285371a3fc58fec6d6463fbb75f3 100644 (file)
@@ -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);
index a194fbbb71fd681be41dcb2e46954a126d345764..e376cb8c836705242d73cc7c54efea2de5dcde82 100644 (file)
@@ -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) {