• On TechRepublic: Top 10 Windows 7 desktop gadgets
advertisement
April 13, 2006 7:30 AM PDT

Repair Permissions: A false panacea?

by CNET staff

There has been a growing debate on various forums and Mac Web sites over the worth of Disk Utility's "Repair Permissions" function as a troubleshooting procedure.

In particular, some prominent users have claimed that repairing permissions is akin to incantation, and doing so before or after applying a Mac OS X update (as we've recommended a number of times on MacFixIt) is pointless.

First, an explanation of what Repair Permissions actually does, straight from Apple:

"Many things you install in Mac OS X are installed from package files (whose filename extension is ".pkg"). Each time something is installed from a package file, a "Bill of Materials" file (whose filename extension is ".bom") is stored in the package's receipt file, which is kept in /Library/Receipts/ . If you look in the Receipts folder, for example, you should see all kinds of files that end with .pkg, including some that were created when Mac OS X was installed (for example, BaseSystem.pkg).

"Each of those '.bom' files contains a list of the files installed by that package, and the proper permissions for each file.

"When you use Disk Utility to verify or repair disk permissions, it reviews each of the .bom files in /Library/Receipts/ and compares its list to the actual permissions on each file listed. If the permissions differ, Disk Utility reports the difference (and corrects them if you use the Repair feature."

In other words, in Disk Utility scans .bom files (for application's that provide them), then modifies permissions mentioned in that .bom file to their original state. As such, in order for an application to be "repaired" by Disk Utility, it must -- as far as we know -- use the standard Apple Installer application and generate a .pkg file with a .bom file in the /Library/Receipts/ directory.

Repairing permissions may actually do more than that, but for now let's explore some misconceptions about the function itself.

Repair Permissions can affect third-party applications Many purportedly reputable Mac OS X Web sites and individuals have claimed that the repair permissions function does not perform any actions on non-Apple applications. This is false. The Repair Permissions function also works for some applications that use the Apple-originated installer package.

Applications that are excluded from the Repair Permissions function include those that were installed using a non-Apple installer application, those copied by drag-and-drop where no receipt file is created, or those that do not place a .pkg file in the /Library/Receipts directory.

This does not mean, however, that if you modify the permissions on any application by using the "Get Info" menu, then repair permissions, the permissions on said application will necessarily be changed back to their original state.

Let's look at an application that does place a .pkg file in the /Library/Receipts directory -- the Parallels Workstation Virtualization software.

We set permissions for this application to "No Access" under the "Ownership and Permissions" section of the Get Info window, and set the owner as current logged in administrator. We then locked the file. The Parallels application icon switched a generic folder icon, and the application could not be launched -- providing no error message, but simply not launching.

We then used Apple's Disk Utility to repair permissions. Although Disk Utility did not specifically report any repairs, and there was no recognition of any changes in the Finder (the Parallels icon was still a generic folder, with the locked symbol and the circular red "No Access" indicator), the application now launched correctly.

This series of operations -- changing the file from "Read and Write" access to "No Access" back and forth, then repairing permissions again -- was repeated several times with similar results. An application that was unable to launch because of incorrect permissions before running Disk Utility could subsequently be launched.

The same process repeated on Font Agent Pro yielded very different results -- changing the file to "Locked" status with "No Access" resulted in a non-launching application, and repairing permissions did not re-allow the application to launch. We had to manually set the owner back to the default "System" owner setting in order for it to properly launch.

Obviously, though it was difficult to get accurate feedback from the Finder, the Repair Permissions function properly changed Parallels' status back to accessibility for the current user.

This tells us two things: The Finder does not always immediately reflect permissions changes, and the Repair Permissions function may take action that is not reported in the log window.

For further corroboration, see this post from a Micromat technical support representative, posted to the MacFixIt Forums:

"[...] There are third-party programs that leave a receipt file in /Library/Receipts. Some time ago, I installed Microsoft Office and then repaired permissions. Hundreds of permissions for Office files were repaired."

What other problems can repairing permissions fix? Apple Knowledge Base article #303032 mentions a problem where when the user tries to connect to an iDisk or WebDAV server, the message "Error Code -50" is displayed and the attempt fails. Or if you're using iDisk Syncing, a "last sync failed" message always appears in the iDisk sync status.

Apple says:

"This happens when permissions are incorrect for the webdav_fs.kext bundle. To fix that, follow these steps: [...] (Repair Permissions). You should now be able to connect to an iDisk or another WebDAV server.

Another Apple Knowledge Base article #107396, reports on an issue where users cannot print, use Classic, start file sharing, burn discs, or update software if the /tmp directory is missing.

The solution? Repair permissions.

Apple says:

"If /tmp is missing, it's easy to make a new one by following these steps: [...] Recreate the missing /tmp link by using the Disk Utility application to repair permissions on your Mac OS X startup volume."

Wait a minute -- doesn't repairing permissions only check .bom files and make changes based on their contents? Apparently not -- it can also re-create the /tmp directory, and presumably correct other routine issues with directory structure.

Does Apple recommend running Repair Permissions after an update? Yes. In a Knowledge Base article describing Disk Utility 10.5, Apple explicitly states:

"Repairing permissions may also be recommended after updating the system or installing new software."

Apple also says:

"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."

As aforementioned, some have claimed that there is no reason to run a Repair Permissions process after a Mac OS X update because the process will simply set the file permissions to those it finds in /Library/Receipts/, and the updater already wrote those permissions values.

However, the values in /Library/Receipts will not all be overwritten by the update -- only those for components affected by the update. Permissions problems for other components may still exist.

What causes permissions issues? According to Apple, there are a variety of causes for permissions issues, including (but not limited to): power interruptions, errant install processes, and files created in Mac OS 9.

It seems that incremental Mac OS X updates can fall into the errant install processes category, if pre-existing permissions issues are extant or the installer process goes awry as a result of interruption, drive corruption, or a myriad of other issues.

The bottom line is that repairing permissions is an Apple-recommended, quick process (usually taking less than a minute) that can resolve some significant issues -- whether or not they are directly caused by a Mac OS X update installation.

Feedback? Late-breakers@macfixit.com.

Resources

  • #303032
  • #107396
  • article
  • According
  • Late-breakers@macfixit.com
  • More from Late-Breakers
  • Recent posts from MacFixIt
    The OS X 10.7 buzz starts--something big in the next release?
    MacFixIt Answers
    Safari still crashing after update?
    Safari 5.0.1 update fixes black Mail backgrounds, autofill, and more
    Making the switch to Apple? Get the perfect setup
    Apple releases OS X 10.6.4 update for iMacs; trackpad driver
    CNET Apple Byte: iPhone to T-Mobile?
    iTunes not connecting to the iTunes store after updating
    Add a Comment (Log in or register) Showing 1 of 2 pages (32 Comments)
    by hamarkus April 13, 2006 8:27 AM PDT
    But how likely is it that permissions get out of line? If this happens in only a few rare cases, then in maybe 99.999% of the time, one is experiencing problems, repairing permissions will not help you.
    Reply to this comment
    by alternapop April 13, 2006 8:27 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by hamarkus</i></div></class><br />
    Running Repair Permissions before or after a softwareupdate is not
    troubleshooting, that's preventative maintenance.

    If something isn't working properly, I'll repair permissions, but usually not
    before or after a software update.
    Reply to this comment
    by w i n t e r m u t e April 13, 2006 8:27 AM PDT
    <class="merchant"><span>&#62;&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by alternapop</i></div></class><br />
    "Running Repair Permissions before or after a softwareupdate is not
    troubleshooting, that's preventative maintenance.

    If something isn't working properly, I'll repair permissions, but usually not
    before or after a software update."

    The reason why it is best to repair permissions before and after an update is
    to ensure that the files being installed can actually be installed in the proper
    folders. Think about an installer trying to place a required file in a subfolder
    of the Application Support folder, yet not having the permission to do so. Not
    all installers properly check to see if all files have been installed properly.
    This would result in an incomplete install and may cause the application to
    work improperly. I've seen many instances of applications that continuously
    "bounce" in the dock, yet never launch... typical of an application that cannot
    properly access required files. Repairing permissions before and after an
    install can, in many instances, repair and prevent such problems.
    Reply to this comment
    by Lou Zer April 13, 2006 8:27 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by hamarkus</i></div></class><br />
    Yeah, but its not like its a long, drawn out process. It takes a minute, maybe two.

    Then again, computer users have, in general, their own set of superstitious actions to 'fix' issues, including repairing permissions, clearing caches, running maintenance scripts, prebinding, always using the combo updater, clean installs (or archive and installs), defragging a disk, rebuilding the desktop (remember that!), etc, etc, etc.

    Doesn't matter what you tell them, they'll keep doing it.

    When it comes time for an install, I, um, well, let's see, I click "Update" on the Auto Update window. That's about it.

    Oh, one more thing. While repairing permissions might not 'solve' problems, it should be run occasionally to make sure no software screwed up the permissions of various system directories. If your System directory got a nice 777 permission on it, it may allow a malicious program to install some nefarious program that launches at startup, without ever having to authenticate.
    Reply to this comment
    by ehildum April 13, 2006 8:27 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by hamarkus</i></div></class><br />
    Based on my experience, the answer is as follows:

    1. For OS X releases up to 10.3, repair permissions was definitely needed as
    many of the various software updates did not correctly set permissions.
    2. After 10.3, the Apple supplied software updates rarely ever left
    permissions incorrect. I cannot think of a case with incorrect permissions in
    any of the 10.4 updates.
    3. Third party software is a different story entirely. Even today, many third
    party applications result in incorrect permissions, so Permissions Repair
    should definitely be run after any third party applications are installed. While
    most of the permission errors are minor, some of the incorrect permissions
    left by third party installers will result in security holes if left uncorrected.

    Running Repair Permissions before doing an update is a good preventative
    step in the cases where Repair permissions was NOT run after installing a
    third party application; if you or not the only user, or if you ran out of time,
    Repair Permissions may not have been run when it should have. Running
    Repair Permissions before an upgrade will prevent issues in this case.

    Running Repair Permissions after doing an update while recommended, is not
    necessary. Most updates do not result in problems that will prevent operation
    of the machine, nor will they lead to long term disk issues by themselves.
    Thus even if you do not repair permissions, everything will generally work.

    In other words, Repair Permissions can fix problems, but in most current
    cases, the problems it fixes are so minor that the system will work fine
    without the repair.

    On the other hand, for a system that is experiencing problems, Repair
    Permissions can fix a large number of issues, and thus is a good step when
    dealing with a troublesome machine.
    Reply to this comment
    by w i n t e r m u t e April 13, 2006 8:27 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by hamarkus</i></div></class><br />
    The likelihood of permissions getting "whacked" is rather high when certain
    tasks are performed. I have found that certain installers, such as the
    Macromedia Flash plug-in installer or Quark Xpress installer, routinely result
    in incorrect permission settings... and while these incorrect settings may not
    be the cause of immediate problems, a cascade effect can result as other
    applications then utilize (or try to utilize) data contained in files or folders
    that may or may not be accessible due to improper permissions settings.

    So the likelihood of permissions being set incorrectly varies greatly, from "a
    near certainty" to "not very likely", depending upon what type of work the
    user is trying to accomplish. Considering that no ill effects have been
    reported from running the repair permissions task, it is best to be liberal in
    its usage rather than not.
    Reply to this comment
    by David K. Wolfe April 13, 2006 9:01 AM PDT
    If correcting permissions before and after an OS installation are highly recommended, then why doesn't Apple make that operation an integral part of their installation process?
    Reply to this comment
    by kmaybury April 13, 2006 9:01 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by David K. Wolfe</i></div></class><br />
    I would second that. Perhaps Apple could explain to why they haven't made it an
    automatic process.

    ---
    Kevin Maybury
    Key Computer Systems
    Reply to this comment
    by Ilgaz April 13, 2006 9:01 AM PDT
    <class="merchant"><span>&#62;&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by kmaybury</i></div></class><br />
    If you have noticed (I bet you did) they somehow changed scheme of repair
    permissions process (caching?) and it is like 2x faster than Panther or Jaguar.

    I really wonder the same thing as you too. Perhaps it is not done as couple of no
    life geeks will start a philosophical debate that they have right to set their own
    permissions?

    I hope it isn't the reason.
    Reply to this comment
    by annard April 13, 2006 9:04 AM PDT
    I do recommend that people run this tool if they allow multiple users on a
    machine. Also with regards to running as a non-administrator it may come in
    handy to prevent shooting yourself in the foot.
    The reason is that many applications that use installers, change the permissions
    of '/', '/Library' or '/Applications' and what have you to allow everybody to write
    in there. Running this tool would at least setup the permissions to a default
    state that Apple recommends.
    Of course, for the true tinkerer admins, this will mess up their scheme. YMMV.
    Reply to this comment
    by MacFixItUser April 13, 2006 9:05 AM PDT
    Great and useful article! I have found that repairing permissions can solve
    many problems. One of them prevents the Mac booting from a particular hard
    disk (you get a "no access" gray icon (prohibitory sign --a circle with a line
    through it) until such permissions are repaired).

    But I have also found that sometimes you may end up with files and folders
    with "unknown" or wrong ownership and permissions that Disk Utility does
    not repair at all. One example is when you have two different Firewire disks
    with different names but with the same home name in both. When you
    connect both and try to access one booting from the other, you may
    encounter the above problems.

    Is there any place where the correct and full "File/Get Info/Ownership &amp;
    Permissions" screen capture windows are displayed? For:

    HardDisk
    --
    Applications
    Applications (Mac OS 9)
    Desktop
    Desktop (Mac OS 9)
    Library
    System
    System Folder (from old Mac)
    Users
    ViewpointLog.log
    --
    home
    Shared

    Maybe MacFixIt could include such information that comes handy when such
    values change and you want to revert them to the correct values.

    Thanks.
    Reply to this comment
    by MacFixItUser April 13, 2006 9:05 AM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by null</i></div></class><br />
    Any utility out there that performs such task of restoring ownership &amp;
    permissions to their default? As said, when ownership is "unknown" or wrong,
    Disk Utility does not fix it and I do not know of any utility fixing it. That is why I
    asked for screen captures above, but having an application to repair it would
    be terrific. Thanks.
    Reply to this comment
    by MacFixItUser April 13, 2006 9:26 AM PDT
    Thanks for an informative article. The question I've always had is: why bother to repair permissions BEFORE an update?

    I figure the updater runs as root, so it can do whatever it likes without paying attention to permissions. Once the update is in place, sure, go ahead and repair. But before? Why?

    The only reason I can imagine it might help is if some parts of the updater don't run as root. But that seems unlikely.
    Reply to this comment
    by Gennx30 April 13, 2006 9:33 AM PDT
    INTERESTINGLY, after a fresh OS install, I delete all the junk I can safely get rid of-this includes Python; I used to note that when I repaired Permissions afterwards, DU would state "Symbolic Link for Python Repaired/created" but only that one thing-the rest stayed gone.
    So apparantly repairing permissions also creates/repairs symbolic links.
    Reply to this comment
    by Zeds Dead April 13, 2006 11:18 AM PDT
    Ahhhh, thank you for writing up a cogent article for the pro-side of this
    argument to point to. I have had arguments with people on this issue going
    well into the past, but it's always so much trouble to post a comment and get
    into it with them. Now there's a link! :-)

    I manage 30+ Macs and anecdotally speaking, about once a year when
    some app refuses to work correctly, I do a Repair Permissions and it works.
    Call it the "Rebuild the Desktop" of the OS X era, if you will.

    95% of the time, rebuilding the desktop in OS 9 was a totally useless step to
    take, because your desktop db wasn't even remotely related to the problem.
    But it's the 5% of the time where it actually helps that makes it a worth-while
    step to take.
    Reply to this comment
    by barrom April 13, 2006 11:31 AM PDT
    I'm with the MacFixIt people on this one. As a Mac Admin for a computer lab and numerous freelance clients, Repair Permissions has saved me countless times.

    http://systemsboy.blogspot.com/2006/04/to-repair-or-not-to-repair.html
    Reply to this comment
    by Bill Strohm April 13, 2006 12:47 PM PDT
    I cannot repair permissions. Each time I try, I get the error message "No valid
    packages." However there is a large number of ".pkg" files in my Library/
    Receipts folder.

    This problem doesn't seem to affect operation of my PPC G5,
    though. TTPro v 4.1.1 and DiskWarrior both say I have no problems, and in fact I
    have not seen any.

    This occurred under 10.4.4, 10.4.5, and still under 10.4.6. Is
    there a fix for this?
    Reply to this comment
    by Andreas.. April 13, 2006 12:47 PM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by Bill Strohm</i></div></class><br />
    That error msg appears when you do not have "<b>BaseSystem.pkg</b>" in /
    Library/Receipts.<p>---<br><I>Andreas</I><br />
    G5 2.1GHz, OS 10.4.6
    Reply to this comment
    by Mango April 13, 2006 12:50 PM PDT
    I'll give you an example of "repair permissions" actually fixing something. [I originally posted this in response to an Unsanity blog posting about repairing permissions.]

    One morning I was using Omniweb without any problems. Later that day, when I launched Omniweb, it got stuck in a "pre-fetching" stage. It wouldn't connect to any website and, after a few seconds, became unresponsive. I had to force-quit. I relaunched it a few times and the problem still existed. Here is the list of troubleshooting things I tried:

    1) Checked Console log and System log for Omniweb-related errors. Found none.
    2) Deleted Omniweb cache. No effect
    3) Deleted Omniweb preference file. No effect.
    4) Deleted Omniweb Application Support folder. No effect.
    5) Downloaded latest version of Omniweb. No effect.
    6) Logged out and back in. No effect.
    7) Rebooted. No effect.
    8) Ran fsck. No effect.
    8) Repaired permissions. Fixed.

    So something changed the permissions on my system which prevented Omniweb from running properly. This happens to me every once and a while under OS X 10.4.x. Sometimes, my entire hard drive gets set to "read-only." I run a variety of applications, but I've never discovered which app(s) screws up my permissions.

    All I know is that repairing permissions has fixed multiple problems for me. Another example I can give is when I tried to install the mlnet daemon. The installer kept failing. I deleted the mlnet cache folder and preferences. Didn't help. Repaired permissions and the installation proceeded successfully.

    It may not be a cure-all, but it's worked for me.
    Reply to this comment
    by April 13, 2006 12:50 PM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by Mango</i></div></class><br />
    I too have had success with repairing permissions. A customer of mine has an
    iMac running Panther. About once a year, classic just hangs when he starts it
    and he must force quit. I have tried everything under the sun to fix this, and as a
    last resort, I repaired the permissions. Done. Now when he calls me with the
    problem, we can fix it over the phone.
    Reply to this comment
    Showing 1 of 2 pages (32 Comments)
    advertisement

    About MacFixIt

    MacFixIt is CNET's troubleshooting resource for all things Mac. The information here helps you navigate the ins-and-outs of Mac ownership with how-tos, troubleshooting information, news, reviews, and more.

    Add this feed to your online news reader