Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Recurring file-permissions problems

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

Posted on Nov 2, 2012 1:27 PM

Reply
18 replies

Nov 11, 2012 12:50 PM in response to Steve Jolly

Updating -- Still having the problem. I'm re-describing it to improve clarity:


I'm running Mountain Lion (10.8.2 latest mod) on a fast quad i7 mid-2012 MacBook Pro.


Occasionally, I'll edit a file and then save a modified version (as, for example, a .pdf).

When I try to open the modified version of the file, later, I get a "you do not have permission to open this file" message.


If I restart my MacBook Pro, the problem will disappear for a while (the files CAN be opened), but, then the permissions quirk 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.

Nov 12, 2012 5:12 PM in response to Linc Davis

A number of them. Preview is a particular problem, giving me the "...you don't have permission to open it" message fairly often. But it could just as well be a file saved in Photoshop or exported from Quark. There may well be some applications and file-types that don't develop the permission symptoms, but I haven't (yet) noticed any such pattern.


It almost never occurs until I've been using the MBP for several hours. Once it starts, it becomes increasingly pervasive until I shut down. Or restart.


Perhaps predictably, I verified today that if I log out and then log back in, I can open the previously no-permission files. Eventually, the problem starts to recur. Baffling.

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.

Nov 13, 2012 3:00 PM in response to Linc Davis

Thanks, Linc. FYI, I'm familiar with your (many) contributions here. ;-)


Also, I'm familiar with Terminal and most other utils; I've had Macs for 25 years, used to code, and I don't panic in the face of some simple UNIX. Can follow your instructions. Again, thanks!


---------------


Having said all of that...


The reponse from Terminal to your command after copy/pasting it into Terminal (also tried simple dragging, just in case there was an obscure difference, and got the same response) was:


Ambiguous output redirect.


... and waiting for another prompt. No numerical output.

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.

Nov 13, 2012 4:19 PM in response to Linc Davis

I will back up the volume and then follow the steps. Thanks!


Here's a bit of additional info. Probably this is all irrelevent, but just in case something triggers an alarm bell...


1) This mid-2012 MBP (non-retina) was ordered from a 3rd-party vendor, MacMall, not Apple. There was a brief delay in the shipment that made me a bit uneasy.


When it arrived it did not appear to be entirely virgin. There was unexplained minor time logged on the machine, about 10 battery cycles shown, and I had to go through some extra steps to set up my user account and delete what appeared to be some leftover traces of a previous admin account. I didn't worry about it at the time; there were no signs of mischief and, since it was just about the top-end machine orderable without going to the Retina (I passed on the MBPR because I needed the upgradeability of the "legacy-style" MBP), I just assumed that someone at Apple or MM were doing a little quality-control or perhaps curiosity benchmarking on a fast unit that came through the line. I immeediately took it up to 16 GB RAM with Crucial and added a 1 TB internal drive. It certainly worked flawlessly, and, until the permissions problems appeared, even better than flawlessly.


2) One minor oddity. After a couple of weeks, I built a Mountain Lion bootable USB 3 thumb-drive to allow running Disk Warrior (they still haven't released it on bootable media) and other maintenance without going to the recovery partition. When I booted from it and checked the Mac-HD settings, I noted that "Ignore ownership on this volume" was checked, which in my experience is unusual.


See anything in any of this?

Recurring file-permissions problems

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.