return NT_STATUS_OK;
}
-static NTSTATUS grant_new_fsp_lease(struct files_struct *fsp,
- struct share_mode_lock *lck,
- const struct GUID *client_guid,
- const struct smb2_lease *lease,
- uint32_t granted)
+NTSTATUS grant_new_fsp_lease(struct files_struct *fsp,
+ struct share_mode_lock *lck,
+ const struct GUID *client_guid,
+ const struct smb2_lease *lease,
+ uint32_t granted,
+ bool bump_epoch)
{
NTSTATUS status;
fsp->lease->lease.lease_flags = lease->lease_flags;
fsp->lease->lease.lease_state = granted;
fsp->lease->lease.lease_epoch = lease->lease_epoch;
- if (granted != 0) {
+ if (granted != 0 && bump_epoch) {
fsp->lease->lease.lease_epoch++;
}
if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
status = grant_new_fsp_lease(
- fsp, lck, client_guid, lease, granted);
+ fsp, lck, client_guid, lease, granted, true);
}
return status;
const struct smb2_create_blobs *in_context_blobs,
struct smb2_create_blobs *out_context_blobs);
+NTSTATUS grant_new_fsp_lease(struct files_struct *fsp,
+ struct share_mode_lock *lck,
+ const struct GUID *client_guid,
+ const struct smb2_lease *lease,
+ uint32_t granted,
+ bool bump_epoch);
+
/* The following definitions come from smbd/oplock.c */
uint32_t get_lease_type(struct share_mode_entry *e, struct file_id id);