mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-03 22:41:49 +02:00
NTFileSystemAdapter: Avoid modifications of entries returned from IFileSystem
This commit is contained in:
parent
c1979716fb
commit
de28e672f9
1 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2014-2020 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||
/* Copyright (C) 2014-2022 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||
*
|
||||
* You can redistribute this program and/or modify it under the terms of
|
||||
* the GNU Lesser Public License as published by the Free Software Foundation,
|
||||
|
@ -50,9 +50,9 @@ namespace SMBLibrary.Adapters
|
|||
// The SMB1 / SMB2 specifications mandate that when zero entries are found, the server SHOULD / MUST return STATUS_NO_SUCH_FILE.
|
||||
// For this reason, we MUST include the current directory and/or parent directory when enumerating a directory
|
||||
// in order to diffrentiate between a directory that does not exist and a directory with no entries.
|
||||
FileSystemEntry currentDirectory = m_fileSystem.GetEntry(path);
|
||||
FileSystemEntry currentDirectory = m_fileSystem.GetEntry(path).Clone();
|
||||
currentDirectory.Name = ".";
|
||||
FileSystemEntry parentDirectory = m_fileSystem.GetEntry(FileSystem.GetParentDirectory(path));
|
||||
FileSystemEntry parentDirectory = m_fileSystem.GetEntry(FileSystem.GetParentDirectory(path)).Clone();
|
||||
parentDirectory.Name = "..";
|
||||
entries.Insert(0, parentDirectory);
|
||||
entries.Insert(0, currentDirectory);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue