uint64_t mid,
uint16_t op_type,
const struct smb2_lease_key *lease_key,
+ const struct GUID *create_guid,
uint32_t share_access,
uint32_t access_mask)
{
if (e.flags & SHARE_ENTRY_FLAG_PERSISTENT_OPEN) {
d->num_persistent++;
d->modified = true;
+ SMB_ASSERT(create_guid != NULL);
+ e.create_guid = *create_guid;
}
ok = share_mode_entry_put(&e, &e_buf);
struct files_struct *fsp);
bool file_has_read_lease(struct files_struct *fsp);
+struct GUID;
bool set_share_mode(
struct share_mode_lock *lck,
struct files_struct *fsp,
uint64_t mid,
uint16_t op_type,
const struct smb2_lease_key *lease_key,
+ const struct GUID *create_guid,
uint32_t share_access,
uint32_t access_mask);
bool reset_share_mode_entry(
bool request_counters_updated;
uint64_t channel_generation;
+ /*
+ * The client provided CreateGuid from a
+ * SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2 if any.
+ */
+ struct GUID _create_guid;
+ struct GUID *create_guid;
+
/*
* The sub request for async backend calls.
* This is used for SMB2 Cancel.
uint32_t granted_lease = 0;
const struct smb2_lease_key *lease_key = NULL;
struct blocker_debug_state *blocker_debug_state = NULL;
+ const struct GUID *create_guid = NULL;
bool delete_on_close;
bool ok;
share_mode_flags_restrict(lck, access_mask, share_access, 0);
+ if (req != NULL && req->smb2req != NULL) {
+ create_guid = req->smb2req->create_guid;
+ }
+
ok = set_share_mode(lck,
fsp,
get_current_uid(fsp->conn),
req ? req->mid : 0,
oplock_type,
lease_key,
+ create_guid,
share_access,
access_mask);
if (!ok) {
return;
}
state->create_guid = &state->_create_guid;
+ /*
+ * Make the CreateGuid available to the FSA and VFS layers via
+ * the "req" argument to SMB_VFS_CREATE_FILE():
+ * req->smb2req->create_guid.
+ */
+ smb2req->_create_guid = state->_create_guid;
+ smb2req->create_guid = &smb2req->_create_guid;
/*
* we need to store the create_guid later