smbd: Simplify callers of notify_filter_string
[Samba.git] / docs-xml / manpages / sharesec.1.xml
blob897adbc74d56414c94e94b89b0bf1fbb64359efe
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="sharesec.1">
5 <refmeta>
6         <refentrytitle>sharesec</refentrytitle>
7         <manvolnum>1</manvolnum>
8         <refmiscinfo class="source">Samba</refmiscinfo>
9         <refmiscinfo class="manual">User Commands</refmiscinfo>
10         <refmiscinfo class="version">&doc.version;</refmiscinfo>
11 </refmeta>
14 <refnamediv>
15         <refname>sharesec</refname>
16         <refpurpose>Set or get share ACLs</refpurpose>
17 </refnamediv>
19 <refsynopsisdiv>
20         <cmdsynopsis>
21                 <command>sharesec</command>
22                 <arg choice="req">sharename</arg>
23                 <arg choice="opt">-r, --remove=ACL</arg>
24                 <arg choice="opt">-m, --modify=ACL</arg>
25                 <arg choice="opt">-a, --add=ACL</arg>
26                 <arg choice="opt">-R, --replace=ACLs</arg>
27                 <arg choice="opt">-D, --delete</arg>
28                 <arg choice="opt">-v, --view</arg>
29                 <arg choice="opt">--view-all</arg>
30                 <arg choice="opt">-M, --machine-sid</arg>
31                 <arg choice="opt">-F, --force</arg>
32                 <arg choice="opt">-d, --debuglevel=DEBUGLEVEL</arg>
33                 <arg choice="opt">-s, --configfile=CONFIGFILE</arg>
34                 <arg choice="opt">-l, --log-basename=LOGFILEBASE</arg>
35                 <arg choice="opt">-S, --setsddl=STRING</arg>
36                 <arg choice="opt">--viewsddl</arg>
37                 <arg choice="opt">-?|--help</arg>
38                 <arg choice="opt">--usage</arg>
39                 <arg choice="opt">-d|--debuglevel=DEBUGLEVEL</arg>
40                 <arg choice="opt">--debug-stdout</arg>
41                 <arg choice="opt">--configfile=CONFIGFILE</arg>
42                 <arg choice="opt">--option=name=value</arg>
43                 <arg choice="opt">-l|--log-basename=LOGFILEBASE</arg>
44                 <arg choice="opt">--leak-report</arg>
45                 <arg choice="opt">--leak-report-full</arg>
46         </cmdsynopsis>
47 </refsynopsisdiv>
49 <refsect1>
50         <title>DESCRIPTION</title>
52         <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
53         <manvolnum>7</manvolnum></citerefentry> suite.</para>
55         <para>The <command>sharesec</command> program manipulates share permissions
56         on SMB file shares.</para>
57 </refsect1>
60 <refsect1>
61         <title>OPTIONS</title>
63         <para>The following options are available to the <command>sharesec</command> program.
64         The format of ACLs is described in the section ACL FORMAT </para>
66         <variablelist>
67                 <varlistentry>
68                 <term>-a|--add=ACL</term>
69                 <listitem><para>Add the ACEs specified to the ACL list.
70                 </para></listitem>
71                 </varlistentry>
73                 <varlistentry>
74                 <term>-D|--delete</term>
75                 <listitem><para>Delete the entire security descriptor.
76                 </para></listitem>
77                 </varlistentry>
79                 <varlistentry>
80                 <term>-F|--force</term>
81                 <listitem><para>Force storing the ACL.
82                 </para></listitem>
83                 </varlistentry>
85                 <varlistentry>
86                 <term>-m|--modify=ACL</term>
87                 <listitem><para>Modify existing ACEs.
88                 </para></listitem>
89                 </varlistentry>
91                 <varlistentry>
92                 <term>-M|--machine-sid</term>
93                 <listitem><para>Initialize the machine SID.
94                 </para></listitem>
95                 </varlistentry>
97                 <varlistentry>
98                 <term>-r|--remove=ACL</term>
99                 <listitem><para>Remove ACEs.
100                 </para></listitem>
101                 </varlistentry>
103                 <varlistentry>
104                 <term>-R|--replace=ACLS</term>
105                 <listitem><para>
106                 Overwrite an existing share permission ACL.
107                 </para></listitem>
108                 </varlistentry>
110                 <varlistentry>
111                 <term>-v|--view</term>
112                 <listitem><para>
113                 List a share acl
114                 </para></listitem>
115                 </varlistentry>
117                 <varlistentry>
118                 <term>--view-all</term>
119                 <listitem><para>
120                 List all share acls
121                 </para></listitem>
122                 </varlistentry>
124                 <varlistentry>
125                 <term>-S|--setsddl=STRING</term>
126                 <listitem><para>
127                 Set security descriptor by providing ACL in SDDL format.
128                 </para></listitem>
129                 </varlistentry>
131                 <varlistentry>
132                 <term>--viewsddl</term>
133                 <listitem><para>
134                 List a share acl in SDDL format.
135                 </para></listitem>
136                 </varlistentry>
138                 &popt.autohelp;
139                 &cmdline.common.samba.client;
140         </variablelist>
141 </refsect1>
144 <refsect1>
145         <title>ACL FORMAT</title>
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>
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>
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
163         the object. Share ACLs do not specify an owner or a group, so
164         these fields are empty.</para>
166         <para>ACLs specify permissions granted to the SID. This SID
167         can be specified in S-1-x-y-z format or as a name in which case
168         it is resolved against the server on which the file or directory
169         resides.  The type, flags and mask values determine the type of
170         access granted to the SID.</para>
172         <para>The type can be either ALLOWED or DENIED to allow/deny access
173         to the SID. The flags values are generally zero for share ACLs.
174         </para>
176         <para>The mask is a value which expresses the access right
177         granted to the SID. It can be given as a decimal or hexadecimal value,
178         or by using one of the following text strings which map to the NT
179         file permissions of the same name.</para>
181         <itemizedlist>
182                 <listitem><para><emphasis>R</emphasis> - Allow read access </para></listitem>
183                 <listitem><para><emphasis>W</emphasis> - Allow write access</para></listitem>
184                 <listitem><para><emphasis>X</emphasis> - Execute permission on the object</para></listitem>
185                 <listitem><para><emphasis>D</emphasis> - Delete the object</para></listitem>
186                 <listitem><para><emphasis>P</emphasis> - Change permissions</para></listitem>
187                 <listitem><para><emphasis>O</emphasis> - Take ownership</para></listitem>
188         </itemizedlist>
190         <para>The following combined permissions can be specified:</para>
192         <itemizedlist>
193                 <listitem><para><emphasis>READ</emphasis> -  Equivalent to 'RX'
194                 permissions</para></listitem>
195                 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
196                 </para></listitem>
197                 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO'
198                 permissions</para></listitem>
199         </itemizedlist>
200         </refsect1>
202 <refsect1>
203         <title>EXIT STATUS</title>
205         <para>The <command>sharesec</command> program sets the exit status
206         depending on the success or otherwise of the operations performed.
207         The exit status may be one of the following values. </para>
209         <para>If the operation succeeded, sharesec returns and exit
210         status of 0.  If <command>sharesec</command> couldn't connect to the specified server,
211         or there was an error getting or setting the ACLs, an exit status
212         of 1 is returned.  If there was an error parsing any command line
213         arguments, an exit status of 2 is returned. </para>
214 </refsect1>
216 <refsect1>
217         <title>EXAMPLES</title>
219         <para>Add full access for SID
220         <parameter>S-1-5-21-1866488690-1365729215-3963860297-17724</parameter> on
221         <parameter>share</parameter>:
222         </para>
224         <programlisting>
225         host:~ # sharesec share -a S-1-5-21-1866488690-1365729215-3963860297-17724:ALLOWED/0/FULL
226         </programlisting>
228         <para>List all ACEs for <parameter>share</parameter>:
229         </para>
231         <programlisting>
232         host:~ # sharesec share -v
233         REVISION:1
234         CONTROL:SR|DP
235         OWNER:
236         GROUP:
237         ACL:S-1-1-0:ALLOWED/0x0/FULL
238         ACL:S-1-5-21-1866488690-1365729215-3963860297-17724:ALLOWED/0x0/FULL
239         </programlisting>
240 </refsect1>
242 <refsect1>
243         <title>VERSION</title>
245         <para>This man page is part of version &doc.version; of the Samba suite.</para>
246 </refsect1>
248 <refsect1>
249         <title>AUTHOR</title>
250         <para>The original Samba software and related utilities
251         were created by Andrew Tridgell. Samba is now developed
252         by the Samba Team as an Open Source project similar
253         to the way the Linux kernel is developed.</para>
254 </refsect1>
256 </refentry>