Build openvas-scanner make error

Use this category only if you have build GVM from sources or if you use packages provided by a 3rdparty repository.

Please read About the Greenbone Source Edition (GSE) and About GVM Architecture before posting.

When posting you should provide information about your environment using the following template:

GVM versions

gsad: (‘gsad --version’)
gvmd: (‘gvmd --version’)
openvas-scanner: (‘openvas --version’, in older GVM versions < 11: ‘openvassd --version’)
gvm-libs:

Environment

Operating system:
Kernel: (‘Linux wfkali 5.10.0-kali7-amd64’)
Installation method / source:

I am trying to build openvas-scanner from source after running cmake … and then make it stops 1% through with the error below:

[ 1%] Building C object misc/CMakeFiles/openvas_misc_shared.dir/network.c.o
/opt/gvm/src/openvas/misc/network.c: In function ‘socket_get_cert’:
/opt/gvm/src/openvas/misc/network.c:872:3: error: ‘g_memdup’ is deprecated: Use ‘g_memdup2’ instead [-Werror=deprecated-declarations]
872 | *cert = g_memdup (cert_list[0].data, *certlen);
| ^
In file included from /usr/include/glib-2.0/glib.h:82,
from /opt/gvm/src/openvas/misc/…/nasl/nasl_lex_ctxt.h:22,
from /opt/gvm/src/openvas/misc/…/nasl/nasl_debug.h:22,
from /opt/gvm/src/openvas/misc/network.c:27:
/usr/include/glib-2.0/glib/gstrfuncs.h:257:23: note: declared here
257 | gpointer g_memdup (gconstpointer mem,

Hi @mcrabb,

Searching on that error brought up the possibility of version number mismatches in components (including the libraries), so to rule that out you can compare what you have with:

New releases for GVM 20.08 and GVM 21.04 (current version numbers) and Building GVM 21.04 — Greenbone Documentation documentation (Greenbone source build guide)

This is an issue with newer versions of libglib2 (glib2 >= 2.68) and should be solved in the next major release of our software. If you want to have a deeper look see Search · org:greenbone g_memdup · GitHub

2 Likes

To turn the errors into warnings (which allows the build process to pass) you can also add a -DCMAKE_BUILD_TYPE=RELEASE to your cmake call like e.g.:

cd build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE
2 Likes

I was able to build the files with this.

Many thanks

2 Likes