How do I repair permissions of a specific directory?

I want to repair permissions of a user defined directory along with it's subdirectories.
How can I do this?

So far, I've looked for options in finder and tried to drag the folder into Disk Utility. But none of my ideas brought success.


Solution 1:

Repairing permissions only affects System files, and files installed from a package with the Installer, which give a BOM (Bill Of Materials, stored in the (~)/Receipts folder) that list the expected permissions. There is no meaning in repairing permissions for “a specific directory“, as an arbitrary directory has no expected permissions against which to compare, unless it is one listed in one of the said files.

(just for sourcing: Wikipedia agrees  ;)  )


If you want to change permissions of a lot of files at once, for example by having copied them from another drive with permissions, and you encounter problems with them, you could use a tool such as BatchMod :)

Solution 2:

The act of "repairing permissions" is a very specific system-level only process. There is nothing in the UNIX-like world (such as BSD, which OS X is based on) that defines what a "correct" permission is. According to a Genius I spoke with at my local Apple Store, there is simply some file that lists important system files/folders, and clicking "Repair Disk Permissions" simply applies the appropriate permissions on the contents of that list.

Client file permissions have no "correct permission" because they can be whatever you want to achieve.

Solution 3:

If I understand your question correctly, you're attempting to reset the permissions on a user's home directory. This is easily accomplished by resetting ACLs on the desired home directly by using the Reset Password utility in the Recovery Partition:

Restart your computer from the recovery partition (if running Lion) or the gray disk (if not running Lion). Open Disk Utility and run a permissions repair on your startup volume. After this is complete, close Disk Utility and open Terminal from the Utilities menu. Type in resetpassword and select your user account (NOT System Administrator/root) from the drop down menu. Click the Reset button at the bottom of the window in the Reset home folder permissions and ACLs section. Quit the Password Utility and go back to the main recovery screen. On your keyboard, hit Command+Q and restart your computer.

It's very important that you don't hold down the power button to exit the recovery session, or the ACL reset won't occur.

Let us know how it goes.