mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Ignore non-standard permissions in delta updates instead of failing the build
Fixes #1383
This commit is contained in:
1 parent
fc3221c5d2
commit
1edfcaba71
2 files changed
+5
-8
No files matched your search
Vendored
+3
-6
@@ -381,13 +381,10 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
|
||||
mode_t permissions = [info[INFO_PERMISSIONS_KEY] unsignedShortValue];
|
||||
if (!isSymLink(ent) && !IS_VALID_PERMISSIONS(permissions)) {
|
||||
permissions = 0755;
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "\nwarning: file permissions %o of '%s' won't be preserved in the delta update (only permissions with modes 0755 and 0644 are supported).\n", permissions & PERMISSION_FLAGS, ent->fts_path);
|
||||
}
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Invalid file permissions after-tree on file %@ (only permissions with modes 0755 and 0644 are supported)", @(ent->fts_path)] }];
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (aclExists(ent)) {
|
||||
@@ -588,7 +585,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
|
||||
NSFileManager *filemgr;
|
||||
filemgr = [NSFileManager defaultManager];
|
||||
|
||||
|
||||
[filemgr removeItemAtPath: patchFile error: NULL];
|
||||
if ([filemgr moveItemAtPath: temporaryFile toPath: patchFile error: NULL] != YES)
|
||||
{
|
||||
|
||||
@@ -627,10 +627,10 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
XCTFail(@"Failed setting file permissions");
|
||||
}
|
||||
|
||||
// This would fail for version 1.0
|
||||
XCTAssertFalse([self testDirectoryHashEqualityWithSource:sourceDirectory destination:destinationDirectory]);
|
||||
} afterDiffHandler:nil];
|
||||
XCTAssertFalse(success);
|
||||
// we just ignore bad permissions, since that's a too common problem to fail on
|
||||
XCTAssertTrue(success);
|
||||
}
|
||||
|
||||
- (void)testBadPermissionsInBeforeTree
|
||||
|
||||
Reference in new issue
Block a user