diff options
-rw-r--r-- | source3/smbd/files.c | 18 | ||||
-rw-r--r-- | source3/smbd/proto.h | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/source3/smbd/files.c b/source3/smbd/files.c index d866d6337c..91eddb879b 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -387,6 +387,24 @@ files_struct *file_find_di_next(files_struct *start_fsp) return NULL; } +struct files_struct *file_find_one_fsp_from_lease_key( + struct smbd_server_connection *sconn, + const struct smb2_lease_key *lease_key) +{ + struct files_struct *fsp; + + for (fsp = sconn->files; fsp; fsp=fsp->next) { + if ((fsp->lease != NULL) && + (fsp->lease->lease.lease_key.data[0] == + lease_key->data[0]) && + (fsp->lease->lease.lease_key.data[1] == + lease_key->data[1])) { + return fsp; + } + } + return NULL; +} + /**************************************************************************** Find any fsp open with a pathname below that of an already open path. ****************************************************************************/ diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 67adbba6f2..7a4b4c972c 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -369,6 +369,9 @@ files_struct *file_find_dif(struct smbd_server_connection *sconn, files_struct *file_find_di_first(struct smbd_server_connection *sconn, struct file_id id); files_struct *file_find_di_next(files_struct *start_fsp); +struct files_struct *file_find_one_fsp_from_lease_key( + struct smbd_server_connection *sconn, + const struct smb2_lease_key *lease_key); bool file_find_subpath(files_struct *dir_fsp); void file_sync_all(connection_struct *conn); void fsp_free(files_struct *fsp); |