Building the VFS SMB Module

In this section:

General Information

Building the VFS SMB Module

General Information

If the Samba version used on your file server is incompatible with all supplied versions of the VFS SMB module used by SpIDer Guard for SMB, you will have to build this module manually from source code.

The source code of the VFS SMB module for SpIDer Guard for SMB is supplied in the additional package named drweb-smbspider-modules-src and is packed to the tar.gz archive. The drweb-smbspider-modules-src package contains a drweb-smbspider- archive with the source code. This archive is placed into /usr/src/11.1.src.tar.gz directory. If the archive is absent in this directory, install the package with the source code manually (from repository or by custom installation from the universal package, depending on the way, of the Dr.Web Server Security Suite installation).

Besides the source code of the VFS SMB module used by SpIDer Guard for SMB, you will also need the source code of the Samba version installed on your file server. If you do not have the source code, download it 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 used by SpIDer Guard for SMB, the source code of the actual version of Samba installed on your file server must be used. Otherwise, correct operation of the SpIDer Guard for SMB is not guaranteed.

 

To build the module manually from the source code, superuser privileges are required. For that purpose, you can use the su command to switch to another user or the sudo command to build the module as a different user.

Building the VFS SMB Module

1.Unpack the archive with the module source code to any directory. For example, the command

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

unpacks the source code to the directory containing the archive and creates a subdirectory with the archive file name.

2.Determine the version of Samba installed on your server and download its source code 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 your Samba server uses the CLUSTER_SUPPORT option, this command displays the CLUSTER_SUPPORT string.

4.Go to the directory with the Samba source code, configure (./configure) and build (make) the server. When configuring, specify the correct value of the CLUSTER_SUPPORT option. In case of issues with configuring and building the source code of Samba, refer to developer documentation, for example at https://www.samba.org/samba/docs/.

Building Samba from the source code is required only for the further correct building of the VFS SMB module used by SpIDer Guard for SMB. There is no need to replace an already installed Samba server with the one built from the source code.

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

# ./configure --with-samba-source=<path to Samba source directory> && make

where <path to Samba source directory> 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 resulting file from the .libs subdirectory (created while building) to the directory with VFS modules of the Samba server (by default, for GNU/Linux, it is /usr/lib/<architecture>-linux-gnu/samba/) and rename it to smb_spider.so. To do that, use the following command:

# cp ./.libs/libsmb_spider.so /usr/lib/x86_64-linux-gnu/samba/smb_spider.so

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

After that, it is necessary to integrate Dr.Web Server Security Suite with the Samba server the way it is described in the corresponding section in the Administrator Manual. Note that, in this case, at 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 Samba server.