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