mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-27 03:08:15 +02:00
Improved compliance with MS-SMB when NTTransactIOCTLRequest.IsFsctl is set to false
This commit is contained in:
parent
19cb25c463
commit
8722f45300
2 changed files with 13 additions and 4 deletions
|
@ -25,6 +25,7 @@ namespace SMBLibrary
|
||||||
STATUS_DISK_FULL = 0xC000007F,
|
STATUS_DISK_FULL = 0xC000007F,
|
||||||
STATUS_MEDIA_WRITE_PROTECTED = 0xC00000A2,
|
STATUS_MEDIA_WRITE_PROTECTED = 0xC00000A2,
|
||||||
STATUS_FILE_IS_A_DIRECTORY = 0xC00000BA,
|
STATUS_FILE_IS_A_DIRECTORY = 0xC00000BA,
|
||||||
|
STATUS_NOT_SUPPORTED = 0xC00000BB,
|
||||||
STATUS_CANNOT_DELETE = 0xC0000121,
|
STATUS_CANNOT_DELETE = 0xC0000121,
|
||||||
|
|
||||||
STATUS_INVALID_SMB = 0x00010002, // CIFS/SMB1: A corrupt or invalid SMB request was received
|
STATUS_INVALID_SMB = 0x00010002, // CIFS/SMB1: A corrupt or invalid SMB request was received
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||||
*
|
*
|
||||||
* You can redistribute this program and/or modify it under the terms of
|
* You can redistribute this program and/or modify it under the terms of
|
||||||
* the GNU Lesser Public License as published by the Free Software Foundation,
|
* the GNU Lesser Public License as published by the Free Software Foundation,
|
||||||
|
@ -126,11 +126,19 @@ namespace SMBLibrary.Server
|
||||||
response.Data = objectID.GetBytes();
|
response.Data = objectID.GetBytes();
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
header.Status = NTStatus.STATUS_NOT_IMPLEMENTED;
|
header.Status = NTStatus.STATUS_NOT_IMPLEMENTED;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// [MS-SMB] If the IsFsctl field is set to zero, the server SHOULD fail the request with STATUS_NOT_SUPPORTED
|
||||||
|
header.Status = NTStatus.STATUS_NOT_SUPPORTED;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void PrepareResponse(NTTransactResponse response, byte[] responseSetup, byte[] responseParameters, byte[] responseData, int maxBufferSize, List<SMBCommand> sendQueue)
|
private static void PrepareResponse(NTTransactResponse response, byte[] responseSetup, byte[] responseParameters, byte[] responseData, int maxBufferSize, List<SMBCommand> sendQueue)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue