kov changed gksu/trunk/ChangeLog, gksu/trunk/configure.ac, gksu/trunk/gksu/gksu.c

Gustavo Noronha kov at costa.debian.org
Tue Jul 11 00:35:44 UTC 2006


Mensagem de log: 
re-ask password 2 times when the first attempt gives us a
wrong password; use the new libgksu API to display an alert
warning about the wrong password

- require libgksu >= 1.9.5 because of the new API


-----


Modified: gksu/trunk/ChangeLog
===================================================================
--- gksu/trunk/ChangeLog	2006-07-11 00:30:32 UTC (rev 648)
+++ gksu/trunk/ChangeLog	2006-07-11 00:35:41 UTC (rev 649)
@@ -1,3 +1,10 @@
+2006-07-10  Gustavo Noronha Silva  <kov at debian.org>
+
+	* gksu/gksu.c:
+	- re-ask password 2 times when the first attempt gives us a
+	  wrong password; use the new libgksu API to display an alert
+	  warning about the wrong password
+
 2006-07-10  Gustavo Noronha Silva  <gustavo.noronha at mds.gov.br>
 
 	* nautilus-gksu/libnautilus-gksu.c:

Modified: gksu/trunk/configure.ac
===================================================================
--- gksu/trunk/configure.ac	2006-07-11 00:30:32 UTC (rev 648)
+++ gksu/trunk/configure.ac	2006-07-11 00:35:41 UTC (rev 649)
@@ -43,7 +43,7 @@
 AC_PATH_PROG(GCONFTOOL, gconftool-2)
 AM_GCONF_SOURCE_2
 
-PKG_CHECK_MODULES(GKSU, [libgksu2 >= 1.9.2, gtk+-2.0 >= 2.4.0, libstartup-notification-1.0])
+PKG_CHECK_MODULES(GKSU, [libgksu2 >= 1.9.5, gtk+-2.0 >= 2.4.0, libstartup-notification-1.0])
 
 gtk_doc_min_version=1.0
 AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])

Modified: gksu/trunk/gksu/gksu.c
===================================================================
--- gksu/trunk/gksu/gksu.c	2006-07-11 00:30:32 UTC (rev 648)
+++ gksu/trunk/gksu/gksu.c	2006-07-11 00:35:41 UTC (rev 649)
@@ -473,8 +473,16 @@
 
   {
     gint count = 0;
+
     for (count = 0; count < 3; count++)
       {
+	if (error) /* wrong password was given */
+	  {
+	    gksu_context_set_alert (context, _("<b>Incorrect password... try again.</b>"));
+	    g_error_free (error);
+	    error = NULL;
+	  }
+
 	if (run_mode == SUDO_MODE)
 	  gksu_sudo_full (context,
 			  NULL, NULL,
@@ -493,12 +501,6 @@
 			 &error);
 	if ((error == NULL) || (error->code != GKSU_ERROR_WRONGPASS))
 	  break;
-
-	if (error)
-	  {
-	    g_error_free (error);
-	    error = NULL;
-	  }
       }
   }
 




More information about the gksu-commits mailing list