summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/smb_server/smb2/smb2_server.h2
-rw-r--r--source4/torture/smb2/connect.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h
index 4f4e769940..daf7e315c2 100644
--- a/source4/smb_server/smb2/smb2_server.h
+++ b/source4/smb_server/smb2/smb2_server.h
@@ -114,7 +114,7 @@ struct smbsrv_request;
#define SMB2SRV_CHECK_FILE_HANDLE(handle) do { \
if (!handle) { \
- smb2srv_send_error(req, NT_STATUS_INVALID_HANDLE); \
+ smb2srv_send_error(req, NT_STATUS_NOT_FOUND); \
return; \
} \
} while (0)
diff --git a/source4/torture/smb2/connect.c b/source4/torture/smb2/connect.c
index 54075b17d0..3b12e54a3b 100644
--- a/source4/torture/smb2/connect.c
+++ b/source4/torture/smb2/connect.c
@@ -207,6 +207,12 @@ BOOL torture_smb2_connect(struct torture_context *torture)
torture_smb2_close(tree, h1);
torture_smb2_close(tree, h2);
+ status = smb2_util_close(tree, h1);
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
+ printf("close should have closed the handle - %s\n", nt_errstr(status));
+ return False;
+ }
+
status = smb2_tdis(tree);
if (!NT_STATUS_IS_OK(status)) {
printf("tdis failed - %s\n", nt_errstr(status));