[Openvas-commits] r12163 - in trunk/openvas-scanner: . tools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 23 11:57:23 CET 2011


Author: mwiegand
Date: 2011-11-23 11:57:22 +0100 (Wed, 23 Nov 2011)
New Revision: 12163

Modified:
   trunk/openvas-scanner/ChangeLog
   trunk/openvas-scanner/tools/greenbone-nvt-sync
Log:
* tools/greenbone-nvt-sync: Quote variables in tests to ensure strings
  containing spaces are handled correctly.


Modified: trunk/openvas-scanner/ChangeLog
===================================================================
--- trunk/openvas-scanner/ChangeLog	2011-11-23 07:33:19 UTC (rev 12162)
+++ trunk/openvas-scanner/ChangeLog	2011-11-23 10:57:22 UTC (rev 12163)
@@ -1,3 +1,8 @@
+2011-11-23  Michael Wiegand <michael.wiegand at greenbone.net>
+
+	* tools/greenbone-nvt-sync: Quote variables in tests to ensure strings
+	containing spaces are handled correctly.
+
 2011-11-10  Michael Wiegand <michael.wiegand at greenbone.net>
 
 	* CMakeLists.txt: Adjust source locations in install command to enable

Modified: trunk/openvas-scanner/tools/greenbone-nvt-sync
===================================================================
--- trunk/openvas-scanner/tools/greenbone-nvt-sync	2011-11-23 07:33:19 UTC (rev 12162)
+++ trunk/openvas-scanner/tools/greenbone-nvt-sync	2011-11-23 10:57:22 UTC (rev 12163)
@@ -91,7 +91,7 @@
   fi
 
   SCANNER_BINARY=`command -v openvassd`
-  if [ -z $SCANNER_BINARY ]
+  if [ -z "$SCANNER_BINARY" ]
   then
     stderr_write "== greenbone-nvt-sync $VERSION ================================================"
     stderr_write "Could not locate your OpenVAS Scanner."
@@ -112,10 +112,10 @@
 
   [ -r $sysconfdir/openvas/greenbone-nvt-sync.conf ] && . $sysconfdir/openvas/greenbone-nvt-sync.conf
 
-  if [ -z $NVT_DIR ]
+  if [ -z "$NVT_DIR" ]
   then
     NVT_DIR=`$SCANNER_BINARY -s | grep plugins_folder | sed 's/plugins\_folder\ *=\ *//'`
-    if [ -z $NVT_DIR ]
+    if [ -z "$NVT_DIR" ]
     then
       stderr_write "== greenbone-nvt-sync $VERSION ================================================"
       stderr_write "Could not determine the location of your NVT collection."
@@ -171,7 +171,7 @@
   mkdir -p "$NVT_DIR"
   read feeduser < $sysconfdir/openvas/gsf-access-key
   custid=`awk -F@ 'NR > 1 { exit }; { print $1 }' $sysconfdir/openvas/gsf-access-key`
-  if [ -z $feeduser ] || [ -z $custid ]
+  if [ -z "$feeduser" ] || [ -z "$custid" ]
   then
     stderr_write "== greenbone-nvt-sync $VERSION ================================================"
     stderr_write "Feed synchronization was not possible because credential information could not"
@@ -194,7 +194,7 @@
       gsmproxy=`grep proxy_feed /admin/ezcli.state | sed -e 's/^.*\/\///' -e 's/:/ /' -e 's/[\t ]*$//'`
       PORT=`grep ^syncport /admin/ezcli.state | sed -e "s/^syncport\t//g"`
     fi
-    if [ "$gsmproxy" = "proxy_feed" ] || [ -z $gsmproxy ]
+    if [ "$gsmproxy" = "proxy_feed" ] || [ -z "$gsmproxy" ]
     then
       rsync -e "ssh -o \"BatchMode=yes\" -p $PORT -i $sysconfdir/openvas/gsf-access-key" -ltrP $RSYNC_VERBOSE --protocol=29 $RSYNC_DELETE $feeduser $NVT_DIR
     else
@@ -316,7 +316,7 @@
 
 do_describe ()
 {
-  if [ -z $NVT_DIR ] ; then
+  if [ -z "$NVT_DIR" ] ; then
     init_sync
   fi
   echo "This script synchronizes an NVT collection with the '$FEED_NAME'."
@@ -325,7 +325,7 @@
 }
 
 do_feedversion () {
-  if [ -z $NVT_DIR ] ; then
+  if [ -z "$NVT_DIR" ] ; then
     init_sync
   fi
   if [ $FEED_PRESENT -eq 1 ] ; then



More information about the Openvas-commits mailing list