aboutsummaryrefslogtreecommitdiffstats
path: root/community/gvm
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2018-01-29 15:05:05 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2018-01-29 15:05:05 +0000
commit4dc8ca9b5e8cc7264f031ffde02f80053dd09aca (patch)
tree032b63fc6ae5f8fb2682bcf76cbaa556fd5d8efe /community/gvm
parent4d25e023a4a0ef86015bae231fb0b10bfcc965d9 (diff)
downloadaports-4dc8ca9b5e8cc7264f031ffde02f80053dd09aca.tar.bz2
aports-4dc8ca9b5e8cc7264f031ffde02f80053dd09aca.tar.xz
community/gvm: updated srcurl, renamed package from openvas-manager
Diffstat (limited to 'community/gvm')
-rw-r--r--community/gvm/000-sys-siglist.patch72
-rw-r--r--community/gvm/001-sys-siglist.patch53
-rw-r--r--community/gvm/002-fortify-source.patch13
-rw-r--r--community/gvm/003-sqlite-insert.patch31
-rw-r--r--community/gvm/APKBUILD53
-rw-r--r--community/gvm/backport-r29476.patch13
-rw-r--r--community/gvm/gvm.confd13
-rw-r--r--community/gvm/gvm.initd19
-rw-r--r--community/gvm/gvm.logrotate11
9 files changed, 278 insertions, 0 deletions
diff --git a/community/gvm/000-sys-siglist.patch b/community/gvm/000-sys-siglist.patch
new file mode 100644
index 0000000000..b741078d83
--- /dev/null
+++ b/community/gvm/000-sys-siglist.patch
@@ -0,0 +1,72 @@
+diff --git a/src/manage_sql.c b/src/manage_sql.c
+index 0ad35e7..c84d722 100644
+--- a/src/manage_sql.c
++++ b/src/manage_sql.c
+@@ -15920,7 +15920,7 @@ cleanup_manage_process (gboolean cleanup)
+ void
+ manage_cleanup_process_error (int signal)
+ {
+- g_debug ("Received %s signal.\n", sys_siglist[signal]);
++ g_debug ("Received %s signal.\n", strsignal(signal));
+ if (sql_is_open ())
+ {
+ if (current_scanner_task)
+diff --git a/src/openvasmd.c b/src/openvasmd.c
+index 891a747..d3feba1 100644
+--- a/src/openvasmd.c
++++ b/src/openvasmd.c
+@@ -780,7 +780,7 @@ setup_signal_handler (int signal, void (*handler) (int), int block)
+ if (sigaction (signal, &action, NULL) == -1)
+ {
+ g_critical ("%s: failed to register %s handler\n",
+- __FUNCTION__, sys_siglist[signal]);
++ __FUNCTION__, strsignal(signal));
+ exit (EXIT_FAILURE);
+ }
+ }
+@@ -811,7 +811,7 @@ setup_signal_handler_info (int signal,
+ if (sigaction (signal, &action, NULL) == -1)
+ {
+ g_critical ("%s: failed to register %s handler\n",
+- __FUNCTION__, sys_siglist[signal]);
++ __FUNCTION__, strsignal(signal));
+ exit (EXIT_FAILURE);
+ }
+ }
+@@ -1238,7 +1238,7 @@ serve_and_schedule ()
+ if (termination_signal)
+ {
+ g_debug ("Received %s signal.\n",
+- sys_siglist[termination_signal]);
++ strsignal(termination_signal));
+ cleanup ();
+ /* Raise signal again, to exit with the correct return value. */
+ setup_signal_handler (termination_signal, SIG_DFL, 0);
+@@ -1248,7 +1248,7 @@ serve_and_schedule ()
+
+ if (sighup_update_nvt_cache)
+ {
+- g_debug ("Received %s signal.\n", sys_siglist[SIGHUP]);
++ g_debug ("Received %s signal.\n", strsignal(SIGHUP));
+ sighup_update_nvt_cache = 0;
+ fork_update_nvt_cache ();
+ }
+@@ -1307,7 +1307,7 @@ serve_and_schedule ()
+ if (termination_signal)
+ {
+ g_debug ("Received %s signal.\n",
+- sys_siglist[termination_signal]);
++ strsignal(termination_signal));
+ cleanup ();
+ /* Raise signal again, to exit with the correct return value. */
+ setup_signal_handler (termination_signal, SIG_DFL, 0);
+@@ -1317,7 +1317,7 @@ serve_and_schedule ()
+
+ if (sighup_update_nvt_cache)
+ {
+- g_debug ("Received %s signal.\n", sys_siglist[SIGHUP]);
++ g_debug ("Received %s signal.\n", strsignal(SIGHUP));
+ sighup_update_nvt_cache = 0;
+ fork_update_nvt_cache ();
+ }
+
diff --git a/community/gvm/001-sys-siglist.patch b/community/gvm/001-sys-siglist.patch
new file mode 100644
index 0000000000..7978f0550f
--- /dev/null
+++ b/community/gvm/001-sys-siglist.patch
@@ -0,0 +1,53 @@
+diff --git a/src/manage_sql.c b/src/manage_sql.c
+index e316374..83d00e9 100644
+--- a/src/manage_sql.c
++++ b/src/manage_sql.c
+@@ -12709,7 +12709,7 @@ void
+ manage_cleanup_process_error (int signal)
+ {
+ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Received %s signal.\n",
+- sys_siglist[signal]);
++ strsignal(signal));
+ if (sql_is_open ())
+ {
+ if (current_scanner_task)
+diff --git a/src/openvasmd.c b/src/openvasmd.c
+index 808a8f1..c9981ad 100644
+--- a/src/openvasmd.c
++++ b/src/openvasmd.c
+@@ -661,7 +661,7 @@ setup_signal_handler (int signal, void (*handler) (int), int block)
+ if (sigaction (signal, &action, NULL) == -1)
+ {
+ g_critical ("%s: failed to register %s handler\n",
+- __FUNCTION__, sys_siglist[signal]);
++ __FUNCTION__, strsignal(signal));
+ exit (EXIT_FAILURE);
+ }
+ }
+@@ -1025,7 +1025,7 @@ serve_and_schedule ()
+ if (termination_signal)
+ {
+ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Received %s signal.\n",
+- sys_siglist[termination_signal]);
++ strsignal(termination_signal));
+ cleanup ();
+ /* Raise signal again, to exit with the correct return value. */
+ setup_signal_handler (termination_signal, SIG_DFL, 0);
+@@ -1036,7 +1036,7 @@ serve_and_schedule ()
+ if (sighup_update_nvt_cache)
+ {
+ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Received %s signal.\n",
+- sys_siglist[SIGHUP]);
++ strsignal(SIGHUP));
+ sighup_update_nvt_cache = 0;
+ fork_update_nvt_cache ();
+ }
+@@ -1095,7 +1095,7 @@ serve_and_schedule ()
+ if (termination_signal)
+ {
+ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Received %s signal.\n",
+- sys_siglist[termination_signal]);
++ strsignal(termination_signal));
+ cleanup ();
+ /* Raise signal again, to exit with the correct return value. */
+ setup_signal_handler (termination_signal, SIG_DFL, 0);
diff --git a/community/gvm/002-fortify-source.patch b/community/gvm/002-fortify-source.patch
new file mode 100644
index 0000000000..539fa7eef5
--- /dev/null
+++ b/community/gvm/002-fortify-source.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 203f8b9..403e091 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -284,7 +284,7 @@ configure_file (tools/openvas-migrate-to-postgres.in tools/openvas-migrate-to-po
+
+ ## Program
+
+-set (HARDENING_FLAGS "-Wformat -Wformat-security -O2 -D_FORTIFY_SOURCE=2 -fstack-protector -Wl,-z,relro -Wl,-z,now")
++set (HARDENING_FLAGS "-Wformat -Wformat-security -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -Wl,-z,relro -Wl,-z,now")
+
+ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${HARDENING_FLAGS} -Wall -D_BSD_SOURCE -D_ISOC99_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64")
diff --git a/community/gvm/003-sqlite-insert.patch b/community/gvm/003-sqlite-insert.patch
new file mode 100644
index 0000000000..da51fa496a
--- /dev/null
+++ b/community/gvm/003-sqlite-insert.patch
@@ -0,0 +1,31 @@
+diff --git a/src/manage_sql.c b/src/manage_sql.c
+index e316374..4aedd83 100644
+--- a/src/manage_sql.c
++++ b/src/manage_sql.c
+@@ -11016,7 +11016,7 @@ check_db_settings ()
+ " ('a6ac88c5-729c-41ba-ac0a-deea4a3441f2', NULL,"
+ " 'Details Export File Name',"
+ " 'File name format string for the export of resource details.',"
+- " '%T-%U');");
++ " '%%T-%%U');");
+
+ if (sql_int ("SELECT count(*) FROM settings"
+ " WHERE uuid = '0872a6ed-4f85-48c5-ac3f-a5ef5e006745'"
+@@ -11027,7 +11027,7 @@ check_db_settings ()
+ " ('0872a6ed-4f85-48c5-ac3f-a5ef5e006745', NULL,"
+ " 'List Export File Name',"
+ " 'File name format string for the export of resource lists.',"
+- " '%T-%D');");
++ " '%%T-%%D');");
+
+ if (sql_int ("SELECT count(*) FROM settings"
+ " WHERE uuid = 'e1a2ae0b-736e-4484-b029-330c9e15b900'"
+@@ -11038,7 +11038,7 @@ check_db_settings ()
+ " ('e1a2ae0b-736e-4484-b029-330c9e15b900', NULL,"
+ " 'Report Export File Name',"
+ " 'File name format string for the export of reports.',"
+- " '%T-%U');");
++ " '%%T-%%U');");
+
+ }
+
diff --git a/community/gvm/APKBUILD b/community/gvm/APKBUILD
new file mode 100644
index 0000000000..2f8cd79cc3
--- /dev/null
+++ b/community/gvm/APKBUILD
@@ -0,0 +1,53 @@
+# Contributor: Francesco Colista <fcolista@alpinelinux.org>
+# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
+pkgname=gvm
+pkgver=7.0.2
+pkgrel=3
+pkgdesc="A layer between the OpenVAS Scanner and various client applications"
+url="http://www.openvas.org/"
+arch="all"
+license="GPL"
+depends="rsync sqlite libxslt sed gnutls-utils"
+makedepends="cmake gvm-libs-dev sqlite-dev
+ libxslt-dev doxygen xmltoman perl-sql-translator
+ gpgme-dev libgcrypt-dev graphviz"
+checkdepends="cppcheck"
+subpackages="$pkgname-doc"
+replaces="openvas-manager"
+source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/$pkgname/archive/v$pkgver.tar.gz
+ $pkgname.initd
+ $pkgname.confd
+ $pkgname.logrotate
+ 000-sys-siglist.patch
+ backport-r29476.patch"
+builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+ cd "$builddir"
+ cmake -DCMAKE_BUILD_TYPE=Release \
+ -DSBINDIR=/usr/bin \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DSYSCONFDIR=/etc \
+ -DLOCALSTATEDIR=/var .
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ install -Dm644 "$srcdir/$pkgname.logrotate" "$pkgdir/etc/logrotate.d/$pkgname"
+ install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
+ install -Dm755 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname"
+}
+
+sha512sums="52792822768c1f145a3ecc63511db15c143b43b644733b627bbcde77c1d126e623d421392cd3bd7d4a16fb1517857393178963a26f0f6afd57c93df766daa786 gvm-7.0.2.tar.gz
+932ba8dd818faf5158472da4d1305c6f6c84834334721aa358e2e9f1d7419cdd6e366f4e9ea9b19412e00010f919dc9155346ed0566eca533e973abe80f3ee67 gvm.initd
+5946db68bb5f7b3bf7cbae208a0fea6c9e023631d9fcd610539d2cf7c6290c8f7c2f55e0b4c7011c2263584b9eb42c7eae07db338917e8cc49acb63eb3950e1f gvm.confd
+a86f156ca822b7b9844dc1cb1cb65c0d2bc146fa4dde64fec851b13b3eaa54fd984946b9336a2ffd0efbaf1c2053ab417067519fb18b807c5c1ce66cf1ee4a9b gvm.logrotate
+f4ce7cb1fc4f34e5679f9e1005cf2ea57cbb3b5807910d5d44cea9499f2ff780feac6b93d1a66d5533106414f60631b274d993b281e4bd5089cd7827d08a5306 000-sys-siglist.patch
+90d71203566d282b83c480440300805f46fb93bccde67e905f020d3e651d20b55040bdd4692c1ce12a47e7384b1e10c196a5e3d857afc752b8b4f66238b0e57b backport-r29476.patch"
diff --git a/community/gvm/backport-r29476.patch b/community/gvm/backport-r29476.patch
new file mode 100644
index 0000000000..8fa21c4128
--- /dev/null
+++ b/community/gvm/backport-r29476.patch
@@ -0,0 +1,13 @@
+--- openvas-manager-7.0/src/openvasmd.c 2017-08-30 21:03:46 UTC (rev 29475)
++++ openvas-manager-7.0/src/openvasmd.c 2017-08-30 21:25:35 UTC (rev 29476)
+@@ -661,8 +661,8 @@
+ {
+ if (openvas_server_new (GNUTLS_CLIENT,
+ CACERT,
+- SCANNERCERT,
+- SCANNERKEY,
++ CLIENTCERT,
++ CLIENTKEY,
+ &client_connection->session,
+ &client_connection->credentials))
+ exit (EXIT_FAILURE);
diff --git a/community/gvm/gvm.confd b/community/gvm/gvm.confd
new file mode 100644
index 0000000000..261836037d
--- /dev/null
+++ b/community/gvm/gvm.confd
@@ -0,0 +1,13 @@
+#Manager listens on given address - by default manager listens on all addresses
+MANAGER_LISTEN=--listen=127.0.0.1
+
+#Manager listens on given port - by default 9390
+MANAGER_PORT=--port=9390
+
+MANAGER_EXTRA_ARGS=""
+
+#Contact scanner on given address
+SCANNER_LISTEN="--scanner-host=127.0.0.1"
+
+#Scanner listens on given port - by default 9391
+SCANNER_PORT="--scanner-port=9391"
diff --git a/community/gvm/gvm.initd b/community/gvm/gvm.initd
new file mode 100644
index 0000000000..d0045d5b2e
--- /dev/null
+++ b/community/gvm/gvm.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+name="OpenVAS Manager"
+command=/usr/bin/openvasmd
+command_args="${MANAGER_LISTEN} ${MANAGER_PORT} ${SCANNER_LISTEN} ${SCANNER_PORT} ${MANAGER_EXTRA_ARGS}"
+pidfile="/run/openvasmd.pid"
+
+depend() {
+ after bootmisc
+ need localmount net openvassd
+}
+
+start_pre() {
+ checkpath --directory --mode 0775 --quiet /var/cache/openvas
+}
+
diff --git a/community/gvm/gvm.logrotate b/community/gvm/gvm.logrotate
new file mode 100644
index 0000000000..69cfa26b19
--- /dev/null
+++ b/community/gvm/gvm.logrotate
@@ -0,0 +1,11 @@
+# logrotate for openvas-manager
+/var/log/openvas/openvasmd.log {
+ rotate 4
+ weekly
+ compress
+ delaycompress
+ missingok
+ postrotate
+ /bin/kill -HUP `pidof openvasmd`
+ endscript
+}