1 <?xml version="1.0" encoding="UTF-8"?>
3 <title>Protecting Your Directories and Files</title>
5 <para>This chapter explains how to protect AFS files and directories by defining permissions on an access control list.</para>
8 <title>Access Control Lists</title>
11 <primary>protection</primary>
13 <secondary>for files and directories</secondary>
17 <primary>access to AFS filespace</primary>
19 <secondary>granting and denying to users</secondary>
23 <primary>directories</primary>
25 <secondary>setting access control list</secondary>
29 <primary>ACL</primary>
31 <secondary>described</secondary>
35 <primary>access control list</primary>
40 <para>AFS augments and refines the standard UNIX scheme for controlling access to files and directories. Instead of using mode
41 bits to define access permissions for individual files, as UNIX does, AFS stores an <emphasis>access control list</emphasis>
42 (<emphasis>ACL</emphasis>) with each directory. It defines which users and groups can access the directory and the files it
43 contains, and in what manner. An ACL can store up to about 20 entries, each of which pairs a user or group and a set of
44 permissions. AFS defines seven permissions rather than the three that UNIX uses.</para>
46 <para>Another refinement to the standard UNIX protection scheme is that users can define their own protection
47 <emphasis>groups</emphasis> and then place the groups on ACLs as though they were individual users. A group can include both
48 users and machines. Each user who belongs to a group inherits all of the permissions granted to the group on the ACL. Similarly,
49 all users who are logged into a machine that belongs to a group inherits all of the permissions granted to the group. You can
50 create groups to place on ACLs and also use groups that other users have created. To learn more about group creation, see <link
51 linkend="HDRWQ60">Using Groups</link>.</para>
53 <para>In addition, AFS defines two system groups called <emphasis role="bold">system:anyuser</emphasis> and <emphasis
54 role="bold">system:authuser</emphasis>. By placing them on ACLs, you can grant access to large numbers of users at once. See
55 <link linkend="HDRWQ50">Using the System Groups on ACLs</link>.</para>
57 <para>Although AFS uses ACLs to protect files and directories, it also uses the UNIX mode bits to a limited extent. See <link
58 linkend="HDRWQ59">How AFS Uses the UNIX Mode Bits</link>.</para>
60 <sect2 id="Header_81">
61 <title>Directory Level Access Control</title>
63 <para>As noted, AFS associates an ACL with each directory, and it applies to all of the files stored in the directory. Files
64 do not have separate ACLs. Defining access at the directory level has several consequences: <itemizedlist>
66 <para>The permissions on a directory's ACL apply to all of the files in the directory. When you move a file to a
67 different directory, you effectively change its permissions to those on its new directory's ACL. Changing a directory's
68 ACL changes the protection on all the files in it.</para>
72 <para>When you create a subdirectory, it inherits the current ACL of its parent directory. You can then set the
73 subdirectory's ACL to be different from its parent's. However, do not make the ACL on the parent directory more
74 restrictive than on a subdirectory, because that can prevent users from accessing the subdirectory even when they have
75 the necessary permissions on its ACL. Specifically, a user must have the <emphasis role="bold">l</emphasis> (<emphasis
76 role="bold">lookup</emphasis>) permission (defined in <link linkend="HDRWQ46">The AFS ACL Permissions</link>) on the
77 parent directory to reach its subdirectories. <indexterm>
78 <primary>subdirectories, accessing</primary>
79 </indexterm> <indexterm>
80 <primary>access to AFS filespace</primary>
82 <secondary>controlling at directory level</secondary>
85 </itemizedlist></para>
87 <para>As a general rule, it makes sense to grant fairly liberal access to your home directory. If you need to protect certain
88 files more closely, place them in subdirectories that have more restrictive ACLs.</para>
93 <title>The AFS ACL Permissions</title>
96 <primary>access permissions on ACL</primary>
98 <seealso>permissions on ACL</seealso>
100 <seealso>ACL</seealso>
104 <primary>permissions on ACL</primary>
106 <secondary>defined</secondary>
110 <primary>ACL</primary>
112 <secondary>permissions defined</secondary>
115 <para>There are seven standard AFS ACL permissions. Functionally, they fall into two groups: one that applies to the directory
116 itself and one that applies to the files.</para>
119 <title>The Four Directory Permissions</title>
121 <para>The four permissions in this group are meaningful with respect to the directory itself. For example, the <emphasis
122 role="bold">i</emphasis> (<emphasis role="bold">insert</emphasis>) permission does not control addition of data to a file, but
123 rather creation of a new file or subdirectory. <variablelist>
125 <term><emphasis role="bold">The l (lookup) permission</emphasis></term>
128 <para>This permission functions as something of a gate keeper for access to the directory and its files, because a
129 user must have it in order to exercise any other permissions. In particular, a user must have this permission to
130 access anything in the directory's subdirectories. <indexterm>
131 <primary>lookup ACL permission</primary>
132 </indexterm> <indexterm>
133 <primary>l ACL permission</primary>
136 <para>This permission enables a user to issue the following commands: <itemizedlist>
138 <para>The <emphasis role="bold">ls</emphasis> command to list the names of the files and subdirectories in the
143 <para>The <emphasis role="bold">ls -ld</emphasis> command to obtain complete status information for the
144 directory element itself</para>
148 <para>The <emphasis role="bold">fs listacl</emphasis> command to examine the directory's ACL</para>
150 </itemizedlist></para>
152 <para>This permission does not enable a user to read the contents of a file in the directory or to issue the <emphasis
153 role="bold">ls -l</emphasis> or <emphasis role="bold">fs listacl</emphasis> commands with a filename as the argument.
154 Those operations require the <emphasis role="bold">r</emphasis> (<emphasis role="bold">read</emphasis>) permission,
155 which is described in <link linkend="HDRWQ48">The Three File Permissions</link>.</para>
157 <para>Similarly, this permission does not enable a user to issue the <emphasis role="bold">ls</emphasis>, <emphasis
158 role="bold">ls -l</emphasis>, <emphasis role="bold">ls -ld</emphasis>, or <emphasis role="bold">fs listacl</emphasis>
159 commands against a subdirectory of the directory. Those operations require the <emphasis role="bold">l</emphasis>
160 permission on the ACL of the subdirectory itself.</para>
165 <term><emphasis role="bold">The i (insert) permission</emphasis></term>
168 <para>This permission enables a user to add new files to the directory, either by creating or copying, and to create
169 new subdirectories. It does not extend into any subdirectories, which are protected by their own ACLs. <indexterm>
170 <primary>insert ACL permission</primary>
171 </indexterm> <indexterm>
172 <primary>i ACL permission</primary>
178 <term><emphasis role="bold">The d (delete) permission</emphasis></term>
181 <para>This permission enables a user to remove files and subdirectories from the directory or move them into other
182 directories (assuming that the user has the <emphasis role="bold">i</emphasis> permission on the ACL of the other
183 directories). <indexterm>
184 <primary>delete ACL permission</primary>
185 </indexterm> <indexterm>
186 <primary>d ACL permission</primary>
192 <term><emphasis role="bold">The a (administer) permission</emphasis></term>
195 <para>This permission enables a user to change the directory's ACL. Members of the <emphasis
196 role="bold">system:administrators</emphasis> group implicitly have this permission on every directory (that is, even
197 if that group does not appear on the ACL). Similarly, the owner of a directory implicitly has this permission on its
198 ACL and those of all directories below it. <indexterm>
199 <primary>administer ACL permission</primary>
200 </indexterm> <indexterm>
201 <primary>a ACL permission</primary>
205 </variablelist></para>
209 <title>The Three File Permissions</title>
211 <para>The three permissions in this group are meaningful with respect to files in a directory, rather than the directory
212 itself or its subdirectories. <variablelist>
214 <term><emphasis role="bold">The r (read) permission</emphasis></term>
217 <para>This permission enables a user to read the contents of files in the directory and to issue the <emphasis
218 role="bold">ls -l</emphasis> command to stat the file elements. <indexterm>
219 <primary>read ACL permission</primary>
220 </indexterm> <indexterm>
221 <primary>r ACL permission</primary>
227 <term><emphasis role="bold">The w (write) permission</emphasis></term>
230 <para>This permission enables a user to modify the contents of files in the directory and to issue the <emphasis
231 role="bold">chmod</emphasis> command to change their UNIX mode bits. <indexterm>
232 <primary>write ACL permission</primary>
233 </indexterm> <indexterm>
234 <primary>w ACL permission</primary>
240 <term><emphasis role="bold">The k (lock) permission</emphasis></term>
243 <para>This permission enables a user to run programs that issue system calls to lock files in the directory.
245 <primary>k ACL permission</primary>
246 </indexterm> <indexterm>
247 <primary>lock ACL permission</primary>
251 </variablelist></para>
254 <sect2 id="Header_85">
255 <title>The Eight Auxiliary Permissions</title>
258 <primary>auxiliary ACL permissions</primary>
262 <primary>ACL</primary>
264 <secondary>auxiliary permissions</secondary>
267 <para>AFS provides eight additional permissions that do not have a defined meaning. They are denoted by the uppercase letters
268 <emphasis role="bold">A</emphasis>, <emphasis role="bold">B</emphasis>, <emphasis role="bold">C</emphasis>, <emphasis
269 role="bold">D</emphasis>, <emphasis role="bold">E</emphasis>, <emphasis role="bold">F</emphasis>, <emphasis
270 role="bold">G</emphasis>, and <emphasis role="bold">H</emphasis>.</para>
272 <para>Your system administrator can choose to write application programs that assign a meaning to one or more of the
273 permissions, and then place them on ACLs to control file access by those programs. Use the <emphasis role="bold">fs
274 listacl</emphasis> and <emphasis role="bold">fs setacl</emphasis> commands to display and set the auxiliary permissions on
275 ACLs just like the standard seven.</para>
278 <sect2 id="Header_86">
279 <title>Shorthand Notation for Sets of Permissions</title>
282 <primary>ACL</primary>
284 <secondary>shorthand notation for grouping sets of permissions</secondary>
288 <primary>shorthand notation for ACL permissions</primary>
292 <primary>permissions on ACL</primary>
294 <secondary>shorthand for</secondary>
297 <para>You can combine the seven permissions in any way in an ACL entry, but certain combinations are more useful than others.
298 Four of the more common combinations have corresponding shorthand forms. When using the <emphasis role="bold">fs
299 setacl</emphasis> command to define ACL entries, you can provide either one or more of the individual letters that represent
300 the permissions, or one of the following shorthand forms: <variablelist>
302 <term><emphasis role="bold">all</emphasis></term>
305 <para>Represents all seven standard permissions (<emphasis role="bold">rlidwka</emphasis>) <indexterm>
306 <primary>all shorthand for ACL permissions</primary>
312 <term><emphasis role="bold">none</emphasis></term>
315 <para>Removes the entry from the ACL, leaving the user or group with no permission <indexterm>
316 <primary>none shorthand for ACL permissions</primary>
322 <term><emphasis role="bold">read</emphasis></term>
325 <para>Represents the <emphasis role="bold">r</emphasis> (<emphasis role="bold">read</emphasis>) and <emphasis
326 role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>) permissions <indexterm>
327 <primary>read shorthand for ACL permissions</primary>
333 <term><emphasis role="bold">write</emphasis></term>
336 <para>Represents all permissions except <emphasis role="bold">a</emphasis> (<emphasis
337 role="bold">administer</emphasis>): <emphasis role="bold">rlidwk</emphasis> <indexterm>
338 <primary>write shorthand for ACL permissions</primary>
342 </variablelist></para>
346 <title>About Normal and Negative Permissions</title>
349 <primary>ACL</primary>
351 <secondary>normal vs. negative permissions</secondary>
355 <primary>ACL</primary>
357 <secondary>normal permissions</secondary>
361 <primary>ACL</primary>
363 <secondary>negative permissions</secondary>
367 <primary>permissions on ACL</primary>
369 <secondary>normal vs. negative</secondary>
373 <primary>normal ACL permissions</primary>
375 <secondary>defined</secondary>
379 <primary>normal ACL permissions</primary>
381 <secondary>setting</secondary>
385 <primary>negative ACL permissions</primary>
387 <secondary>defined</secondary>
390 <para>ACLs enable you both to grant and to deny access to a directory and the files in it. To grant access, use the <emphasis
391 role="bold">fs setacl</emphasis> command to create an ACL entry that associates a set of permissions with a user or group, as
392 described in <link linkend="HDRWQ54">Changing an ACL</link>. When you use the <emphasis role="bold">fs listacl</emphasis>
393 command to display an ACL (as described in <link linkend="HDRWQ52">Displaying an ACL</link>), such entries appear underneath
394 the following header, which uses the term <emphasis>rights</emphasis> to refer to permissions:</para>
400 <para>There are two ways to deny access: <indexterm>
401 <primary>negative ACL permissions</primary>
403 <secondary>setting</secondary>
404 </indexterm> <orderedlist>
406 <para>The recommended method is simply to omit an entry for the user or group from the ACL, or to omit the appropriate
407 permissions from an entry. Use the <emphasis role="bold">fs setacl</emphasis> command to remove or edit an existing
408 entry. In most cases, this method is enough to prevent access of certain kinds or by certain users. You must take care,
409 however, not to grant the undesired permissions to any groups to which such users belong.</para>
413 <para>The more explicit method for denying access is to place an entry on the <emphasis>negative permissions</emphasis>
414 section of an ACL, by including the <emphasis role="bold">-negative</emphasis> flag to the <emphasis role="bold">fs
415 setacl</emphasis> command. For instructions, see <link linkend="HDRWQ56">To Add, Remove, or Edit Negative ACL
416 Permissions</link>. The <emphasis role="bold">fs listacl</emphasis> command displays the negative permissions section of
417 an ACL underneath the following header: <programlisting>
419 </programlisting></para>
421 <para>When determining what type of access to grant to a user, AFS first examines all of the entries in the normal
422 permissions section of the ACL. It then subtracts any permissions associated with the user (or with groups to which the
423 user belongs) on the negative permissions section of the ACL. Therefore, negative permissions always cancel out normal
426 <para>Negative permissions can be confusing, because they reverse the usual meaning of the <emphasis role="bold">fs
427 setacl</emphasis> command. In particular, combining the <emphasis role="bold">none</emphasis> shorthand and the
428 <emphasis role="bold">-negative</emphasis> flag is a double negative: by removing an entry from the negative permissions
429 section of the ACL, you enable a user once again to obtain permissions via entries in the normal permissions section.
430 Combining the <emphasis role="bold">all</emphasis> shorthand with the <emphasis role="bold">-negative</emphasis> flag
431 explicitly denies all permissions.</para>
433 <para>It is useless to create an entry in the negative permissions section if an entry in the normal permissions section
434 grants the denied permissions to the <emphasis role="bold">system:anyuser</emphasis> group. In this case, users can
435 obtain the permissions simply by using the <emphasis role="bold">unlog</emphasis> command to discard their tokens. When
436 they do so, AFS recognizes them as the <emphasis role="bold">anonymous</emphasis> user, who belongs to the <emphasis
437 role="bold">system:anyuser</emphasis> group but does not match the entries on the negative permissions section of the
440 </orderedlist></para>
443 <sect2 id="Header_88">
444 <title>Setting DFS ACLs</title>
446 <para>If your machine is configured to access a DCE cell's DFS filespace via the AFS/DFS Migration Toolkit, then you can use
447 the AFS <emphasis role="bold">fs listacl</emphasis> and <emphasis role="bold">fs setacl</emphasis> commands to display and set
448 the ACLs on DFS directories and files that you own. However, DFS uses a slightly different set of permissions and a different
449 syntax for ACL entries. See the DFS documentation or ask your system administrator.</para>
453 <title>Dropbox Permissions</title>
455 <para>If a user or group is granted the <emphasis
456 role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>) and
457 <emphasis role="bold">i</emphasis> (<emphasis
458 role="bold">insert</emphasis>) permissions, but not the <emphasis
459 role="bold">r</emphasis> (<emphasis role="bold">read</emphasis>) and/or
460 <emphasis role="bold">w</emphasis> (<emphasis
461 role="bold">write</emphasis>) permissions, this is commonly referred to
462 as a "dropbox" for that user or group. What this means is that that user
463 or group may deposit files in the directory, but they may not read or
464 modify their file later, nor any other file in the directory.</para>
466 <para>Know, however, that some of these restrictions are enforced on the
467 client and not on the fileserver, and so should not be relied on for
468 security. In particular, the fileserver does not know when a file is
469 opened or closed on the client, and and so read and write permissions are
470 granted to any user with "dropbox" permissions that owns the accessed
473 <para>Additionally, granting "dropbox" permissons to <emphasis
474 role="bold">system:anyuser</emphasis> raises additional problems, if you
475 want the dropbox to work for unauthenticated users. Any file deposited by
476 an unauthenticated user will be owned by the unauthenticated user ID, and
477 so would be readable and modifiable by anyone. In order to try and
478 prevent accidentally revealing private information, the fileserver does
479 not grant the implicit read permission to unauthenticated users, even if
480 they have dropbox permissions. This may cause depositing files as an
481 unauthenticated user to arbitrarily fail, and so you should not depend on
482 granting dropbox permissions to unauthenticated users to work
488 <title>Using the System Groups on ACLs</title>
491 <primary>system groups</primary>
493 <secondary>using on ACLs</secondary>
494 </indexterm> <indexterm>
495 <primary>system:anyuser group</primary>
497 <secondary>using on ACLs</secondary>
498 </indexterm> <indexterm>
499 <primary>system:authuser group</primary>
500 </indexterm> <indexterm>
501 <primary>system:administrators group</primary>
502 </indexterm> AFS defines two <emphasis>system groups</emphasis> that grant access to a large number of users at once when
503 placed on an ACL. However, you cannot control the membership of these groups, so consider carefully what kind of permissions you
504 wish to give them. (You do control the membership of the groups you own; see <link linkend="HDRWQ60">Using Groups</link>.)
507 <term><emphasis role="bold">system:anyuser</emphasis></term>
510 <para>Includes anyone who can access the cell's file tree, including users who have tokens in the local cell, users who
511 have logged in on a local AFS client machine but have not obtained tokens (such as the local superuser <emphasis
512 role="bold">root</emphasis>), and users who have connected to a local machine from outside the cell. Creating an ACL
513 entry for this group is the only way to extend access to AFS users from foreign cells, unless your system administrator
514 creates local authentication accounts for them. <indexterm>
515 <primary>ACL</primary>
517 <secondary>foreign users on</secondary>
523 <term><emphasis role="bold">system:authuser</emphasis></term>
526 <para>Includes all users who have a valid AFS token obtained from the local cell's AFS authentication service.</para>
529 </variablelist></para>
531 <para>The third system group, <emphasis role="bold">system:administrators</emphasis>, includes a small group of administrators
532 who have extensive permissions in the cell. You do not generally need to put this group on your ACLs, because its members always
533 have the <emphasis role="bold">a</emphasis> (<emphasis role="bold">administer</emphasis>) permission on every ACL, even if the
534 group does not appear on it.</para>
536 <sect2 id="Header_90">
537 <title>Enabling Access to Subdirectories</title>
540 <primary>subdirectories, accessing</primary>
544 <primary>access to AFS filespace</primary>
546 <secondary>controlling for subdirectories</secondary>
549 <para>A user must have the <emphasis role="bold">l</emphasis> permission on a directory to access its subdirectories in any
550 way. Even if users have extensive permissions on a subdirectory, they cannot access it if the parent directory's ACL does not
551 grant the <emphasis role="bold">l</emphasis> permission.</para>
553 <para>You can grant the <emphasis role="bold">l</emphasis> permission in one of three ways: grant it to a system group
554 (<emphasis role="bold">system:anyuser</emphasis> or <emphasis role="bold">system:authuser</emphasis>), grant it to individual
555 users, or grant it to one or more groups of users defined by you or other users (see <link linkend="HDRWQ60">Using
556 Groups</link>). Granting the <emphasis role="bold">l</emphasis> permission to the <emphasis
557 role="bold">system:anyuser</emphasis> group is the easiest option and is generally secure because the permission only enables
558 users to list the contents of the directory, not to read the files in it. If you want to enable only locally authenticated
559 users to list a directory's contents, substitute the <emphasis role="bold">system:authuser</emphasis> group for the <emphasis
560 role="bold">system:anyuser</emphasis> group. Your system administrator has possibly already created an entry on your home
561 directory's ACL that grants the <emphasis role="bold">r</emphasis> and <emphasis role="bold">l</emphasis> permissions to the
562 <emphasis role="bold">system:anyuser</emphasis> group.</para>
565 <sect2 id="Header_91">
566 <title>Extending Access to Service Processes</title>
569 <primary>access to AFS filespace</primary>
571 <secondary>enabling for service processes</secondary>
574 <para>It is sometimes necessary to grant more extensive permissions to the <emphasis role="bold">system:anyuser</emphasis>
575 group so that processes that provide printing and mail delivery service can work correctly. For example, printing processes
576 sometimes need the <emphasis role="bold">r</emphasis> permission in addition to the <emphasis role="bold">l</emphasis>
577 permission. A mail delivery process possibly needs the <emphasis role="bold">i</emphasis> permission to place new messages in
578 your mail directory. Your system administrator has probably already created the necessary ACL entries. If you notice an ACL
579 entry for which the purpose is unclear, check with your system administrator before removing it.</para>
583 <title>Extending Access to Users from Foreign Cells</title>
586 <primary>access to AFS filespace</primary>
588 <secondary>enabling for users from foreign cells</secondary>
589 </indexterm> The only way to grant access to users from foreign cells who do not have an account in your cell is to put the
590 <emphasis role="bold">system:anyuser</emphasis> group on an ACL. Remember, however, that such an entry extends access to
591 everyone who can reach your cell, not just the AFS users from foreign cells that you have in mind.</para>
596 <title>Displaying an ACL</title>
599 <primary>ACL</primary>
601 <secondary>displaying</secondary>
605 <primary>displaying</primary>
607 <secondary>ACL entries</secondary>
611 <primary>permissions on ACL</primary>
613 <secondary>displaying</secondary>
616 <para>To display the ACL associated with a file or directory, issue the <emphasis role="bold">fs listacl</emphasis>
619 <para><emphasis role="bold">Note for AFS/DFS Migration Toolkit users:</emphasis> If the machine on which you issue the <emphasis
620 role="bold">fs listacl</emphasis> command is configured to access a DCE cell's DFS filespace via the AFS/DFS Migration Toolkit,
621 you can use the command to display the ACL on DFS files and directories. To display a DFS directory's Initial Container or
622 Initial Object ACL instead of the regular one, include the <emphasis role="bold">fs listacl</emphasis> command's <emphasis
623 role="bold">-id</emphasis> or <emphasis role="bold">-if</emphasis> flag. For more information, ask your system administrator.
624 The <emphasis role="bold">fs</emphasis> command interpreter ignores the <emphasis role="bold">-id</emphasis> and <emphasis
625 role="bold">-if</emphasis> flags if you include them when displaying an AFS ACL.</para>
628 <title>To display an ACL</title>
632 <para>Issue the <emphasis role="bold">fs listacl</emphasis> command. <indexterm>
633 <primary>fs commands</primary>
635 <secondary>listacl</secondary>
636 </indexterm> <indexterm>
637 <primary>commands</primary>
639 <secondary>fs listacl</secondary>
640 </indexterm> <programlisting>
641 % <emphasis role="bold">fs listacl</emphasis> [<<replaceable>dir/file path</replaceable>><superscript>+</superscript>]
642 </programlisting></para>
648 <term><emphasis role="bold">la</emphasis></term>
651 <para>Is an acceptable alias for <emphasis role="bold">listacl</emphasis> (and <emphasis
652 role="bold">lista</emphasis> is the shortest acceptable abbreviation).</para>
657 <term><emphasis role="bold"><replaceable>dir/file path</replaceable></emphasis></term>
660 <para>Names one or more files or directories for which to display the ACL. For a file, the output displays the ACL
661 on its directory. If you omit this argument, the output is for the current working directory. Partial pathnames are
662 interpreted relative to the current working directory. You can also use the following notation on its own or as part
663 of a pathname: <variablelist>
665 <term><emphasis role="bold">.</emphasis></term>
668 <para>(A single period). Specifies the current working directory.</para>
673 <term><emphasis role="bold">..</emphasis></term>
676 <para>(Two periods). Specifies the current working directory's parent directory.</para>
681 <term><emphasis role="bold">*</emphasis></term>
684 <para>(The asterisk). Specifies each file and subdirectory in the current working directory. The ACL
685 displayed for a file is always the same as for its directory, but the ACL for each subdirectory can
689 </variablelist></para>
696 <para>The output for each file or directory specified as <replaceable>dir/file path</replaceable> begins with the following
697 header to identify it:</para>
700 Access list for <replaceable>dir/file path</replaceable> is
703 <para>The <computeroutput>Normal rights</computeroutput> header appears on the next line, followed by lines that each pair a
704 user or group name and a set of permissions. The permissions appear as the single letters defined in <link
705 linkend="HDRWQ46">The AFS ACL Permissions</link>, and always in the order <emphasis role="bold">rlidwka</emphasis>. If there
706 are any negative permissions, the <computeroutput>Negative rights</computeroutput> header appears next, followed by pairs of
707 negative permissions.</para>
709 <para>If the following error message appears instead of an ACL, you do not have the permissions needed to display an ACL. To
710 specify a directory name as the <replaceable>dir/file path</replaceable> argument, you must have the <emphasis
711 role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>) permission on the ACL. To specify a filename, you must also
712 have the <emphasis role="bold">r</emphasis> (<emphasis role="bold">read</emphasis>) permission on its directory's ACL.</para>
715 fs: You don't have the required access permissions on '<replaceable>dir/file path</replaceable>'
719 <sect2 id="Header_95">
720 <title>Example: Displaying the ACL on One Directory</title>
723 <primary>examples</primary>
725 <secondary>displaying ACL for single directory</secondary>
728 <para>The following example displays the ACL on user <emphasis role="bold">terry</emphasis>'s home directory in the ABC
729 Corporation cell:</para>
732 % <emphasis role="bold">fs la /afs/abc.com/usr/terry</emphasis>
733 Access list for /afs/abc.com/usr/terry is
743 <para>where <emphasis role="bold">pat</emphasis>, <emphasis role="bold">terry</emphasis>, and <emphasis
744 role="bold">jones</emphasis> are individual users, <emphasis role="bold">system:authuser</emphasis> is a system group, and
745 <emphasis role="bold">terry:other-dept</emphasis> is a group that <emphasis role="bold">terry</emphasis> owns. The list of
746 normal permissions grants all permissions to <emphasis role="bold">terry</emphasis>, the <emphasis role="bold">rlw</emphasis>
747 permissions to <emphasis role="bold">pat</emphasis>, and the <emphasis role="bold">rl</emphasis> permissions to the members of
748 the <emphasis role="bold">system:authuser</emphasis> group.</para>
750 <para>The list of negative permissions denies the <emphasis role="bold">rl</emphasis> permissions to <emphasis
751 role="bold">jones</emphasis> and the members of the <emphasis role="bold">terry:other-dept</emphasis> group. These entries
752 effectively prevent them from accessing <emphasis role="bold">terry</emphasis>'s home directory in any way; they cancel out
753 the <emphasis role="bold">rl</emphasis> permissions extended to the <emphasis role="bold">system:authuser</emphasis> group,
754 which is the only entry on the normal permissions section of the ACL that possibly applies to them.</para>
757 <sect2 id="Header_96">
758 <title>Example: Displaying the ACLs on Multiple Directories</title>
761 <primary>examples</primary>
763 <secondary>displaying ACLs for multiple directories</secondary>
766 <para>The following example illustrates how you can specify pathnames in different ways, and the appearance of the output for
767 multiple directories. It displays the ACL for three directories: the current working directory (which is a subdirectory of
768 user <emphasis role="bold">terry</emphasis>'s home directory), the home directory for user <emphasis
769 role="bold">pat</emphasis>, and another subdirectory of <emphasis role="bold">terry</emphasis>'s home directory called
770 <emphasis role="bold">plans</emphasis>.</para>
773 % <emphasis role="bold">fs listacl . /afs/abc.com/usr/pat ../plans</emphasis>
778 Access list for /afs/abc.com/usr/pat is
783 Access list for ../plans is
792 <title>Changing an ACL</title>
795 <primary>changing</primary>
797 <secondary>ACLs</secondary>
801 <primary>setting permissions on ACL</primary>
805 <primary>ACL</primary>
807 <secondary>setting</secondary>
811 <primary>permissions on ACL</primary>
813 <secondary>setting</secondary>
816 <para>To add, remove, or edit ACL entries, use the <emphasis role="bold">fs setacl</emphasis> command. By default, the command
817 manipulates entries on the normal permissions section of the ACL. To manipulate entries on the negative permissions section,
818 include the <emphasis role="bold">-negative</emphasis> flag as instructed in <link linkend="HDRWQ56">To Add, Remove, or Edit
819 Negative ACL Permissions</link>.</para>
821 <para>You can change any ACL on which you already have the <emphasis role="bold">a</emphasis> permission. You always have the
822 <emphasis role="bold">a</emphasis> permission on the ACL of every directory that you own, even if you accidentally remove that
823 permission from the ACL. (The <emphasis role="bold">ls -ld</emphasis> command reports a directory's owner.) Your system
824 administrator normally designates you as the owner of your home directory and its subdirectories, and you possibly own other
825 directories also.</para>
827 <para>If an ACL entry already exists for the user or group you specify, then the new permissions completely replace the existing
828 permissions rather than being added to them. In other words, when issuing the <emphasis role="bold">fs setacl</emphasis>
829 command, you must include all permissions that you want to grant to a user or group.</para>
831 <para><emphasis role="bold">Note for AFS/DFS Migration Toolkit users:</emphasis> If the machine on which you issue the <emphasis
832 role="bold">fs setacl</emphasis> command is configured to access a DCE cell's DFS filespace via the AFS/DFS Migration Toolkit,
833 you can use the command to set the ACL on DFS files and directories. To set a DFS directory's Initial Container or Initial
834 Object ACL instead of the regular one, include the <emphasis role="bold">fs setacl</emphasis> command's <emphasis
835 role="bold">-id</emphasis> or <emphasis role="bold">-if</emphasis> flag. For more information, ask your system administrator.
836 The <emphasis role="bold">fs</emphasis> command interpreter ignores the <emphasis role="bold">-id</emphasis> and <emphasis
837 role="bold">-if</emphasis> flags if you include them when setting an AFS ACL.</para>
840 <title>To Add, Remove, or Edit Normal ACL Permissions</title>
843 <primary>creating</primary>
845 <secondary>ACL entry in normal permissions section</secondary>
849 <primary>ACL</primary>
851 <secondary>creating normal entry</secondary>
855 <primary>adding</primary>
857 <secondary>ACL entry to normal permissions section</secondary>
861 <primary>granting access to AFS filespace</primary>
865 <primary>access to AFS filespace</primary>
867 <secondary>ACL entries control</secondary>
871 <primary>directories</primary>
873 <secondary>granting access</secondary>
877 <primary>files</primary>
879 <secondary>granting access</secondary>
882 <para>Issue the <emphasis role="bold">fs setacl</emphasis> command to edit entries in the normal permissions section of the
883 ACL. To remove an entry, specify the <emphasis role="bold">none</emphasis> shorthand as the permissions. If an ACL entry
884 already exists for a user or group, the permissions you specify completely replace those in the existing entry. <indexterm>
885 <primary>commands</primary>
887 <secondary>fs setacl</secondary>
888 </indexterm> <indexterm>
889 <primary>fs commands</primary>
891 <secondary>setacl</secondary>
895 % <emphasis role="bold">fs setacl -dir</emphasis> <<replaceable>directory</replaceable>><superscript>+</superscript> <emphasis
896 role="bold">-acl</emphasis> <<replaceable>access list entries</replaceable>><superscript>+</superscript>
899 <para>where <variablelist>
901 <term><emphasis role="bold">sa</emphasis></term>
904 <para>Is an acceptable alias for <emphasis role="bold">setacl</emphasis> (and <emphasis role="bold">seta</emphasis> is
905 the shortest acceptable abbreviation).</para>
910 <term><emphasis role="bold">-dir</emphasis></term>
913 <para>Names one or more directories to which to apply the ACL entries defined by the <emphasis
914 role="bold">-acl</emphasis> argument. Partial pathnames are interpreted relative to the current working directory. You
915 can also use the following notation on its own or as part of a pathname: <variablelist>
917 <term><emphasis role="bold">.</emphasis></term>
920 <para>(A single period). If used by itself, sets the ACL on the current working directory.</para>
925 <term><emphasis role="bold">..</emphasis></term>
928 <para>(Two periods). If used by itself, sets the ACL on the current working directory's parent
934 <term><emphasis role="bold">*</emphasis></term>
937 <para>(The asterisk). Sets the ACL on each of the subdirectories in the current working directory. You must
938 precede it with the <emphasis role="bold">-dir</emphasis> switch, since it potentially designates multiple
939 directories. The <emphasis role="bold">fs</emphasis> command interpreter generates the following error message
940 for each file in the directory: <programlisting>
941 fs: '<replaceable>filename</replaceable>': Not a directory
942 </programlisting></para>
945 </variablelist></para>
947 <para>If you specify only one directory (or file) name, you can omit the <emphasis role="bold">-dir</emphasis> and
948 <emphasis role="bold">-acl</emphasis> switches. For more on omitting switches, see <link linkend="HDRWQ86">Appendix B,
949 OpenAFS Command Syntax and Online Help</link>.</para>
954 <term><emphasis role="bold">-acl</emphasis></term>
957 <para>Specifies one or more ACL entries, each of which pairs a user or group name and a set of permissions. Separate
958 the pairs, and the two parts of each pair, with one or more spaces.</para>
960 <para>To define the permissions, provide either:</para>
964 <para>One or more of the letters that represent the standard or auxiliary permissions (<emphasis
965 role="bold">rlidwka</emphasis> and <emphasis role="bold">ABCDEFGH</emphasis>), in any order</para>
969 <para>One of the four shorthand notations: <itemizedlist>
971 <para><emphasis role="bold">all</emphasis> (equals <emphasis role="bold">rlidwka</emphasis>)</para>
975 <para><emphasis role="bold">none</emphasis> (removes the entry)</para>
979 <para><emphasis role="bold">read</emphasis> (equals <emphasis role="bold">rl</emphasis>)</para>
983 <para><emphasis role="bold">write</emphasis> (equals <emphasis role="bold">rlidwk</emphasis>)</para>
985 </itemizedlist></para>
989 <para>On a single command line, you can combine user and group entries. Also, you can both combine individual letters
990 and use the shorthand notations, but not within a single pair.</para>
993 </variablelist></para>
996 <sect2 id="Header_99">
997 <title>Example: Adding a Single ACL Entry</title>
1000 <primary>examples</primary>
1002 <secondary>adding a user to an ACL</secondary>
1005 <para>Either of the following example commands grants user <emphasis role="bold">pat</emphasis> the <emphasis
1006 role="bold">r</emphasis> and <emphasis role="bold">l</emphasis> permissions on the ACL of the <emphasis
1007 role="bold">notes</emphasis> subdirectory of the current working directory. They illustrate how it is possible to omit the
1008 <emphasis role="bold">-dir</emphasis> and <emphasis role="bold">-acl</emphasis> switches when you name only one
1012 % <emphasis role="bold">fs sa notes pat rl</emphasis>
1013 % <emphasis role="bold">fs sa notes pat read</emphasis>
1017 <sect2 id="Header_100">
1018 <title>Example: Setting Several ACL Entries on One Directory</title>
1020 <para>The following example edits the ACL for the current working directory. It removes the entry for the <emphasis
1021 role="bold">system:anyuser</emphasis> group, and adds two entries: one grants all permissions except <emphasis
1022 role="bold">a</emphasis> to the members of the <emphasis role="bold">terry:colleagues</emphasis> group and the other grants
1023 the <emphasis role="bold">r</emphasis> and <emphasis role="bold">l</emphasis> permissions to the <emphasis
1024 role="bold">system:authuser</emphasis> group.</para>
1027 % <emphasis role="bold">fs sa -dir . -acl system:anyuser none terry:colleagues write</emphasis> \
1028 <emphasis role="bold">system:authuser rl</emphasis>
1032 <sect2 id="HDRWQ56">
1033 <title>To Add, Remove, or Edit Negative ACL Permissions</title>
1036 <primary>creating</primary>
1038 <secondary>ACL entry in negative permissions section</secondary>
1042 <primary>ACL</primary>
1044 <secondary>creating negative entry</secondary>
1048 <primary>adding</primary>
1050 <secondary>ACL entry to negative permissions section</secondary>
1054 <primary>denying access with negative ACL entry</primary>
1058 <primary>directories</primary>
1060 <secondary>denying access</secondary>
1064 <primary>files</primary>
1066 <secondary>denying access</secondary>
1069 <para>Issue the <emphasis role="bold">fs setacl</emphasis> command with the <emphasis role="bold">-negative</emphasis> flag to
1070 edit entries in the negative permissions section of the ACL. To remove an entry, specify the <emphasis
1071 role="bold">none</emphasis> shorthand as the permissions. If an ACL entry already exists for a user or group, the permissions
1072 you specify completely replace those in the existing entry. <indexterm>
1073 <primary>fs commands</primary>
1075 <secondary>setacl</secondary>
1077 <tertiary>with -negative flag</tertiary>
1078 </indexterm> <indexterm>
1079 <primary>commands</primary>
1081 <secondary>fs setacl</secondary>
1085 % <emphasis role="bold">fs setacl -dir</emphasis> <<replaceable>directory</replaceable>><superscript>+</superscript> <emphasis
1086 role="bold">-acl</emphasis> <<replaceable>access list entries</replaceable>><superscript>+</superscript> <emphasis
1087 role="bold">-negative</emphasis>
1090 <para>where <variablelist>
1092 <term><emphasis role="bold">sa</emphasis></term>
1095 <para>Is an acceptable alias for <emphasis role="bold">setacl</emphasis> (and <emphasis role="bold">seta</emphasis> is
1096 the shortest acceptable abbreviation).</para>
1101 <term><emphasis role="bold">-dir</emphasis></term>
1104 <para>Names one or more directories to which to apply the negative ACL entries defined by the <emphasis
1105 role="bold">-acl</emphasis> argument. For a detailed description of acceptable values, see <link linkend="HDRWQ55">To
1106 Add, Remove, or Edit Normal ACL Permissions</link>.</para>
1111 <term><emphasis role="bold">-acl</emphasis></term>
1114 <para>Specifies one or more ACL entries, each of which pairs a user or group name and a set of permissions. Separate
1115 the pairs, and the two parts of each pair, with one or more spaces. For a detailed description of acceptable values,
1116 see <link linkend="HDRWQ55">To Add, Remove, or Edit Normal ACL Permissions</link>. Keep in mind that the usual meaning
1117 of each permission is reversed.</para>
1122 <term><emphasis role="bold">-negative</emphasis></term>
1125 <para>Places the entries defined by the <emphasis role="bold">-acl</emphasis> argument on the negative permissions
1126 section of the ACL for each directory named by the <emphasis role="bold">-dir</emphasis> argument.</para>
1129 </variablelist></para>
1132 <sect2 id="Header_102">
1133 <title>Example: Setting an Entry in the Negative Permissions Section</title>
1136 <primary>examples</primary>
1138 <secondary>creating entry on negative permissions section of ACL</secondary>
1141 <para>User <emphasis role="bold">terry</emphasis> has granted all access permissions except <emphasis role="bold">a</emphasis>
1142 to the group <emphasis role="bold">terry:team</emphasis> on her <emphasis role="bold">plans</emphasis> subdirectory.</para>
1145 % <emphasis role="bold">cd /afs/abc.com/usr/terry</emphasis>
1146 % <emphasis role="bold">fs listacl plans</emphasis>
1147 Access control list for plans is
1154 <para>However, <emphasis role="bold">terry</emphasis> notices that one of the members of the group, user <emphasis
1155 role="bold">pat</emphasis>, has been making inappropriate changes to files. To prevent this without removing <emphasis
1156 role="bold">pat</emphasis> from the group or changing the permissions for the <emphasis role="bold">terry:team</emphasis>
1157 group, <emphasis role="bold">terry</emphasis> creates an entry on the negative permissions section of the ACL that denies the
1158 <emphasis role="bold">w</emphasis> and <emphasis role="bold">d</emphasis> permissions to <emphasis
1159 role="bold">pat</emphasis>:</para>
1162 % <emphasis role="bold">fs setacl plans pat wd -negative</emphasis>
1163 % <emphasis role="bold">fs listacl plans</emphasis>
1164 Access control list for plans is
1174 <sect2 id="Header_103">
1175 <title>Example: Restoring Access by Removing an Entry from the Negative Permissions Section</title>
1177 <para>In the previous example, user <emphasis role="bold">terry</emphasis> put <emphasis role="bold">pat</emphasis> on the
1178 negative permissions section of ACL for the <emphasis role="bold">plans</emphasis> subdirectory. But the result has been
1179 inconvenient and <emphasis role="bold">pat</emphasis> has promised not to change files any more. To enable <emphasis
1180 role="bold">pat</emphasis> to exercise all permissions granted to the members of the <emphasis
1181 role="bold">terry:team</emphasis> group, <emphasis role="bold">terry</emphasis> removes the entry for <emphasis
1182 role="bold">pat</emphasis> from the negative permissions section of the ACL.</para>
1185 % <emphasis role="bold">fs setacl plans pat none -negative</emphasis>
1186 % <emphasis role="bold">fs listacl plans</emphasis>
1187 Access control list for plans is
1196 <sect1 id="HDRWQ57">
1197 <title>Completely Replacing an ACL</title>
1200 <primary>ACL</primary>
1202 <secondary>replacing all entries</secondary>
1206 <primary>ACL</primary>
1208 <secondary>clearing</secondary>
1212 <primary>replacing</primary>
1214 <secondary>all entries on ACL</secondary>
1218 <primary>erasing all ACL entries</primary>
1222 <primary>clearing all ACL entries</primary>
1226 <primary>removing</primary>
1228 <secondary>all ACL entries</secondary>
1232 <primary>directories</primary>
1234 <secondary>replacing ACL</secondary>
1237 <para>It is sometimes simplest to clear an ACL completely before defining new permissions on it, for instance if the mix of
1238 normal and negative permissions makes it difficult to understand how their interaction affects access to the directory. To clear
1239 an ACL completely while you define new entries, include the <emphasis role="bold">-clear</emphasis> flag on the <emphasis
1240 role="bold">fs setacl</emphasis> command. When you include this flag, you can create entries on either the normal permissions or
1241 the negative permissions section of the ACL, but not on both at once.</para>
1243 <para>Remember to create an entry for yourself. As the owner of the directory, you always have the <emphasis
1244 role="bold">a</emphasis> (<emphasis role="bold">administer</emphasis>) permission required to replace a deleted entry, but the
1245 effects the effects of a missing ACL entry can be confusing enough to make it difficult to realize that the problem is a missing
1246 entry. In particular, the lack of the <emphasis role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>) permission
1247 prevents you from using any shorthand notation in pathnames (such as a period for the current working directory or two periods
1248 for the parent directory).</para>
1250 <sect2 id="Header_105">
1251 <title>To Replace an ACL Completely</title>
1253 <para>Issue the <emphasis role="bold">fs setacl</emphasis> command with the <emphasis role="bold">-clear</emphasis> flag to
1254 clear the ACL completely before setting either normal or negative permissions. Because you need to grant the owner of the
1255 directory all permissions, it is better in most cases to set normal permissions at this point. <indexterm>
1256 <primary>fs commands</primary>
1258 <secondary>setacl</secondary>
1260 <tertiary>completely replacing ACL</tertiary>
1264 % <emphasis role="bold">fs setacl -dir</emphasis> <<replaceable>directory</replaceable>><superscript>+</superscript> <emphasis
1265 role="bold">-acl</emphasis> <<replaceable>access list entries</replaceable>><superscript>+</superscript> <emphasis
1266 role="bold">-clear</emphasis> [<emphasis role="bold">-negative</emphasis>]
1269 <para>where <variablelist>
1271 <term><emphasis role="bold">sa</emphasis></term>
1274 <para>Is an acceptable alias for <emphasis role="bold">setacl</emphasis> (and <emphasis role="bold">seta</emphasis> is
1275 the shortest acceptable abbreviation).</para>
1280 <term><emphasis role="bold">-dir</emphasis></term>
1283 <para>Names one or more directories to which to apply the ACL entries defined by the <emphasis
1284 role="bold">-acl</emphasis> argument. For a detailed description of acceptable values, see <link linkend="HDRWQ55">To
1285 Add, Remove, or Edit Normal ACL Permissions</link>.</para>
1290 <term><emphasis role="bold">-acl</emphasis></term>
1293 <para>Specifies one or more ACL entries, each of which pairs a user or group name and a set of permissions. Separate
1294 the pairs, and the two parts of each pair, with one or more spaces. Remember to grant all permissions to the owner of
1295 the directory. For a detailed description of acceptable values, see <link linkend="HDRWQ55">To Add, Remove, or Edit
1296 Normal ACL Permissions</link>.</para>
1301 <term><emphasis role="bold">-clear</emphasis></term>
1304 <para>Removes all entries from each ACL before creating the entries indicated by the <emphasis
1305 role="bold">-acl</emphasis> argument.</para>
1310 <term><emphasis role="bold">-negative</emphasis></term>
1313 <para>Places the entries defined by the <emphasis role="bold">-acl</emphasis> argument on the negative permissions
1314 section of each ACL.</para>
1317 </variablelist></para>
1320 <sect2 id="Header_106">
1321 <title>Example: Replacing an ACL</title>
1324 <primary>examples</primary>
1326 <secondary>replacing an ACL</secondary>
1329 <para>The following example clears the ACL on the current working directory and creates entries that grant all permissions to
1330 user <emphasis role="bold">terry</emphasis> and all permissions except <emphasis role="bold">a</emphasis> to user <emphasis
1331 role="bold">pat</emphasis>.</para>
1334 % <emphasis role="bold">fs setacl . terry all pat write -clear</emphasis>
1335 % <emphasis role="bold">fs listacl .</emphasis>
1336 Access control list for . is
1344 <sect1 id="HDRWQ58">
1345 <title>Copying ACLs Between Directories</title>
1348 <primary>ACL</primary>
1350 <secondary>copying between directories</secondary>
1354 <primary>creating</primary>
1356 <secondary>ACL as copy of another</secondary>
1360 <primary>copying</primary>
1362 <secondary>ACL between directories</secondary>
1366 <primary>directories</primary>
1368 <secondary>copying ACLs between</secondary>
1371 <para>The <emphasis role="bold">fs copyacl</emphasis> command copies a source directory's ACL to one or more destination
1372 directories. It does not affect the source ACL at all, but changes each destination ACL as follows: <itemizedlist>
1374 <para>If an entry on the source ACL does not exist on the destination ACL, the command copies it to the destination
1379 <para>If an entry on the destination ACL does not also exist on the source ACL, the command does not remove it unless you
1380 include the <emphasis role="bold">-clear</emphasis> flag, which overwrites the destination ACL completely.</para>
1384 <para>If an entry is on both ACLs, the command changes the destination ACL entry to match the source ACL entry.</para>
1386 </itemizedlist></para>
1388 <para>To copy an ACL, you must have the <emphasis role="bold">l</emphasis> permission on the source ACL and the <emphasis
1389 role="bold">a</emphasis> permission on each destination ACL. If you identify the source directory by naming a file in it, you
1390 must also have the <emphasis role="bold">r</emphasis> permission on the source ACL. To display the permissions you have on the
1391 two directories, use the <emphasis role="bold">fs listacl</emphasis> command as described in <link linkend="HDRWQ52">Displaying
1392 an ACL</link>.</para>
1394 <para><emphasis role="bold">Note for AFS/DFS Migration Toolkit users:</emphasis> If the machine on which you issue the <emphasis
1395 role="bold">fs copyacl</emphasis> command is configured for access to a DCE cell's DFS filespace via the AFS/DFS Migration
1396 Toolkit, you can use the command to copy ACLs between DFS files and directories also. The command includes <emphasis
1397 role="bold">-id</emphasis> and <emphasis role="bold">-if</emphasis> flags for altering a DFS directory's Initial Container and
1398 Initial Object ACLs as well as its regular ACL; for details, ask your system administrator. You cannot copy ACLs between AFS and
1399 DFS directories, because they use different ACL formats. The <emphasis role="bold">fs</emphasis> command interpreter ignores the
1400 <emphasis role="bold">-id</emphasis> and <emphasis role="bold">-if</emphasis> flags if you include them when copying AFS
1403 <sect2 id="Header_108">
1404 <title>To Copy an ACL Between Directories</title>
1407 <primary>commands</primary>
1409 <secondary>fs copyacl</secondary>
1413 <primary>fs commands</primary>
1415 <secondary>copyacl</secondary>
1418 <para>Issue the <emphasis role="bold">fs copyacl</emphasis> command to copy a source ACL to the ACL on one or more destination
1422 % <emphasis role="bold">fs copyacl -fromdir</emphasis> <<replaceable>source directory</replaceable>> <emphasis role="bold">-todir</emphasis> <<replaceable>destination directory</replaceable>><superscript>+</superscript> \
1423 [<emphasis role="bold">-clear</emphasis>]
1426 <para>where <variablelist>
1428 <term><emphasis role="bold">co</emphasis></term>
1431 <para>Is the shortest acceptable abbreviation for <emphasis role="bold">copyacl</emphasis>.</para>
1436 <term><emphasis role="bold">-fromdir</emphasis></term>
1439 <para>Names the source directory from which to copy the ACL. Partial pathnames are interpreted relative to the current
1440 working directory. If this argument names a file, the ACL is copied from its directory.</para>
1445 <term><emphasis role="bold">-todir</emphasis></term>
1448 <para>Names each destination directory to which to copy the source ACL. Partial pathnames are interpreted relative to
1449 the current working directory. Filenames are not acceptable.</para>
1454 <term><emphasis role="bold">-clear</emphasis></term>
1457 <para>Completely overwrites each destination directory's ACL with the source ACL.</para>
1460 </variablelist></para>
1463 <sect2 id="Header_109">
1464 <title>Example: Copying an ACL from One Directory to Another</title>
1467 <primary>examples</primary>
1469 <secondary>copying ACL between directories</secondary>
1472 <para>In this example, user <emphasis role="bold">terry</emphasis> copies the ACL from her home directory (the current working
1473 directory) to its <emphasis role="bold">plans</emphasis> subdirectory. She begins by displaying both ACLs.</para>
1476 % <emphasis role="bold">fs listacl . plans</emphasis>
1477 Access list for . is
1482 Access list for plans is
1488 % <emphasis role="bold">fs copyacl -from . -to plans</emphasis>
1490 % <emphasis role="bold">fs listacl . plans</emphasis>
1491 Access list for . is
1496 Access list for plans is
1506 <sect1 id="HDRWQ59">
1507 <title>How AFS Uses the UNIX Mode Bits</title>
1510 <primary>UNIX, differences with AFS</primary>
1512 <secondary>mode bits, interpretation</secondary>
1516 <primary>mode bits (UNIX)</primary>
1518 <secondary>interpretation in AFS</secondary>
1521 <para>Although AFS protects data primarily with ACLs rather than mode bits, it does not ignore the mode bits entirely. An
1522 explanation of how mode bits work in the UNIX file system is outside the scope of this document, and the following discussion
1523 assumes you understand them; if necessary, see your UNIX documentation. Also, the following discussion does not cover the
1524 setuid, setgid or sticky bits. If you need to understand how those bits work on AFS files, see the <emphasis>OpenAFS
1525 Administration Guide</emphasis> or ask your system administrator.</para>
1527 <para>AFS uses the UNIX mode bits in the following way:</para>
1531 <para>It uses the initial bit to distinguish files and directories. This is the bit that appears first in the output from
1532 the <emphasis role="bold">ls -l</emphasis> command and shows the hyphen (<computeroutput>-</computeroutput>) for a file or
1533 the letter <computeroutput>d</computeroutput> for a directory.</para>
1537 <para>It does not use any of the mode bits on a directory. The AFS ACL alone controls directory access.</para>
1541 <para>For a file, the owner (first) set of bits interacts with the ACL entries that apply to the file in the following way.
1542 AFS does not use the group or world (second and third sets) of mode bits at all. <itemizedlist>
1544 <para>If the first <emphasis role="bold">r</emphasis> mode bit is not set, no one (including the owner) can read the
1545 file, no matter what permissions they have on the ACL. If the bit is set, users also need the <emphasis
1546 role="bold">r</emphasis> and <emphasis role="bold">l</emphasis> permissions on the ACL of the file's directory to read
1551 <para>If the first <emphasis role="bold">w</emphasis> mode bit is not set, no one (including the owner) can modify the
1552 file. If the <emphasis role="bold">w</emphasis> bit is set, users also need the <emphasis role="bold">w</emphasis> and
1553 <emphasis role="bold">l</emphasis> permissions on the ACL of the file's directory to modify the file.</para>
1557 <para>There is no ACL permission directly corresponding to the <emphasis role="bold">x</emphasis> mode bit, but to
1558 execute a file stored in AFS, the user must also have the <emphasis role="bold">r</emphasis> and <emphasis
1559 role="bold">l</emphasis> permissions on the ACL of the file's directory.</para>
1561 </itemizedlist></para>
1565 <para>When you issue the UNIX <emphasis role="bold">chmod</emphasis> command on an AFS file or directory, AFS changes the bits
1566 appropriately. To change a file's mode bits, you must have the AFS <emphasis role="bold">w</emphasis> permission on the ACL of
1567 the file's directory. To change a directory's mode bits, you must have the <emphasis role="bold">d</emphasis>, <emphasis
1568 role="bold">i</emphasis>, and <emphasis role="bold">l</emphasis> permissions on its ACL. <indexterm>
1569 <primary>commands</primary>
1571 <secondary>chmod</secondary>
1572 </indexterm> <indexterm>
1573 <primary>chmod command</primary>
1576 <sect2 id="Header_111">
1577 <title>Example: Disabling Write Access for a File</title>
1580 <primary>examples</primary>
1582 <secondary>using chmod</secondary>
1585 <para>Suppose <emphasis role="bold">terry</emphasis> is chairing a committee that is writing a proposal. As each section is
1586 approved, she turns off write access to that file to prevent further changes. For example, the following <emphasis
1587 role="bold">chmod</emphasis> command turns off the <emphasis role="bold">w</emphasis> mode bits on the file <emphasis
1588 role="bold">proposal.chap2</emphasis>. This makes it impossible for anyone to change the file, no matter what permissions are
1589 granted on the directory ACL.</para>
1592 % <emphasis role="bold">chmod -w proposal.chap2</emphasis>
1593 % <emphasis role="bold">ls -l</emphasis>
1594 -rw-r--r-- 1 terry 573 Nov 10 09:57 conclusion
1595 -r--r--r-- 1 terry 573 Nov 15 10:34 intro
1596 -r--r--r-- 1 terry 573 Dec 1 15:07 proposal.chap2
1597 -rw-r--r-- 1 terry 573 Nov 10 09:57 proposal.chap3
1598 -rw-r--r-- 1 terry 573 Nov 10 09:57 proposal.chap4