Skip navigation

Recurring file-permissions problems

825 Views 18 Replies Latest reply: Nov 13, 2012 8:14 PM by Steve Jolly RSS
1 2 Previous Next
Steve Jolly Level 1 Level 1 (35 points)
Currently Being Moderated
Nov 2, 2012 1:27 PM

A problem has abruptly appeared and keeps (unpredictably) recurring.  When I edit a file and then save the modified version of that file, something breaks and when I try to reopen the file, later, I get a "you do not have permission to open this file" message. And the file can't be opened.

 

If I restart my MacBook Pro, the problem will usually disappear for a while, then begins to pop up again.

 

I've been running Mountain Lion since shortly after it was introduced. This is a new problem (never encountered it in 25 years with Macs; this began a few days ago) and has me baffled.

MacBook Pro, OS X Mountain Lion (10.8.2), Quad i7 16GB RAM 2GPU's 1GB vidRAM
  • Linc Davis Level 10 Level 10 (107,510 points)
    Currently Being Moderated
    Nov 11, 2012 1:28 PM (in response to Steve Jolly)

    Does this happen only with one application, or with more than one?

  • Linc Davis Level 10 Level 10 (107,510 points)
    Currently Being Moderated
    Nov 12, 2012 5:20 PM (in response to Steve Jolly)

    Problems such as yours are sometimes caused by files that should belong to you but are locked or have wrong permissions. This procedure will check for such files. It makes no changes and therefore will not, in itself, solve your problem.

    First, empty the Trash.

    Launch the Terminal application in any of the following ways:

    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)

    ☞ In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.

    Triple-click anywhere in the line below to select it, then drag or copy it — do not type — into the Terminal window:

    find . $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 -o -acl \) 2> /dev/null | wc -l

    Press return. The command may take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear.

    The output of this command, on a line directly below what you entered, will be a number such as "35." Please post it in a reply.

  • Linc Davis Level 10 Level 10 (107,510 points)
    Currently Being Moderated
    Nov 13, 2012 3:05 PM (in response to Steve Jolly)

    I re-tested the command, and it's correct. Please follow the instructions exactly and try again. If it still doesn't work, post a screenshot of the Terminal window showing what you did.

  • Linc Davis Level 10 Level 10 (107,510 points)
    Currently Being Moderated
    Nov 13, 2012 3:23 PM (in response to Steve Jolly)

    No, it's not correct. Repair permissions in Disk Utility.

  • Linc Davis Level 10 Level 10 (107,510 points)
    Currently Being Moderated
    Nov 13, 2012 3:25 PM (in response to Steve Jolly)

    You're running the C shell, not the default bash shell. Type "sh" at the prompt (without the quotes), then press return and try again.

  • Linc Davis Level 10 Level 10 (107,510 points)
    Currently Being Moderated
    Nov 13, 2012 3:45 PM (in response to Steve Jolly)

    Back up all data now.

    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. If none of this is meaningful to you, you don't need to worry about it.

     

    Step 1

    Launch the Terminal application in any of the following ways:

    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)

    ☞ In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.

    Drag or copy — do not type — the following line into the Terminal window, then press return:

    sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:20 ~ $_ ; chmod -R -N ~ $_ 2> /dev/null

    Be sure to select the whole line by triple-clicking anywhere in it. You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. You don't need to post the warning. If you don’t have a login password, you’ll need to set one before you can run the command.

    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.

    Step 2

     

    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.

    When the OS X Utilities screen appears, select Utilities Terminal from the menu bar. A text window opens.

    In the Terminal window, type this:

    resetpassword

    That's one word with no spaces. Then press return. A Reset Password window opens. You’re not going to reset a password.

    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.

    Select your username from the menu labeled Select the user account if not already selected.

    Under Reset Home Directory Permissions and ACLs, click the Reset button.

    When that's done, launch Disk Utility and repair the permissions of the boot volume.

    Select  Restart from the menu bar.

1 2 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (1)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.