[Gpa-commits] r766 - in trunk: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 7 13:16:46 CET 2007


Author: werner
Date: 2007-02-07 13:16:45 +0100 (Wed, 07 Feb 2007)
New Revision: 766

Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/configure.ac
   trunk/src/ChangeLog
   trunk/src/gpafileencryptop.c
   trunk/src/gpakeyselector.c
Log:
Fixed a freeze and a crash in the file manager.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-01-29 16:07:20 UTC (rev 765)
+++ trunk/ChangeLog	2007-02-07 12:16:45 UTC (rev 766)
@@ -1,3 +1,9 @@
+2007-01-10  Werner Koch  <wk at g10code.com>
+
+	* configure.ac (GPGME_CFLAGS, GPGME_LIBS): Use them and do not
+	append them to CFLAGS etc.
+	(AM_PATH_GTK_2_0): Likewise.
+
 2006-07-25  Werner Koch  <wk at g10code.com>
 
 	Released 0.7.4.

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2007-01-29 16:07:20 UTC (rev 765)
+++ trunk/NEWS	2007-02-07 12:16:45 UTC (rev 766)
@@ -1,7 +1,11 @@
 Noteworthy changes in version 0.7.5
 ------------------------------------------------
 
+ * Allow setting a password if it is empty.
 
+ * Fixed changing of expiration date for non-C-99 systems.
+
+
 Noteworthy changes in version 0.7.4 (2006-07-25)
 ------------------------------------------------
 

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2007-01-29 16:07:20 UTC (rev 765)
+++ trunk/configure.ac	2007-02-07 12:16:45 UTC (rev 766)
@@ -175,25 +175,20 @@
 	    AC_MSG_ERROR(Cannot find a getopt_long function))))
 
 dnl Where is the GTK+ toolkit
-AM_PATH_GTK_2_0(2.2.0,
-            [LIBS="$LIBS $GTK_LIBS"
-            CFLAGS="$CFLAGS $GTK_CFLAGS"],
-            AC_MSG_ERROR(Cannot find GTK+ 2.0))
+AM_PATH_GTK_2_0(2.2.0,, AC_MSG_ERROR(Cannot find GTK+ 2.0))
 
 #
 # Depending on the OS we need to test for different versions of gpgme.
 #
 _AM_PATH_GPGME_CONFIG
 if test "$have_w32_system" = yes; then
-  AM_PATH_GPGME_GLIB([1:1.1.1],
-            [LIBS="$LIBS $GPGME_GLIB_LIBS"
-            CFLAGS="$CFLAGS $GPGME_GLIB_CFLAGS"],
-            AC_MSG_ERROR(Cannot find an up to date GPGME))
+  AM_PATH_GPGME_GLIB([1:1.1.3],, AC_MSG_ERROR(Cannot find an up to date GPGME))
+  GPGME_LIBS="$GPGME_GLIB_LIBS"
+  GPGME_CFLAGS="GPGME_GLIB_CFLAGS"
+  AC_SUBST(GPGME_CFLAGS)
+  AC_SUBST(GPGME_LIBS)
 else
-  AM_PATH_GPGME([1:1.1.1],
-            [LIBS="$LIBS $GPGME_LIBS"
-             CFLAGS="$CFLAGS $GPGME_CFLAGS"],
-            AC_MSG_ERROR(Cannot find an up to date GPGME))
+  AM_PATH_GPGME([1:1.1.3],, AC_MSG_ERROR(Cannot find an up to date GPGME))
 fi
 
 

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2007-01-29 16:07:20 UTC (rev 765)
+++ trunk/src/ChangeLog	2007-02-07 12:16:45 UTC (rev 766)
@@ -1,3 +1,12 @@
+2007-02-07  Werner Koch  <wk at g10code.com>
+
+	* gpakeyselector.c (gpa_key_selector_get_selected_keys): Avoid
+	endless loop when seleting more than one key.
+
+	* gpafileencryptop.c (gpa_file_encrypt_operation_done_cb): Do not
+	free RSET here ..
+	(gpa_file_encrypt_operation_finalize): .. but here.
+
 2007-01-29  Werner Koch  <wk at g10code.com>
 
 	* gpgmeedit.c (struct edit_parms_s): New field

Modified: trunk/src/gpafileencryptop.c
===================================================================
--- trunk/src/gpafileencryptop.c	2007-01-29 16:07:20 UTC (rev 765)
+++ trunk/src/gpafileencryptop.c	2007-02-07 12:16:45 UTC (rev 766)
@@ -54,6 +54,14 @@
 static void
 gpa_file_encrypt_operation_finalize (GObject *object)
 {  
+  GpaFileEncryptOperation *op = GPA_FILE_ENCRYPT_OPERATION (object);
+
+  /* FIXME: The use of RSET is messed up.  There is no clear concept
+     on who own the key.  This should be fixed by refing the keys
+     object.  I doubt that the keys are at all released. */
+  g_free (op->rset);
+  op->rset = NULL;
+
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -216,7 +224,7 @@
   else
     {
       err = gpgme_op_encrypt_start (GPA_OPERATION (op)->context->ctx,
-				    op->rset,GPGME_ENCRYPT_ALWAYS_TRUST,
+				    op->rset, GPGME_ENCRYPT_ALWAYS_TRUST,
 				    op->plain, op->cipher);
     }
   if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
@@ -250,11 +258,15 @@
 {
   /* Do clean up on the operation */
   gpgme_data_release (op->plain);
+  op->plain = NULL;
   close (op->plain_fd);
+  op->plain_fd = -1;
   gpgme_data_release (op->cipher);
+  op->cipher = NULL;
   close (op->cipher_fd);
+  op->cipher_fd = -1;
   gtk_widget_hide (GPA_FILE_OPERATION (op)->progress_dialog);
-  g_free (op->rset);
+
   if (gpg_err_code (err) != GPG_ERR_NO_ERROR) 
     {
       /* If an error happened, (or the user canceled) delete the created file
@@ -262,6 +274,7 @@
        */
       unlink (op->cipher_filename);
       g_free (op->cipher_filename);
+      op->cipher_filename = NULL;
       g_signal_emit_by_name (GPA_OPERATION (op), "completed");
     }
   else
@@ -270,6 +283,7 @@
       g_signal_emit_by_name (GPA_OPERATION (op), "created_file",
 			     op->cipher_filename);
       g_free (op->cipher_filename);
+      op->cipher_filename = NULL;
       /* Go to the next file in the list and encrypt it */
       GPA_FILE_OPERATION (op)->current = g_list_next 
 	(GPA_FILE_OPERATION (op)->current);

Modified: trunk/src/gpakeyselector.c
===================================================================
--- trunk/src/gpakeyselector.c	2007-01-29 16:07:20 UTC (rev 765)
+++ trunk/src/gpakeyselector.c	2007-02-07 12:16:45 UTC (rev 766)
@@ -135,7 +135,8 @@
 
 /* API */
 
-GtkWidget *gpa_key_selector_new (gboolean secret)
+GtkWidget *
+gpa_key_selector_new (gboolean secret)
 {
   GtkWidget *sel = (GtkWidget*) g_object_new (GPA_KEY_SELECTOR_TYPE, NULL);
 
@@ -166,7 +167,8 @@
 
 /* Return a list of selected gpgme_key_t's. The caller must free the list.
  */
-GList *gpa_key_selector_get_selected_keys (GpaKeySelector * selector)
+GList *
+gpa_key_selector_get_selected_keys (GpaKeySelector * selector)
 {
   GtkTreeSelection *selection = 
     gtk_tree_view_get_selection (GTK_TREE_VIEW (selector));
@@ -175,7 +177,7 @@
   GList *keys = NULL;
   GList *cur;
 
-  for (cur = list; cur; cur = g_list_next (list))
+  for (cur = list; cur; cur = g_list_next (cur))
     {
       gpgme_key_t key;
       GtkTreeIter iter;
@@ -196,7 +198,8 @@
   return keys;
 }
 
-gboolean gpa_key_selector_has_selection (GpaKeySelector * selector)
+gboolean 
+gpa_key_selector_has_selection (GpaKeySelector * selector)
 {
   int selected =  gtk_tree_selection_count_selected_rows 
     (gtk_tree_view_get_selection (GTK_TREE_VIEW (selector)));
@@ -205,7 +208,8 @@
 
 /* Internal */
 
-void gpa_key_selector_next_key (gpgme_key_t key, gpointer data)
+void 
+gpa_key_selector_next_key (gpgme_key_t key, gpointer data)
 {
   GpaKeySelector *selector = data;
   GtkListStore *store;
@@ -240,7 +244,8 @@
   g_free (userid);
 }
 
-void gpa_key_selector_done (gpointer data)
+void 
+gpa_key_selector_done (gpointer data)
 {
   GpaKeySelector *selector = data;
 



More information about the Gpa-commits mailing list