smbd: Add lease key to share_mode_entry
authorVolker Lendecke <vl@samba.org>
Thu, 13 Sep 2018 10:47:55 +0000 (12:47 +0200)
committerChristof Schmitt <cs@samba.org>
Sun, 14 Apr 2019 04:01:30 +0000 (04:01 +0000)
Instead of indexing into the leases[] array, put the lease_db reference into
the share_mode_entry. For simplicity, put in the client guid as well. We
*might* be able to retrieve that from somewhere else, but as other smbd
processes have to look at the lease values, put in the full leases_db index
data.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
source3/librpc/idl/open_files.idl
source3/locking/locking.c

index c07a903..a474da1 100644 (file)
@@ -47,6 +47,8 @@ interface open_files
                hyper           op_mid;
                uint16          op_type;
                uint32          lease_idx;
+               GUID            client_guid;
+               smb2_lease_key  lease_key;
                uint32          access_mask;
                uint32          share_access;
                uint32          private_options;
index d4c3b32..b70d0d6 100644 (file)
@@ -844,6 +844,10 @@ bool set_share_mode(struct share_mode_lock *lck, struct files_struct *fsp,
        e->op_mid = mid;
        e->op_type = op_type;
        e->lease_idx = lease_idx;
+       if (lease_idx != UINT32_MAX) {
+               e->client_guid = lck->data->leases[lease_idx].client_guid;
+               e->lease_key = lck->data->leases[lease_idx].lease_key;
+       }
        e->time.tv_sec = fsp->open_time.tv_sec;
        e->time.tv_usec = fsp->open_time.tv_usec;
        e->share_file_id = fsp->fh->gen_id;