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>
10 <title>Stackable VFS modules</title>
13 <title>Features and Benefits</title>
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 through the loaded VFS modules.
18 This chapter covers all the modules that come with the Samba source and references to
19 some external modules.
26 <title>Discussion</title>
29 If not supplied with your platform distribution binary Samba package you may have problems
30 compiling 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.
35 To use the VFS modules, create a share similar to the one below. The
36 important parameter is the <smbconfoption><name>vfs objects</name></smbconfoption> 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, see <link linkend="vfsrecyc"/>.
40 <smbconfexample id="vfsrecyc">
41 <title>smb.conf with VFS modules</title>
42 <smbconfsection>[audit]</smbconfsection>
43 <smbconfoption><name>comment</name><value>Audited /data directory</value></smbconfoption>
44 <smbconfoption><name>path</name><value>/data</value></smbconfoption>
45 <smbconfoption><name>vfs objects</name><value>audit recycle</value></smbconfoption>
46 <smbconfoption><name>writeable</name><value>yes</value></smbconfoption>
47 <smbconfoption><name>browseable</name><value>yes</value></smbconfoption>
52 The modules are used in the order in which they are specified.
56 Samba will attempt to load modules from the <filename>/lib</filename> directory in the root directory of the
57 Samba installation (usually <filename>/usr/lib/samba/vfs</filename> or <filename>/usr/local/samba/lib/vfs
62 Some modules can be used twice for the same share.
63 This can be done using a configuration similar to the one shown in <link linkend="multimodule"/>.
65 <smbconfexample id="multimodule">
66 <title>smb.conf with multiple VFS modules</title>
67 <smbconfsection>[test]</smbconfsection>
68 <smbconfoption><name>comment</name><value>VFS TEST</value></smbconfoption>
69 <smbconfoption><name>path</name><value>/data</value></smbconfoption>
70 <smbconfoption><name>writeable</name><value>yes</value></smbconfoption>
71 <smbconfoption><name>browseable</name><value>yes</value></smbconfoption>
72 <smbconfoption><name>vfs objects</name><value>example:example1 example example:test</value></smbconfoption>
73 <smbconfoption><name>example1: parameter</name><value>1</value></smbconfoption>
74 <smbconfoption><name>example: parameter</name><value>5</value></smbconfoption>
75 <smbconfoption><name>test: parameter</name><value>7</value></smbconfoption>
82 <title>Included Modules</title>
88 A simple module to audit file access to the syslog
89 facility. The following operations are logged:
91 <listitem><para>share</para></listitem>
92 <listitem><para>connect/disconnect</para></listitem>
93 <listitem><para>directory opens/create/remove</para></listitem>
94 <listitem><para>file open/close/rename/unlink/chmod</para></listitem>
101 <title>extd_audit</title>
104 This module is identical with the <command>audit</command> module above except
105 that it sends audit logs to both syslog as well as the <command>smbd</command> log files. The
106 <smbconfoption><name>log level</name></smbconfoption> for this module is set in the &smb.conf; file.
110 Valid settings and the information that will be recorded are shown in <link linkend="xtdaudit"/>.
113 <table frame="all" id="xtdaudit">
114 <title>Extended Auditing Log Information</title>
115 <tgroup cols="2" align="center">
117 <row><entry align="center">Log Level</entry><entry>Log Details - File and Directory Operations</entry></row>
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>
129 <sect2 id="fakeperms">
130 <title>fake_perms</title>
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, 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.
142 <title>recycle</title>
145 A Recycle Bin-like module. Where used, unlink calls will be intercepted and files moved
146 to the recycle directory instead of being deleted. This gives the same effect as the
147 <guiicon>Recycle Bin</guiicon> on Windows computers.
151 The <guiicon>Recycle Bin</guiicon> will not appear in <application>Windows Explorer</application> views of the network file system
152 (share) nor on any mapped drive. Instead, a directory called <filename>.recycle</filename> will be
153 automatically created when the first file is deleted. Users can recover files from the
154 <filename>.recycle</filename> directory. If the <parameter>recycle:keeptree</parameter> has been
155 specified, deleted files will be found in a path identical with that from which the file was deleted.
158 <para>Supported options for the <command>recycle</command> module are as follow:
161 <term>recycle:repository</term>
163 Relative path of the directory where deleted files should be moved.
168 <term>recycle:keeptree</term>
170 Specifies whether the directory structure should be kept or if the files in the directory that is being
171 deleted should be kept seperately in the recycle bin.
176 <term>recycle:versions</term>
178 If this option is set, two files
179 with the same name that are deleted will both
180 be kept in the recycle bin. Newer deleted versions
181 of a file will be called <quote>Copy #x of <replaceable>filename</replaceable></quote>.
186 <term>recycle:touch</term>
188 Specifies whether a file's access date should be touched when the file is moved to the recycle bin.
193 <term>recycle:maxsize</term>
195 Files that are larger than the number of bytes specified by this parameter will not be put into the recycle bin.
200 <term>recycle:exclude</term>
202 List of files that should not be put into the recycle bin when deleted, but deleted in the regular way.
207 <term>recycle:exclude_dir</term>
209 Contains a list of directories. When files from these directories are
210 deleted, they are not put into the
211 recycle bin but are deleted in the
217 <term>recycle:noversions</term>
219 Opposite of <parameter>recycle:versions</parameter>. If both options are specified, this one takes precedence.
228 <title>netatalk</title>
231 A netatalk module will ease co-existence of Samba and netatalk file sharing services.
234 <para>Advantages compared to the old netatalk module:
236 <listitem><para>Does not care about creating .AppleDouble forks, just keeps them in sync.</para></listitem>
237 <listitem><para>If a share in &smb.conf; does not contain .AppleDouble item in hide or veto list, it will be added automatically.</para></listitem>
246 <title>VFS Modules Available Elsewhere</title>
249 This section contains a listing of various other VFS modules that
250 have been posted but do not currently reside in the Samba CVS
251 tree for one reason or another (e.g., it is easy for the maintainer
252 to have his or her own CVS tree).
256 No statements about the stability or functionality of any module
257 should be implied due to its presence here.
261 <title>DatabaseFS</title>
264 URL: <ulink noescape="1" url="http://www.css.tayloru.edu/~elorimer/databasefs/index.php">http://www.css.tayloru.edu/~elorimer/databasefs/index.php</ulink>
267 <para>By <ulink url="mailto:elorimer@css.tayloru.edu">Eric Lorimer.</ulink></para>
270 I have created a VFS module that implements a fairly complete read-only
271 filesystem. It presents information from a database as a filesystem in
272 a modular and generic way to allow different databases to be used
273 (originally designed for organizing MP3s under directories such as
274 <quote>Artists,</quote> <quote>Song Keywords,</quote> and so on. I have since easily
275 applied it to a student
276 roster database.) The directory structure is stored in the
277 database itself and the module makes no assumptions about the database
278 structure beyond the table it requires to run.
282 Any feedback would be appreciated: comments, suggestions, patches,
283 and so on. If nothing else, hopefully it might prove useful for someone
284 else who wishes to create a virtual filesystem.
292 <para>URL: <ulink noescape="1" url="http://www.openantivirus.org/">http://www.openantivirus.org/</ulink></para>
295 <filename>samba-vscan</filename> is a proof-of-concept module for Samba, which
296 uses the VFS (virtual file system) features of Samba 2.2.x/3.0
297 alphaX. Of course, Samba has to be compiled with VFS support.
298 <filename>samba-vscan</filename> supports various virus scanners and is maintained