<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>Stackable VFS modules</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="SAMBA Project Documentation"
HREF="samba-howto-collection.html"><LINK
REL="UP"
TITLE="Advanced Configuration"
HREF="optional.html"><LINK
REL="PREVIOUS"
TITLE="PAM Configuration for Centrally Managed Authentication"
HREF="pam.html"><LINK
REL="NEXT"
TITLE="Hosting a Microsoft Distributed File System tree on Samba"
HREF="msdfs.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SAMBA Project Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="pam.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="msdfs.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="VFS"
></A
>Chapter 21. Stackable VFS modules</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>21.1. <A
HREF="vfs.html#AEN3601"
>Introduction and configuration</A
></DT
><DT
>21.2. <A
HREF="vfs.html#AEN3610"
>Included modules</A
></DT
><DD
><DL
><DT
>21.2.1. <A
HREF="vfs.html#AEN3612"
>audit</A
></DT
><DT
>21.2.2. <A
HREF="vfs.html#AEN3620"
>extd_audit</A
></DT
><DT
>21.2.3. <A
HREF="vfs.html#AEN3624"
>recycle</A
></DT
><DT
>21.2.4. <A
HREF="vfs.html#AEN3661"
>netatalk</A
></DT
></DL
></DD
><DT
>21.3. <A
HREF="vfs.html#AEN3668"
>VFS modules available elsewhere</A
></DT
><DD
><DL
><DT
>21.3.1. <A
HREF="vfs.html#AEN3672"
>DatabaseFS</A
></DT
><DT
>21.3.2. <A
HREF="vfs.html#AEN3680"
>vscan</A
></DT
></DL
></DD
></DL
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN3601"
>21.1. Introduction and configuration</A
></H1
><P
>Since samba 3.0, samba supports stackable VFS(Virtual File System) modules.  
Samba passes each request to access the unix file system thru the loaded VFS modules. 
This chapter covers all the modules that come with the samba source and references to 
some external modules.</P
><P
>You may have problems to compile these modules, as shared libraries are
compiled and linked in different ways on different systems.
They currently have been tested against GNU/linux and IRIX.</P
><P
>To use the VFS modules, create a share similar to the one below.  The
important parameter is the <B
CLASS="COMMAND"
>vfs object</B
> parameter which must point to
the exact pathname of the shared library objects. For example, to log all access 
to files and use a recycle bin:

<PRE
CLASS="PROGRAMLISTING"
>       [audit]
                comment = Audited /data directory
                path = /data
                vfs object = /path/to/audit.so /path/to/recycle.so
                writeable = yes
                browseable = yes</PRE
></P
><P
>The modules are used in the order they are specified.</P
><P
>Further documentation on writing VFS modules for Samba can be found in
the Samba Developers Guide.</P
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN3610"
>21.2. Included modules</A
></H1
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3612"
>21.2.1. audit</A
></H2
><P
>A simple module to audit file access to the syslog
facility.  The following operations are logged:
<P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
>share</TD
></TR
><TR
><TD
>connect/disconnect</TD
></TR
><TR
><TD
>directory opens/create/remove</TD
></TR
><TR
><TD
>file open/close/rename/unlink/chmod</TD
></TR
></TBODY
></TABLE
><P
></P
></P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3620"
>21.2.2. extd_audit</A
></H2
><P
>This module is identical with the <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>audit</I
></SPAN
> module above except
that it sends audit logs to both syslog as well as the smbd log file/s. The 
loglevel for this module is set in the smb.conf file. At loglevel = 0, only file
and directory deletions and directory and file creations are logged. At loglevel = 1
file opens are renames and permission changes are logged , while at loglevel = 2 file
open and close calls are logged also.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3624"
>21.2.3. recycle</A
></H2
><P
>A recycle-bin like modules. When used any unlink call
will be intercepted and files moved to the recycle
directory instead of beeing deleted.</P
><P
>Supported options:
<P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>vfs_recycle_bin:repository</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:keeptree</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:versions</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:touch</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:maxsize</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:exclude</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:exclude_dir</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:noversions</DT
><DD
><P
>FIXME</P
></DD
></DL
></DIV
></P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3661"
>21.2.4. netatalk</A
></H2
><P
>A netatalk module, that will ease co-existence of samba and
netatalk file sharing services.</P
><P
>Advantages compared to the old netatalk module:
<P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
>it doesn't care about creating of .AppleDouble forks, just keeps ones in sync</TD
></TR
><TR
><TD
>if share in smb.conf doesn't contain .AppleDouble item in hide or veto list, it will be added automatically</TD
></TR
></TBODY
></TABLE
><P
></P
></P
></DIV
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN3668"
>21.3. VFS modules available elsewhere</A
></H1
><P
>This section contains a listing of various other VFS modules that 
have been posted but don't currently reside in the Samba CVS 
tree for one reason ot another (e.g. it is easy for the maintainer 
to have his or her own CVS tree).</P
><P
>No statemets about the stability or functionality any module
should be implied due to its presence here.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3672"
>21.3.1. DatabaseFS</A
></H2
><P
>URL: <A
HREF="http://www.css.tayloru.edu/~elorimer/databasefs/index.php"
TARGET="_top"
>http://www.css.tayloru.edu/~elorimer/databasefs/index.php</A
></P
><P
>By <A
HREF="mailto:elorimer@css.tayloru.edu"
TARGET="_top"
>Eric Lorimer</A
>.</P
><P
>I have created a VFS module which implements a fairly complete read-only
filesystem.  It presents information from a database as a filesystem in
a modular and generic way to allow different databases to be used
(originally designed for organizing MP3s under directories such as
"Artists," "Song Keywords," etc... I have since applied it to a student
roster database very easily).  The directory structure is stored in the
database itself and the module makes no assumptions about the database
structure beyond the table it requires to run.</P
><P
>Any feedback would be appreciated: comments, suggestions, patches,
etc...  If nothing else, hopefully it might prove useful for someone
else who wishes to create a virtual filesystem.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3680"
>21.3.2. vscan</A
></H2
><P
>URL: <A
HREF="http://www.openantivirus.org/"
TARGET="_top"
>http://www.openantivirus.org/</A
></P
><P
>samba-vscan is a proof-of-concept module for Samba, which
uses the VFS (virtual file system) features of Samba 2.2.x/3.0
alphaX. Of couse, Samba has to be compiled with VFS support. 
samba-vscan supports various virus scanners and is maintained 
by Rainer Link.</P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="pam.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="samba-howto-collection.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="msdfs.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>PAM Configuration for Centrally Managed Authentication</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="optional.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Hosting a Microsoft Distributed File System tree on Samba</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>