summaryrefslogtreecommitdiff
path: root/source3/smbd/files.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/files.c')
-rw-r--r--source3/smbd/files.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index ef229a4098..cba79aefcf 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -582,22 +582,15 @@ files_struct *file_fsp(struct smb_request *req, uint16 fid)
return fsp;
}
-struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req,
- uint64_t persistent_id,
- uint64_t volatile_id)
+struct files_struct *file_fsp_get(struct smbd_smb2_request *smb2req,
+ uint64_t persistent_id,
+ uint64_t volatile_id)
{
struct smbXsrv_open *op;
NTSTATUS status;
NTTIME now = 0;
struct files_struct *fsp;
- if (smb2req->compat_chain_fsp != NULL) {
- if (smb2req->compat_chain_fsp->deferred_close) {
- return NULL;
- }
- return smb2req->compat_chain_fsp;
- }
-
now = timeval_to_nttime(&smb2req->request_time);
status = smb2srv_open_lookup(smb2req->sconn->conn,
@@ -636,6 +629,27 @@ struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req,
return NULL;
}
+ return fsp;
+}
+
+struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req,
+ uint64_t persistent_id,
+ uint64_t volatile_id)
+{
+ struct files_struct *fsp;
+
+ if (smb2req->compat_chain_fsp != NULL) {
+ if (smb2req->compat_chain_fsp->deferred_close) {
+ return NULL;
+ }
+ return smb2req->compat_chain_fsp;
+ }
+
+ fsp = file_fsp_get(smb2req, persistent_id, volatile_id);
+ if (fsp == NULL) {
+ return NULL;
+ }
+
smb2req->compat_chain_fsp = fsp;
return fsp;
}