From 10a60df1ccc5e5992c63802861589fb81372f64e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 13 Sep 2018 12:47:55 +0200 Subject: [PATCH] smbd: Add lease key to share_mode_entry 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 Reviewed-by: Christof Schmitt --- source3/librpc/idl/open_files.idl | 2 ++ source3/locking/locking.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/source3/librpc/idl/open_files.idl b/source3/librpc/idl/open_files.idl index c07a903878e..a474da104c1 100644 --- a/source3/librpc/idl/open_files.idl +++ b/source3/librpc/idl/open_files.idl @@ -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; diff --git a/source3/locking/locking.c b/source3/locking/locking.c index d4c3b32be7f..b70d0d62bb1 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -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; -- 2.34.1