man-pages/man1/chacl.1.html
2021-03-31 01:06:50 +01:00

224 lines
5.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of CHACL</TITLE>
</HEAD><BODY>
<H1>CHACL</H1>
Section: Access Control Lists (1)<BR>Updated: ACL File Utilities<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
chacl - change the access control list of a file or directory
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>chacl acl pathname...</B>
<BR>
<B>chacl -b acl dacl pathname...</B>
<BR>
<B>chacl -d dacl pathname...</B>
<BR>
<B>chacl -R pathname...</B>
<BR>
<B>chacl -D pathname...</B>
<BR>
<B>chacl -B pathname...</B>
<BR>
<B>chacl -l pathname...</B>
<BR>
<B>chacl -r pathname...</B>
<BR>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<I>chacl</I>
is an IRIX-compatibility command, and is maintained for those
users who are familiar with its use from either XFS or IRIX.
Refer to the
<B>SEE ALSO</B>
section below for a description of tools
which conform more closely to the (withdrawn draft) POSIX 1003.1e
standard which describes Access Control Lists (ACLs).
<P>
<I>chacl</I>
changes the ACL(s) for a file or directory.
The ACL(s) specified are applied to each file in the <TT>pathname</TT> arguments.
<P>
Each ACL is a string which is interpreted using the
<I><A HREF="/cgi-bin/man/man2html?3+acl_from_text">acl_from_text</A></I>(3)
routine.
These strings are made up of comma separated clauses each of which
is of the form, tag:name:perm. Where <TT>tag</TT> can be:
<DL COMPACT>
<DT id="1">&quot;user&quot; (or &quot;u&quot;)<DD>
indicating that the entry is a &quot;user&quot; ACL entry.
<DT id="2">&quot;group&quot; (or &quot;g&quot;)<DD>
indicating that the entry is a &quot;group&quot; ACL entry.
<DT id="3">&quot;other&quot; (or &quot;o&quot;)<DD>
indicating that the entry is an &quot;other&quot; ACL entry.
<DT id="4">&quot;mask&quot; (or &quot;m&quot;)<DD>
indicating that the entry is a &quot;mask&quot; ACL entry.
</DL>
<P>
<TT>name</TT> is a string which is the user or group name for the ACL entry.
A null <TT>name</TT> in a user or group ACL entry indicates the file's
owner or file's group.
<TT>perm</TT> is the string &quot;rwx&quot; where each of the entries may be replaced
by a &quot;-&quot; indicating no access of that type, e.g. &quot;r-x&quot;, &quot;--x&quot;, &quot;---&quot;.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="5"><B>-b</B>
<DD>
Indicates that there are two ACLs to change, the first is the
file access ACL and the second the directory default ACL.
<DT id="6"><B>-d</B>
<DD>
Used to set only the default ACL of a directory.
<DT id="7"><B>-R</B>
<DD>
Removes the file access ACL only.
<DT id="8"><B>-D</B>
<DD>
Removes directory default ACL only.
<DT id="9"><B>-B</B>
<DD>
Remove all ACLs.
<DT id="10"><B>-l</B>
<DD>
Lists the access ACL and possibly the default ACL associated
with the specified files or directories. This option was added
during the Linux port of XFS, and is not IRIX compatible.
<DT id="11"><B>-r</B>
<DD>
Set the access ACL recursively for each subtree rooted at <TT>pathname</TT>(s).
This option was also added during the Linux port of XFS, and is not
compatible with IRIX.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>EXAMPLES</H2>
A minimum ACL:
<P>
<PRE>
<B>chacl u::rwx,g::r-x,o::r-- file</B>
</PRE>
<P>
The file ACL is set so that the file's owner has &quot;rwx&quot;, the file's
group has read and execute, and others have read only access to the file.
<P>
An ACL that is not a minimum ACL, that is, one that specifies
a user or group other than the file's owner or owner's group,
must contain a mask entry:
<P>
<PRE>
<TT>chacl u::rwx,g::r-x,o::r--,u:bob:r--,m::r-x file1 file2</TT>
</PRE>
<P>
To set the default and access ACLs on <TT>newdir</TT> to be the
same as on <TT>olddir</TT>, you could type:
<P>
<PRE>
<TT>chacl -b `chacl -l olddir | \
sed -e 's/.*\[//' -e 's#/# #' -e 's/]$//'` newdir
</TT>
</PRE>
<A NAME="lbAG">&nbsp;</A>
<H2>CAUTIONS</H2>
<I>chacl</I>
can replace the existing ACL. To add or delete entries, you
must first do <TT>chacl -l</TT> to get the existing ACL, and use the output
to form the arguments to
<I>chacl</I>.
<P>
Changing the permission bits of a file will change the file access
ACL settings (see
<I><A HREF="/cgi-bin/man/man2html?1+chmod">chmod</A></I>(1)).
However, file creation mode masks (see
<I><A HREF="/cgi-bin/man/man2html?1+umask">umask</A></I>(1))
will not affect the access ACL settings of files created using directory
default ACLs.
<P>
ACLs are filesystem extended attributes and hence are not typically
archived or restored using the conventional archiving utilities.
See
<I><A HREF="/cgi-bin/man/man2html?5+attr">attr</A></I>(5)
for more information about extended attributes and see
<I><A HREF="/cgi-bin/man/man2html?8+xfsdump">xfsdump</A></I>(8)
for a method of backing them up under XFS.
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+getfacl">getfacl</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+setfacl">setfacl</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+chmod">chmod</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+umask">umask</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?3+acl_from_text">acl_from_text</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?5+acl">acl</A></B>(5), <B><A HREF="/cgi-bin/man/man2html?8+xfsdump">xfsdump</A></B>(8)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="12"><A HREF="#lbAB">NAME</A><DD>
<DT id="13"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="14"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="15"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="16"><A HREF="#lbAF">EXAMPLES</A><DD>
<DT id="17"><A HREF="#lbAG">CAUTIONS</A><DD>
<DT id="18"><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:08 GMT, March 31, 2021
</BODY>
</HTML>