[openvas-scanner] Bump to OpenVAS 4 release version openvas-scanner-3.2.2

rebus rebus at fedoraproject.org
Sat Mar 26 22:50:42 UTC 2011


commit 71619f6f3479bad89bc76eed753ae8223530e171
Author: Michal Ambroz <rebus at seznam.cz>
Date:   Sat Mar 26 23:48:35 2011 +0100

    Bump to OpenVAS 4 release version openvas-scanner-3.2.2

 openvas-scanner-notused.patch |  158 +++++++++++++++++++++++++++++++++++++++++
 openvas-scanner.spec          |   16 +++-
 2 files changed, 170 insertions(+), 4 deletions(-)
---
diff --git a/openvas-scanner-notused.patch b/openvas-scanner-notused.patch
new file mode 100644
index 0000000..ac2e0c1
--- /dev/null
+++ b/openvas-scanner-notused.patch
@@ -0,0 +1,158 @@
+New version of gcc used for fedora 15 is reporting errors with -Werror also for
+variables set, but never used.
+Where it was obvious I fixed the code. In other cases avoid this error by:
+(void)variable;
+diff -ru openvas-scanner-3.2.2/src/attack.c openvas-scanner-3.2.2.new/src/attack.c
+--- openvas-scanner-3.2.2/src/attack.c	2011-02-21 10:40:34.000000000 +0100
++++ openvas-scanner-3.2.2.new/src/attack.c	2011-03-26 13:00:43.000000000 +0100
+@@ -939,7 +939,9 @@
+ {
+   int max_hosts = 0;
+   int num_tested = 0;
++  /* variable set but not used
+   int host_pending = 0;
++  */
+   char hostname[1024];
+   char *hostlist;
+   struct in6_addr host_ip;
+@@ -1139,7 +1141,9 @@
+             }
+         }
+ 
++      /* variable set but not used
+       host_pending = 0;
++      */
+       memcpy (&addrs.ip6, &host_ip, sizeof (struct in6_addr));
+ 
+       /* Do we have the right to test this host ? */
+@@ -1156,9 +1160,11 @@
+           int s;
+           char *MAC = NULL;
+           int mac_err = -1;
++	  /*variable set but not used
+           struct in_addr addr;
+ 
+           addr.s_addr = host_ip.s6_addr32[3];
++	  */
+           if (preferences_use_mac_addr (preferences)
+               && v6_is_local_ip (&host_ip))
+             {
+diff -ru openvas-scanner-3.2.2/src/nasl_plugins.c openvas-scanner-3.2.2.new/src/nasl_plugins.c
+--- openvas-scanner-3.2.2/src/nasl_plugins.c	2011-02-21 10:40:34.000000000 +0100
++++ openvas-scanner-3.2.2.new/src/nasl_plugins.c	2011-03-26 13:05:19.000000000 +0100
+@@ -253,6 +253,10 @@
+ 
+   if (preferences_benice (NULL))
+     nice_retval = nice (-5);
++  
++  /* avoid compilation error as variable nice_retval is set but not used now */
++  (void)nice_retval;
++
+   // @todo: Check value of nice_retval to see if it was successful.
+   // Keep in mind that even -1 can mean success here; see man page of nice
+   // for details.
+diff -ru openvas-scanner-3.2.2/src/ntp_11.c openvas-scanner-3.2.2.new/src/ntp_11.c
+--- openvas-scanner-3.2.2/src/ntp_11.c	2011-02-21 10:40:34.000000000 +0100
++++ openvas-scanner-3.2.2.new/src/ntp_11.c	2011-03-26 13:12:06.000000000 +0100
+@@ -812,11 +812,11 @@
+   while (plugins->next)
+     {
+       struct arglist *args = plugins->value;
+-      struct arglist *d, *deps;
++      struct arglist *deps;
+       if (!args)
+         goto nxt;
+ 
+-      d = deps = plug_get_deps (args);
++      deps = plug_get_deps (args);
+       if (deps == NULL)
+         goto nxt;
+ 
+diff -ru openvas-scanner-3.2.2/src/openvassd.c openvas-scanner-3.2.2.new/src/openvassd.c
+--- openvas-scanner-3.2.2/src/openvassd.c	2011-02-21 10:40:34.000000000 +0100
++++ openvas-scanner-3.2.2.new/src/openvassd.c	2011-03-26 13:13:56.000000000 +0100
+@@ -429,6 +429,10 @@
+   /* Everyone runs with a nicelevel of 10 */
+   if (preferences_benice (prefs))
+     nice_retval = nice (10);
++
++  /* avoid compilation error as variable nice_retval is set but not used */
++  (void) nice_retval;
++
+   // @todo: Check value of nice_retval to see if it was successful.
+   // Keep in mind that even -1 can mean success here; see man page of nice
+   // for details.
+diff -ru openvas-scanner-3.2.2/src/oval_plugins.c openvas-scanner-3.2.2.new/src/oval_plugins.c
+--- openvas-scanner-3.2.2/src/oval_plugins.c	2011-02-21 10:40:34.000000000 +0100
++++ openvas-scanner-3.2.2.new/src/oval_plugins.c	2011-03-26 13:18:28.000000000 +0100
+@@ -442,6 +442,9 @@
+                 ("This OVAL file contains the following definitions:\n",
+                  g_strndup (descriptions, 3100),
+                  "\n(list cut due to memory limitations)", NULL);
++
++		/* avoid compilation error as variable description is set but never used */
++		(void) description;
+             }
+           else
+             {
+diff -ru openvas-scanner-3.2.2/src/preferences.c openvas-scanner-3.2.2.new/src/preferences.c
+--- openvas-scanner-3.2.2/src/preferences.c	2011-02-21 10:40:34.000000000 +0100
++++ openvas-scanner-3.2.2.new/src/preferences.c	2011-03-26 21:31:23.000000000 +0100
+@@ -452,7 +452,10 @@
+ int
+ preferences_drop_privileges (struct arglist *preferences, char *oid)
+ {
++  /* variable set but never used
+   char *pref;
++  */
++
+   int ret = 0;
+ 
+   if (preferences == NULL)
+@@ -464,7 +467,9 @@
+         ret = 1;
+     }
+ 
++  /* variable set but never used
+   pref = arg_get_value (preferences, "drop_privileges");
++  */
+   return ret;
+ }
+ 
+diff -ru openvas-scanner-3.2.2/src/shared_socket.c openvas-scanner-3.2.2.new/src/shared_socket.c
+--- openvas-scanner-3.2.2/src/shared_socket.c	2011-02-21 10:40:34.000000000 +0100
++++ openvas-scanner-3.2.2.new/src/shared_socket.c	2011-03-26 21:35:51.000000000 +0100
+@@ -96,10 +96,15 @@
+ 
+   char *buffer = NULL;
+   int bufsz = 0;
++  /* variable set but never used
+   int e;
++  */
+   int type;
+ 
++  /* variable set but never used
+   e = internal_recv (soc, &buffer, &bufsz, &type);
++  */
++  internal_recv (soc, &buffer, &bufsz, &type);
+   if ((type & INTERNAL_COMM_MSG_SHARED_SOCKET) == 0
+       || (type & INTERNAL_COMM_SHARED_SOCKET_DORECVMSG) == 0)
+     {
+diff -ru openvas-scanner-3.2.2/src/sighand.c openvas-scanner-3.2.2.new/src/sighand.c
+--- openvas-scanner-3.2.2/src/sighand.c	2011-02-21 10:40:34.000000000 +0100
++++ openvas-scanner-3.2.2.new/src/sighand.c	2011-03-26 21:39:53.000000000 +0100
+@@ -46,9 +46,14 @@
+ void
+ let_em_die (int pid)
+ {
++  /* variable x set but never used
+   int status, x;
+ 
+   x = waitpid (pid, &status, WNOHANG);
++  */
++
++  int status;
++  waitpid (pid, &status, WNOHANG);
+ }
+ 
+ 
diff --git a/openvas-scanner.spec b/openvas-scanner.spec
index 079aded..d4a49a8 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.2
-Release:	1%{?dist}
+Release:	2%{?dist}
 URL:		http://www.openvas.org
 License:	GPLv2
 Group:		System Environment/Libraries
@@ -18,7 +18,7 @@ Source6:	openvas-nvt-sync-cronjob
 #Separation of feeds is currently not possible because nasl script_dependencies doesn't search in all include_folders
 #Patch0:		openvas-scanner-nvtfeed.patch
 
-#Accomodate to /etc/pki as suggested by http://fedoraproject.org/wiki/PackagingDrafts/Certificates
+#Put certs to /etc/pki as suggested by http://fedoraproject.org/wiki/PackagingDrafts/Certificates
 #Not reported upstream as it is RedHat/Fedora specific
 Patch1:		openvas-scanner-pki.patch
 
@@ -30,8 +30,13 @@ Patch2:		openvas-scanner-mkcertclient.patch
 #Reported upstream http://wald.intevation.org/tracker/?func=detail&aid=1940&group_id=29&atid=220
 Patch3:		openvas-scanner-rulesdir.patch
 
+#Fix compile time errors for F15 where variables set but not used are reported as error
+#Reported upstream http://wald.intevation.org/tracker/?func=detail&aid=1942&group_id=29&atid=220
+Patch4:		openvas-scanner-notused.patch
+
+
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires:	openvas-libraries-devel >= 4.0.0
+BuildRequires:	openvas-libraries-devel
 BuildRequires:	cmake >= 2.6.0
 BuildRequires:	glib2-devel
 BuildRequires:	libpcap-devel
@@ -76,6 +81,8 @@ Scanner module for the Open Vulnerability Assessment System (OpenVAS).
 %patch1 -p 1 -b .pkipath
 %patch2 -p 1 -b .mkcert
 %patch3 -p 1 -b .rules
+%patch4 -p 1 -b .notused
+
 
 for i in CHANGES ChangeLog; do
 	iconv -f iso8859-1 -t utf-8 $i > $i.utf8 && \
@@ -85,6 +92,7 @@ done
 
 %build
 #configure --disable-static
+export CFLAGS=-Werror=unused-but-set-variable
 %cmake -DLOCALSTATEDIR:PATH=%{_var} -DOPENVASSD_RULES:PATH=%{_sysconfdir}/openvas/openvassd.rules
 make %{?_smp_mflags}
 
@@ -149,7 +157,7 @@ rm -rf %{buildroot}
 
 %post
 # This adds the proper /etc/rc*.d links for the script
-if [ $1 = 1 ]; then
+if [ "$1" -eq 1 ]; then
 	/sbin/chkconfig --add openvas-scanner
 fi
 


More information about the scm-commits mailing list