Purpose
Sets the ACL for a directory
Synopsis
fs setacl -dir <directory>+ -acl <access list entries>+ [-clear] [-negative] [-id] [-if] [-help] fs sa -d <directory>+ -a <access list entries>+ [-c] [-n] [-id] [-if] [-h] fs seta -d <directory>+ -a <access list entries>+ [-c] [-n] [-id] [-if] [-h]
Description
The fs setacl command adds the access control list (ACL) entries specified with the -acl argument to the ACL of each directory named by the -dir argument.
If the -dir argument designates a pathname in DFS filespace (accessed via the AFS/DFS Migration Toolkit Protocol Translator), it can be a file as well as a directory. The ACL must already include an entry for mask_obj, however. For more details, refer to the IBM AFS/DFS Migration Toolkit Administration Guide and Reference.
Only user and group entries are acceptable values for the -acl argument. Do not place machine entries (IP addresses) directly on an ACL; instead, make the machine entry a group member and place the group on the ACL.
To completely erase the existing ACL before adding the new entries, provide the -clear flag. To add the specified entries to the Negative rights section of the ACL (deny rights to specified users or groups), provide the -negative flag.
To display an ACL, use the fs listacl command. To copy an ACL from one directory to another, use the fs copyacl command.
Cautions
If the ACL already grants certain permissions to a user or group, the permissions specified with the fs setacl command replace the existing permissions, rather than being added to them.
Setting negative permissions is generally unnecessary and not recommended. Simply omitting a user or group from the Normal rights section of the ACL is normally adequate to prevent access. In particular, note that it is futile to deny permissions that are granted to members of the system:anyuser group on the same ACL; the user needs only to issue the unlog command to receive the denied permissions.
When including the -clear option, be sure to reinstate an entry for each directory's owner that includes at least the l (lookup) permission. Without that permission, it is impossible to resolve the "dot" ( . ) and "dot dot" ( . . ) shorthand from within the directory. (The directory's owner does implicitly have the a [administer] permission even on a cleared ACL, but must know to use it to add other permissions.)
Options
Specify the read/write path to each directory (or DFS file), to avoid the failure that results from attempting to change a read-only volume. By convention, the read/write path is indicated by placing a period before the cell name at the pathname's second level (for example, /afs/.abc.com). For further discussion of the concept of read/write and read-only paths through the filespace, see the fs mkmount reference page.
in that order, separated by a space (thus every instance of this argument has two parts). The accepted AFS abbreviations and shorthand words, and the meaning of each, are as follows:
It is acceptable to mix entries that combine the individual letters with entries that use the shorthand words, but not use both types of notation within an individual pairing of user or group and permissions.
To learn the proper format and acceptable values for DFS ACL entries, see the IBM AFS/DFS Migration Toolkit Administration Guide and Reference.
This argument is not supported for DFS files or directories, because DFS does not implement negative ACL permissions.
Examples
The following example adds two entries to the Normal rights section of the current working directory's ACL: the first entry grants r (read) and l (lookup) permissions to the group pat:friends, while the other (using the write shorthand) gives all permissions except a (administer) to the user smith.
% fs setacl -dir . -acl pat:friends rl smith write % fs listacl -path . Access list for . is Normal rights: pat:friends rl smith rlidwk
The following example includes the -clear flag, which removes the existing permissions (as displayed with the fs listacl command) from the current working directory's reports subdirectory and replaces them with a new set.
% fs listacl -dir reports Access list for reports is Normal rights: system:authuser rl pat:friends rlid smith rlidwk pat rlidwka Negative rights: terry rl % fs setacl -clear -dir reports -acl pat all smith write system:anyuser rl % fs listacl -dir reports Access list for reports is Normal rights: system:anyuser rl smith rlidwk pat rlidwka
The following example use the -dir and -acl switches because it sets the ACL for more than one directory (both the current working directory and its public subdirectory).
% fs setacl -dir . public -acl pat:friends rli % fs listacl -path . public Access list for . is Normal rights: pat rlidwka pat:friends rli Access list for public is Normal rights: pat rlidwka pat:friends rli
Privilege Required
The issuer must have the a (administer) permission on the directory's ACL; the directory's owner and the members of the system:administrators group have the right implicitly, even if it does not appear on the ACL.
Related Information
IBM AFS/DFS Migration Toolkit Administration Guide and Reference