1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="smbcacls.1">
6 <refentrytitle>smbcacls</refentrytitle>
7 <manvolnum>1</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">User Commands</refmiscinfo>
10 <refmiscinfo class="version">3.6</refmiscinfo>
15 <refname>smbcacls</refname>
16 <refpurpose>Set or get ACLs on an NT file or directory names</refpurpose>
21 <command>smbcacls</command>
22 <arg choice="req">//server/share</arg>
23 <arg choice="req">filename</arg>
24 <arg choice="opt">-D acls</arg>
25 <arg choice="opt">-M acls</arg>
26 <arg choice="opt">-a acls</arg>
27 <arg choice="opt">-S acls</arg>
28 <arg choice="opt">-C name</arg>
29 <arg choice="opt">-G name</arg>
30 <arg choice="opt">--numeric</arg>
31 <arg choice="opt">-t</arg>
32 <arg choice="opt">-U username</arg>
33 <arg choice="opt">-h</arg>
34 <arg choice="opt">-d</arg>
39 <title>DESCRIPTION</title>
41 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
42 <manvolnum>7</manvolnum></citerefentry> suite.</para>
44 <para>The <command>smbcacls</command> program manipulates NT Access Control
45 Lists (ACLs) on SMB file shares. </para>
50 <title>OPTIONS</title>
52 <para>The following options are available to the <command>smbcacls</command> program.
53 The format of ACLs is described in the section ACL FORMAT </para>
58 <term>-a|--add acls</term>
59 <listitem><para>Add the ACLs specified to the ACL list. Existing
60 access control entries are unchanged. </para></listitem>
66 <term>-M|--modify acls</term>
67 <listitem><para>Modify the mask value (permissions) for the ACLs
68 specified on the command line. An error will be printed for each
69 ACL specified that was not already present in the ACL list
76 <term>-D|--delete acls</term>
77 <listitem><para>Delete any ACLs specified on the command line.
78 An error will be printed for each ACL specified that was not
79 already present in the ACL list. </para></listitem>
85 <term>-S|--set acls</term>
86 <listitem><para>This command sets the ACLs on the file with
87 only the ones specified on the command line. All other ACLs are
88 erased. Note that the ACL specified must contain at least a revision,
89 type, owner and group for the call to succeed. </para></listitem>
95 <term>-C|--chown name</term>
96 <listitem><para>The owner of a file or directory can be changed
97 to the name given using the <parameter>-C</parameter> option.
98 The name can be a sid in the form S-1-x-y-z or a name resolved
99 against the server specified in the first argument. </para>
101 <para>This command is a shortcut for -M OWNER:name.
108 <term>-G|--chgrp name</term>
109 <listitem><para>The group owner of a file or directory can
110 be changed to the name given using the <parameter>-G</parameter>
111 option. The name can be a sid in the form S-1-x-y-z or a name
112 resolved against the server specified n the first argument.
115 <para>This command is a shortcut for -M GROUP:name.</para></listitem>
121 <term>--numeric</term>
122 <listitem><para>This option displays all ACL information in numeric
123 format. The default is to convert SIDs to names and ACE types
124 and masks to a readable string format. </para></listitem>
128 <term>-t|--test-args</term>
130 Don't actually do anything, only validate the correctness of
136 &stdarg.server.debug;
138 &popt.common.credentials;
144 <title>ACL FORMAT</title>
146 <para>The format of an ACL is one or more ACL entries separated by
147 either commas or newlines. An ACL entry is one of the following: </para>
149 <para><programlisting>
150 REVISION:<revision number>
151 OWNER:<sid or name>
152 GROUP:<sid or name>
153 ACL:<sid or name>:<type>/<flags>/<mask>
154 </programlisting></para>
157 <para>The revision of the ACL specifies the internal Windows
158 NT ACL revision for the security descriptor.
159 If not specified it defaults to 1. Using values other than 1 may
160 cause strange behaviour. </para>
162 <para>The owner and group specify the owner and group sids for the
163 object. If a SID in the format S-1-x-y-z is specified this is used,
164 otherwise the name specified is resolved using the server on which
165 the file or directory resides. </para>
167 <para>ACLs specify permissions granted to the SID. This SID again
168 can be specified in S-1-x-y-z format or as a name in which case
169 it is resolved against the server on which the file or directory
170 resides. The type, flags and mask values determine the type of
171 access granted to the SID. </para>
173 <para>The type can be either ALLOWED or DENIED to allow/deny access
174 to the SID. The flags values are generally zero for file ACLs and
175 either 9 or 2 for directory ACLs. Some common flags are: </para>
178 <listitem><para><constant>#define SEC_ACE_FLAG_OBJECT_INHERIT 0x1</constant></para></listitem>
179 <listitem><para><constant>#define SEC_ACE_FLAG_CONTAINER_INHERIT 0x2</constant></para></listitem>
180 <listitem><para><constant>#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT 0x4</constant></para></listitem>
181 <listitem><para><constant>#define SEC_ACE_FLAG_INHERIT_ONLY 0x8</constant></para></listitem>
184 <para>At present flags can only be specified as decimal or
185 hexadecimal values.</para>
187 <para>The mask is a value which expresses the access right
188 granted to the SID. It can be given as a decimal or hexadecimal value,
189 or by using one of the following text strings which map to the NT
190 file permissions of the same name. </para>
193 <listitem><para><emphasis>R</emphasis> - Allow read access </para></listitem>
194 <listitem><para><emphasis>W</emphasis> - Allow write access</para></listitem>
195 <listitem><para><emphasis>X</emphasis> - Execute permission on the object</para></listitem>
196 <listitem><para><emphasis>D</emphasis> - Delete the object</para></listitem>
197 <listitem><para><emphasis>P</emphasis> - Change permissions</para></listitem>
198 <listitem><para><emphasis>O</emphasis> - Take ownership</para></listitem>
202 <para>The following combined permissions can be specified:</para>
206 <listitem><para><emphasis>READ</emphasis> - Equivalent to 'RX'
207 permissions</para></listitem>
208 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
210 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO'
211 permissions</para></listitem>
216 <title>EXIT STATUS</title>
218 <para>The <command>smbcacls</command> program sets the exit status
219 depending on the success or otherwise of the operations performed.
220 The exit status may be one of the following values. </para>
222 <para>If the operation succeeded, smbcacls returns and exit
223 status of 0. If <command>smbcacls</command> couldn't connect to the specified server,
224 or there was an error getting or setting the ACLs, an exit status
225 of 1 is returned. If there was an error parsing any command line
226 arguments, an exit status of 2 is returned. </para>
230 <title>VERSION</title>
232 <para>This man page is correct for version 3 of the Samba suite.</para>
236 <title>AUTHOR</title>
238 <para>The original Samba software and related utilities
239 were created by Andrew Tridgell. Samba is now developed
240 by the Samba Team as an Open Source project similar
241 to the way the Linux kernel is developed.</para>
243 <para><command>smbcacls</command> was written by Andrew Tridgell
244 and Tim Potter.</para>
246 <para>The conversion to DocBook for Samba 2.2 was done
247 by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 was done
248 by Alexander Bokovoy.</para>