Ignore symlink permissions in binary deltas (#1905)

Co-authored-by: Kornel <kornel@geekhood.net>
This commit is contained in:
Mayur PawasheandKornel authored and GitHub committed 2021-07-23 17:42:13 -07:00
1 parent 119766a650
commit cb9386a4ea
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -190,6 +190,11 @@ NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion)
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion)) {
uint16_t mode = ent->fts_statp->st_mode;
// permission of symlinks is irrelevant and can't be changed.
// hardcoding a value helps avoid differences between filesystems.
if (ent->fts_info == FTS_SL) {
mode = 0755;
}
uint16_t type = ent->fts_info;
uint16_t permissions = mode & PERMISSION_FLAGS;
+1 -1
View File
@@ -257,7 +257,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
XCTFail(@"Failed setting file permissions");
}
XCTAssertFalse([self testDirectoryHashEqualityWithSource:sourceDirectory destination:destinationDirectory]);
XCTAssertTrue([self testDirectoryHashEqualityWithSource:sourceDirectory destination:destinationDirectory]);
}];
}