mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-10 11:23:17 +02:00
Added logging of GetFileInformation and GetFileSystemInformation failures
This commit is contained in:
parent
7791f27276
commit
a8ea9554d0
2 changed files with 5 additions and 2 deletions
|
@ -114,13 +114,14 @@ namespace SMBLibrary.Server.SMB1
|
|||
return response;
|
||||
}
|
||||
|
||||
internal static Transaction2QueryFSInformationResponse GetSubcommandResponse(SMB1Header header, Transaction2QueryFSInformationRequest subcommand, FileSystemShare share)
|
||||
internal static Transaction2QueryFSInformationResponse GetSubcommandResponse(SMB1Header header, Transaction2QueryFSInformationRequest subcommand, FileSystemShare share, SMB1ConnectionState state)
|
||||
{
|
||||
Transaction2QueryFSInformationResponse response = new Transaction2QueryFSInformationResponse();
|
||||
QueryFSInformation queryFSInformation;
|
||||
NTStatus queryStatus = SMB1FileSystemHelper.GetFileSystemInformation(out queryFSInformation, subcommand.InformationLevel, share.FileSystem);
|
||||
if (queryStatus != NTStatus.STATUS_SUCCESS)
|
||||
{
|
||||
state.LogToServer(Severity.Verbose, "GetFileSystemInformation failed. Information level: {0}, NTStatus: {1}", subcommand.InformationLevel, queryStatus);
|
||||
header.Status = queryStatus;
|
||||
return null;
|
||||
}
|
||||
|
@ -146,6 +147,7 @@ namespace SMBLibrary.Server.SMB1
|
|||
NTStatus queryStatus = SMB1FileSystemHelper.GetFileInformation(out queryInformation, entry, false, subcommand.InformationLevel);
|
||||
if (queryStatus != NTStatus.STATUS_SUCCESS)
|
||||
{
|
||||
state.LogToServer(Severity.Verbose, "GetFileInformation on '{0}' failed. Information level: {1}, NTStatus: {2}", path, subcommand.InformationLevel, queryStatus);
|
||||
header.Status = queryStatus;
|
||||
return null;
|
||||
}
|
||||
|
@ -175,6 +177,7 @@ namespace SMBLibrary.Server.SMB1
|
|||
NTStatus queryStatus = SMB1FileSystemHelper.GetFileInformation(out queryInformation, entry, openFile.DeleteOnClose, subcommand.InformationLevel);
|
||||
if (queryStatus != NTStatus.STATUS_SUCCESS)
|
||||
{
|
||||
state.LogToServer(Severity.Verbose, "GetFileInformation on '{0}' failed. Information level: {1}, NTStatus: {2}", openFile.Path, subcommand.InformationLevel, queryStatus);
|
||||
header.Status = queryStatus;
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ namespace SMBLibrary.Server.SMB1
|
|||
}
|
||||
else if (subcommand is Transaction2QueryFSInformationRequest)
|
||||
{
|
||||
subcommandResponse = Transaction2SubcommandHelper.GetSubcommandResponse(header, (Transaction2QueryFSInformationRequest)subcommand, fileSystemShare);
|
||||
subcommandResponse = Transaction2SubcommandHelper.GetSubcommandResponse(header, (Transaction2QueryFSInformationRequest)subcommand, fileSystemShare, state);
|
||||
}
|
||||
else if (subcommand is Transaction2QueryPathInformationRequest)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue