Patch from metze to update VFS docs to include notes on multiple instances
[bbaumbach/samba-autobuild/.git] / docs / docbook / projdoc / VFS.xml
1 <chapter id="VFS">
2 <chapterinfo>
3         &author.jelmer;
4         &author.jht;
5         <author><firstname>Tim</firstname><surname>Potter</surname></author>
6         <author><firstname>Simo</firstname><surname>Sorce</surname><contrib>original vfs_skel README</contrib></author>
7         <author><firstname>Alexander</firstname><surname>Bokovoy</surname><contrib>original vfs_netatalk docs</contrib></author>
8         <author><firstname>Stefan</firstname><surname>Metzmacher</surname><contrib>Update for multiple modules</contrib></author>
9 </chapterinfo>
10 <title>Stackable VFS modules</title>
11
12 <sect1>
13 <title>Features and Benefits</title>
14
15 <para>
16 Since Samba-3, there is support for stackable VFS(Virtual File System) modules.  
17 Samba passes each request to access the unix file system thru the loaded VFS modules. 
18 This chapter covers all the modules that come with the samba source and references to 
19 some external modules.
20 </para>
21
22
23 </sect1>
24
25 <sect1>
26 <title>Discussion</title>
27
28 <para>
29 If not supplied with your platform distribution binary Samba package you may have problems
30 to compile these modules, as shared libraries are compiled and linked in different ways
31 on different systems.  They currently have been tested against GNU/Linux and IRIX.
32 </para>
33
34 <para>
35 To use the VFS modules, create a share similar to the one below.  The
36 important parameter is the <command>vfs objects</command> parameter where
37 you can list one or more VFS modules by name. For example, to log all access 
38 to files and put deleted files in a recycle bin:
39
40 <programlisting>
41 [audit]
42         comment = Audited /data directory
43         path = /data
44         vfs objects = audit recycle
45         writeable = yes
46         browseable = yes
47 </programlisting>
48 </para>
49
50 <para>
51 The modules are used in the order in which they are specified.
52 </para>
53
54 <para>
55 Samba will attempt to load modules from the <emphasis>lib</emphasis>
56 directory in the root directory of the samba installation (usually 
57 <filename>/usr/lib/samba</filename> or <filename>/usr/local/samba/lib
58 </filename>).
59 </para>
60
61 <para>
62 Some modules can be used twice for the same share.
63 This can be done using a configuration similar to the one below.
64
65 <programlisting>
66 [test]
67         comment = VFS TEST
68         path = /data
69         writeable = yes
70         browseable = yes
71         vfs objects = example:example1 example example:test
72                 example1: parameter = 1
73                 example:  parameter = 5
74                 test:     parameter = 7
75 </programlisting>
76 </para>
77
78 </sect1>
79
80 <sect1>
81 <title>Included modules</title>
82
83         <sect2>
84         <title>audit</title>
85
86                 <para>
87                 A simple module to audit file access to the syslog
88                 facility.  The following operations are logged:
89                 <simplelist>
90                 <member>share</member>
91                 <member>connect/disconnect</member>
92                 <member>directory opens/create/remove</member>
93                 <member>file open/close/rename/unlink/chmod</member>
94                 </simplelist>
95                 </para>
96
97         </sect2>
98
99         <sect2>
100         <title>extd_audit</title>
101
102                 <para>
103                 This module is identical with the <emphasis>audit</emphasis> module above except
104                 that it sends audit logs to both syslog as well as the smbd log file/s. The 
105                 loglevel for this module is set in the smb.conf file. 
106                 </para>
107
108                 <para>
109                 The logging information that will be written to the smbd log file is controlled by
110                 the <parameter>log level</parameter> parameter in <filename>smb.conf</filename>. The
111                 following information will be recorded:
112                 </para>
113
114                 <table frame="all"><title>Extended Auditing Log Information</title>
115                 <tgroup cols="2" align="center">
116                         <thead>
117                         <row><entry align="center">Log Level</entry><entry>Log Details - File and Directory Operations</entry></row>
118                         </thead>
119                         <tbody>
120                         <row><entry align="center">0</entry><entry align="left">Creation / Deletion</entry></row>
121                         <row><entry align="center">1</entry><entry align="left">Create / Delete / Rename / Permission Changes</entry></row>
122                         <row><entry align="center">2</entry><entry align="left">Create / Delete / Rename / Perm Change / Open / Close</entry></row>
123                         </tbody>
124                 </tgroup>
125                 </table>
126
127         </sect2>
128
129         <sect2>
130         <title>fake_perms</title>
131
132                 <para>
133                 This module was created to allow Roaming Profile files and directories to be set (on the Samba server
134                 under Unix) as read only. This module will if installed on the Profiles share will report to the client
135                 that the Profile files and directories are writable. This satisfies the client even though the files
136                 will never be overwritten as the client logs out or shuts down.
137                 </para>
138
139         </sect2>
140
141         <sect2>
142         <title>recycle</title>
143
144                 <para>
145                 A recycle-bin like module. When used any unlink call
146                 will be intercepted and files moved to the recycle
147                 directory instead of being deleted.
148                 </para>
149                 
150                 <para>Supported options:
151                 <variablelist>
152                         <varlistentry>
153                         <term>recycle:repository</term>
154                         <listitem><para>FIXME</para></listitem>
155                         </varlistentry>
156
157                         <varlistentry>
158                         <term>recycle:keeptree</term>
159                         <listitem><para>FIXME</para></listitem>
160                         </varlistentry>
161                         
162                         <varlistentry>
163                         <term>recycle:versions</term>
164                         <listitem><para>FIXME</para></listitem>
165                         </varlistentry>
166
167                         <varlistentry>
168                         <term>recycle:touch</term>
169                         <listitem><para>FIXME</para></listitem>
170                         </varlistentry>
171
172                         <varlistentry>
173                         <term>recycle:maxsize</term>
174                         <listitem><para>FIXME</para></listitem>
175                         </varlistentry>
176
177                         <varlistentry>
178                         <term>recycle:exclude</term>
179                         <listitem><para>FIXME</para></listitem>
180                         </varlistentry>
181
182                         <varlistentry>
183                         <term>recycle:exclude_dir</term>
184                         <listitem><para>FIXME</para></listitem>
185                         </varlistentry>
186
187                         <varlistentry>
188                         <term>recycle:noversions</term>
189                         <listitem><para>FIXME</para></listitem>
190                         </varlistentry>
191                 </variablelist>
192                 </para>
193
194         </sect2>
195
196         <sect2>
197         <title>netatalk</title>
198
199                 <para>
200                 A netatalk module, that will ease co-existence of samba and
201                 netatalk file sharing services.
202                 </para>
203
204                 <para>Advantages compared to the old netatalk module:
205                 <simplelist>
206                 <member>it doesn't care about creating of .AppleDouble forks, just keeps them in sync</member>
207                 <member>if a share in &smb.conf; doesn't contain .AppleDouble item in hide or veto list, it will be added automatically</member>
208                 </simplelist>
209                 </para>
210
211         </sect2>
212
213 </sect1>
214
215 <sect1>
216 <title>VFS modules available elsewhere</title>
217
218 <para>
219 This section contains a listing of various other VFS modules that 
220 have been posted but don't currently reside in the Samba CVS 
221 tree for one reason or another (e.g. it is easy for the maintainer 
222 to have his or her own CVS tree).
223 </para>
224
225 <para>
226 No statements about the stability or functionality of any module
227 should be implied due to its presence here.
228 </para>
229
230         <sect2>
231         <title>DatabaseFS</title>
232
233                 <para>
234                 URL: <ulink url="http://www.css.tayloru.edu/~elorimer/databasefs/index.php">http://www.css.tayloru.edu/~elorimer/databasefs/index.php</ulink>
235                 </para>
236
237                 <para>By <ulink url="mailto:elorimer@css.tayloru.edu">Eric Lorimer</ulink>.</para>
238
239                 <para>
240                 I have created a VFS module which implements a fairly complete read-only
241                 filesystem.  It presents information from a database as a filesystem in
242                 a modular and generic way to allow different databases to be used
243                 (originally designed for organizing MP3s under directories such as
244                 "Artists," "Song Keywords," etc... I have since applied it to a student
245                 roster database very easily).  The directory structure is stored in the
246                 database itself and the module makes no assumptions about the database
247                 structure beyond the table it requires to run.
248                 </para>
249
250                 <para>
251                 Any feedback would be appreciated: comments, suggestions, patches,
252                 etc...  If nothing else, hopefully it might prove useful for someone
253                 else who wishes to create a virtual filesystem.
254                 </para>
255
256         </sect2>
257
258         <sect2>
259         <title>vscan</title>
260
261                 <para>URL: <ulink url="http://www.openantivirus.org/">http://www.openantivirus.org/</ulink></para>
262
263                 <para>
264                 samba-vscan is a proof-of-concept module for Samba, which
265                 uses the VFS (virtual file system) features of Samba 2.2.x/3.0
266                 alphaX. Of couse, Samba has to be compiled with VFS support. 
267                 samba-vscan supports various virus scanners and is maintained 
268                 by Rainer Link.
269                 </para>
270
271         </sect2>
272 </sect1>
273
274 <sect1>
275 <title>Common Errors</title>
276
277 <para>
278 There must be some gotchas we should record here! Jelmer???
279 </para>
280
281 </sect1>
282 </chapter>