Apple Event: May 7th at 7 am PT

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

ACL Tips version 2

The following is a more concise version of my ACL tips post, with some relevant and updated answers for 10.4.4.

Before You Begin: I recommend starting with Mac OS X Server 10.4.3 minimum. Some quirkiness in the ACL model exists in earlier versions of Mac OS X Server 10.4. Also, be sure to check all of your volumes with Disk Utility's Repair function before proceeding. ACL information is stored in the Extended Attributes file, and damage to that file can cause confusion when setting or changing permissions.

The Tiger Permissions Model: Mac OS X Server version 10.4 supports standard UNIX (POSIX) permissions and Access Control Lists (ACLs). ACLs offer some options previously unavailable in earlier versions of the server software, and can be used to define permissions for newly created files and folders. You don't have to use ACLs, though: When disabled, the permissions model simply relies on POSIX permissions, just as with Mac OS X Server 10.3 and earlier. When ACLs are enabled, Mac OS X Server considers ACL information and POSIX information. This consideration process returns the Effective Permissions for a particular file or folder (filesystem object).

The ACL model Apple uses is identical to the model used by Microsoft Windows; however, there is no "ACL only" option that will ignore POSIX permissions. You either have POSIX only (with ACLs disabled), or both (Effective Permissions).

ACLs are enabled on a per-volume basis. You can do so in the Sharing section of Workgroup Manager by clicking the All tab and navigating to an HFS+ volume in the list. Or, you can do so from the command line with fsaclctl.

Effective Permissions: When ACLs are enabled, the Effective Permissions are calculated in the following way:

(relevant POSIX permissions) union (relevant ACL Allow entries) take away (relevant ACL Deny entries)

This means that applicable POSIX permissions (either owner, group, or POSIX everyone) and applicable ACL Allow entries are combined to grant the connecting user access to the filesystem object. If no ACL Deny entries apply to the connecting user, then the Effective Permissions for the user accessing the filesystem object are simply the union of applicable POSIX and ACL Allow entries. If an ACL Deny entry applies to the connecting user, then that level of access is not granted for the filesystem object.

In this way, the ACL Deny entry has the most power. When specified, it overrides any ACL Allow rule or POSIX permission bit.

Applicable POSIX Permissions: The POSIX permissions for a connecting user accessing a filesystem object are determined using the following method. Remember, POSIX permissions are applicable when ACLs are disabled and when they are enabled (as part of the Effective Permissions model).

POSIX permissions consist of three "fields": an owner which must be assigned to a user, a group, and an everyone else category. Sometimes each category is referred to as a POSIX permission bit, and the everyone else field may be referred to as "world," since those are the permissions assigned to any user who cannot be categorized as the filesystem object's owner or group member.

Each POSIX permission field can have zero, one, two, or three of three bits enabled, which determine eight different levels of access: read, write, and execute (for files, launch/open; for folders, view contents). Each is called a bit because together they represent a three-bit number ranging from 0 (binary 000) to 7 (binary 111), where read=4 (binary 100), write=2 (binary 010), and execute=1 (binary 001). As you can see, this allows eight different combinations for eight different access levels:

No access = 0 (000)
Execute only = 1 (001)
Write only = 2 (010)
Write & Execute (Drop Box) = 3 (011)
Read only = 4 (100)
Read & Execute =5 (101)
Read & Write = 6 (110)
Read, Write, and Execute = 7 (111)

If the connecting user is the filesystem object's owner, then he/she receives the POSIX permissions assigned to the owner of the filesystem object. If and only if that fails, then Mac OS X checks to see if the connecting user should be assigned the POSIX permissions assigned to the filesystem object's group. (First it checks to see if the connecting user's primary group matches that of the group assigned to the filesystem object; if there's no match, then it looks up the filesystem object's group to see if the connecting user is a member.) If and only if the group assignment fails, then the connecting user is assigned the POSIX permissions of the everyone else category. If all fail, then no access is returned.

In this way, the POSIX permissions are either those assigned to the owner, group, or everyone else category; if more than one is true for the connecting user, then the first item that is true determines the POSIX permissions returned. In other words, owner overrides group, and group overrides everyone else.

Everyone else doesn't necessarily mean guest. In fact, guest access is only available if it has been enabled for the AFP or SMB services using Server Admin. Often guests do receive the permissions assigned to the everyone else group, unless you use the group named "everyone" (GID 12) in the POSIX group field when assigning it to a filesystem object. Since this is redundant, the "everyone" group is more useful with ACLs.

Setting POSIX Permissions and New File & Folder Behavior: Each filesystem object has three (normally) or four (for special modes) POSIX permission fields attached to it. The permissions for owner, group, and everyone else are often abbreviated using the decimal form of each permission. For example, 773, means owner can read, write, and execute (7), group can do the same, and everyone else can read and execute (drop box) only. An owner name and group name are attached to the filesystem object by the UID and GID of each.

Normally, the POSIX model always applies a default set of permissions calculated by using the umask to newly created files and folders. This is called "standard POSIX behavior" or "standard UNIX behavior". By default the umask is 0022, which means that newly created files receive permissions of 755. The only thing that changes are the owner and group permission field names. The owner is set to the user who created (or duplicated or copied) the file or folder, and the group is set to that user's primary group (which is staff for most users).

You can change the way that the POSIX model applies permissions to newly created files and folders:

* You can set the set-UID or set-GID bits to define a specific owner or group for newly created files. (See man chmod for details.)

* When ACLs are disabled, you can enable the "Inherit Permissions" access option. In this case, the permission fields and bits are inherited from their enclosing folder. This option is disabled with ACLs, because ACLs provide a more robust model for permission inheritance.

continued

Apple Certified System Administrator, AuburnMac; ACN + ACA

Posted on Jan 16, 2006 1:32 AM

Reply
20 replies

Mar 8, 2006 1:18 PM in response to Gerrit DeWitt

Thanks a lot Gerrit for taking the time to explain all this in such a good manner. I think I am finally starting to get it.

My problem is related to my users copying files onto the server or creating folders and files on the server. It is locking out the other users from accessing the folder. I know how to fix this using the ACEs and ACLs, but this would be a lot of work considering that I have hundreds of folders which are several levels down from the root on the sharepoint.

My thought is that a simpler solution would be if there is a way to change the default POSIX umask from 0022 to 0000. If I am understanding this correctly, then if this umask is changed, then when a user creates a folder, or copies a folder onto the server, then owner, group and everyone permissions for the folder would be r/w.
Is there a way to do this, or am I way off base in my thinking.

XServe Dual G5 2.3Ghz Mac OS X (10.4.5)

Mar 14, 2006 8:50 PM in response to Gerrit DeWitt

Hi Tim.

You can reset the finder prefs for creating documents and files with the following commands:

(if you're using a network user, you will not need the sudo part of the command)

sudo defaults write com.apple.finder umask 2
(then check to see if it was written: defaults read com.apple.finder umask)
sudo defaults write -g NSUmask 2
(then check to see if it was written: sudo defaults read -g NSUmask)

Good luck.


Mar 15, 2006 2:05 AM in response to drewsta@mac.com

Good tip. Just remember that changing the umask to 0002 or 0000 can have some potentially unwanted side-effects; just keep the following in mind:

1. Now all files and directories created are read/write for not only the user, but the defined group (umask=0002 yields POSIX permissions of 775) can as well. Further, using an all-zeroes umask means that everyone can read and write (POSIX 777).

2. If you use network home directories, any new files saved by Sally (for example) are now read/write for Beth with either umask setting. (This may not always be the case, but it is the "default" since all users in an Open Directory Master have their primary groups set to staff; in a local NetInfo domain on 10.3 and later, UID-specific groups are used.)

If Sally and Beth have homes on the same home directory share point, all Sally has to do in order to access (or potentially delete) Beth's files is move up a level and double-click Sally's home in the path in the automounted AFP share.

Even if their homes reside on different share points, Beth can still use Connect to Server to access (and potentially modify) Sally's files.

I use the word "potentially" because the POSIX umask change does not affect files that have already been created. However, default user homes have POSIX permissions set to 755 for their top-levels, so read access is possible at least.

3. If you have guest access turned on for AFP or Windows services, and AFP or SMB guest access enabled for one or more share points where newly created files reside, guests can potentially delete your data.

4. if you have anonymous access turned on for the FTP service, and FTP guest access enabled for the share point, the #3 situation is possible.

5. The Apache (HTTP) server and WebDAV processes interact with the filesystem using the www user. Users authenticating for realm authoring via WebDAV may be able to modify data as in situation #3.

6. A simple mistake (or malicious shell script) executed by one user can potentially delete lots more files than were normally delete-able.

Just know that there's a reason why the umask is 0022!

--Gerrit

Mar 15, 2006 2:09 AM in response to Tim Hardesty

Thank you for the compliments.

You can propagate permissions to nested children and grandchildren (including nested folders) by adding the -R flag to the chmod command like this:

chmod -R +a "user allow read...."

Also remember that inclusion of either the file_inherit or directory_inherit controls on a parent folder will send that object's permissions downward to newly-created descendants - until a limit_inherit flag is set on one of the descendant folders (which is optional).

--Gerrit

May 5, 2006 8:04 AM in response to Gerrit DeWitt

I have been experiencing some troubles with ACL and the resulting effective permissions. I am running OS X Server 10.4.6. I have set up a series of shares and applied the necessary groups with read and write access to the ACL with full inheritance to make sure any child folders, child files and all decendants inherit full read and write abilities. However, my users are having imtermittent problems either copying files and folders into the share or deleting folders and files from the share.

The use case is that a user of one group will drop a folder with one or more files into a share. A user from another group then reviews the files, copies them to a new location, and deletes the original folder and files.

Everything works about 75% of the time, but on occasion, a user can not copy a folder or file to a share that they could copy to previously, or a user can not delete a folder or file from a share that they could delete from previously.

When this occurs, I use workgroup manager to inspect the effective permissions of the shares and folders in question. The ACL for the share, folders and files is correct, but the effective permissions inspector does not accurately reflect this information. It at times will only display the users permissions based on the POSIX permissions for the share, folder or file.

Any ideas?

ACL Tips version 2

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