mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-07 10:03:18 +02:00
Return STATUS_ACCESS_DENIED when writing to file that was opened for reading and vice versa
This commit is contained in:
parent
1679629b47
commit
ee55b59a2f
1 changed files with 2 additions and 2 deletions
|
@ -274,7 +274,7 @@ namespace SMBLibrary.Server
|
||||||
}
|
}
|
||||||
else // File
|
else // File
|
||||||
{
|
{
|
||||||
if (stream == null)
|
if (stream == null || !stream.CanRead)
|
||||||
{
|
{
|
||||||
state.LogToServer(Severity.Debug, "ReadFile: Cannot read '{0}', Invalid Operation.", openFilePath);
|
state.LogToServer(Severity.Debug, "ReadFile: Cannot read '{0}', Invalid Operation.", openFilePath);
|
||||||
return NTStatus.STATUS_ACCESS_DENIED;
|
return NTStatus.STATUS_ACCESS_DENIED;
|
||||||
|
@ -335,7 +335,7 @@ namespace SMBLibrary.Server
|
||||||
}
|
}
|
||||||
else // File
|
else // File
|
||||||
{
|
{
|
||||||
if (stream == null)
|
if (stream == null || !stream.CanWrite)
|
||||||
{
|
{
|
||||||
state.LogToServer(Severity.Debug, "WriteFile: Cannot write '{0}'. Invalid Operation.", openFilePath);
|
state.LogToServer(Severity.Debug, "WriteFile: Cannot write '{0}'. Invalid Operation.", openFilePath);
|
||||||
return NTStatus.STATUS_ACCESS_DENIED;
|
return NTStatus.STATUS_ACCESS_DENIED;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue