Repairing Disk Permissions. Not exactly a topic that you would expect to spark much controversy. Yet, surprisingly, it is the focal point of a rather heated debate.
The command itself is innocuous enough. It is included as part of the First Aid component of Disk Utility. Apple's Help for Disk Utility states: "User permissions associated with files, folders, or applications can become damaged and prevent a file or application from opening. Permissions problems can also cause your computer to run slowly. Using Disk Utility, you may be able to fix these permissions problems...Repairing permissions may also be recommended after updating the system or installing new software."
Consistent with this, many users and Web sites (including MacFixIt and at least some postings on MacinTouch) recommend the use of Repair Disk Permissions, not only for specific signs of trouble, but as a part of generic troubleshooting and ongoing maintenance for your Mac.
In contrast, other members of the Mac community (writing in locations such as the Daring Fireball , Unsanity, and the MDJ) argue that running this command just for maintenance, in the absence of any particular symptom, is essentially worthless. Some critics go even further and claim there is no justification for ever selecting to repair permissions. Not only is it useless, they contend, but it may even cause new problems to appear. This viewpoint is often expressed with inflammatory rhetoric such as "covering yourself in Vaseline and rolling around naked in the dirt and repairing permissions are just as likely to fix your Mac OS X problem" (Unsanity).
Regardless of who's right or wrong, I don't believe that insulting users is merited here, especially when these users are simply following advice suggested by Apple itself. As it turns out, I also do not agree with the position of these critics. So, although I may be stepping into a minefield, here's my own take on this subject and my resulting recommendations. [Disclaimer: I was not involved in the authorship of previous MacFixIt articles on this subject. This column is my separate opinion, and does not necessarily reflect the views of MacFixIt.]: Continued
- Repair Disk Permissions works by checking a list of permissions stored in archive.bom files, located in the "receipt" packages found in the /Library/Receipts folder. Receipt packages are placed in this folder when you install files via Apple's Installer utility. When Disk Utility finds a discrepancy between a file's current permissions and the ones listed for it in the relevant .bom file, it "fixes" them.
- That said, the effect of running the Repair Disk Permissions command is a limited one. It can only verify and repair permissions of files:
(a) that were installed via Apple's Installer utility, thereby leaving a receipt package in the /Library/Receipts folder (meaning, for example, the command will have no effect on software "installed" via a drag-and-drop or via a different installer utility);
(b) for which the relevant receipt package(s) have not been moved or deleted from the Receipts folder;
(c) that have not been moved from their originally installed location (such as the /Applications folder for most applications).
Finally, as stated in an Apple Knowledge Base article, "Certain files whose permissions can be changed during normal usage without affecting their function are intentionally not checked."
- Almost all Apple-installed software meets the above requirements. In addition, so do numerous third-party programs that similarly use Apple's Installer utility. However, Repair Disk Permissions may not fix incorrect permissions for some of these third-party files. I am still not certain of the cause of these omissions, but I have confirmed that they occur (although check out this MacFixIt article for more details regarding the vagaries of repairing permissions of third-party software). The net result is that the Repair Disk Permissions command is mainly, and most reliably, limited to fixing problems with Apple software.
- As pointed out by critics, it is possible that running Repair Disk Permissions could replace correct permissions with incorrect ones. How can this happen? One situation is when the permissions for already installed software are wrong because the settings in the relevant archive.bom file were never correct to begin with. The developer may address this problem in various ways. One way is to release a "patch" application that fixes the permissions (bypassing the use of the Installer utility). The problem is that, because this does not affect the contents of the Receipts folders, when your next run Repair Disk Permissions, and assuming that Repair Disk Permissions actually affects this particular software, it will cause the file's permissions to revert back to the original and incorrect permissions.
Although technically a possibility, it is a very remote one. Why? First, Apple addresses and prevents this issue for its own software via a special file that is included with Mac OS X Updates. The file, called HintFile.plist and installed in /System/Library/PrivateFrameworks/DiskManagement.framework/Versions/A/Resources, contains any updated and corrected permissions. Essentially, Disk Utility uses this file to assign updated permissions to previously installed files, overriding what the files' original receipt package data would otherwise dictate. Second, for third-party software, as already pointed out, Repair Disk Permissions often has no effect anyway. In any case, it should be the responsibility of the developer to make sure that any method they provide for updating permissions is not undone when the user runs Repair Disk Permissions.
Still, the above situation is a major reason that critics contend that Repair Disk Permissions should never be used simply as a maintenance procedure. In other words, if it ain't broke, don't try to fix it. However, even this distinction is sometimes lost. For example, the title of an Unsanity site's article is Exercises in Futility Part 2: Repairing Permissions Is Useless. There is no suggestion here of a distinction between using the command for maintenance vs. repair. Quite the contrary, it suggests that you should never use the command under any circumstances, no how, no way, nada, zilcho (although the subsequent text of the article is not quite as extreme as the title would suggest).
- Apple continues to include the Repair Disk Permissions command as part of Disk Utility, and offers no warnings against its use. To me, this is a tacit indication that Apple sees no problem with using the command. In the spirit of the Hippocratic Oath ("First, do no harm"), if Apple truly felt that running Repair Disk Permissions was potentially harmful, it should say or do something about it. Of course, Apple may have a different view. Still, it seems unfair to characterize users who place their faith in Apple's wisdom as "purveyors of superstition" (MDJ; the cited text is not available online).
Critics have a rebuttal to this as well. They contend that Apple doesn't really recommend using the command, except in very limited ways. For example, Daring Fireball states: "To be fair to everyone who persists in believing that it is a periodic maintenance task, there is at least one Apple support documentation that hints that it is, but note the title of that document: 'My Computer Keeps Freezing or I See a Flashing Question Mark'." I guess the author is suggesting that Apple really only recommends the procedure if you cannot start up your Mac.
The MDJ similarly notes that the quote from Disk Utility Help, as cited at the start of this column, "says the procedure 'may be recommended after updating the system or installing new software.' (Emphasis added.) The article does not say who may recommend this, or when that would happen." Again, the implication is that Apple is not really saying that Repair Disk Permissions is recommended; only that it may be recommended in certain non-defined situations.
Actually, Apple does offer stronger and more specific recommendations on this matter. In two recent Knowledge Base articles (Mac Maintenance Quick Assist and Printing Quick Assist), it clearly includes Repair Disk Permissions on a list of suggested maintenance procedures.
In the end, Apple tech documents are not likely to be a source of definitive "proof" for either position in this debate. Like turning to quotes from the Bible in religious debates, there is at least some fuel to be found for both sides. I would welcome a direct unequivocal reply from Apple on this controversy. But so far, they have not done so.
- Finally, you may ask: beyond the examples cited above, how could a file that started with correct permissions later wind up with incorrect ones? That is, why should the Repair Disk Permissions command be needed at all?
For starters, problems can occur when an Installer utility incorrectly modifies permissions for folders or files that are not part of what it installs. This can happen because, once you give your admin password to an Installer utility, it has the power to modify the permissions of virtually any file and folder on your drive. A poorly written script, used as part of the installation, can wind up unintentionally and incorrectly changing permissions. This is a rare occurrence these days, but it can happen.
Additionally, performing any of an assortment of popular hints and tips can result in the modification of permissions. For example, as I will cover in upcoming installments of my tutorial series on .plist files, there are times when you might want to modify the content of .plist files in the /Library and /System/Library folders, or even in Unix directories. Depending upon how you do this, the ownership and permissions of these files may be changed (e.g., the ownership is typically changed from System to you). Running Repair Disk Permissions will restore these permissions back to their intended settings. For example, when I recently ran Repair Disk Permissions, it corrected permissions for: ./Library/Preferences/SystemConfiguration/preferences.plist, ./System/Library/CoreServices/Finder.app/Contents/Resources/default_smart.plist, and ./private/etc/authorization (which is a .plist file despite the absence of the .plist extension in its name). These were all files that I had modified.
So what does all of this mean in terms of if and when you should use Repair Disk Permissions?:
- If you are having symptoms that Repair Disk Permissions could potentially help, especially problems opening files, run the command. The possible gains outweigh the minimal risks.
- If you have "hacked" files outside of your Home directory, such as the .plist files I just mentioned, running Repair Disk Permissions can restore the correct permissions to these files. While things may run smoothly even if you do not do this, it's better for the files to have the intended permissions. If you know what you are doing, you could instead manually reset the permissions (via the file's Info window settings or via Terminal), but I see no reason to avoid using Repair Disk Permissions here.
- Running the command periodically as part of a maintenance routine could potentially fix problems that might otherwise be overlooked. For example, the last time I ran the command, it reported and fixed errors to /System/Library/Automator/Activate Fonts.action. Still, if you are inclined never to run this command for strictly maintenance reasons, I would not argue with you. The potential benefit from doing so is minimal at best. And there remains a small risk that it could make matters worse.
- You may occasionally see recommendations to run Repair Disk Permissions at specific other times, especially before and/or after installing a Mac OS X Update. In this case, I agree with those (such as Daring Fireball) that contend this has little or no merit. Anecdotes to the contrary are likely mistaken as to cause and effect.
In the end, I recommend being skeptical of extreme positions, whether a claim that it is essential to run Repair Disk Permissions regularly or never to run it at all. As is usually the case, the truth lies somewhere in between.
This is the latest in a series of mac.column.ted columns by Ted Landau. To see a list of previous columns, click here. To send comments regarding this column directly to Ted, click here. To get Ted's latest book, Mac OS X Help Line, click here.Resources