@FireWolf4 years ago
Howdy! Long time no see. Apple has released macOS Mojave, the next generation of OS for Mac users, and now it’s time to get RepairPermissions updated.
>> Latest Version: 3.9.3225 @ 2018.06.05
In OS X El Capitan, without `diskutil repairPermissions`, we can use `repair_packages` in /usr/libexec/ to verify and repair permissions. But now this handy command line tool has been removed from the latest macOS Sierra by Apple. Since it may not be safe to force use the `repair_packages` in macOS Sierra, it’s time for me to rewrite my `RepairPermissions` to support the new macOS Sierra.
RepairPermissions is a command line tool written in Swift language to verify and repair permissions on Apple’s OS X and macOS. With newly designed APIs and data structure, RepairPermissions now supports verifying and repairing permissions on Apple’s latest macOS Mojave!
>> New Key Features
Support Apple’s latest macOS Mojave.
Dynamically optimized for multi-threading.
Support multiple boot environments.
Save results to a local file.
>> Relevant Product Info
RepairPermissions is affiliated to FireWolf’s KCPM Utility Pro and FireWolf OS X PE Maintenance Kits.
Both families will adopt the new features of RepairPermissions V3 in next major releases.
>> Supported OS Version
RepairPermissions supports running on the following macOS versions:
OS X Mavericks (10.9.x)
OS X Yosemite (10.10.x)
OS X El Capitan (10.11.x)
macOS Sierra (10.12.x)
macOS High Sierra (10.13.x) (as of 3.7.2315)
macOS Mojave (10.14.x) (as of 3.9.3225)
>> Supported Boot Environments
RepairPermissions supports running in OS X Normal Mode, OS X Single User Mode, OS X Recovery Mode, OS X Recovery Single User Mode, and FireWolf OS X PE.
>> Recommended Installation Path
It is recommended to install RepairPermissions to
/usr/local/bin so that you can directly run RepairPermissions in your terminal.
This usage guide is currently frozen for RepairPermissions 3.0.1105+ (Stable Release).
!!! Make sure that your SIP flag CSR_ALLOW_UNRESTRICTED_FS is enabled. !!!
This is the simplest use of RepairPermissions. By default, this command will help you repair permissions of the root volume, aka the current boot volume. Note that the results will NOT be displayed on the screen but will be saved to your Desktop folder (
RepairPermissions --output ~/Desktop/Result.txt /
This is a handy command to use RepairPermissions. It will help you repair permissions of the root volume, aka the current boot volume, and will save the results to a plain text file named
Result.txt in your Desktop folder.
RepairPermissions --no-output /
This command will help you repair permissions of the root volume, aka the current boot volume, and will prevent RepairPermissions from saving the results on your local disk.
More detailed usages are available via typing
Usage: RepairPermissions [COMMANDS] <targetVolume>... Recommended (default) usage: Commands: RepairPermissions <targetVolume> Description: targetVolume is a valid mount point of an os volume. See usage examples below for detailed information. Available (optional) commands: --help Print this usage guide. --verify Verify permissions of the given volume. --repair Repair permissions of the given volume. --output <path> Print detailed information to the given <path>. <path> must be an absolute path. --max-thread <n> Specify the maximum number of threads. <n> must be an integer. --no-output Prevent RepairPermissions from saving results on your local disk. --check-update Check for updates. --update Update RepairPermissions to the latest version.
>> Reporting Bugs
Feel free to use the comment section to report any issues.
>> Update Logs
V3.9.3225 (2018.06.05) [Stable]
Adopt Swift 4.2.
Supports macOS Mojave (10.14.x)
V3.8.3220 (2018.03.22) [Stable]
Adjust the parser algorithm: Switch to dynamic programming to speed up parsing further.
POSIX permissions are converted to octal number in the report as before.
Adjust the update catalog URL.
Note that previous versions (<= 3.8.3200) may no longer receive the latest update via the `–check-update` option.
It is highly recommended to update to the latest version.
V3.8.3200 (2017.12.24) [Stable]
Happy Holidays! I’m so “excited” to bring the next major release of RepairPermissions!
This new release mainly focuses on improving performance and robustness.
Adopt Swift 4.
Reimplement the underlying parser in pure C.
- libRepairPermissions now interacts with the parser natively without additional wrappers.
- The data structure has been redesigned to reduce the memory usage significantly.
- The algorithm has been improved to speed up parsing and is now compatible with multithreading.
Reimplement the libRepairPermissions API.
- A better multithreading approach to use multi-core processors more efficiently and equally.
- Minimize the number of synchronous operations and make multithreading more robust.
- The procedure to check file permissions has been improved to reduce the memory usage by up to 50%.
(On my machine: Previous: about 1.5GB; Now: about 700MB)
- Fix the compatibility under OS X Mavericks and OS X Yosemite.
(Although you can always use `diskutil repairPermissions` instead. 🙂 )
- Improve the generated report: Now it can be interpreted and serialized to other formats more easily.
Improve the front-end command line interface.
- Add a new option “–plist” to save the results in property list format.
- The update manager becomes a separate module to provide more robust services.
- Fix an issue that POSIX permissions of the updated binary are falsely set.
- The owner of the updated binary is no longer `root`: it will be your user name. (UID = 501)
- The group owner of the updated binary is no longer `wheel`: it will be `admin`. (GID = 080)
Other under-the-hood improvements.
Some changes related to design choices.
- Remove the real-time progress indicator of verifying/repairing permissions because of consuming unnecessary CPU time.
Currently, the new libRepairPermissions does not report real-time progress.
Although it is not difficult for me to add this functionality back, I believe real-time progress slows down the process of checking permissions.
Maybe I could add a new option like `–with-progress` for you to choose between high efficiency and psychological comfort?
- Remove the real-time progress bar of downloading updates from the server.
The update is so small (about 2MB) and do we really need a progress bar for it?
However, I would probably bring this back after I complete my tiny portable download engine. 🙂
For those who upgrade from 3.6.x/3.7.x using the builtin updater, you may find an error “Illegal instructions: 4” when you are trying to run the new binary.
This is because the updater falsely sets the permissions of the updated binary.
Please manually fix the permissions via
sudo chmod 755 /usr/local/bin/RepairPermissions.
Sorry for the inconvenience, and this issue has been addressed in 3.8.3200.
V3.7.2320 (2017.06.22) [Stable]
Fix the auto-update.
V3.7.2315 (2017.06.08) [Stable]
Supports macOS High Sierra (10.13.x)
Reduce the number of file I/Os.
Reduce the memory usage.
Minor improvements in libRepairPermissions.
Known Issue in this version:
RepairPermissions runs very slow under macOS High Sierra. (96s <10.13 DP1> VS 21s <10.12.5>)
This is probably related to the new file system. I will keep an eye on this issue.
V3.6.2171 (2017.03.18) [Stable]
Fix a memory allocation issue.
Add a new command `–update` so that users can directly update RepairPermissions to the latest version.
Improve the error handling in libRepairPermissions.
Other under-the-hood improvements in libRepairPermissions.
(FWRepairPermissions APIs have been renamed to libRepairPermissions.)
V3.5.2050 (2016.10.27) : [Stable]
Minor fixes in FWRepairPermissions APIs.
V3.5.2032 (2016.10.12) : [Stable]
Display the elapsed time.
Minor bugs fixed.
V3.5.2025 (2016.09.25) : [Stable]
Adopt Swift 3, and bump the API version to 3.0.
New algorithm and data structure used in the core layers of FWRepairPermissions APIs boost RepairPermissions up to 20X.
Improve memory management and code structure.
V3.5 Beta 2 (2016.09.25) : [Internal]
Adopt Swift 3.
Adjust the code structure of high-level APIs to support the new core layers.
This is still an internal beta release.
V3.5 Beta 1 (2016.09.23) : [Internal]
Significantly improve the core layers of FWRepairPermissions APIs.
Use new algorithm and data structure in the core layers to speed up verifying and repairing permissions.
This is an internal beta release.
V3.3.1315 (2016.09.02) : [Stable]
Synchronize the internal FWRepairPermissions APIs with KCPM Utility Pro V6.
Improve memory management.
Improve the progress indicator.
V3.2.1276 (2016.08.18) : [Stable]
Optimize the internal code and data structure.
Reconstruct the output results. It is now more easy to read.
RepairPermissions - Verify and repair permissions of an entire volume Version: 3.2.1276 @ 2016.08.17 Date: 2016.08.18 15:50:18 User: FireWolf File: /Volumes/Macintosh HD 10.12/private/var/db/datadetectors Reason: POSIX Permissions Mismatched Current: 701 Correct: 711 New: N/A Status: Verified File: /Volumes/Macintosh HD 10.12/private/var/db/displaypolicyd Reason: Owner ID Mismatched Current: 244 Correct: 0 New: N/A Status: Verified
Bump the internal FWRepairPermissions API version to 2.0.
V3.1.1156 (2016.08.16) : [Internal]
Bump the internal FWRootlessKit API version to 2.0.
This is an internal version. Ignore this. : ).
V3.1.1155 (2016.08.09) : [Stable]
Owner of the results file generated by RepairPermissions in Normal Boot environment will no longer be
root. Now you can delete the results file without typing your password.
V3.1.1152 (2016.08.08) : [Stable]
Resolve an issue that some directories and files permissions are falsely set. (Thanks to arslan2012)
To fix your home directory permissions, type
sudo chown 501:80 ~ in your terminal.
Support verifying and repairing permissions on volumes other than the root volume.
V3.0.1105 (2016.08.07) : [Stable]
Support OS X Mavericks.
Add checking for updates.
Improve SIP flags check.
Minor internal API improvements.
Initial stable release.
V3.0 Beta 9 (2016.08.06) : [RC3]
As of Beta 9, RepairPermissions will check your SIP flags.
If the CSR_ALLOW_UNRESTRICTED_FS flag is not set on your machine, you will receive a warning message, but RepairPermissions will still keep running.
(Probably this will be the last beta.) : )
V3.0 Beta 8 (2016.08.05) :
Add a new option
Users can use this new option to prevent RepairPermissions from saving the results on your local disk.
V3.0 Beta 7 (2016.08.03) :
As of Beta 7, RepairPermissions now supports running in OS X Normal Mode, OS X Single User Mode, OS X Recovery Mode, OS X Recovery Single User Mode, and FireWolf OS X PE.
* Results will now by default be saved to the following path:
~/Desktop/RepairPermissionsResults-<timestamp>.txt [OS X Normal Mode]
/RepairPermissionsResults-<timestamp>.txt [Single User Mode]
/targetVolume/RepairPermissionsResult-<timestamp>.txt [OS X Recovery Mode/FireWolf OS X PE/OS X Recovery Single User Mode]
Note that it is recommended to use the default path to save the results, especially in OS X Recovery Mode, OS X Recovery Single User Mode, and FireWolf OS X PE.
Improve boot environment check.
Bump the internal RepairPermissions API to 1.3 to fully support all boot modes.
V3.0 Beta 6 (2016.08.02): [RC2]
RepairPermissions now supports running in Single User mode.
Note that when RepairPermissions is running in Single User mode, you don’t have to type
/sbin/fsck -fy and
/sbin/mount -uw / by yourself. RepairPermissions will automatically check the current boot environment and do all required stuff for you. Besides, RepairPermissions will also automatically restart your computer. (You have 10 seconds to abort the reboot process by default.)
Minor changes in terminal output format.
V3.0 Beta 5 (2016.08.02):
Bump the internal RepairPermissions API version to 1.2 to support custom thread configurations.
--max-thread option is now compatible with the new API.
V3.0 Beta 4 (2016.08.01): [RC1]
Fix a potential deadlock bug.
Improve code structure and the error handling mechanism.
Results of verifying/repairing permissions will now by default be saved to ~/Desktop/FWPRResult_<time>.txt.
Add a progress indicator to show current progress and status.
Bump the internal RepairPermissions API version to 1.1.
Improve the internal RepairPermissions API to fully support KCPM Utility Pro 6.0 Beta.
Temporarily remove the option
--max-thread introduced in Beta 3 as it is currently not compatible with the new API.
V3.0 Beta 3 (2016.07.30):
Add new option
--max-thread to specify the maximum number of thread that RepairPermissions can use.
Improve multi-threading stability.
Minor tweaks and fix some typos.
V3.0 Beta 2 (2016.07.17):
Fix a fatal error related to fixing permissions.
V3.0 Beta 1 (2016.07.16):
Initial 3.0 beta release.
Backup Downloads: https://drive.firewolf.science/public/RepairPermissions/
V3.9.3225: RepairPermissions 3.9.3225 (Stable) (4230 downloads) (MD5: 870c5cd76ea7c7f462a33ba574b0693a)
RepairPermissions 3.8.3220 (Stable) (1035 downloads)
RepairPermissions 3.8.3200 (Stable) (1075 downloads)
V3.7.2320: RepairPermissions 3.7.2320 (Stable) (14123 downloads) (MD5: 33be7c94879cc48358bb4da406e580c9)
V3.7.2315: <REMOVED> RepairPermissions 3.7.2315 (Stable) (476 downloads) (MD5: b3c403947e80ed7d3ede97bc23fbf482)
V3.6.2171: <REMOVED> RepairPermissions 3.6.2171 (Stable) (618 downloads) (MD5: 9ee01ab35f5f5151c83e39736e83e356)
V3.5.2050: <REMOVED> RepairPermissions 3.5.2050 (Stable) (5150 downloads) (MD5: 14880df3b02c203f6ac58cb6ed62a959.zip)
V3.5.2032: <REMOVED> RepairPermissions 3.5.2032 (Stable) (1476 downloads) (MD5: d042d9a2e3166865d1d29b863381bed2)
V3.5.2025: <REMOVED> RepairPermissions 3.5.2025 (Stable) (3671 downloads) (MD5: d3e16fd44c22603c4bc58fb4917afaab)
RepairPermissions 3.3.1315 (Stable) (1263 downloads)
RepairPermissions 3.2.1276 (Stable) (1547 downloads)
V3.1.1155: <REMOVED> RepairPermissions 3.1.1155 (Stable) (1905 downloads) (MD5: 3b9a2307a31e64b7cfb106338b02a685)
V3.1.1152: <REMOVED> RepairPermissions 3.1.1152 (Stable) (3562 downloads) (MD5: e267891091d7dc24f312538621fecf99)
V3.0.1105: <REMOVED> RepairPermissions 3.0.1105 (Stable) (487 downloads) (MD5: e3d679d38ae3867eec608d4647f786b8)
V3.0 Beta 9: <REMOVED>
RepairPermissions 3.0b9 (396 downloads)
V3.0 Beta 8: <REMOVED>
RepairPermissions 3.0b8 (375 downloads)
V3.0 Beta 7: <REMOVED>
RepairPermissions 3.0b7 (324 downloads)
V3.0 Beta 6: <REMOVED>
RepairPermissions 3.0b6 (356 downloads)
V3.0 Beta 5: <REMOVED> RepairPermissions 3.0b5 (336 downloads) (MD5: fc3a3fc2899e3dee33fa9182c8f68faa)
V3.0 Beta 4: <REMOVED>
RepairPermissions 3.0b4 (377 downloads)
V3.0 Beta 3: <REMOVED>
RepairPermissions 3.0b3 (367 downloads)
V3.0 Beta 2: <REMOVED> RepairPermissions 3.0b2 (569 downloads)
V3.0 Beta 1: <REMOVED>