vfs modules in samba

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

 

 

 

 

 

root@hw-lmk:/etc# apt-get install samba Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: eatmydata libeatmydata1 python-babel-localedata python3-babel python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-markupsafe python3-pyrsistent python3-tz Use 'apt autoremove' to remove them. The following additional packages will be installed: attr libavahi-client3 libavahi-common-data libavahi-common3 libboost-iostreams1.83.0 libboost-thread1.83.0 libcephfs2 libcups2t64 libldb2 librados2 librdmacm1t64 libtalloc2 libtdb1 libtevent0t64 liburing2 libwbclient0 python3-dnspython python3-gpg python3-ldb python3-markdown python3-samba python3-talloc python3-tdb samba-ad-provision samba-common samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules tdb-tools Suggested packages: cups-common python3-trio python3-aioquic python3-h2 python3-httpx python3-httpcore python-markdown-doc bind9 bind9utils ctdb ldb-tools winbind heimdal-clients The following NEW packages will be installed: attr libavahi-client3 libavahi-common-data libavahi-common3 libboost-iostreams1.83.0 libboost-thread1.83.0 libcephfs2 libcups2t64 libldb2 librados2 librdmacm1t64 libtalloc2 libtdb1 libtevent0t64 liburing2 libwbclient0 python3-dnspython python3-gpg python3-ldb python3-markdown python3-samba python3-talloc python3-tdb samba samba-ad-provision samba-common samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules tdb-tools 0 upgraded, 31 newly installed, 0 to remove and 4 not upgraded. Need to get 4,800 kB/19.2 MB of archives. After this operation, 102 MB of additional disk space will be used. Do you want to continue? [Y/n] y Err:1 http://repo.huaweicloud.com/ubuntu noble-updates/main amd64 librados2 amd64 19.2.0-0ubuntu0.24.04.1 404 Not Found [IP: 180.153.168.51 80] Err:2 http://repo.huaweicloud.com/ubuntu noble-updates/main am
最新发布
03-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值