[openvas-scanner] fixed reporting of the missing certificates in the startscript

rebus rebus at fedoraproject.org
Tue Jan 24 07:49:43 UTC 2012


commit 092200e8e8924b75b60d19ab6743e482079b117f
Author: Michal Ambroz <rebus at seznam.cz>
Date:   Tue Jan 24 08:49:05 2012 +0100

    fixed reporting of the missing certificates in the startscript

 openvas-scanner.initd |   15 ++++++++++++++-
 openvas-scanner.spec  |    5 ++++-
 2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/openvas-scanner.initd b/openvas-scanner.initd
index dcd86ab..950bfb9 100644
--- a/openvas-scanner.initd
+++ b/openvas-scanner.initd
@@ -54,10 +54,23 @@ start() {
 
 	CACERT=`grep ca_file $config | cut -d= -f2`
 	if [ \! -z "$CACERT" -a \! -f "$CACERT" ]; then
-		logger --tag "$progname" "Certificate specified in the configuration file not found. Did you run openvas-mkcert tool?"
+		logger --tag "$progname" "CA Certificate specified in the configuration file not found. Did you run openvas-mkcert tool?"
 		exit 2
 	fi
 
+	KEYFILE=`grep key_file $config | cut -d= -f2`
+	if [ \! -z "$KEYFILE" -a \! -f "$KEYFILE" ]; then
+		logger --tag "$progname" "Private key specified in the configuration file not found. Did you run openvas-mkcert tool?"
+		exit 2
+	fi
+
+	CERTFILE=`grep cert_file $config | cut -d= -f2`
+	if [ \! -z "$CERTFILE" -a \! -f "$CERTFILE" ]; then
+		logger --tag "$progname" "Public Certificate specified in the configuration file not found. Did you run openvas-mkcert tool?"
+		exit 2
+	fi
+
+
 	echo "Starting $progname:"
 	daemon --pidfile=/var/run/$prog.pid $prog -q $PARAMS
 	RETVAL=$?
diff --git a/openvas-scanner.spec b/openvas-scanner.spec
index 5489d37..2bf848d 100644
--- a/openvas-scanner.spec
+++ b/openvas-scanner.spec
@@ -1,7 +1,7 @@
 Name:		openvas-scanner
 Summary:	Open Vulnerability Assessment (OpenVAS) Scanner
 Version:	3.2.5
-Release:	3%{?dist}
+Release:	4%{?dist}
 URL:		http://www.openvas.org
 License:	GPLv2
 Group:		System Environment/Libraries
@@ -210,6 +210,9 @@ fi
 #attr(644,root,root) _{_libdir}/openvas/plugins/*.nes
 
 %changelog
+* Mon Jan 23 2012 Michal Ambroz <rebus at, seznam.cz> - 3.2.5-4
+- fixed reporting of missing key file
+
 * Mon Jan 23 2012 Michal Ambroz <rebus at, seznam.cz> - 3.2.5-3
 - changed init.d script to display hints about openvas-mkcert in syslog
 


More information about the scm-commits mailing list