aboutsummaryrefslogtreecommitdiffstats
path: root/testing/openvas-manager
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-08-18 12:26:02 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-08-18 12:26:02 +0000
commit11bb90420d74b579256bd81c9b8c37208577339c (patch)
tree7f1f5e8ebd2229d8f045d842dfdd7f00c4a07454 /testing/openvas-manager
parente4aabbb60710901fb208c3a5516a67aee2e02f35 (diff)
downloadaports-11bb90420d74b579256bd81c9b8c37208577339c.tar.bz2
aports-11bb90420d74b579256bd81c9b8c37208577339c.tar.xz
Revert "community/openvas-manager: moved from testing"
Diffstat (limited to 'testing/openvas-manager')
-rw-r--r--testing/openvas-manager/001-sys-siglist.patch53
-rw-r--r--testing/openvas-manager/002-fortify-source.patch13
-rw-r--r--testing/openvas-manager/003-sqlite-insert.patch31
-rw-r--r--testing/openvas-manager/APKBUILD71
-rw-r--r--testing/openvas-manager/openvasmd.confd13
-rw-r--r--testing/openvas-manager/openvasmd.initd19
-rw-r--r--testing/openvas-manager/openvasmd.logrotate11
7 files changed, 211 insertions, 0 deletions
diff --git a/testing/openvas-manager/001-sys-siglist.patch b/testing/openvas-manager/001-sys-siglist.patch
new file mode 100644
index 0000000000..7978f0550f
--- /dev/null
+++ b/testing/openvas-manager/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/testing/openvas-manager/002-fortify-source.patch b/testing/openvas-manager/002-fortify-source.patch
new file mode 100644
index 0000000000..539fa7eef5
--- /dev/null
+++ b/testing/openvas-manager/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/testing/openvas-manager/003-sqlite-insert.patch b/testing/openvas-manager/003-sqlite-insert.patch
new file mode 100644
index 0000000000..da51fa496a
--- /dev/null
+++ b/testing/openvas-manager/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/testing/openvas-manager/APKBUILD b/testing/openvas-manager/APKBUILD
new file mode 100644
index 0000000000..146cda7b85
--- /dev/null
+++ b/testing/openvas-manager/APKBUILD
@@ -0,0 +1,71 @@
+# Contributor: Francesco Colista <fcolista@alpinelinux.org>
+# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
+pkgname=openvas-manager
+_pkgname=openvasmd
+pkgver=6.0.8
+_pkgid=2295
+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"
+depends_dev=""
+makedepends="$depends_dev cmake openvas-libraries-dev sqlite-dev
+ libxslt-dev doxygen xmltoman perl-sql-translator"
+install=""
+subpackages="$pkgname-doc"
+source="http://wald.intevation.org/frs/download.php/$_pkgid/$pkgname-${pkgver}.tar.gz
+ $_pkgname.initd
+ $_pkgname.confd
+ $_pkgname.logrotate
+ 001-sys-siglist.patch
+ 002-fortify-source.patch"
+_builddir="$srcdir"/$pkgname-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ cmake -DCMAKE_BUILD_TYPE=Release \
+ -DSBINDIR=/usr/bin \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DSYSCONFDIR=/etc \
+ -DLOCALSTATEDIR=/var .
+ make || return 1
+}
+
+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"
+
+}
+
+md5sums="8a282a5ddaac91f5a8190c4a7ba72e51 openvas-manager-6.0.8.tar.gz
+1daea41f920aac1d675bf4bb8af05063 openvasmd.initd
+8534212d73d54166afd624bbe3964cc7 openvasmd.confd
+f57ae79654fb9a6249ce883ebb393d3d openvasmd.logrotate
+0113d65199172756cb797b4bb30d4007 001-sys-siglist.patch
+bec2936ebf70209835b963ddbebf3b31 002-fortify-source.patch"
+sha256sums="498f72a047841d55102ed50a16b0a096f66a5c951010cfaa3241689d693c11d7 openvas-manager-6.0.8.tar.gz
+3611840794e1c08082417f776cb124171707cde1699c0c3ea737e178fe40ede7 openvasmd.initd
+6ffaacaca5c58b54b3aa34a262172994dc6c6e286d036cd9aeecf3dda215fdb9 openvasmd.confd
+8dce4905097d7e622a87d661903193480806968c55f085bd4ad167ea3864f84d openvasmd.logrotate
+8c13641fc26660fe2f600fc9a4e7d5901e0892b6195ad401c92edec75e9f402d 001-sys-siglist.patch
+78919051580bb1077f6061d9285f9343d155ee3c955e2a440ef067f58efe1a4b 002-fortify-source.patch"
+sha512sums="f01ea7f83796236de0ee4c9499564bef257ad19df56c9a2784bf306e98d5294f717d2a9e88ecf613f1f530ce570c21eee94532e87b6173a0339f6f8c5c8bd04b openvas-manager-6.0.8.tar.gz
+932ba8dd818faf5158472da4d1305c6f6c84834334721aa358e2e9f1d7419cdd6e366f4e9ea9b19412e00010f919dc9155346ed0566eca533e973abe80f3ee67 openvasmd.initd
+5946db68bb5f7b3bf7cbae208a0fea6c9e023631d9fcd610539d2cf7c6290c8f7c2f55e0b4c7011c2263584b9eb42c7eae07db338917e8cc49acb63eb3950e1f openvasmd.confd
+a86f156ca822b7b9844dc1cb1cb65c0d2bc146fa4dde64fec851b13b3eaa54fd984946b9336a2ffd0efbaf1c2053ab417067519fb18b807c5c1ce66cf1ee4a9b openvasmd.logrotate
+bb68fb95e48cf6b0602023d566b05fb675b55a703b0ecf616d0ff42fd7fc023396d2ef8ea089e074739e980a086d9911894050c23c03c842e5c7393be6d85639 001-sys-siglist.patch
+a3ab3773f339efa98abdba77aaf383f6c1d76c7f15557ac6f8bc80199158066d6ac3a7981e1af4ac4e397b66acb48c1cba125848b30e935829a75a5a7e8322dc 002-fortify-source.patch"
diff --git a/testing/openvas-manager/openvasmd.confd b/testing/openvas-manager/openvasmd.confd
new file mode 100644
index 0000000000..261836037d
--- /dev/null
+++ b/testing/openvas-manager/openvasmd.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/testing/openvas-manager/openvasmd.initd b/testing/openvas-manager/openvasmd.initd
new file mode 100644
index 0000000000..d0045d5b2e
--- /dev/null
+++ b/testing/openvas-manager/openvasmd.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/testing/openvas-manager/openvasmd.logrotate b/testing/openvas-manager/openvasmd.logrotate
new file mode 100644
index 0000000000..69cfa26b19
--- /dev/null
+++ b/testing/openvas-manager/openvasmd.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
+}