NAME
SYNOPSIS
chacl acl pathname...
chacl ­b acl dacl pathname...
chacl ­d dacl pathname...
chacl ­R pathname...
chacl ­D pathname...
chacl ­B pathname...
chacl ­l pathname...
DESCRIPTION
EXAMPLES
chacl ­b `chacl ­l olddir | sed ­e 's/.*[//' ­e 's#/# #' ­e 's/]$//'` newdir
CAUTIONS
SEE ALSO
CAVEATS

NAME

chacl - change or list the access control list of a file or directory

SYNOPSIS

chacl acl pathname...

chacl ­b acl dacl pathname...

chacl ­d dacl pathname...

chacl ­R pathname...

chacl ­D pathname...

chacl ­B pathname...

chacl ­l pathname...

DESCRIPTION

chacl changes or lists the Access Control List(s) for a file or directory. The ­b flag indicates that there are two ACLs to change, the first is the file access ACL and the second the directory default ACL. The ­d flag is used to set only the default ACL of a directory. The ACL(s) specified are applied to each file in the pathname arguments. The ­R and ­D flags are used to remove the file access ACL and directory default ACL respectively, the ­B flag will remove all ACLs. The ­l flag is used to list the access ACL and possibly the default ACL associated with the specified files or directories.

Each ACL is a string which is processed via acl_from_text(3). These strings are made up of comma separated clauses each of which is of the form, tag:name:perm. Where tag can be

"user" (or "u")

"group" (or "g")

"other" (or "o")

"mask" (or "m")

indicating that the entry is a user ACL entry.

indicating that the entry is a group ACL entry.

indicating that the entry is an other ACL entry.

indicating that the entry is a mask ACL entry.

name is a string which is the user or group name for the ACL entry. A null name in a user or group ACL entry indicates the file's owner or file's group. perm is the string "rwx" where each of the entries may be replaced by a "­" indicating no access of that type, e.g. "r­x", "­­x", "­­­".

EXAMPLES

A minimum ACL: chacl u::rwx,g::r­x,o::r­­ file
The file ACL is set so that the file's owner has rwx, the file's group has read and execute, and others have read only access to the file.

An ACL that is not a minimum ACL, that is, one that specifies a user or group other than the file's owner or owner's group, must contain a mask entry: chacl u::rwx,g::r­x,o::r­­,u:guest:r­­,m::r­x file1 file2

To set the default and access ACLs on newdir to be the same as on oldir, you could type:

chacl ­b `chacl ­l olddir | sed ­e 's/.*[//' ­e 's#/# #' ­e 's/]$//'` newdir

CAUTIONS

chacl can replace the existing ACL. To add or delete entries, you must first do chacl ­l to get the existing ACL, and use the output to form the arguments to chacl.

Changing the permission bits of a file will change the file access ACL settings (see chmod(1)). Similarly file­creation mode masks can effect the access ACL settings of files created using directory default ACLs (see umask(1)).

ACLs are filesystem extended attributes and are not typically archived or restored using conventional archiving utilities. See attr(1) for more information about Extended Attributes and see xfsdump(8) for a method to back them up.

SEE ALSO

acl_from_text(3), umask(1), xfsdump(8).

CAVEATS

This command is likely to be deprecated when a standard file­system independent ACL library is available.