Allows renaming files that are not executable on Unix

This commit is contained in:
BinaryAlley committed 2026-09-06 10:43:34 -07:00
1 parent 114bfe94ff
commit f14b321294
2 files changed
+1 -31

No files matched your search

@@ -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);