This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[samba.git] / docs / docbook / manpages / smbcacls.1.sgml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
2 <refentry id="smbcacls">
3
4 <refmeta>
5         <refentrytitle>smbcacls</refentrytitle>
6         <manvolnum>1</manvolnum>
7 </refmeta>
8
9
10 <refnamediv>
11         <refname>smbcacls</refname>
12         <refpurpose>Set or get ACLs on an NT file or directory names</refpurpose>
13 </refnamediv>
14
15 <refsynopsisdiv>
16         <cmdsynopsis>
17                 <command>smbcacls</command>
18                 <arg choice="req">//server/share</arg>
19                 <arg choice="req">filename</arg>
20                 <arg choice="opt">-U username</arg>
21                 <arg choice="opt">-A acls</arg>
22                 <arg choice="opt">-M acls</arg>
23                 <arg choice="opt">-D acls</arg>
24                 <arg choice="opt">-S acls</arg>
25                 <arg choice="opt">-C name</arg>
26                 <arg choice="opt">-G name</arg>
27                 <arg choice="opt">-n</arg>
28                 <arg choice="opt">-h</arg>
29         </cmdsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33         <title>DESCRIPTION</title>
34
35         <para>This tool is part of the <ulink url="samba.7.html">
36         Samba</ulink> suite.</para>
37         
38         <para>The <command>smbcacls</command> program manipulates NT Access Control Lists 
39         (ACLs) on SMB file shares. </para>
40 </refsect1>
41
42
43 <refsect1>
44         <title>OPTIONS</title>
45
46         <para>The following options are available to the <command>smbcacls</command> program.  
47         The format of ACLs is described in the section ACL FORMAT </para>
48
49
50         <variablelist>
51                 <varlistentry>
52                 <term>-A acls</term>
53                 <listitem><para>Add the ACLs specified to the ACL list.  Existing 
54                 access control entries are unchanged. </para></listitem>
55                 </varlistentry>
56                 
57                 
58                 
59                 <varlistentry>
60                 <term>-M acls</term>
61                 <listitem><para>Modify the mask value (permissions) for the ACLs 
62                 specified on the command line.  An error will be printed for each 
63                 ACL specified that was not already present in the ACL list
64                 </para></listitem>
65                 </varlistentry>
66                 
67                 
68                 
69                 <varlistentry>
70                 <term>-D acls</term>
71                 <listitem><para>Delete any ACLs specified on the command line.  
72                 An error will be printed for each ACL specified that was not 
73                 already present in the ACL list. </para></listitem>
74                 </varlistentry>
75                 
76                 
77                 
78                 <varlistentry>
79                 <term>-S acls</term>
80                 <listitem><para>This command sets the ACLs on the file with 
81                 only the ones specified on the command line.  All other ACLs are 
82                 erased.  Note that the ACL specified must contain at least a revision, 
83                 type, owner and group for the call to succeed. </para></listitem>
84                 </varlistentry>
85                 
86                 
87                 
88                 <varlistentry>
89                 <term>-U username</term>
90                 <listitem><para>Specifies a username used to connect to the 
91                 specified service.  The username may be of the form "username" in 
92                 which case the user is prompted to enter in a password and the 
93                 workgroup specified in the <filename>smb.conf</filename> file is 
94                 used, or "username%password"  or "DOMAIN\username%password" and the 
95                 password and workgroup names are used as provided. </para></listitem>
96                 </varlistentry>
97                 
98                 
99                 
100                 <varlistentry>
101                 <term>-C name</term>
102                 <listitem><para>The owner of a file or directory can be changed 
103                 to the name given using the <parameter>-C</parameter> option.  
104                 The name can be a sid in the form S-1-x-y-z or a name resolved 
105                 against the server specified in the first argument. </para>
106                 
107                 <para>This command is a shortcut for -M OWNER:name. 
108                 </para></listitem>
109                 </varlistentry>
110                 
111                 
112                 
113                 <varlistentry>
114                 <term>-G name</term>
115                 <listitem><para>The group owner of a file or directory can 
116                 be changed to the name given using the <parameter>-G</parameter> 
117                 option.  The name can be a sid in the form S-1-x-y-z or a name 
118                 resolved against the server specified n the first argument.
119                 </para>
120                 
121                 <para>This command is a shortcut for -M GROUP:name.</para></listitem>
122                 </varlistentry>
123                 
124                 
125                 
126                 <varlistentry>
127                 <term>-n</term>
128                 <listitem><para>This option displays all ACL information in numeric 
129                 format.  The default is to convert SIDs to names and ACE types 
130                 and masks to a readable string format.  </para></listitem>
131                 </varlistentry>
132                 
133                 
134                 
135                 <varlistentry>
136                 <term>-h</term>
137                 <listitem><para>Print usage information on the <command>smbcacls
138                 </command> program.</para></listitem>
139                 </varlistentry>
140         </variablelist>
141 </refsect1>
142
143
144 <refsect1>
145         <title>ACL FORMAT</title>
146
147         <para>The format of an ACL is one or more ACL entries separated by 
148         either commas or newlines.  An ACL entry is one of the following: </para>
149
150         <para><programlisting> 
151 REVISION:&lt;revision number&gt;
152 OWNER:&lt;sid or name&gt;
153 GROUP:&lt;sid or name&gt;
154 ACL:&lt;sid or name&gt;:&lt;type&gt;/&lt;flags&gt;/&lt;mask&gt;
155         </programlisting></para>
156   
157
158         <para>The revision of the ACL specifies the internal Windows 
159         NT ACL revision for the security descriptor.  
160         If not specified it defaults to 1.  Using values other than 1 may 
161         cause strange behaviour. </para>
162
163         <para>The owner and group specify the owner and group sids for the 
164         object.  If a SID in the format CWS-1-x-y-z is specified this is used, 
165         otherwise the name specified is resolved using the server on which 
166         the file or directory resides. </para>
167
168                 <para>ACLs specify permissions granted to the SID.  This SID again 
169                 can be specified in CWS-1-x-y-z format or as a name in which case 
170                 it is resolved against the server on which the file or directory 
171                 resides.  The type, flags and mask values determine the type of 
172                 access granted to the SID. </para>
173
174                 <para>The type can be either 0 or 1 corresponding to ALLOWED or 
175                 DENIED access to the SID.  The flags values are generally
176                 zero for file ACLs and either 9 or 2 for directory ACLs.  Some 
177                 common flags are: </para>
178
179                 <itemizedlist> 
180                         <listitem><para>#define SEC_ACE_FLAG_OBJECT_INHERIT             0x1</para></listitem>
181                         <listitem><para>#define SEC_ACE_FLAG_CONTAINER_INHERIT          0x2</para></listitem>
182                         <listitem><para>#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT       0x4
183                         </para></listitem>
184                         <listitem><para>#define SEC_ACE_FLAG_INHERIT_ONLY               0x8</para>
185                         </listitem>
186         </itemizedlist>
187   
188         <para>At present flags can only be specified as decimal or 
189         hexadecimal values.</para>
190  
191         <para>The mask is a value which expresses the access right 
192         granted to the SID. It can be given as a decimal or hexadecimal value, 
193         or by using one of the following text strings which map to the NT 
194         file permissions of the same name. </para>
195
196         <itemizedlist>
197                 <listitem><para><emphasis>R</emphasis> - Allow read access </para></listitem>
198                 <listitem><para><emphasis>W</emphasis> - Allow write access</para></listitem>
199                 <listitem><para><emphasis>X</emphasis> - Execute permission on the object</para></listitem>
200                 <listitem><para><emphasis>D</emphasis> - Delete the object</para></listitem>
201                 <listitem><para><emphasis>P</emphasis> - Change permissions</para></listitem>
202                 <listitem><para><emphasis>O</emphasis> - Take ownership</para></listitem>
203         </itemizedlist>
204
205
206         <para>The following combined permissions can be specified:</para>
207
208
209         <itemizedlist>
210                 <listitem><para><emphasis>READ</emphasis> -  Equivalent to 'RX'
211                 permissions</para></listitem>
212                 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
213                 </para></listitem>
214                 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO' 
215                 permissions</para></listitem>
216         </itemizedlist>
217         </refsect1>
218
219 <refsect1>
220         <title>EXIT STATUS</title>
221
222         <para>The <command>smbcacls</command> program sets the exit status 
223         depending on the success or otherwise of the operations performed.  
224         The exit status may be one of the following values. </para>
225
226         <para>If the operation succeeded, smbcacls returns and exit 
227         status of 0.  If <command>smbcacls</command> couldn't connect to the specified server, 
228         or there was an error getting or setting the ACLs, an exit status 
229         of 1 is returned.  If there was an error parsing any command line 
230         arguments, an exit status of 2 is returned. </para>
231 </refsect1>
232
233 <refsect1>
234         <title>VERSION</title>
235
236         <para>This man page is correct for version 2.2 of 
237         the Samba suite.</para>
238 </refsect1>
239
240 <refsect1>
241         <title>AUTHOR</title>
242         
243         <para>The original Samba software and related utilities 
244         were created by Andrew Tridgell. Samba is now developed
245         by the Samba Team as an Open Source project similar 
246         to the way the Linux kernel is developed.</para>
247         
248         <para><command>smbcacls</command> was written by Andrew Tridgell 
249         and Tim Potter.</para>
250         
251         <para>The conversion to DocBook for Samba 2.2 was done 
252         by Gerald Carter</para>
253 </refsect1>
254
255 </refentry>