These days i am doing the samba vfs modules here is my note about it
About vfs modules in the samba:
There are several vfs modules i have checked out:audit, extd_audit,default_quota,recycle,shadow_copy,vscan-clamav
Audit,extd_autit: Just write some audit log the /var/log/messages to record who did what
recycle: it can create a recycle folder for the specific share folder we can set the path and name of the recycle folder.
when we use recycle vfs objects to the specific share folder and if we delete the files under the share folder they will be moved to the recycle folder instead of being deleted.
in the smb.conf we should add the recycle vfs object to the share folder for example:
vfs object=recycle
recycle:repositary=.delete/%U
recycle:keeptree=yes
recycle:directory_mode=0777
default_quota: we can set a default quota for a user with root account.in the smb.conf we should specify the uid of the user we want to set default quota for. for example:
vfs objects = default_quota
dequota_quota:uid = 501
shadow_copy: we can see the previous snapshot with this vfs module in xp(i don't know it does not work in windows7)
vscan-clamav: anti-virus module for samba. we should modify the source code of vscan-clamav.
in vscan-clamav.c:254
change "pstrcpy(filepath, handle->conn->connectpath);" to "pstrcpy(filepath,handle->conn->origpath);"
the connnectpath contains nothing so it doesnot work and we should use origpath which contains the full file path such as /root/test
Here i also give my smb.conf and clamd.conf and vscan-clamav.conf
smb.conf:
clamd.conf:
i Just modify the following record:
about vscan-clamav.conf
About clamd install and complier
download samba-3.0.33.tar.gz, samba-vscan-0.3.6c-beta5.tar.gz
tar zxvf samba-3.0.33.tar.gz
tar zxvf samba-vscan-0.3.6c-beta5.tar.gz
mv samba-vscan-0.3.6c-beta5 samba-3.0.33/examples/VFS/
cd samba-3.0.33/source
./configure
make proto
cd samba-3.0.33/examples/VFS/samba-vscan-0.3.6c-beta5
./configure
make clamav
cp vscan-clamav.so /usr/lib/samba/vfs