Building the VFS SMB Module

Top  Previous  Next

If it is detected during the Dr.Web for UNIX File Servers installation that the Samba version used on your file server is incompatible with all 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 and are packed in the tar.gz archive. The drweb-smbspider-modules-src package contains a drweb-smbspider-11.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 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 used by SpIDer Guard for SMB, you will also need the source codes of the Samba version 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 Samba version 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 the sudocommand to build the module as a different user.

Building 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-11.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, perform configuration (./configure) and then building (make) of the server. When configuring, define the correct value of the option responsible for CLUSTER_SUPPORT . 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 code files is necessary only for the correct building of the VFS SMB module used by SpIDer Guard for SMB 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 the VFS SMB module is successfully built, copy the libsmb_spider.so binary file from the .libs subdirectory (created while building) to the directory for the VFS modules of installed Samba (by default, for GNU/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 server were built.

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 section in 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 server.