mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:21:10 +00:00
Allows renaming files that are not executable on Unix
This commit is contained in:
1 parent
114bfe94ff
commit
f14b321294
2 files changed
+1
-31
No files matched your search
+1
-3
@@ -247,9 +247,7 @@ internal class FileProviderService : IFileProviderService
|
||||
Result<FileSystemPathId> newFilePathResult = FileSystemPathId.Create(newFile);
|
||||
if (newFilePathResult.IsFailure)
|
||||
return newFilePathResult.Errors;
|
||||
// check if the user has access permissions to the provided path
|
||||
if (!_fileSystemPermissionsService.CanAccessPath(path, FileAccessMode.Execute))
|
||||
return Errors.Permission.UnauthorizedAccess;
|
||||
// renaming a file only requires write access to its parent directory, never execute access to the file itself
|
||||
if (!_fileSystemPermissionsService.CanAccessPath(parendDirectoryResult.Value, FileAccessMode.Write))
|
||||
return Errors.Permission.UnauthorizedAccess;
|
||||
_fileSystem.File.Move(path.Path, newFilePathResult.Value.Path);
|
||||
|
||||
Reference in new issue
Block a user