[Openvas-commits] r5568 - in trunk/openvas-client: . openvas openvas/prefs_dialog

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 15 21:16:56 CEST 2009


Author: mattm
Date: 2009-10-15 21:16:54 +0200 (Thu, 15 Oct 2009)
New Revision: 5568

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/openvas/monitor_dialog.c
   trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_auth.c
Log:
	* openvas/prefs_dialog/prefs_dialog_auth.c [USE_OMP]
	(prefs_dialog_auth_omp_connection): If a do_connect attempt fails,
	continue to the dialog, otherwise return success.  Only return success
	in the dialog case if there is a socket.

	* openvas/monitor_dialog.c (monitor_dialog_setup) [USE_OMP]: With OMP
	contexts start the attack before creating the dialog, in case attack_host
	fails and pops up a message.

Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2009-10-15 18:14:59 UTC (rev 5567)
+++ trunk/openvas-client/ChangeLog	2009-10-15 19:16:54 UTC (rev 5568)
@@ -34,14 +34,26 @@
 
 2009-10-15  Matthew Mundell <matthew.mundell at intevation.de>
 
-	* openvas/monitor_dialog.c (idle_socket): Give up gracefully if getting
-	the status fails.  Close the server when removing the idle.  Reformat
-	three lines.
+	* openvas/prefs_dialog/prefs_dialog_auth.c [USE_OMP]
+	(prefs_dialog_auth_omp_connection): If a do_connect attempt fails,
+	continue to the dialog, otherwise return success.  Only return success
+	in the dialog case if there is a socket.
 
-	* openvas/attack.c (attack_host): Add error messages to fail cases.
+	* openvas/monitor_dialog.c (monitor_dialog_setup) [USE_OMP]: With OMP
+	contexts start the attack before creating the dialog, in case attack_host
+	fails and pops up a message.
 
 2009-10-15  Matthew Mundell <matthew.mundell at intevation.de>
 
+	* openvas/monitor_dialog.c (idle_socket) [USE_OMP]: Give up gracefully if
+	getting	the status fails.  Close the server when removing the idle.
+	Reformat three lines.
+
+	* openvas/attack.c (attack_host) [USE_OMP]: Add error messages to fail
+	cases.
+
+2009-10-15  Matthew Mundell <matthew.mundell at intevation.de>
+
 	* src/omp-cli.c (main): Add --delete-report.
 
 2009-10-15  Matthew Mundell <matthew.mundell at intevation.de>

Modified: trunk/openvas-client/openvas/monitor_dialog.c
===================================================================
--- trunk/openvas-client/openvas/monitor_dialog.c	2009-10-15 18:14:59 UTC (rev 5567)
+++ trunk/openvas-client/openvas/monitor_dialog.c	2009-10-15 19:16:54 UTC (rev 5568)
@@ -292,6 +292,27 @@
   context->action = CONTEXT_SCANNING;
   prefs_context_update (context);
 
+#ifdef USE_OMP
+  if (context->protocol == PROTOCOL_OMP)
+    {
+      /* Start the attack before setting the idle handler, in case
+       * attack_host pops up an error message. */
+
+      if (!attack_host (victim, context))
+        {
+#if 0
+          arg_set_value (MainDialog, "CONTEXT", -1, parent);
+#endif
+          // FIX explain why
+          if (context->protocol == PROTOCOL_OMP)
+            context->action = CONTEXT_IDLE;
+          prefs_context_update (context);
+          scopetreeview_connected_update (context);
+          return;
+        }
+    }
+#endif /* USE_OMP */
+
   w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   gtk_window_set_default_size(GTK_WINDOW(w), 320,200);
 
@@ -395,6 +416,11 @@
                    (GtkSignalFunc)monitor_stop_whole_test,ctrls);
   gtk_box_pack_start(GTK_BOX(box), w, FALSE, TRUE, 0);
   gtk_widget_show(w);
+
+#ifdef USE_OMP
+  if (context->protocol == PROTOCOL_OMP) return;
+#endif
+
   if(!attack_host(victim, context))
   {
     gtk_widget_hide(arg_get_value(ctrls, "WINDOW"));
@@ -403,11 +429,6 @@
 #if 0
     arg_set_value(MainDialog, "CONTEXT", -1, parent);
 #endif
-#ifdef USE_OMP
-    // FIX explain why
-    if (context->protocol == PROTOCOL_OMP)
-      context->action = CONTEXT_IDLE;
-#endif
     prefs_context_update(context);
     scopetreeview_connected_update(context);
   }

Modified: trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_auth.c
===================================================================
--- trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_auth.c	2009-10-15 18:14:59 UTC (rev 5567)
+++ trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_auth.c	2009-10-15 19:16:54 UTC (rev 5568)
@@ -667,9 +667,11 @@
       if (prefs_dialog_auth_do_connect (context, MainDialog))
         /* Connection failed, free the password so the user can change it. */
         efree (&manager->passwd);
-      return (context->socket >= 0);
+      else
+        return TRUE;
     }
-  return prefs_dialog_auth_connect_dialog (context, MainDialog);
+  return prefs_dialog_auth_connect_dialog (context, MainDialog)
+         && context->socket > 0;
 }
 #endif /* USE_OMP */
 



More information about the Openvas-commits mailing list