mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-21 16:55:54 +02:00
Return STATUS_INVALID_PARAMETER instead of STATUS_SMB_BAD_COMMAND when client tries to perform operation on mismatching share
This commit is contained in:
parent
7c3e6edf84
commit
acf3a99214
2 changed files with 11 additions and 10 deletions
|
@ -136,7 +136,8 @@ namespace SMBLibrary.Server.SMB1
|
|||
{
|
||||
if (!(share is NamedPipeShare))
|
||||
{
|
||||
header.Status = NTStatus.STATUS_SMB_BAD_COMMAND;
|
||||
// [MS-CIFS] If the pipe is not a message mode pipe, the Trans subsystem MUST fail the request with STATUS_INVALID_PARAMETER
|
||||
header.Status = NTStatus.STATUS_INVALID_PARAMETER;
|
||||
return new ErrorResponse(CommandName.SMB_COM_TRANSACTION);
|
||||
}
|
||||
|
||||
|
@ -196,7 +197,7 @@ namespace SMBLibrary.Server.SMB1
|
|||
|
||||
if (!(share is FileSystemShare))
|
||||
{
|
||||
header.Status = NTStatus.STATUS_SMB_BAD_COMMAND;
|
||||
header.Status = NTStatus.STATUS_INVALID_PARAMETER;
|
||||
return new ErrorResponse(CommandName.SMB_COM_TRANSACTION2);
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ namespace SMBLibrary.Server
|
|||
{
|
||||
if (!(share is FileSystemShare))
|
||||
{
|
||||
header.Status = NTStatus.STATUS_SMB_BAD_COMMAND;
|
||||
header.Status = NTStatus.STATUS_INVALID_PARAMETER;
|
||||
return new ErrorResponse(command.CommandName);
|
||||
}
|
||||
CreateDirectoryRequest request = (CreateDirectoryRequest)command;
|
||||
|
@ -156,7 +156,7 @@ namespace SMBLibrary.Server
|
|||
{
|
||||
if (!(share is FileSystemShare))
|
||||
{
|
||||
header.Status = NTStatus.STATUS_SMB_BAD_COMMAND;
|
||||
header.Status = NTStatus.STATUS_INVALID_PARAMETER;
|
||||
return new ErrorResponse(command.CommandName);
|
||||
}
|
||||
DeleteDirectoryRequest request = (DeleteDirectoryRequest)command;
|
||||
|
@ -175,7 +175,7 @@ namespace SMBLibrary.Server
|
|||
{
|
||||
if (!(share is FileSystemShare))
|
||||
{
|
||||
header.Status = NTStatus.STATUS_SMB_BAD_COMMAND;
|
||||
header.Status = NTStatus.STATUS_INVALID_PARAMETER;
|
||||
return new ErrorResponse(command.CommandName);
|
||||
}
|
||||
DeleteRequest request = (DeleteRequest)command;
|
||||
|
@ -185,7 +185,7 @@ namespace SMBLibrary.Server
|
|||
{
|
||||
if (!(share is FileSystemShare))
|
||||
{
|
||||
header.Status = NTStatus.STATUS_SMB_BAD_COMMAND;
|
||||
header.Status = NTStatus.STATUS_INVALID_PARAMETER;
|
||||
return new ErrorResponse(command.CommandName);
|
||||
}
|
||||
RenameRequest request = (RenameRequest)command;
|
||||
|
@ -195,7 +195,7 @@ namespace SMBLibrary.Server
|
|||
{
|
||||
if (!(share is FileSystemShare))
|
||||
{
|
||||
header.Status = NTStatus.STATUS_SMB_BAD_COMMAND;
|
||||
header.Status = NTStatus.STATUS_INVALID_PARAMETER;
|
||||
return new ErrorResponse(command.CommandName);
|
||||
}
|
||||
QueryInformationRequest request = (QueryInformationRequest)command;
|
||||
|
@ -205,7 +205,7 @@ namespace SMBLibrary.Server
|
|||
{
|
||||
if (!(share is FileSystemShare))
|
||||
{
|
||||
header.Status = NTStatus.STATUS_SMB_BAD_COMMAND;
|
||||
header.Status = NTStatus.STATUS_INVALID_PARAMETER;
|
||||
return new ErrorResponse(command.CommandName);
|
||||
}
|
||||
SetInformationRequest request = (SetInformationRequest)command;
|
||||
|
@ -231,7 +231,7 @@ namespace SMBLibrary.Server
|
|||
{
|
||||
if (!(share is FileSystemShare))
|
||||
{
|
||||
header.Status = NTStatus.STATUS_SMB_BAD_COMMAND;
|
||||
header.Status = NTStatus.STATUS_INVALID_PARAMETER;
|
||||
return new ErrorResponse(command.CommandName);
|
||||
}
|
||||
CheckDirectoryRequest request = (CheckDirectoryRequest)command;
|
||||
|
@ -249,7 +249,7 @@ namespace SMBLibrary.Server
|
|||
{
|
||||
if (!(share is FileSystemShare))
|
||||
{
|
||||
header.Status = NTStatus.STATUS_SMB_BAD_COMMAND;
|
||||
header.Status = NTStatus.STATUS_INVALID_PARAMETER;
|
||||
return new ErrorResponse(command.CommandName);
|
||||
}
|
||||
SetInformation2Request request = (SetInformation2Request)command;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue