mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-26 16:43:26 +02:00
NTFileSystemHelper: CreateFile: Updated logging messages
This commit is contained in:
parent
c4b6d9a08b
commit
2460401955
1 changed files with 8 additions and 8 deletions
|
@ -68,7 +68,7 @@ namespace SMBLibrary.Server
|
||||||
if (entry != null)
|
if (entry != null)
|
||||||
{
|
{
|
||||||
// File already exists, fail the request
|
// File already exists, fail the request
|
||||||
state.LogToServer(Severity.Debug, "NTCreate: File '{0}' already exist", path);
|
state.LogToServer(Severity.Debug, "CreateFile: File '{0}' already exist", path);
|
||||||
return NTStatus.STATUS_OBJECT_NAME_COLLISION;
|
return NTStatus.STATUS_OBJECT_NAME_COLLISION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,12 +81,12 @@ namespace SMBLibrary.Server
|
||||||
{
|
{
|
||||||
if (forceDirectory)
|
if (forceDirectory)
|
||||||
{
|
{
|
||||||
state.LogToServer(Severity.Information, "NTCreate: Creating directory '{0}'", path);
|
state.LogToServer(Severity.Information, "CreateFile: Creating directory '{0}'", path);
|
||||||
entry = fileSystem.CreateDirectory(path);
|
entry = fileSystem.CreateDirectory(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state.LogToServer(Severity.Information, "NTCreate: Creating file '{0}'", path);
|
state.LogToServer(Severity.Information, "CreateFile: Creating file '{0}'", path);
|
||||||
entry = fileSystem.CreateFile(path);
|
entry = fileSystem.CreateFile(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,18 +95,18 @@ namespace SMBLibrary.Server
|
||||||
ushort errorCode = IOExceptionHelper.GetWin32ErrorCode(ex);
|
ushort errorCode = IOExceptionHelper.GetWin32ErrorCode(ex);
|
||||||
if (errorCode == (ushort)Win32Error.ERROR_SHARING_VIOLATION)
|
if (errorCode == (ushort)Win32Error.ERROR_SHARING_VIOLATION)
|
||||||
{
|
{
|
||||||
state.LogToServer(Severity.Debug, "NTCreate: Sharing violation creating '{0}'", path);
|
state.LogToServer(Severity.Debug, "CreateFile: Error creating '{0}'. Sharing violation.", path);
|
||||||
return NTStatus.STATUS_SHARING_VIOLATION;
|
return NTStatus.STATUS_SHARING_VIOLATION;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state.LogToServer(Severity.Debug, "NTCreate: Error creating '{0}'", path);
|
state.LogToServer(Severity.Debug, "CreateFile: Error creating '{0}'. Data Error.", path);
|
||||||
return NTStatus.STATUS_DATA_ERROR;
|
return NTStatus.STATUS_DATA_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (UnauthorizedAccessException)
|
catch (UnauthorizedAccessException)
|
||||||
{
|
{
|
||||||
state.LogToServer(Severity.Debug, "NTCreate: Error creating '{0}', Access Denied", path);
|
state.LogToServer(Severity.Debug, "CreateFile: Error creating '{0}'. Access Denied.", path);
|
||||||
return NTStatus.STATUS_ACCESS_DENIED;
|
return NTStatus.STATUS_ACCESS_DENIED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,12 +132,12 @@ namespace SMBLibrary.Server
|
||||||
{
|
{
|
||||||
if (forceDirectory)
|
if (forceDirectory)
|
||||||
{
|
{
|
||||||
state.LogToServer(Severity.Information, "NTCreate: Creating directory '{0}'", path);
|
state.LogToServer(Severity.Information, "CreateFile: Creating directory '{0}'", path);
|
||||||
entry = fileSystem.CreateDirectory(path);
|
entry = fileSystem.CreateDirectory(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state.LogToServer(Severity.Information, "NTCreate: Creating file '{0}'", path);
|
state.LogToServer(Severity.Information, "CreateFile: Creating file '{0}'", path);
|
||||||
entry = fileSystem.CreateFile(path);
|
entry = fileSystem.CreateFile(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue