OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / acl / original / man1 / chacl.1
1 .TH CHACL 1 "ACL File Utilities" "September 2001" "Access Control Lists"
2 .SH NAME
3 chacl \- change the access control list of a file or directory
4 .SH SYNOPSIS
5 .B chacl acl pathname...
6 .br
7 .B chacl \-b acl dacl pathname...
8 .br
9 .B chacl \-d dacl pathname...
10 .br
11 .B chacl \-R pathname...
12 .br
13 .B chacl \-D pathname...
14 .br
15 .B chacl \-B pathname...
16 .br
17 .B chacl \-l pathname...
18 .br
19 .B chacl \-r pathname...
20 .br
21 .SH DESCRIPTION
22 .I chacl
23 is an IRIX-compatibility command, and is maintained for those
24 users who are familiar with its use from either XFS or IRIX.
25 Refer to the
26 .B "SEE ALSO"
27 section below for a description of tools
28 which conform more closely to the (withdrawn draft) POSIX 1003.1e
29 standard which describes Access Control Lists (ACLs).
30 .PP
31 .I chacl
32 changes the ACL(s) for a file or directory.
33 The ACL(s) specified are applied to each file in the \f4pathname\f1 arguments.
34 .P
35 Each ACL is a string which is interpreted using the
36 .IR acl_from_text (3)
37 routine.
38 These strings are made up of comma separated clauses each of which
39 is of the form, tag:name:perm.  Where \f4tag\fP can be:
40 .TP
41 "user" (or "u")
42 indicating that the entry is a user ACL entry.
43 .TP
44 "group" (or "g")
45 indicating that the entry is a group ACL entry.
46 .TP
47 "other" (or "o")
48 indicating that the entry is an other ACL entry.
49 .TP
50 "mask" (or "m")
51 indicating that the entry is a mask ACL entry.
52 .P
53 \f4name\fP is a string which is the user or group name for the ACL entry.
54 A null \f4name\fP in a user or group ACL entry indicates the file's
55 owner or file's group.
56 \f4perm\fP is the string "rwx" where each of the entries may be replaced
57 by a "\-" indicating no access of that type, e.g. "r\-x", "\-\-x", "\-\-\-".
58 .SH OPTIONS
59 .TP
60 .B \-b
61 Indicates that there are two ACLs to change, the first is the
62 file access ACL and the second the directory default ACL.
63 .TP
64 .B \-d
65 Used to set only the default ACL of a directory.  
66 .TP
67 .B \-R
68 Removes the file access ACL only.
69 .TP
70 .B \-D
71 Removes directory default ACL only.
72 .TP
73 .B \-B
74 Remove all ACLs. 
75 .TP
76 .B \-l
77 Lists the access ACL and possibly the default ACL associated
78 with the specified files or directories.  This option was added
79 during the Linux port of XFS, and is not IRIX compatible.
80 .TP
81 .B \-r
82 Set the access ACL recursively for each subtree rooted at \f4pathname\f1(s).
83 This option was also added during the Linux port of XFS, and is not
84 compatible with IRIX.
85 .SH EXAMPLES
86 A minimum ACL:
87 .PP
88 .nf
89   \f3chacl u::rwx,g::r-x,o::r-- file\fP
90 .fi
91 .PP
92 The file ACL is set so that the file's owner has "rwx", the file's
93 group has read and execute, and others have read only access to the file.
94 .P
95 An ACL that is not a minimum ACL, that is, one that specifies
96 a user or group other than the file's owner or owner's group,
97 must contain a mask entry:
98 .PP
99 .nf
100   \f4chacl u::rwx,g::r-x,o::r--,u:bob:r--,m::r-x file1 file2\fP
101 .fi
102 .PP
103 To set the default and access ACLs on \f4newdir\f1 to be the 
104 same as on \f4olddir\f1, you could type:
105 .PP
106 .nf
107   \f4chacl \-b `chacl \-l olddir | \\
108       sed \-e 's/.*\\[//' \-e 's#/# #' \-e 's/]$//'` newdir
109 \fP
110 .fi
111 .SH CAUTIONS
112 .I chacl
113 can replace the existing ACL.  To add or delete entries, you
114 must first do \f4chacl \-l\fP to get the existing ACL, and use the output
115 to form the arguments to
116 .IR chacl .
117 .P
118 Changing the permission bits of a file will change the file access
119 ACL settings (see
120 .IR chmod (1)).
121 However, file creation mode masks (see
122 .IR umask (1))
123 will not affect the access ACL settings of files created using directory 
124 default ACLs. 
125 .P
126 ACLs are filesystem extended attributes and hence are not typically
127 archived or restored using the conventional archiving utilities.
128 See
129 .IR attr (5)
130 for more information about extended attributes and see
131 .IR xfsdump (8) 
132 for a method of backing them up under XFS.
133 .SH SEE ALSO
134 .BR getfacl "(1), " setfacl "(1), " chmod "(1), " umask "(1), " acl_from_text "(3), " acl "(5), " xfsdump (8)