[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openvas-cvs
Subject:    [Openvas-commits] r5336 - in trunk/openvas-client: .
From:       scm-commit () wald ! intevation ! org
Date:       2009-09-30 13:06:02
Message-ID: 20090930130602.D774C85D9F59 () pyrosoma ! intevation ! org
[Download RAW message or body]

Author: mattm
Date: 2009-09-30 15:06:02 +0200 (Wed, 30 Sep 2009)
New Revision: 5336

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_auth.c
Log:
	* openvas/prefs_dialog_auth.c (prefs_dialog_auth_connect_dialog)
	(prefs_dialog_auth_omp_connection) [USE_OMP]: If the auth fails, clear
	the password.

Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2009-09-30 12:56:47 UTC (rev 5335)
+++ trunk/openvas-client/ChangeLog	2009-09-30 13:06:02 UTC (rev 5336)
@@ -1,5 +1,11 @@
 2009-09-30  Matthew Mundell <matthew.mundell@intevation.de>
 
+	* openvas/prefs_dialog_auth.c (prefs_dialog_auth_connect_dialog)
+	(prefs_dialog_auth_omp_connection) [USE_OMP]: If the auth fails, clear
+	the password.
+
+2009-09-30  Matthew Mundell <matthew.mundell@intevation.de>
+
 	* MANIFEST: Add openvas/openvas-client_log.conf.
 
 2009-09-30  Matthew Mundell <matthew.mundell@intevation.de>

Modified: trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_auth.c
===================================================================
--- trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_auth.c	2009-09-30 12:56:47 UTC (rev 5335)
+++ trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_auth.c	2009-09-30 13:06:02 UTC (rev 5336)
@@ -525,7 +525,7 @@
     if(gtk_dialog_run(GTK_DIALOG(auth->dialog)) == GTK_RESPONSE_OK)
     {
 #ifdef USE_OMP
-      struct context *original_context;
+      struct context *original_context, *manager;
 #endif
       const char *hostname;
       int port;
@@ -590,6 +590,7 @@
         {
           // FIX explain why needed
           context_save_recurse (context);
+          manager = context;
           /* Switch back, so the session and socket end up in the given
            * context. */
           context = original_context;
@@ -598,6 +599,11 @@
       err = prefs_dialog_auth_do_connect(context, ctrls);
       if(err)
       {
+#ifdef USE_OMP
+        /* Clear the stored password, so the user can enter another. */
+        if (context->protocol == PROTOCOL_OMP && manager->passwd)
+          efree (&manager->passwd);
+#endif
 	show_error("%s", err);
 	continue;
       }
@@ -657,7 +663,9 @@
 
   if (manager->passwd)
     {
-      prefs_dialog_auth_do_connect (context, MainDialog);
+      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);
     }
   return prefs_dialog_auth_connect_dialog (context, MainDialog);

_______________________________________________
Openvas-commits mailing list
Openvas-commits@wald.intevation.org
http://lists.wald.intevation.org/mailman/listinfo/openvas-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic