Appendix G. Building VFS SMB Module for Samba

If it is detected during the product installation that the Samba version used on your file server is incompatible with all the supplied versions of the VFS SMB modules for SpIDer Guard for SMB, you need to build the VFS SMB module manually using the supplied source codes.

The source codes of the VFS SMB module for SpIDer Guard for SMB are supplied in the additional package named drweb-smbspider-modules-src. The package contains a drweb-smbspider-10.1.0.src.tar.gz archive with the source codes. This archive is placed into /usr/src/ directory. If the archive is absent in this directory, install the package with the source codes manually (from the Dr.Web Repository or by custom installation from the universal package, depending on the way of the product installation).

Beside the source codes of the VFS SMB module, you also need the source codes of Samba installed on your file server. If you do not have the source codes, download them from the developer's source, for example https://www.samba.org/samba/download/. To determine which version of the Samba is installed on your file server, use the following command:

$ smbd -V

To build the VFS SMB module for SpIDer Guard for SMB, the source codes of the actual version of Samba installed on your server must be used. Otherwise, correct operation of the SpIDer Guard for SMB is not guaranteed.

To build the module manually from the source codes, administrative (root) privileges are required. For that purpose, you can use the su command to switch to another user or thesudo command to build the module as a different user.

To build the VFS SMB module

1.Unpack the archive with the VFS SMB module source codes to any directory. For example, the following command

# tar -xf drweb-smbspider-10.1.0.src.tar.gz

unpacks the source codes to the created directory. This directory has the archive's name and is created in the same location where the archive resides.

2.Determine the version of Samba installed on your server and download its source codes if necessary.

3.Determine if the version of Samba installed on your server uses the CLUSTER_SUPPORT option. To do that, use the following command:

$ smbd -b | grep CLUSTER_SUPPORT

If the output contains the CLUSTER_SUPPORT string, the version of Samba installed on your server uses the CLUSTER_SUPPORT option.

4.Go to the directory with the Samba source codes, configure (./configure) and then build it (make). When configuring, define the correct value for the CLUSTER_SUPPORT option according to the Samba installed on your server. To learn to configure and build Samba, refer to developer's official documentation, for example at https://www.samba.org/samba/docs/.

Note that building Samba from the source codes is necessary only for the correct building of the VFS SMB module in the next step. You do not have to replace Samba already installed on your server with the new binaries built from the source codes.

5.When you have successfully built Samba, go to the directory with the VFS SMB module source codes and issue the following command:

# ./configure --with-samba-source=<path_to_dir_with_Samba_src> && make

where <path_to_dir_with_Samba_src> is the path to the directory where Samba was built in the previous step.

6.When you have successfully built the VFS SMB module, copy the libsmb_spider.so binary file from the .libs subdirectory (created while building) to the directory for the VFS modules of the installed Samba (by default, for Linux, it is /usr/lib/samba/vfs) and rename it to smb_spider.so. To do that, use the following command:

# cp ./.libs/libsmb_spider.so /usr/lib/samba/vfs/smb_spider.so

7.After copying of the built VFS SMB module, you can delete the directories were the VFS SMB module and the Samba were built.

8.After that, it is necessary to complete integration between Dr.Web for UNIX File Servers and the Samba server the way it is described in the corresponding chapter of the Administrator Manual. Please note that in this case, in the first step of the integration, it is not necessary to create the smb_spider.so symbolic link in the directory of the VFS modules of the installed Samba.