An Introduction to Permissions

Date: 2008-11-02 11:52:02 Created: null

Summary

Wrongly set permissions can indeed be a problem to a computer running Mac OS X, but it is a very uncommon one under the vast majority of circumstances. I believe some people with knowledge about permissions started recommending regular permission repairs because, while it is unlikely to help, it is even more unlikely to harm. Changing batteries in the remote for your TV every morning doesn't do any harm either, but it's only actually meaningful if the batteries in the remote are dead.

Background

Repairing permissions seems to have become a standard troubleshooting step for Mac OS X. People recommend doing it before and after system updates as well as when someone has strange problems in general with their Mac. At the same time, there are a few people who say repairing permissions is more or less just voodoo and often doesn't matter at all. What people seem to forget completely is to say what permissions actually are and what happens when you repair them. Hence this little text.

My goal here is to shed some light on what permissions are and what they're good for. So I will try to keep this as non-technical as possible, and might skip over a technical detail or two here and there. Technical-minded people can find plenty more information out there. This isn't about how to repair permissions either. There's plenty of information out there about that too.

Small Language Reservation

As I am using OS X in Swedish I may have mistranslated something somewhere here. Feel free to correct me if you find an error. Hopefully I won't have written anything too confusing ...

What Permissions Are

Every file and folder on a Mac OS X volume has a set of permissions. It's part of those "industrial-strength UNIX underpinnings" Apple likes to tell us about. What it boils down to is that for each file and folder an owner and a group can be set. And for both of those a level of access can be set. The level of access decides what can be done with the file or folder. A level of access can also be set for everyone who is not the owner or a member of the set group.

The access levels are "read and write", "read only", "write only" (only available for folders) and "no access". They mean just what it sounds like, if you can read and write you can do anything with a file, if you can only read you can just open it and look at the contents but not change it. Finally, if you have no access you can't do anything at all.

Viewing Permissions

You can view the permissions of a file or folder by selecting it in Finder and choosing "Show info" from the "File" menu. At the bottom of the information window is the section "Owners and permissions", click the arrow next to "Details" to see the full information.

Here's what the permissions look like for a file in my movies folder:

Permission information, in Swedish

It's in Swedish, but hopefully it's understandable in any case

First there's owner, and that's my user account in this case. The access for the owner is read and write. Next there's group, and in this case that's one called staff. Every user in the group staff is allowed to read this file only. Finally there's others, and they can only read the file as well.

So, to change or delete this file you have to use my user account. This is the normal thing for any file you have created (including downloading it from the web or other sources), you and only you are allowed to change it. The owner of a file is allowed to modify the permissions on that file. If someone else wants to do so they will have to authorise themselves with an administrator password. That's why you need to enter your password in the process of performing updates, the system needs authorisation to modify itself as well.

So, there are users, and they can belong to one of more groups. Nothing strange there. However, users are not only the accounts various people use to log in to the computer, users can also be various parts of the system itself, or be created for specific programs. If you click the lock next to the owner you can look at the other alternatives in the drop down. There are quite a few users, and unless you're into this sort of thing their names probably don't tell you much about what they're there for. The important part is that there are different users, and that different users can be allowed to do different things to files and folders.

What Repair Permissions Does

So, what repair permissions actually does is to look at files and folders on your hard drive and try to figure out if the owner and group settings make sense. Repair permissions only check permissions on things that have been installed from a package, a file with a .pkg extension (most often system updates and other relatively low-level things). When something is installed from a package file a sort of reciept file is saved by the system. That file contains a list of files installed from the package, and what permissions were set for each of them.

So, repair permissions simply goes through the list of reciepts and then looks at each file to see if the permissions match. If there is a difference, it says so and sets the permissions back to what the reciept states. No more, no less.

Note, for example, that everything that wasn't installed from a package just doesn't exist in the world of permission repairs.

Apparant and Real Problems

Let's say a program installs a log file as part of its installation. During installation, the log is created so that only the program itself has the right to read it. "Group" and "others" are set to have no access. This information is written down in the reciept. But the creators of the program realized the user may want to examine the log as well, so afterwards the permissions of the file is changed so that "others" are allowed to read it. This would show up as a warning during a permission check, and it would be changed back to no access by a repair.

It has also been noted that sometimes Apple will themselves change permissions on certain files with various system updates. Apparantly this is noted by/in disk utility by saying "We're using special permissions for (...)" or something similar.

So, something doesn't have to be a problem just because it is listed as one when repair permissions is ran.

Before I had another example here stating that a system update could possibly fail because of incorrect permissions. Which was, quite naturally, totally wrong. I even wrote above about it. Entering an administration password gives the updates the rights to change things around as they need. Thus the update will set whatever permissions it wants, and won't be stopped by any already set.

In short permission problems don't happen all by themselves. Someone or something had to change permissions from what the system expected, and to do that it needed permissions in the first place. To tell the truth, I can't think of a situation where a non-technical user would manage to ruin system permissions completely by accident. Unless a user messes with permissions they're pretty darn unlikely to be incorrect for any purpost. Thus, it's pretty darn unlikely that incorrect permissions are the source of any problem you or anyone else might be experiencing with a Mac.

In Closing

Recommended further reading is the external "Rosyna on Perms" up on the right. There's a lot more detail in there, and fine examples of problems repairing permissions has nothing at all to do with.

Well, that's about it. Hopefully that gave a slightly clearer idea of what permissions are and aren't. If it didn't just give me a shout and I'll try to make it better.

If you found it completely perfect and a wonder of clarity ... you must have read something else than what I wrote. Thanks for your time!