balsa r7997 - in trunk: . libbalsa



Author: pawels
Date: Wed Nov 19 17:43:18 2008
New Revision: 7997
URL: http://svn.gnome.org/viewvc/balsa?rev=7997&view=rev

Log:
* configure.in: detect gnome-keyring-2.24 to work around bug 556530.
* libbalsa/{imap-,}server.c: store passwords asap to keyring (Peter B.).
* libbalsa/server.h: use own schema only with buggy gnome-keyring.


Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/libbalsa/imap-server.c
   trunk/libbalsa/server.c
   trunk/libbalsa/server.h

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Wed Nov 19 17:43:18 2008
@@ -284,6 +284,11 @@
    if $PKG_CONFIG --exists gnome-keyring-1; then
       gnome_extras="$gnome_extras gnome-keyring-1"
       AC_DEFINE(HAVE_GNOME_KEYRING,1,[Defined when gnome-keyring is there.])
+      # Work around http://bugzilla.gnome.org/show_bug.cgi?id=556530
+      if $PKG_CONFIG --atleast-version=2.24.1 gnome-keyring-1; then
+         AC_DEFINE(HAVE_GNOME_KEYRING_24,1,
+                   [Defined with gnome-keyring-2.24 or newer.])
+      fi
       with_gnome_keyring=yes
    else
       with_gnome_keyring=no

Modified: trunk/libbalsa/imap-server.c
==============================================================================
--- trunk/libbalsa/imap-server.c	(original)
+++ trunk/libbalsa/imap-server.c	Wed Nov 19 17:43:18 2008
@@ -523,6 +523,16 @@
 		    gchar *buff = libbalsa_rot(server->passwd);
 		    libbalsa_free_password(server->passwd);
 		    server->passwd = buff;
+	            gnome_keyring_store_password_sync
+                        (LIBBALSA_SERVER_KEYRING_SCHEMA, NULL,
+                         _("Balsa passwords"), server->passwd,
+                         "protocol", server->protocol,
+                         "server", server->host,
+                         "user", server->user,
+                         NULL);
+		    /* We could in principle clear the password in the
+		       config file here but we do not for the backward
+		       compatibility. */
 		}
 	    }
 #else

Modified: trunk/libbalsa/server.c
==============================================================================
--- trunk/libbalsa/server.c	(original)
+++ trunk/libbalsa/server.c	Wed Nov 19 17:43:18 2008
@@ -341,6 +341,16 @@
 		gchar *buff = libbalsa_rot(server->passwd);
 		libbalsa_free_password(server->passwd);
 		server->passwd = buff;
+		gnome_keyring_store_password_sync
+		    (LIBBALSA_SERVER_KEYRING_SCHEMA, NULL,
+		     _("Balsa passwords"), server->passwd,
+		     "protocol", server->protocol,
+		     "server", server->host,
+		     "user", server->user,
+		     NULL);
+		    /* We could in principle clear the password in the
+		       config file here but we do not for the backward
+		       compatibility. */
 	    }
 	}
 #else

Modified: trunk/libbalsa/server.h
==============================================================================
--- trunk/libbalsa/server.h	(original)
+++ trunk/libbalsa/server.h	Wed Nov 19 17:43:18 2008
@@ -28,7 +28,13 @@
 
 #if defined (HAVE_GNOME_KEYRING)
 #include <gnome-keyring.h>
+
+#if defined(HAVE_GNOME_KEYRING_24)
+#define LIBBALSA_SERVER_KEYRING_SCHEMA GNOME_KEYRING_NETWORK_PASSWORD
+#else
 extern const GnomeKeyringPasswordSchema* LIBBALSA_SERVER_KEYRING_SCHEMA;
+#endif /* HAVE_GNOME_KEYRING_24 */
+
 #define libbalsa_free_password gnome_keyring_free_password
 #else
 #define libbalsa_free_password g_free



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]