You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix a regression in PbxCp which caused files to inappropriately gain the execute bit. `isExecutable` is conceptually a higher level operation which (per POSIX) can return true even if the file has no execute permission bits set:
"If execute permission is requested, access shall be granted if execute permission is granted to at least one user by the file permission bits or by an alternate access control mechanism"
No test because it's not clear what the concrete conditions are under which this occurs. That said, copying now checks against the owner permission bit specifically, as that's the actual intent of what the code is meaning to do and matches the original behavior.
Additionally, fix some missing permission information in getFileInfo for the PseudoFS implementation and increase test coverage a bit. Avoids it coming back to bite later.
rdar://154663442
Copy file name to clipboardExpand all lines: Sources/SWBUtil/FSProxy.swift
+29-27Lines changed: 29 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,11 @@ public protocol FSProxy: AnyObject, Sendable {
160
160
// FIXME: Need to document behavior w.r.t. error handling.
161
161
func isDirectory(_ path:Path)->Bool
162
162
163
-
/// Checks whether the given path has the execute bit (which on Windows is determined by the file extension).
163
+
/// Checks whether the given path is executable.
164
+
///
165
+
/// On Windows, this is determined by the file extension (based on `SHGetFileInfo`), while on Unix it's determined by `access`, which means a file may be deemed executable even if no execute bit is set in the POSIX permissions.
0 commit comments