Server: SMB1: Pass the Transaction2 MaxDataCount parameter to methods that retrieve FileInformation / FileSystemInformation

This commit is contained in:
Tal Aloni 2019-04-02 15:52:11 +03:00
parent 01eb1ecc9e
commit 68cc57e9a8
2 changed files with 7 additions and 7 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved. /* Copyright (C) 2014-2019 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,
@ -131,7 +131,7 @@ namespace SMBLibrary.Server.SMB1
return response; return response;
} }
internal static Transaction2QueryFSInformationResponse GetSubcommandResponse(SMB1Header header, Transaction2QueryFSInformationRequest subcommand, ISMBShare share, SMB1ConnectionState state) internal static Transaction2QueryFSInformationResponse GetSubcommandResponse(SMB1Header header, uint maxDataCount, Transaction2QueryFSInformationRequest subcommand, ISMBShare share, SMB1ConnectionState state)
{ {
SMB1Session session = state.GetSession(header.UID); SMB1Session session = state.GetSession(header.UID);
if (share is FileSystemShare) if (share is FileSystemShare)
@ -224,7 +224,7 @@ namespace SMBLibrary.Server.SMB1
return new Transaction2SetFSInformationResponse(); return new Transaction2SetFSInformationResponse();
} }
internal static Transaction2QueryPathInformationResponse GetSubcommandResponse(SMB1Header header, Transaction2QueryPathInformationRequest subcommand, ISMBShare share, SMB1ConnectionState state) internal static Transaction2QueryPathInformationResponse GetSubcommandResponse(SMB1Header header, uint maxDataCount, Transaction2QueryPathInformationRequest subcommand, ISMBShare share, SMB1ConnectionState state)
{ {
SMB1Session session = state.GetSession(header.UID); SMB1Session session = state.GetSession(header.UID);
string path = subcommand.FileName; string path = subcommand.FileName;
@ -278,7 +278,7 @@ namespace SMBLibrary.Server.SMB1
return response; return response;
} }
internal static Transaction2QueryFileInformationResponse GetSubcommandResponse(SMB1Header header, Transaction2QueryFileInformationRequest subcommand, ISMBShare share, SMB1ConnectionState state) internal static Transaction2QueryFileInformationResponse GetSubcommandResponse(SMB1Header header, uint maxDataCount, Transaction2QueryFileInformationRequest subcommand, ISMBShare share, SMB1ConnectionState state)
{ {
SMB1Session session = state.GetSession(header.UID); SMB1Session session = state.GetSession(header.UID);
OpenFileObject openFile = session.GetOpenFileObject(subcommand.FID); OpenFileObject openFile = session.GetOpenFileObject(subcommand.FID);

View file

@ -206,7 +206,7 @@ namespace SMBLibrary.Server.SMB1
} }
else if (subcommand is Transaction2QueryFSInformationRequest) else if (subcommand is Transaction2QueryFSInformationRequest)
{ {
subcommandResponse = Transaction2SubcommandHelper.GetSubcommandResponse(header, (Transaction2QueryFSInformationRequest)subcommand, share, state); subcommandResponse = Transaction2SubcommandHelper.GetSubcommandResponse(header, maxDataCount, (Transaction2QueryFSInformationRequest)subcommand, share, state);
} }
else if (subcommand is Transaction2SetFSInformationRequest) else if (subcommand is Transaction2SetFSInformationRequest)
{ {
@ -214,7 +214,7 @@ namespace SMBLibrary.Server.SMB1
} }
else if (subcommand is Transaction2QueryPathInformationRequest) else if (subcommand is Transaction2QueryPathInformationRequest)
{ {
subcommandResponse = Transaction2SubcommandHelper.GetSubcommandResponse(header, (Transaction2QueryPathInformationRequest)subcommand, share, state); subcommandResponse = Transaction2SubcommandHelper.GetSubcommandResponse(header, maxDataCount, (Transaction2QueryPathInformationRequest)subcommand, share, state);
} }
else if (subcommand is Transaction2SetPathInformationRequest) else if (subcommand is Transaction2SetPathInformationRequest)
{ {
@ -222,7 +222,7 @@ namespace SMBLibrary.Server.SMB1
} }
else if (subcommand is Transaction2QueryFileInformationRequest) else if (subcommand is Transaction2QueryFileInformationRequest)
{ {
subcommandResponse = Transaction2SubcommandHelper.GetSubcommandResponse(header, (Transaction2QueryFileInformationRequest)subcommand, share, state); subcommandResponse = Transaction2SubcommandHelper.GetSubcommandResponse(header, maxDataCount, (Transaction2QueryFileInformationRequest)subcommand, share, state);
} }
else if (subcommand is Transaction2SetFileInformationRequest) else if (subcommand is Transaction2SetFileInformationRequest)
{ {