mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-29 18:27:48 +02:00
SMB2: Minor logging improvements
This commit is contained in:
parent
941429d75e
commit
685be319a6
2 changed files with 8 additions and 1 deletions
|
@ -42,6 +42,7 @@ namespace SMBLibrary.Server.SMB2
|
|||
return new ErrorResponse(request.CommandName, queryStatus);
|
||||
}
|
||||
|
||||
state.LogToServer(Severity.Information, "GetFileInformation on '{0}{1}' succeeded. Information class: {2}", share.Name, openFile.Path, request.FileInformationClass);
|
||||
QueryInfoResponse response = new QueryInfoResponse();
|
||||
response.SetFileInformation(fileInformation);
|
||||
return response;
|
||||
|
@ -63,6 +64,8 @@ namespace SMBLibrary.Server.SMB2
|
|||
state.LogToServer(Severity.Verbose, "GetFileSystemInformation on '{0}' failed. Information class: {1}, NTStatus: {2}", share.Name, request.FileSystemInformationClass, queryStatus);
|
||||
return new ErrorResponse(request.CommandName, queryStatus);
|
||||
}
|
||||
|
||||
state.LogToServer(Severity.Information, "GetFileSystemInformation on '{0} succeeded. Information class: {1}", share.Name, request.FileSystemInformationClass);
|
||||
QueryInfoResponse response = new QueryInfoResponse();
|
||||
response.SetFileSystemInformation(fileSystemInformation);
|
||||
return response;
|
||||
|
|
|
@ -41,23 +41,27 @@ namespace SMBLibrary.Server.SMB2
|
|||
}
|
||||
catch (UnsupportedInformationLevelException)
|
||||
{
|
||||
state.LogToServer(Severity.Verbose, "SetFileInformation on '{0}{1}' failed. Information class: {2}, NTStatus: STATUS_INVALID_INFO_CLASS", share.Name, openFile.Path, request.FileInformationClass);
|
||||
return new ErrorResponse(request.CommandName, NTStatus.STATUS_INVALID_INFO_CLASS);
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
state.LogToServer(Severity.Verbose, "SetFileInformation on '{0}{1}' failed. Information class: {2}, NTStatus: STATUS_NOT_SUPPORTED", share.Name, openFile.Path, request.FileInformationClass);
|
||||
return new ErrorResponse(request.CommandName, NTStatus.STATUS_NOT_SUPPORTED);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
state.LogToServer(Severity.Verbose, "SetFileInformation on '{0}{1}' failed. Information class: {2}, NTStatus: STATUS_INVALID_PARAMETER", share.Name, openFile.Path, request.FileInformationClass);
|
||||
return new ErrorResponse(request.CommandName, NTStatus.STATUS_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
NTStatus status = share.FileStore.SetFileInformation(openFile.Handle, information);
|
||||
if (status != NTStatus.STATUS_SUCCESS)
|
||||
{
|
||||
state.LogToServer(Severity.Verbose, "SetFileInformation on '{0}{1}' failed. Information class: {2}, NTStatus: {3}", share.Name, openFile.Path, information.FileInformationClass, status);
|
||||
state.LogToServer(Severity.Verbose, "SetFileInformation on '{0}{1}' failed. Information class: {2}, NTStatus: {3}", share.Name, openFile.Path, request.FileInformationClass, status);
|
||||
return new ErrorResponse(request.CommandName, status);
|
||||
}
|
||||
state.LogToServer(Severity.Information, "SetFileInformation on '{0}{1}' succeeded. Information class: {2}", share.Name, openFile.Path, request.FileInformationClass);
|
||||
return new SetInfoResponse();
|
||||
}
|
||||
return new ErrorResponse(request.CommandName, NTStatus.STATUS_NOT_SUPPORTED);
|
||||
|
|
Loading…
Add table
Reference in a new issue