diff --git a/SMBLibrary/Server/SMB1/TransactionHelper.cs b/SMBLibrary/Server/SMB1/TransactionHelper.cs index 6b0e9bd..e5b75d8 100644 --- a/SMBLibrary/Server/SMB1/TransactionHelper.cs +++ b/SMBLibrary/Server/SMB1/TransactionHelper.cs @@ -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); } diff --git a/SMBLibrary/Server/SMBServer.SMB1.cs b/SMBLibrary/Server/SMBServer.SMB1.cs index f6d2ffb..9918d3c 100644 --- a/SMBLibrary/Server/SMBServer.SMB1.cs +++ b/SMBLibrary/Server/SMBServer.SMB1.cs @@ -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;