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>
454 <title>Using the System Groups on ACLs</title>
457 <primary>system groups</primary>
459 <secondary>using on ACLs</secondary>
460 </indexterm> <indexterm>
461 <primary>system:anyuser group</primary>
463 <secondary>using on ACLs</secondary>
464 </indexterm> <indexterm>
465 <primary>system:authuser group</primary>
466 </indexterm> <indexterm>
467 <primary>system:administrators group</primary>
468 </indexterm> AFS defines two <emphasis>system groups</emphasis> that grant access to a large number of users at once when
469 placed on an ACL. However, you cannot control the membership of these groups, so consider carefully what kind of permissions you
470 wish to give them. (You do control the membership of the groups you own; see <link linkend="HDRWQ60">Using Groups</link>.)
473 <term><emphasis role="bold">system:anyuser</emphasis></term>
476 <para>Includes anyone who can access the cell's file tree, including users who have tokens in the local cell, users who
477 have logged in on a local AFS client machine but have not obtained tokens (such as the local superuser <emphasis
478 role="bold">root</emphasis>), and users who have connected to a local machine from outside the cell. Creating an ACL
479 entry for this group is the only way to extend access to AFS users from foreign cells, unless your system administrator
480 creates local authentication accounts for them. <indexterm>
481 <primary>ACL</primary>
483 <secondary>foreign users on</secondary>
489 <term><emphasis role="bold">system:authuser</emphasis></term>
492 <para>Includes all users who have a valid AFS token obtained from the local cell's AFS authentication service.</para>
495 </variablelist></para>
497 <para>The third system group, <emphasis role="bold">system:administrators</emphasis>, includes a small group of administrators
498 who have extensive permissions in the cell. You do not generally need to put this group on your ACLs, because its members always
499 have the <emphasis role="bold">a</emphasis> (<emphasis role="bold">administer</emphasis>) permission on every ACL, even if the
500 group does not appear on it.</para>
502 <sect2 id="Header_90">
503 <title>Enabling Access to Subdirectories</title>
506 <primary>subdirectories, accessing</primary>
510 <primary>access to AFS filespace</primary>
512 <secondary>controlling for subdirectories</secondary>
515 <para>A user must have the <emphasis role="bold">l</emphasis> permission on a directory to access its subdirectories in any
516 way. Even if users have extensive permissions on a subdirectory, they cannot access it if the parent directory's ACL does not
517 grant the <emphasis role="bold">l</emphasis> permission.</para>
519 <para>You can grant the <emphasis role="bold">l</emphasis> permission in one of three ways: grant it to a system group
520 (<emphasis role="bold">system:anyuser</emphasis> or <emphasis role="bold">system:authuser</emphasis>), grant it to individual
521 users, or grant it to one or more groups of users defined by you or other users (see <link linkend="HDRWQ60">Using
522 Groups</link>). Granting the <emphasis role="bold">l</emphasis> permission to the <emphasis
523 role="bold">system:anyuser</emphasis> group is the easiest option and is generally secure because the permission only enables
524 users to list the contents of the directory, not to read the files in it. If you want to enable only locally authenticated
525 users to list a directory's contents, substitute the <emphasis role="bold">system:authuser</emphasis> group for the <emphasis
526 role="bold">system:anyuser</emphasis> group. Your system administrator has possibly already created an entry on your home
527 directory's ACL that grants the <emphasis role="bold">r</emphasis> and <emphasis role="bold">l</emphasis> permissions to the
528 <emphasis role="bold">system:anyuser</emphasis> group.</para>
531 <sect2 id="Header_91">
532 <title>Extending Access to Service Processes</title>
535 <primary>access to AFS filespace</primary>
537 <secondary>enabling for service processes</secondary>
540 <para>It is sometimes necessary to grant more extensive permissions to the <emphasis role="bold">system:anyuser</emphasis>
541 group so that processes that provide printing and mail delivery service can work correctly. For example, printing processes
542 sometimes need the <emphasis role="bold">r</emphasis> permission in addition to the <emphasis role="bold">l</emphasis>
543 permission. A mail delivery process possibly needs the <emphasis role="bold">i</emphasis> permission to place new messages in
544 your mail directory. Your system administrator has probably already created the necessary ACL entries. If you notice an ACL
545 entry for which the purpose is unclear, check with your system administrator before removing it.</para>
549 <title>Extending Access to Users from Foreign Cells</title>
552 <primary>access to AFS filespace</primary>
554 <secondary>enabling for users from foreign cells</secondary>
555 </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
556 <emphasis role="bold">system:anyuser</emphasis> group on an ACL. Remember, however, that such an entry extends access to
557 everyone who can reach your cell, not just the AFS users from foreign cells that you have in mind.</para>
562 <title>Displaying an ACL</title>
565 <primary>ACL</primary>
567 <secondary>displaying</secondary>
571 <primary>displaying</primary>
573 <secondary>ACL entries</secondary>
577 <primary>permissions on ACL</primary>
579 <secondary>displaying</secondary>
582 <para>To display the ACL associated with a file or directory, issue the <emphasis role="bold">fs listacl</emphasis>
585 <para><emphasis role="bold">Note for AFS/DFS Migration Toolkit users:</emphasis> If the machine on which you issue the <emphasis
586 role="bold">fs listacl</emphasis> command is configured to access a DCE cell's DFS filespace via the AFS/DFS Migration Toolkit,
587 you can use the command to display the ACL on DFS files and directories. To display a DFS directory's Initial Container or
588 Initial Object ACL instead of the regular one, include the <emphasis role="bold">fs listacl</emphasis> command's <emphasis
589 role="bold">-id</emphasis> or <emphasis role="bold">-if</emphasis> flag. For more information, ask your system administrator.
590 The <emphasis role="bold">fs</emphasis> command interpreter ignores the <emphasis role="bold">-id</emphasis> and <emphasis
591 role="bold">-if</emphasis> flags if you include them when displaying an AFS ACL.</para>
594 <title>To display an ACL</title>
598 <para>Issue the <emphasis role="bold">fs listacl</emphasis> command. <indexterm>
599 <primary>fs commands</primary>
601 <secondary>listacl</secondary>
602 </indexterm> <indexterm>
603 <primary>commands</primary>
605 <secondary>fs listacl</secondary>
606 </indexterm> <programlisting>
607 % <emphasis role="bold">fs listacl</emphasis> [<<replaceable>dir/file path</replaceable>><superscript>+</superscript>]
608 </programlisting></para>
614 <term><emphasis role="bold">la</emphasis></term>
617 <para>Is an acceptable alias for <emphasis role="bold">listacl</emphasis> (and <emphasis
618 role="bold">lista</emphasis> is the shortest acceptable abbreviation).</para>
623 <term><emphasis role="bold"><replaceable>dir/file path</replaceable></emphasis></term>
626 <para>Names one or more files or directories for which to display the ACL. For a file, the output displays the ACL
627 on its directory. If you omit this argument, the output is for the current working directory. Partial pathnames are
628 interpreted relative to the current working directory. You can also use the following notation on its own or as part
629 of a pathname: <variablelist>
631 <term><emphasis role="bold">.</emphasis></term>
634 <para>(A single period). Specifies the current working directory.</para>
639 <term><emphasis role="bold">..</emphasis></term>
642 <para>(Two periods). Specifies the current working directory's parent directory.</para>
647 <term><emphasis role="bold">*</emphasis></term>
650 <para>(The asterisk). Specifies each file and subdirectory in the current working directory. The ACL
651 displayed for a file is always the same as for its directory, but the ACL for each subdirectory can
655 </variablelist></para>
662 <para>The output for each file or directory specified as <replaceable>dir/file path</replaceable> begins with the following
663 header to identify it:</para>
666 Access list for <replaceable>dir/file path</replaceable> is
669 <para>The <computeroutput>Normal rights</computeroutput> header appears on the next line, followed by lines that each pair a
670 user or group name and a set of permissions. The permissions appear as the single letters defined in <link
671 linkend="HDRWQ46">The AFS ACL Permissions</link>, and always in the order <emphasis role="bold">rlidwka</emphasis>. If there
672 are any negative permissions, the <computeroutput>Negative rights</computeroutput> header appears next, followed by pairs of
673 negative permissions.</para>
675 <para>If the following error message appears instead of an ACL, you do not have the permissions needed to display an ACL. To
676 specify a directory name as the <replaceable>dir/file path</replaceable> argument, you must have the <emphasis
677 role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>) permission on the ACL. To specify a filename, you must also
678 have the <emphasis role="bold">r</emphasis> (<emphasis role="bold">read</emphasis>) permission on its directory's ACL.</para>
681 fs: You don't have the required access permissions on '<replaceable>dir/file path</replaceable>'
685 <sect2 id="Header_95">
686 <title>Example: Displaying the ACL on One Directory</title>
689 <primary>examples</primary>
691 <secondary>displaying ACL for single directory</secondary>
694 <para>The following example displays the ACL on user <emphasis role="bold">terry</emphasis>'s home directory in the ABC
695 Corporation cell:</para>
698 % <emphasis role="bold">fs la /afs/abc.com/usr/terry</emphasis>
699 Access list for /afs/abc.com/usr/terry is
709 <para>where <emphasis role="bold">pat</emphasis>, <emphasis role="bold">terry</emphasis>, and <emphasis
710 role="bold">jones</emphasis> are individual users, <emphasis role="bold">system:authuser</emphasis> is a system group, and
711 <emphasis role="bold">terry:other-dept</emphasis> is a group that <emphasis role="bold">terry</emphasis> owns. The list of
712 normal permissions grants all permissions to <emphasis role="bold">terry</emphasis>, the <emphasis role="bold">rlw</emphasis>
713 permissions to <emphasis role="bold">pat</emphasis>, and the <emphasis role="bold">rl</emphasis> permissions to the members of
714 the <emphasis role="bold">system:authuser</emphasis> group.</para>
716 <para>The list of negative permissions denies the <emphasis role="bold">rl</emphasis> permissions to <emphasis
717 role="bold">jones</emphasis> and the members of the <emphasis role="bold">terry:other-dept</emphasis> group. These entries
718 effectively prevent them from accessing <emphasis role="bold">terry</emphasis>'s home directory in any way; they cancel out
719 the <emphasis role="bold">rl</emphasis> permissions extended to the <emphasis role="bold">system:authuser</emphasis> group,
720 which is the only entry on the normal permissions section of the ACL that possibly applies to them.</para>
723 <sect2 id="Header_96">
724 <title>Example: Displaying the ACLs on Multiple Directories</title>
727 <primary>examples</primary>
729 <secondary>displaying ACLs for multiple directories</secondary>
732 <para>The following example illustrates how you can specify pathnames in different ways, and the appearance of the output for
733 multiple directories. It displays the ACL for three directories: the current working directory (which is a subdirectory of
734 user <emphasis role="bold">terry</emphasis>'s home directory), the home directory for user <emphasis
735 role="bold">pat</emphasis>, and another subdirectory of <emphasis role="bold">terry</emphasis>'s home directory called
736 <emphasis role="bold">plans</emphasis>.</para>
739 % <emphasis role="bold">fs listacl . /afs/abc.com/usr/pat ../plans</emphasis>
744 Access list for /afs/abc.com/usr/pat is
749 Access list for ../plans is
758 <title>Changing an ACL</title>
761 <primary>changing</primary>
763 <secondary>ACLs</secondary>
767 <primary>setting permissions on ACL</primary>
771 <primary>ACL</primary>
773 <secondary>setting</secondary>
777 <primary>permissions on ACL</primary>
779 <secondary>setting</secondary>
782 <para>To add, remove, or edit ACL entries, use the <emphasis role="bold">fs setacl</emphasis> command. By default, the command
783 manipulates entries on the normal permissions section of the ACL. To manipulate entries on the negative permissions section,
784 include the <emphasis role="bold">-negative</emphasis> flag as instructed in <link linkend="HDRWQ56">To Add, Remove, or Edit
785 Negative ACL Permissions</link>.</para>
787 <para>You can change any ACL on which you already have the <emphasis role="bold">a</emphasis> permission. You always have the
788 <emphasis role="bold">a</emphasis> permission on the ACL of every directory that you own, even if you accidentally remove that
789 permission from the ACL. (The <emphasis role="bold">ls -ld</emphasis> command reports a directory's owner.) Your system
790 administrator normally designates you as the owner of your home directory and its subdirectories, and you possibly own other
791 directories also.</para>
793 <para>If an ACL entry already exists for the user or group you specify, then the new permissions completely replace the existing
794 permissions rather than being added to them. In other words, when issuing the <emphasis role="bold">fs setacl</emphasis>
795 command, you must include all permissions that you want to grant to a user or group.</para>
797 <para><emphasis role="bold">Note for AFS/DFS Migration Toolkit users:</emphasis> If the machine on which you issue the <emphasis
798 role="bold">fs setacl</emphasis> command is configured to access a DCE cell's DFS filespace via the AFS/DFS Migration Toolkit,
799 you can use the command to set the ACL on DFS files and directories. To set a DFS directory's Initial Container or Initial
800 Object ACL instead of the regular one, include the <emphasis role="bold">fs setacl</emphasis> command's <emphasis
801 role="bold">-id</emphasis> or <emphasis role="bold">-if</emphasis> flag. For more information, ask your system administrator.
802 The <emphasis role="bold">fs</emphasis> command interpreter ignores the <emphasis role="bold">-id</emphasis> and <emphasis
803 role="bold">-if</emphasis> flags if you include them when setting an AFS ACL.</para>
806 <title>To Add, Remove, or Edit Normal ACL Permissions</title>
809 <primary>creating</primary>
811 <secondary>ACL entry in normal permissions section</secondary>
815 <primary>ACL</primary>
817 <secondary>creating normal entry</secondary>
821 <primary>adding</primary>
823 <secondary>ACL entry to normal permissions section</secondary>
827 <primary>granting access to AFS filespace</primary>
831 <primary>access to AFS filespace</primary>
833 <secondary>ACL entries control</secondary>
837 <primary>directories</primary>
839 <secondary>granting access</secondary>
843 <primary>files</primary>
845 <secondary>granting access</secondary>
848 <para>Issue the <emphasis role="bold">fs setacl</emphasis> command to edit entries in the normal permissions section of the
849 ACL. To remove an entry, specify the <emphasis role="bold">none</emphasis> shorthand as the permissions. If an ACL entry
850 already exists for a user or group, the permissions you specify completely replace those in the existing entry. <indexterm>
851 <primary>commands</primary>
853 <secondary>fs setacl</secondary>
854 </indexterm> <indexterm>
855 <primary>fs commands</primary>
857 <secondary>setacl</secondary>
861 % <emphasis role="bold">fs setacl -dir</emphasis> <<replaceable>directory</replaceable>><superscript>+</superscript> <emphasis
862 role="bold">-acl</emphasis> <<replaceable>access list entries</replaceable>><superscript>+</superscript>
865 <para>where <variablelist>
867 <term><emphasis role="bold">sa</emphasis></term>
870 <para>Is an acceptable alias for <emphasis role="bold">setacl</emphasis> (and <emphasis role="bold">seta</emphasis> is
871 the shortest acceptable abbreviation).</para>
876 <term><emphasis role="bold">-dir</emphasis></term>
879 <para>Names one or more directories to which to apply the ACL entries defined by the <emphasis
880 role="bold">-acl</emphasis> argument. Partial pathnames are interpreted relative to the current working directory. You
881 can also use the following notation on its own or as part of a pathname: <variablelist>
883 <term><emphasis role="bold">.</emphasis></term>
886 <para>(A single period). If used by itself, sets the ACL on the current working directory.</para>
891 <term><emphasis role="bold">..</emphasis></term>
894 <para>(Two periods). If used by itself, sets the ACL on the current working directory's parent
900 <term><emphasis role="bold">*</emphasis></term>
903 <para>(The asterisk). Sets the ACL on each of the subdirectories in the current working directory. You must
904 precede it with the <emphasis role="bold">-dir</emphasis> switch, since it potentially designates multiple
905 directories. The <emphasis role="bold">fs</emphasis> command interpreter generates the following error message
906 for each file in the directory: <programlisting>
907 fs: '<replaceable>filename</replaceable>': Not a directory
908 </programlisting></para>
911 </variablelist></para>
913 <para>If you specify only one directory (or file) name, you can omit the <emphasis role="bold">-dir</emphasis> and
914 <emphasis role="bold">-acl</emphasis> switches. For more on omitting switches, see <link linkend="HDRWQ86">Appendix B,
915 OpenAFS Command Syntax and Online Help</link>.</para>
920 <term><emphasis role="bold">-acl</emphasis></term>
923 <para>Specifies one or more ACL entries, each of which pairs a user or group name and a set of permissions. Separate
924 the pairs, and the two parts of each pair, with one or more spaces.</para>
926 <para>To define the permissions, provide either:</para>
930 <para>One or more of the letters that represent the standard or auxiliary permissions (<emphasis
931 role="bold">rlidwka</emphasis> and <emphasis role="bold">ABCDEFGH</emphasis>), in any order</para>
935 <para>One of the four shorthand notations: <itemizedlist>
937 <para><emphasis role="bold">all</emphasis> (equals <emphasis role="bold">rlidwka</emphasis>)</para>
941 <para><emphasis role="bold">none</emphasis> (removes the entry)</para>
945 <para><emphasis role="bold">read</emphasis> (equals <emphasis role="bold">rl</emphasis>)</para>
949 <para><emphasis role="bold">write</emphasis> (equals <emphasis role="bold">rlidwk</emphasis>)</para>
951 </itemizedlist></para>
955 <para>On a single command line, you can combine user and group entries. Also, you can both combine individual letters
956 and use the shorthand notations, but not within a single pair.</para>
959 </variablelist></para>
962 <sect2 id="Header_99">
963 <title>Example: Adding a Single ACL Entry</title>
966 <primary>examples</primary>
968 <secondary>adding a user to an ACL</secondary>
971 <para>Either of the following example commands grants user <emphasis role="bold">pat</emphasis> the <emphasis
972 role="bold">r</emphasis> and <emphasis role="bold">l</emphasis> permissions on the ACL of the <emphasis
973 role="bold">notes</emphasis> subdirectory of the current working directory. They illustrate how it is possible to omit the
974 <emphasis role="bold">-dir</emphasis> and <emphasis role="bold">-acl</emphasis> switches when you name only one
978 % <emphasis role="bold">fs sa notes pat rl</emphasis>
979 % <emphasis role="bold">fs sa notes pat read</emphasis>
983 <sect2 id="Header_100">
984 <title>Example: Setting Several ACL Entries on One Directory</title>
986 <para>The following example edits the ACL for the current working directory. It removes the entry for the <emphasis
987 role="bold">system:anyuser</emphasis> group, and adds two entries: one grants all permissions except <emphasis
988 role="bold">a</emphasis> to the members of the <emphasis role="bold">terry:colleagues</emphasis> group and the other grants
989 the <emphasis role="bold">r</emphasis> and <emphasis role="bold">l</emphasis> permissions to the <emphasis
990 role="bold">system:authuser</emphasis> group.</para>
993 % <emphasis role="bold">fs sa -dir . -acl system:anyuser none terry:colleagues write</emphasis> \
994 <emphasis role="bold">system:authuser rl</emphasis>
999 <title>To Add, Remove, or Edit Negative ACL Permissions</title>
1002 <primary>creating</primary>
1004 <secondary>ACL entry in negative permissions section</secondary>
1008 <primary>ACL</primary>
1010 <secondary>creating negative entry</secondary>
1014 <primary>adding</primary>
1016 <secondary>ACL entry to negative permissions section</secondary>
1020 <primary>denying access with negative ACL entry</primary>
1024 <primary>directories</primary>
1026 <secondary>denying access</secondary>
1030 <primary>files</primary>
1032 <secondary>denying access</secondary>
1035 <para>Issue the <emphasis role="bold">fs setacl</emphasis> command with the <emphasis role="bold">-negative</emphasis> flag to
1036 edit entries in the negative permissions section of the ACL. To remove an entry, specify the <emphasis
1037 role="bold">none</emphasis> shorthand as the permissions. If an ACL entry already exists for a user or group, the permissions
1038 you specify completely replace those in the existing entry. <indexterm>
1039 <primary>fs commands</primary>
1041 <secondary>setacl</secondary>
1043 <tertiary>with -negative flag</tertiary>
1044 </indexterm> <indexterm>
1045 <primary>commands</primary>
1047 <secondary>fs setacl</secondary>
1051 % <emphasis role="bold">fs setacl -dir</emphasis> <<replaceable>directory</replaceable>><superscript>+</superscript> <emphasis
1052 role="bold">-acl</emphasis> <<replaceable>access list entries</replaceable>><superscript>+</superscript> <emphasis
1053 role="bold">-negative</emphasis>
1056 <para>where <variablelist>
1058 <term><emphasis role="bold">sa</emphasis></term>
1061 <para>Is an acceptable alias for <emphasis role="bold">setacl</emphasis> (and <emphasis role="bold">seta</emphasis> is
1062 the shortest acceptable abbreviation).</para>
1067 <term><emphasis role="bold">-dir</emphasis></term>
1070 <para>Names one or more directories to which to apply the negative ACL entries defined by the <emphasis
1071 role="bold">-acl</emphasis> argument. For a detailed description of acceptable values, see <link linkend="HDRWQ55">To
1072 Add, Remove, or Edit Normal ACL Permissions</link>.</para>
1077 <term><emphasis role="bold">-acl</emphasis></term>
1080 <para>Specifies one or more ACL entries, each of which pairs a user or group name and a set of permissions. Separate
1081 the pairs, and the two parts of each pair, with one or more spaces. For a detailed description of acceptable values,
1082 see <link linkend="HDRWQ55">To Add, Remove, or Edit Normal ACL Permissions</link>. Keep in mind that the usual meaning
1083 of each permission is reversed.</para>
1088 <term><emphasis role="bold">-negative</emphasis></term>
1091 <para>Places the entries defined by the <emphasis role="bold">-acl</emphasis> argument on the negative permissions
1092 section of the ACL for each directory named by the <emphasis role="bold">-dir</emphasis> argument.</para>
1095 </variablelist></para>
1098 <sect2 id="Header_102">
1099 <title>Example: Setting an Entry in the Negative Permissions Section</title>
1102 <primary>examples</primary>
1104 <secondary>creating entry on negative permissions section of ACL</secondary>
1107 <para>User <emphasis role="bold">terry</emphasis> has granted all access permissions except <emphasis role="bold">a</emphasis>
1108 to the group <emphasis role="bold">terry:team</emphasis> on her <emphasis role="bold">plans</emphasis> subdirectory.</para>
1111 % <emphasis role="bold">cd /afs/abc.com/usr/terry</emphasis>
1112 % <emphasis role="bold">fs listacl plans</emphasis>
1113 Access control list for plans is
1120 <para>However, <emphasis role="bold">terry</emphasis> notices that one of the members of the group, user <emphasis
1121 role="bold">pat</emphasis>, has been making inappropriate changes to files. To prevent this without removing <emphasis
1122 role="bold">pat</emphasis> from the group or changing the permissions for the <emphasis role="bold">terry:team</emphasis>
1123 group, <emphasis role="bold">terry</emphasis> creates an entry on the negative permissions section of the ACL that denies the
1124 <emphasis role="bold">w</emphasis> and <emphasis role="bold">d</emphasis> permissions to <emphasis
1125 role="bold">pat</emphasis>:</para>
1128 % <emphasis role="bold">fs setacl plans pat wd -negative</emphasis>
1129 % <emphasis role="bold">fs listacl plans</emphasis>
1130 Access control list for plans is
1140 <sect2 id="Header_103">
1141 <title>Example: Restoring Access by Removing an Entry from the Negative Permissions Section</title>
1143 <para>In the previous example, user <emphasis role="bold">terry</emphasis> put <emphasis role="bold">pat</emphasis> on the
1144 negative permissions section of ACL for the <emphasis role="bold">plans</emphasis> subdirectory. But the result has been
1145 inconvenient and <emphasis role="bold">pat</emphasis> has promised not to change files any more. To enable <emphasis
1146 role="bold">pat</emphasis> to exercise all permissions granted to the members of the <emphasis
1147 role="bold">terry:team</emphasis> group, <emphasis role="bold">terry</emphasis> removes the entry for <emphasis
1148 role="bold">pat</emphasis> from the negative permissions section of the ACL.</para>
1151 % <emphasis role="bold">fs setacl plans pat none -negative</emphasis>
1152 % <emphasis role="bold">fs listacl plans</emphasis>
1153 Access control list for plans is
1162 <sect1 id="HDRWQ57">
1163 <title>Completely Replacing an ACL</title>
1166 <primary>ACL</primary>
1168 <secondary>replacing all entries</secondary>
1172 <primary>ACL</primary>
1174 <secondary>clearing</secondary>
1178 <primary>replacing</primary>
1180 <secondary>all entries on ACL</secondary>
1184 <primary>erasing all ACL entries</primary>
1188 <primary>clearing all ACL entries</primary>
1192 <primary>removing</primary>
1194 <secondary>all ACL entries</secondary>
1198 <primary>directories</primary>
1200 <secondary>replacing ACL</secondary>
1203 <para>It is sometimes simplest to clear an ACL completely before defining new permissions on it, for instance if the mix of
1204 normal and negative permissions makes it difficult to understand how their interaction affects access to the directory. To clear
1205 an ACL completely while you define new entries, include the <emphasis role="bold">-clear</emphasis> flag on the <emphasis
1206 role="bold">fs setacl</emphasis> command. When you include this flag, you can create entries on either the normal permissions or
1207 the negative permissions section of the ACL, but not on both at once.</para>
1209 <para>Remember to create an entry for yourself. As the owner of the directory, you always have the <emphasis
1210 role="bold">a</emphasis> (<emphasis role="bold">administer</emphasis>) permission required to replace a deleted entry, but the
1211 effects the effects of a missing ACL entry can be confusing enough to make it difficult to realize that the problem is a missing
1212 entry. In particular, the lack of the <emphasis role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>) permission
1213 prevents you from using any shorthand notation in pathnames (such as a period for the current working directory or two periods
1214 for the parent directory).</para>
1216 <sect2 id="Header_105">
1217 <title>To Replace an ACL Completely</title>
1219 <para>Issue the <emphasis role="bold">fs setacl</emphasis> command with the <emphasis role="bold">-clear</emphasis> flag to
1220 clear the ACL completely before setting either normal or negative permissions. Because you need to grant the owner of the
1221 directory all permissions, it is better in most cases to set normal permissions at this point. <indexterm>
1222 <primary>fs commands</primary>
1224 <secondary>setacl</secondary>
1226 <tertiary>completely replacing ACL</tertiary>
1230 % <emphasis role="bold">fs setacl -dir</emphasis> <<replaceable>directory</replaceable>><superscript>+</superscript> <emphasis
1231 role="bold">-acl</emphasis> <<replaceable>access list entries</replaceable>><superscript>+</superscript> <emphasis
1232 role="bold">-clear</emphasis> [<emphasis role="bold">-negative</emphasis>]
1235 <para>where <variablelist>
1237 <term><emphasis role="bold">sa</emphasis></term>
1240 <para>Is an acceptable alias for <emphasis role="bold">setacl</emphasis> (and <emphasis role="bold">seta</emphasis> is
1241 the shortest acceptable abbreviation).</para>
1246 <term><emphasis role="bold">-dir</emphasis></term>
1249 <para>Names one or more directories to which to apply the ACL entries defined by the <emphasis
1250 role="bold">-acl</emphasis> argument. For a detailed description of acceptable values, see <link linkend="HDRWQ55">To
1251 Add, Remove, or Edit Normal ACL Permissions</link>.</para>
1256 <term><emphasis role="bold">-acl</emphasis></term>
1259 <para>Specifies one or more ACL entries, each of which pairs a user or group name and a set of permissions. Separate
1260 the pairs, and the two parts of each pair, with one or more spaces. Remember to grant all permissions to the owner of
1261 the directory. For a detailed description of acceptable values, see <link linkend="HDRWQ55">To Add, Remove, or Edit
1262 Normal ACL Permissions</link>.</para>
1267 <term><emphasis role="bold">-clear</emphasis></term>
1270 <para>Removes all entries from each ACL before creating the entries indicated by the <emphasis
1271 role="bold">-acl</emphasis> argument.</para>
1276 <term><emphasis role="bold">-negative</emphasis></term>
1279 <para>Places the entries defined by the <emphasis role="bold">-acl</emphasis> argument on the negative permissions
1280 section of each ACL.</para>
1283 </variablelist></para>
1286 <sect2 id="Header_106">
1287 <title>Example: Replacing an ACL</title>
1290 <primary>examples</primary>
1292 <secondary>replacing an ACL</secondary>
1295 <para>The following example clears the ACL on the current working directory and creates entries that grant all permissions to
1296 user <emphasis role="bold">terry</emphasis> and all permissions except <emphasis role="bold">a</emphasis> to user <emphasis
1297 role="bold">pat</emphasis>.</para>
1300 % <emphasis role="bold">fs setacl . terry all pat write -clear</emphasis>
1301 % <emphasis role="bold">fs listacl .</emphasis>
1302 Access control list for . is
1310 <sect1 id="HDRWQ58">
1311 <title>Copying ACLs Between Directories</title>
1314 <primary>ACL</primary>
1316 <secondary>copying between directories</secondary>
1320 <primary>creating</primary>
1322 <secondary>ACL as copy of another</secondary>
1326 <primary>copying</primary>
1328 <secondary>ACL between directories</secondary>
1332 <primary>directories</primary>
1334 <secondary>copying ACLs between</secondary>
1337 <para>The <emphasis role="bold">fs copyacl</emphasis> command copies a source directory's ACL to one or more destination
1338 directories. It does not affect the source ACL at all, but changes each destination ACL as follows: <itemizedlist>
1340 <para>If an entry on the source ACL does not exist on the destination ACL, the command copies it to the destination
1345 <para>If an entry on the destination ACL does not also exist on the source ACL, the command does not remove it unless you
1346 include the <emphasis role="bold">-clear</emphasis> flag, which overwrites the destination ACL completely.</para>
1350 <para>If an entry is on both ACLs, the command changes the destination ACL entry to match the source ACL entry.</para>
1352 </itemizedlist></para>
1354 <para>To copy an ACL, you must have the <emphasis role="bold">l</emphasis> permission on the source ACL and the <emphasis
1355 role="bold">a</emphasis> permission on each destination ACL. If you identify the source directory by naming a file in it, you
1356 must also have the <emphasis role="bold">r</emphasis> permission on the source ACL. To display the permissions you have on the
1357 two directories, use the <emphasis role="bold">fs listacl</emphasis> command as described in <link linkend="HDRWQ52">Displaying
1358 an ACL</link>.</para>
1360 <para><emphasis role="bold">Note for AFS/DFS Migration Toolkit users:</emphasis> If the machine on which you issue the <emphasis
1361 role="bold">fs copyacl</emphasis> command is configured for access to a DCE cell's DFS filespace via the AFS/DFS Migration
1362 Toolkit, you can use the command to copy ACLs between DFS files and directories also. The command includes <emphasis
1363 role="bold">-id</emphasis> and <emphasis role="bold">-if</emphasis> flags for altering a DFS directory's Initial Container and
1364 Initial Object ACLs as well as its regular ACL; for details, ask your system administrator. You cannot copy ACLs between AFS and
1365 DFS directories, because they use different ACL formats. The <emphasis role="bold">fs</emphasis> command interpreter ignores the
1366 <emphasis role="bold">-id</emphasis> and <emphasis role="bold">-if</emphasis> flags if you include them when copying AFS
1369 <sect2 id="Header_108">
1370 <title>To Copy an ACL Between Directories</title>
1373 <primary>commands</primary>
1375 <secondary>fs copyacl</secondary>
1379 <primary>fs commands</primary>
1381 <secondary>copyacl</secondary>
1384 <para>Issue the <emphasis role="bold">fs copyacl</emphasis> command to copy a source ACL to the ACL on one or more destination
1388 % <emphasis role="bold">fs copyacl -fromdir</emphasis> <<replaceable>source directory</replaceable>> <emphasis role="bold">-todir</emphasis> <<replaceable>destination directory</replaceable>><superscript>+</superscript> \
1389 [<emphasis role="bold">-clear</emphasis>]
1392 <para>where <variablelist>
1394 <term><emphasis role="bold">co</emphasis></term>
1397 <para>Is the shortest acceptable abbreviation for <emphasis role="bold">copyacl</emphasis>.</para>
1402 <term><emphasis role="bold">-fromdir</emphasis></term>
1405 <para>Names the source directory from which to copy the ACL. Partial pathnames are interpreted relative to the current
1406 working directory. If this argument names a file, the ACL is copied from its directory.</para>
1411 <term><emphasis role="bold">-todir</emphasis></term>
1414 <para>Names each destination directory to which to copy the source ACL. Partial pathnames are interpreted relative to
1415 the current working directory. Filenames are not acceptable.</para>
1420 <term><emphasis role="bold">-clear</emphasis></term>
1423 <para>Completely overwrites each destination directory's ACL with the source ACL.</para>
1426 </variablelist></para>
1429 <sect2 id="Header_109">
1430 <title>Example: Copying an ACL from One Directory to Another</title>
1433 <primary>examples</primary>
1435 <secondary>copying ACL between directories</secondary>
1438 <para>In this example, user <emphasis role="bold">terry</emphasis> copies the ACL from her home directory (the current working
1439 directory) to its <emphasis role="bold">plans</emphasis> subdirectory. She begins by displaying both ACLs.</para>
1442 % <emphasis role="bold">fs listacl . plans</emphasis>
1443 Access list for . is
1448 Access list for plans is
1454 % <emphasis role="bold">fs copyacl -from . -to plans</emphasis>
1456 % <emphasis role="bold">fs listacl . plans</emphasis>
1457 Access list for . is
1462 Access list for plans is
1472 <sect1 id="HDRWQ59">
1473 <title>How AFS Uses the UNIX Mode Bits</title>
1476 <primary>UNIX, differences with AFS</primary>
1478 <secondary>mode bits, interpretation</secondary>
1482 <primary>mode bits (UNIX)</primary>
1484 <secondary>interpretation in AFS</secondary>
1487 <para>Although AFS protects data primarily with ACLs rather than mode bits, it does not ignore the mode bits entirely. An
1488 explanation of how mode bits work in the UNIX file system is outside the scope of this document, and the following discussion
1489 assumes you understand them; if necessary, see your UNIX documentation. Also, the following discussion does not cover the
1490 setuid, setgid or sticky bits. If you need to understand how those bits work on AFS files, see the <emphasis>OpenAFS
1491 Administration Guide</emphasis> or ask your system administrator.</para>
1493 <para>AFS uses the UNIX mode bits in the following way:</para>
1497 <para>It uses the initial bit to distinguish files and directories. This is the bit that appears first in the output from
1498 the <emphasis role="bold">ls -l</emphasis> command and shows the hyphen (<computeroutput>-</computeroutput>) for a file or
1499 the letter <computeroutput>d</computeroutput> for a directory.</para>
1503 <para>It does not use any of the mode bits on a directory. The AFS ACL alone controls directory access.</para>
1507 <para>For a file, the owner (first) set of bits interacts with the ACL entries that apply to the file in the following way.
1508 AFS does not use the group or world (second and third sets) of mode bits at all. <itemizedlist>
1510 <para>If the first <emphasis role="bold">r</emphasis> mode bit is not set, no one (including the owner) can read the
1511 file, no matter what permissions they have on the ACL. If the bit is set, users also need the <emphasis
1512 role="bold">r</emphasis> and <emphasis role="bold">l</emphasis> permissions on the ACL of the file's directory to read
1517 <para>If the first <emphasis role="bold">w</emphasis> mode bit is not set, no one (including the owner) can modify the
1518 file. If the <emphasis role="bold">w</emphasis> bit is set, users also need the <emphasis role="bold">w</emphasis> and
1519 <emphasis role="bold">l</emphasis> permissions on the ACL of the file's directory to modify the file.</para>
1523 <para>There is no ACL permission directly corresponding to the <emphasis role="bold">x</emphasis> mode bit, but to
1524 execute a file stored in AFS, the user must also have the <emphasis role="bold">r</emphasis> and <emphasis
1525 role="bold">l</emphasis> permissions on the ACL of the file's directory.</para>
1527 </itemizedlist></para>
1531 <para>When you issue the UNIX <emphasis role="bold">chmod</emphasis> command on an AFS file or directory, AFS changes the bits
1532 appropriately. To change a file's mode bits, you must have the AFS <emphasis role="bold">w</emphasis> permission on the ACL of
1533 the file's directory. To change a directory's mode bits, you must have the <emphasis role="bold">d</emphasis>, <emphasis
1534 role="bold">i</emphasis>, and <emphasis role="bold">l</emphasis> permissions on its ACL. <indexterm>
1535 <primary>commands</primary>
1537 <secondary>chmod</secondary>
1538 </indexterm> <indexterm>
1539 <primary>chmod command</primary>
1542 <sect2 id="Header_111">
1543 <title>Example: Disabling Write Access for a File</title>
1546 <primary>examples</primary>
1548 <secondary>using chmod</secondary>
1551 <para>Suppose <emphasis role="bold">terry</emphasis> is chairing a committee that is writing a proposal. As each section is
1552 approved, she turns off write access to that file to prevent further changes. For example, the following <emphasis
1553 role="bold">chmod</emphasis> command turns off the <emphasis role="bold">w</emphasis> mode bits on the file <emphasis
1554 role="bold">proposal.chap2</emphasis>. This makes it impossible for anyone to change the file, no matter what permissions are
1555 granted on the directory ACL.</para>
1558 % <emphasis role="bold">chmod -w proposal.chap2</emphasis>
1559 % <emphasis role="bold">ls -l</emphasis>
1560 -rw-r--r-- 1 terry 573 Nov 10 09:57 conclusion
1561 -r--r--r-- 1 terry 573 Nov 15 10:34 intro
1562 -r--r--r-- 1 terry 573 Dec 1 15:07 proposal.chap2
1563 -rw-r--r-- 1 terry 573 Nov 10 09:57 proposal.chap3
1564 -rw-r--r-- 1 terry 573 Nov 10 09:57 proposal.chap4