Commit Graph
17 Commits
Author SHA1 Message Date
Zorg acc4674c3e Fix volume detection being wrong in rare cases (#2026) 2021-11-24 11:33:04 -05:00
Rajiv Shah bb56b5b259 Run SwifLint autocorrect 2020-06-10 12:15:34 +01:00
Zorg 163158cacf Merge branch 'master' into ui-separation-and-xpc 2016-09-16 15:08:04 -04:00
Zorg ed5dca3423 Update unit tests to Swift 3 2016-09-14 23:05:05 -04:00
Zorg 8c564fef1f Remove +[SUFileManager defaultManager] and use alloc/init 2016-07-30 10:39:17 -04:00
Zorg 9f4e44f919 Don't move old app to Trash
Several reasons:
* The user may not look at the trash anyway, and it would bloat their HD space
* Other sofware updaters don't move old versions to the trash either. Can confuse the user or not be seemly transparent experience.
* Moving app to trash will not work if user has to authenticate anyway
* Unclear how long and expensive this operation *could* take in all scenarios
* App replacements in Apple's new file system can be atomic-safe, but that may only be the case if the old app is no longer needed

Cons:
* Few tech savvy users may not be able to restore an app without re-downloading it. This would still be rarely done even amongst them.
2016-07-25 19:11:20 -04:00
Zorg 66e3083e0c Initial work on removing AuthorizationExecuteWithPrivileges
I need to at least look at:
* Automatic downloaded / silent updates
* Running updates as root user from beginning
* Status info query service
* Add guided flag in the appcast
2016-07-18 17:40:35 -04:00
Zorg ddb4262b7b Rename and document -updateAccessTimeOfItemAtRootURL:error: 2016-07-04 21:25:54 -04:00
Zorg 599c3fb3c1 Add unit test for updating access dates 2016-07-04 21:10:49 -04:00
Jake Petroules bb624ffa59 Replace OS X with macOS or more generic terminology. 2016-06-15 13:46:19 -07:00
Zorg be1e86174a Wait for the appropriate process when authorizing file operations
This changes the way we authorize & execute commands, and how we wait for their completion. In order to obtain the correct child to wait (instead of another one terminating intermediately), we use a wrapper tool (fileop) to output its pid onto the communication pipe that we read from the other end.
2016-06-08 21:49:58 -04:00
Zorg d263bf4fd0 Don't follow symbolic links for file operations
This fixes issues with updating modification/access time, and changing owner/group
where symbolic links used to be followed. Symbolic link tests are included.
2016-04-11 03:05:53 -04:00
Zorg 6818d1f180 Verify existence of destination parent directory for moving/copying 2015-10-10 00:12:58 -04:00
Zorg ee72ec3dab Fix issues with copying files from different mounted drives
The move operation now does an explict copy & remove.

We also copy items using FSCopyObjectSync due to issues
existing in copyfile (and NSFileManager).

Both of these fix bugs in some cases where items cannot be moved
from one network drive to another. In my testing before this patch,
I was unable to get the test application to launch and was unable
to move the old installation to the trash.
2015-10-09 23:58:23 -04:00
Zorg 9b74309eb5 Make allowsAuthorization apply to all of SUFileManager's methods 2015-10-09 17:49:46 -04:00
Zorg 6af2fbfb6e Update modification & access time for new update
If we don't do this, Finder may not report the correct file size for the new update.
The system also may not register the new app in its database if we don't do this.

We may have been able to get away with not doing this before because we used to perform a copy
to install the update. However, now updates in some cases can be done with only move operations.

This should also be an alternative way of addressing issue #508
2015-09-27 10:53:22 -04:00
Zorg 32591954bc Add SUFileManager tests and fix issues along the way
* Fix uid / gid not being applied to the root path or non-directory inputs
* Remove the code that released quarantines using the NSURL way.
  It turned out not to be very reliable and didn't pass the tests.
  More explanation is given in the code.
* Prefix private methods with _ and expose some of them to the tests
2015-09-26 14:28:53 -04:00