[Openvas-commits] r3112 - in trunk/openvas-libraries: . libopenvas

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Apr 16 17:53:58 CEST 2009


Author: jan
Date: 2009-04-16 17:53:58 +0200 (Thu, 16 Apr 2009)
New Revision: 3112

Modified:
   trunk/openvas-libraries/ChangeLog
   trunk/openvas-libraries/libopenvas/network.c
Log:
* libopenvas/network.c: Removed any code path for conditional
NESSUS_CNX_LOCK. This was a "Quick & dirty patch to run Nessus
from behind a picky firewall (e.g. FW/1 and his 'Rule 0'): Nessus
will never open more than 1 connection at a time."
It appears to be deseperately outdated and never used.
OpenVAS allows to configure the number of concurrent checks,
so this should be the way to go in case of firewall-based problems.



Modified: trunk/openvas-libraries/ChangeLog
===================================================================
--- trunk/openvas-libraries/ChangeLog	2009-04-16 14:39:16 UTC (rev 3111)
+++ trunk/openvas-libraries/ChangeLog	2009-04-16 15:53:58 UTC (rev 3112)
@@ -1,5 +1,15 @@
 2009-04-16  Jan-Oliver Wagner <jan-oliver.wagner at intevation.de>
 
+	* libopenvas/network.c: Removed any code path for conditional
+	NESSUS_CNX_LOCK. This was a "Quick & dirty patch to run Nessus
+	from behind a picky firewall (e.g. FW/1 and his 'Rule 0'): Nessus
+	will never open more than 1 connection at a time."
+	It appears to be deseperately outdated and never used.
+	OpenVAS allows to configure the number of concurrent checks,
+	so this should be the way to go in case of firewall-based problems.
+
+2009-04-16  Jan-Oliver Wagner <jan-oliver.wagner at intevation.de>
+
 	* libopenvas/openvas_server.h, libopenvas/openvas_server.c
 	(openvas_server_connect_to_server): Renamed to openvas_server_open.
 	(openvas_server_close_server_connection): Renamed to openvas_server_close.

Modified: trunk/openvas-libraries/libopenvas/network.c
===================================================================
--- trunk/openvas-libraries/libopenvas/network.c	2009-04-16 14:39:16 UTC (rev 3111)
+++ trunk/openvas-libraries/libopenvas/network.c	2009-04-16 15:53:58 UTC (rev 3112)
@@ -93,23 +93,6 @@
 static nessus_connection connections[NESSUS_FD_MAX];
 
 /**
- * Quick & dirty patch to run Nessus from behind a picky firewall (e.g.
- * FW/1 and his 'Rule 0'): Nessus will never open more than 1 connection at
- * a time.
- * Define NESSUS_CNX_LOCK, recompile and install nessus-library, and restart nessusd
- *
- * WARNING: waiting on the lock file may be long, so increase the default
- * script timeout or some scripts may be killed.
- */
-#undef NESSUS_CNX_LOCK
-/*#define NESSUS_CNX_LOCK	"/tmp/NessusCnx"*/
-
-#ifdef NESSUS_CNX_LOCK
-static int	lock_cnt = 0;
-static int	lock_fd = -1;
-#endif
-
-/**
  * NESSUS_STREAM(x) is TRUE if <x> is a Nessus-ified fd
  */
 #define NESSUS_STREAM(x) (((x - NESSUS_FD_OFF) < NESSUS_FD_MAX) && ((x - NESSUS_FD_OFF) >=0))
@@ -1914,37 +1897,6 @@
 
   set_socket_source_addr(soc, 0);
 
-#if defined NESSUS_CNX_LOCK
-  if (lock_cnt == 0)
-{
-      lock_fd = open(NESSUS_CNX_LOCK, O_RDWR|O_CREAT);
-      if (lock_fd < 0)
-	nessus_perror(NESSUS_CNX_LOCK);
-      else
-	{
-	  time_t	t1 = time(NULL), t2;
-	  if (flock(lock_fd, LOCK_EX) < 0)
-	    nessus_perror(NESSUS_CNX_LOCK);
-	  else
-	    {
-	      lock_cnt ++;
-	      t2 = time(NULL);
-#if 1
-	      if (t2 - t1 > 0)
-		fprintf(stderr, "[%d] open_socket: " NESSUS_CNX_LOCK " locked in %d s\n", getpid(), t2 - t1);
-#endif
-	    }
-	}
-    }
-  else
-    {
-#if 1
-      fprintf(stderr, "[%d] open_socket: sleeping 1 second\n", getpid());
-#endif
-      sleep(1);
-    }
-#endif  
-  
   if (connect(soc, (struct sockaddr*) paddr, sizeof(*paddr)) < 0)
     {
 #if DEBUG_SSL > 2
@@ -2302,17 +2254,6 @@
 socket_close(soc)
 int soc;
 {
-#if defined NESSUS_CNX_LOCK
-  if (lock_cnt > 0)
-    if (-- lock_cnt == 0)
-      {
-	if (flock(lock_fd, LOCK_UN) < 0)
-	  nessus_perror(NESSUS_CNX_LOCK);
-	if (close(lock_fd) < 0)
-	  nessus_perror(NESSUS_CNX_LOCK);
-	lock_fd = -1;
-      }
-#endif  
   return close(soc);
 }
 



More information about the Openvas-commits mailing list