1 <html><head><meta http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1"><title>Chapter
20. Stackable VFS modules
</title><link rel=
"stylesheet" href=
"samba.css" type=
"text/css"><meta name=
"generator" content=
"DocBook XSL Stylesheets V1.60.1"><link rel=
"home" href=
"index.html" title=
"SAMBA Project Documentation"><link rel=
"up" href=
"optional.html" title=
"Part III. Advanced Configuration"><link rel=
"previous" href=
"CUPS-printing.html" title=
"Chapter 19. CUPS Printing Support"><link rel=
"next" href=
"winbind.html" title=
"Chapter 21. Winbind: Use of Domain Accounts"></head><body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF"><div class=
"navheader"><table width=
"100%" summary=
"Navigation header"><tr><th colspan=
"3" align=
"center">Chapter
20. Stackable VFS modules
</th></tr><tr><td width=
"20%" align=
"left"><a accesskey=
"p" href=
"CUPS-printing.html">Prev
</a> </td><th width=
"60%" align=
"center">Part III. Advanced Configuration
</th><td width=
"20%" align=
"right"> <a accesskey=
"n" href=
"winbind.html">Next
</a></td></tr></table><hr></div><div class=
"chapter" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title"><a name=
"VFS"></a>Chapter
20. Stackable VFS modules
</h2></div><div><div class=
"author"><h3 class=
"author"><span class=
"firstname">Jelmer
</span> <span class=
"othername">R.
</span> <span class=
"surname">Vernooij
</span></h3><div class=
"affiliation"><span class=
"orgname">The Samba Team
<br></span><div class=
"address"><p><tt class=
"email"><<a href=
"mailto:jelmer@samba.org">jelmer@samba.org
</a>></tt></p></div></div></div></div><div><div class=
"author"><h3 class=
"author"><span class=
"firstname">John
</span> <span class=
"othername">H.
</span> <span class=
"surname">Terpstra
</span></h3><div class=
"affiliation"><span class=
"orgname">Samba Team
<br></span><div class=
"address"><p><tt class=
"email"><<a href=
"mailto:jht@samba.org">jht@samba.org
</a>></tt></p></div></div></div></div><div><div class=
"author"><h3 class=
"author"><span class=
"firstname">Tim
</span> <span class=
"surname">Potter
</span></h3><div class=
"affiliation"><span class=
"orgname">Samba Team
<br></span><div class=
"address"><p><tt class=
"email"><<a href=
"mailto:tpot@samba.org">tpot@samba.org
</a>></tt></p></div></div></div></div><div><div class=
"author"><h3 class=
"author"><span class=
"firstname">Simo
</span> <span class=
"surname">Sorce
</span></h3><span class=
"contrib">original vfs_skel README
</span></div></div><div><div class=
"author"><h3 class=
"author"><span class=
"firstname">Alexander
</span> <span class=
"surname">Bokovoy
</span></h3><span class=
"contrib">original vfs_netatalk docs
</span></div></div><div><div class=
"author"><h3 class=
"author"><span class=
"firstname">Stefan
</span> <span class=
"surname">Metzmacher
</span></h3><span class=
"contrib">Update for multiple modules
</span></div></div></div><div></div></div><div class=
"toc"><p><b>Table of Contents
</b></p><dl><dt><a href=
"VFS.html#id2948269">Features and Benefits
</a></dt><dt><a href=
"VFS.html#id2948287">Discussion
</a></dt><dt><a href=
"VFS.html#id2948540">Included Modules
</a></dt><dd><dl><dt><a href=
"VFS.html#id2948547">audit
</a></dt><dt><a href=
"VFS.html#id2948583">extd_audit
</a></dt><dt><a href=
"VFS.html#fakeperms">fake_perms
</a></dt><dt><a href=
"VFS.html#id2948756">recycle
</a></dt><dt><a href=
"VFS.html#id2948986">netatalk
</a></dt></dl></dd><dt><a href=
"VFS.html#id2949031">VFS Modules Available Elsewhere
</a></dt><dd><dl><dt><a href=
"VFS.html#id2949053">DatabaseFS
</a></dt><dt><a href=
"VFS.html#id2949115">vscan
</a></dt></dl></dd></dl></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2948269"></a>Features and Benefits
</h2></div></div><div></div></div><p>
2 Since Samba-
3, there is support for stackable VFS (Virtual File System) modules.
3 Samba passes each request to access the UNIX file system through the loaded VFS modules.
4 This chapter covers all the modules that come with the Samba source and references to
6 </p></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2948287"></a>Discussion
</h2></div></div><div></div></div><p>
7 If not supplied with your platform distribution binary Samba package you may have problems
8 compiling these modules, as shared libraries are compiled and linked in different ways
9 on different systems. They currently have been tested against GNU/Linux and IRIX.
11 To use the VFS modules, create a share similar to the one below. The
12 important parameter is the
<a class=
"indexterm" name=
"id2948308"></a><i class=
"parameter"><tt>vfs objects
</tt></i> parameter where
13 you can list one or more VFS modules by name. For example, to log all access
14 to files and put deleted files in a recycle bin, see
<link linkend=
"vfsrecyc">.
16 </p><div class=
"example"><a name=
"vfsrecyc"></a><p class=
"title"><b>Example
20.1. smb.conf with VFS modules
</b></p><table class=
"simplelist" border=
"0" summary=
"Simple list"><tr><td> </td></tr><tr><td><i class=
"parameter"><tt>[audit]
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>comment = Audited /data directory
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>path = /data
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>vfs objects = audit recycle
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>writeable = yes
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>browseable = yes
</tt></i></td></tr></table></div><p>
18 The modules are used in the order in which they are specified.
20 Samba will attempt to load modules from the
<tt class=
"filename">/lib
</tt> directory in the root directory of the
21 Samba installation (usually
<tt class=
"filename">/usr/lib/samba/vfs
</tt> or
<tt class=
"filename">/usr/local/samba/lib/vfs
24 Some modules can be used twice for the same share.
25 This can be done using a configuration similar to the one shown in
<link linkend=
"multimodule">.
27 </p><div class=
"example"><a name=
"multimodule"></a><p class=
"title"><b>Example
20.2. smb.conf with multiple VFS modules
</b></p><table class=
"simplelist" border=
"0" summary=
"Simple list"><tr><td> </td></tr><tr><td><i class=
"parameter"><tt>[test]
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>comment = VFS TEST
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>path = /data
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>writeable = yes
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>browseable = yes
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>vfs objects = example:example1 example example:test
</tt></i></td></tr><tr><td><i class=
"parameter"><tt>example1: parameter =
1</tt></i></td></tr><tr><td><i class=
"parameter"><tt>example: parameter =
5</tt></i></td></tr><tr><td><i class=
"parameter"><tt>test: parameter =
7</tt></i></td></tr></table></div><p>
28 </p></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2948540"></a>Included Modules
</h2></div></div><div></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2948547"></a>audit
</h3></div></div><div></div></div><p>
29 A simple module to audit file access to the syslog
30 facility. The following operations are logged:
31 </p><div class=
"itemizedlist"><ul type=
"disc"><li>share
</li><li>connect/disconnect
</li><li>directory opens/create/remove
</li><li>file open/close/rename/unlink/chmod
</li></ul></div><p>
32 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2948583"></a>extd_audit
</h3></div></div><div></div></div><p>
33 This module is identical with the
<b class=
"command">audit
</b> module above except
34 that it sends audit logs to both syslog as well as the
<b class=
"command">smbd
</b> log files. The
35 <a class=
"indexterm" name=
"id2948610"></a><i class=
"parameter"><tt>log level
</tt></i> for this module is set in the
<tt class=
"filename">smb.conf
</tt> file.
37 Valid settings and the information that will be recorded are shown in
<link linkend=
"xtdaudit">.
38 </p><div class=
"table"><a name=
"xtdaudit"></a><p class=
"title"><b>Table
20.1. Extended Auditing Log Information
</b></p><table summary=
"Extended Auditing Log Information" border=
"1"><colgroup><col><col></colgroup><thead><tr><th align=
"center">Log Level
</th><th align=
"center">Log Details - File and Directory Operations
</th></tr></thead><tbody><tr><td align=
"center">0</td><td align=
"left">Creation / Deletion
</td></tr><tr><td align=
"center">1</td><td align=
"left">Create / Delete / Rename / Permission Changes
</td></tr><tr><td align=
"center">2</td><td align=
"left">Create / Delete / Rename / Perm Change / Open / Close
</td></tr></tbody></table></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"fakeperms"></a>fake_perms
</h3></div></div><div></div></div><p>
39 This module was created to allow Roaming Profile files and directories to be set (on the Samba server
40 under UNIX) as read only. This module will, if installed on the Profiles share, report to the client
41 that the Profile files and directories are writable. This satisfies the client even though the files
42 will never be overwritten as the client logs out or shuts down.
43 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2948756"></a>recycle
</h3></div></div><div></div></div><p>
44 A Recycle Bin-like module. Where used, unlink calls will be intercepted and files moved
45 to the recycle directory instead of being deleted. This gives the same effect as the
46 <span class=
"guiicon">Recycle Bin
</span> on Windows computers.
48 The
<span class=
"guiicon">Recycle Bin
</span> will not appear in
<span class=
"application">Windows Explorer
</span> views of the network file system
49 (share) nor on any mapped drive. Instead, a directory called
<tt class=
"filename">.recycle
</tt> will be
50 automatically created when the first file is deleted. Users can recover files from the
51 <tt class=
"filename">.recycle
</tt> directory. If the
<i class=
"parameter"><tt>recycle:keeptree
</tt></i> has been
52 specified, deleted files will be found in a path identical with that from which the file was deleted.
53 </p><p>Supported options for the
<b class=
"command">recycle
</b> module are as follow:
54 </p><div class=
"variablelist"><dl><dt><span class=
"term">recycle:repository
</span></dt><dd><p>
55 Relative path of the directory where deleted files should be moved.
56 </p></dd><dt><span class=
"term">recycle:keeptree
</span></dt><dd><p>
57 Specifies whether the directory structure should be kept or if the files in the directory that is being
58 deleted should be kept seperately in the recycle bin.
59 </p></dd><dt><span class=
"term">recycle:versions
</span></dt><dd><p>
60 If this option is set, two files
61 with the same name that are deleted will both
62 be kept in the recycle bin. Newer deleted versions
63 of a file will be called
“<span class=
"quote">Copy #x of
<i class=
"replaceable"><tt>filename
</tt></i></span>”.
64 </p></dd><dt><span class=
"term">recycle:touch
</span></dt><dd><p>
65 Specifies whether a file's access date should be touched when the file is moved to the recycle bin.
66 </p></dd><dt><span class=
"term">recycle:maxsize
</span></dt><dd><p>
67 Files that are larger than the number of bytes specified by this parameter will not be put into the recycle bin.
68 </p></dd><dt><span class=
"term">recycle:exclude
</span></dt><dd><p>
69 List of files that should not be put into the recycle bin when deleted, but deleted in the regular way.
70 </p></dd><dt><span class=
"term">recycle:exclude_dir
</span></dt><dd><p>
71 Contains a list of directories. When files from these directories are
72 deleted, they are not put into the
73 recycle bin but are deleted in the
75 </p></dd><dt><span class=
"term">recycle:noversions
</span></dt><dd><p>
76 Opposite of
<i class=
"parameter"><tt>recycle:versions
</tt></i>. If both options are specified, this one takes precedence.
77 </p></dd></dl></div><p>
78 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2948986"></a>netatalk
</h3></div></div><div></div></div><p>
79 A netatalk module will ease co-existence of Samba and netatalk file sharing services.
80 </p><p>Advantages compared to the old netatalk module:
81 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>Does not care about creating .AppleDouble forks, just keeps them in sync.
</p></li><li><p>If a share in
<tt class=
"filename">smb.conf
</tt> does not contain .AppleDouble item in hide or veto list, it will be added automatically.
</p></li></ul></div><p>
82 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2949031"></a>VFS Modules Available Elsewhere
</h2></div></div><div></div></div><p>
83 This section contains a listing of various other VFS modules that
84 have been posted but do not currently reside in the Samba CVS
85 tree for one reason or another (e.g., it is easy for the maintainer
86 to have his or her own CVS tree).
88 No statements about the stability or functionality of any module
89 should be implied due to its presence here.
90 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2949053"></a>DatabaseFS
</h3></div></div><div></div></div><p>
91 URL:
<ulink url=
"http://www.css.tayloru.edu/~elorimer/databasefs/index.php">http://www.css.tayloru.edu/~elorimer/databasefs/index.php
</ulink>
92 </p><p>By
<ulink url=
"mailto:elorimer@css.tayloru.edu">Eric Lorimer.
</ulink></p><p>
93 I have created a VFS module that implements a fairly complete read-only
94 filesystem. It presents information from a database as a filesystem in
95 a modular and generic way to allow different databases to be used
96 (originally designed for organizing MP3s under directories such as
97 “<span class=
"quote">Artists,
</span>” “<span class=
"quote">Song Keywords,
</span>” and so on. I have since easily
98 applied it to a student
99 roster database.) The directory structure is stored in the
100 database itself and the module makes no assumptions about the database
101 structure beyond the table it requires to run.
103 Any feedback would be appreciated: comments, suggestions, patches,
104 and so on. If nothing else, hopefully it might prove useful for someone
105 else who wishes to create a virtual filesystem.
106 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2949115"></a>vscan
</h3></div></div><div></div></div><p>URL:
<ulink url=
"http://www.openantivirus.org/">http://www.openantivirus.org/
</ulink></p><p>
107 <tt class=
"filename">samba-vscan
</tt> is a proof-of-concept module for Samba, which
108 uses the VFS (virtual file system) features of Samba
2.2.x/
3.0
109 alphaX. Of course, Samba has to be compiled with VFS support.
110 <tt class=
"filename">samba-vscan
</tt> supports various virus scanners and is maintained
112 </p></div></div></div><div class=
"navfooter"><hr><table width=
"100%" summary=
"Navigation footer"><tr><td width=
"40%" align=
"left"><a accesskey=
"p" href=
"CUPS-printing.html">Prev
</a> </td><td width=
"20%" align=
"center"><a accesskey=
"u" href=
"optional.html">Up
</a></td><td width=
"40%" align=
"right"> <a accesskey=
"n" href=
"winbind.html">Next
</a></td></tr><tr><td width=
"40%" align=
"left" valign=
"top">Chapter
19. CUPS Printing Support
</td><td width=
"20%" align=
"center"><a accesskey=
"h" href=
"index.html">Home
</a></td><td width=
"40%" align=
"right" valign=
"top"> Chapter
21. Winbind: Use of Domain Accounts
</td></tr></table></div></body></html>