mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-29 18:27:48 +02:00
NTFileSystemAdapter: Bugfix: FILE_OPEN_IF was not handled properly if the file exists
This commit is contained in:
parent
dae8a6b19e
commit
340f55c26e
1 changed files with 63 additions and 48 deletions
|
@ -157,6 +157,20 @@ namespace SMBLibrary
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fileStatus = FileStatus.FILE_EXISTS;
|
fileStatus = FileStatus.FILE_EXISTS;
|
||||||
|
if (createDisposition == CreateDisposition.FILE_OPEN_IF)
|
||||||
|
{
|
||||||
|
if (entry.IsDirectory && forceFile)
|
||||||
|
{
|
||||||
|
return NTStatus.STATUS_FILE_IS_A_DIRECTORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entry.IsDirectory && forceDirectory)
|
||||||
|
{
|
||||||
|
return NTStatus.STATUS_OBJECT_PATH_INVALID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (!requestedWriteAccess)
|
if (!requestedWriteAccess)
|
||||||
{
|
{
|
||||||
return NTStatus.STATUS_ACCESS_DENIED;
|
return NTStatus.STATUS_ACCESS_DENIED;
|
||||||
|
@ -216,6 +230,7 @@ namespace SMBLibrary
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return NTStatus.STATUS_INVALID_PARAMETER;
|
return NTStatus.STATUS_INVALID_PARAMETER;
|
||||||
|
|
Loading…
Add table
Reference in a new issue