Bug#702911: unblock: almanah/0.9.1-1
Hi Angel and Salvatore,
On Sun, Mar 24, 2013 at 01:44:35PM +0100, Salvatore Bonaccorso wrote:
> On Sun, Mar 24, 2013 at 12:09:38PM +0100, Salvatore Bonaccorso wrote:
> > Disclaimer: not part of the release team but noticed #702911 as the
> > corresponding #702905 in almanah fixes a security bug.
> >
> > It looks that your unblock request never went trough the list, as the
> > debdiff is quite big. At this stage of the release the release team
> > will probably not acknowledge this unblock request.
> >
> > I did only a short test: this looks also to a regression from Squeeze,
> > as in Squeeze it is possible to have a diary encrypted. But upgrading
> > to wheezy then the diary.db does not get encrypted after closing.
>
> Was a little bit to fast hitting enter sending the email, and did not
> propose something to this. With the above, I think best approach would
> be to upload an almanah package trough t-p-u versioned as
> 0.9.0-1+deb7u1 containing only the fix needed.
I took a look the patch, and it seems only the very last part (which changes
the code) is actually needed. I created a patch for a TPU version with only
this change and did some basic testing. With this patch, the db is encrypted.
> But this needs first an approval by the release team.
Obviously. But that seems more likely than a review of the diff between the
versions in wheeze and sid.
Cheers,
Ivo
diff -Nru almanah-0.9.0/debian/changelog almanah-0.9.0/debian/changelog
--- almanah-0.9.0/debian/changelog 2012-04-03 14:25:33.000000000 +0200
+++ almanah-0.9.0/debian/changelog 2013-03-24 15:02:41.000000000 +0100
@@ -1,3 +1,11 @@
+almanah (0.9.0-1+deb7u1) testing; urgency=low
+
+ * Non-maintainer upload.
+ * Backport patch from 0.9.1 to support encrypting the database (Closes:
+ #702905)
+
+ -- Ivo De Decker <ivo.dedecker@ugent.be> Sun, 24 Mar 2013 15:02:38 +0100
+
almanah (0.9.0-1) unstable; urgency=low
* debian/watch: Update for .xz
diff -Nru almanah-0.9.0/debian/patches/almanah_encrypt_db_702905.patch almanah-0.9.0/debian/patches/almanah_encrypt_db_702905.patch
--- almanah-0.9.0/debian/patches/almanah_encrypt_db_702905.patch 1970-01-01 01:00:00.000000000 +0100
+++ almanah-0.9.0/debian/patches/almanah_encrypt_db_702905.patch 2013-03-24 15:04:40.000000000 +0100
@@ -0,0 +1,83 @@
+Description: Enable encryption
+Backport the change from from 0.9.1 to allow encryption of the db.
+
+---
+
+Origin: upstream
+Bug: 702905
+Bug-Debian: http://bugs.debian.org/702905
+Forwarded: not-needed
+
+--- almanah-0.9.0.orig/src/application.c
++++ almanah-0.9.0/src/application.c
+@@ -36,7 +36,7 @@ static void set_property (GObject *objec
+ static void startup (GApplication *application);
+ static void activate (GApplication *application);
+ static gint handle_command_line (GApplication *application, GApplicationCommandLine *command_line);
+-static void quit_main_loop (GApplication *application);
++static void window_removed (GtkApplication *application, GtkWindow *window);
+
+ struct _AlmanahApplicationPrivate {
+ gboolean debug;
+@@ -59,6 +59,7 @@ almanah_application_class_init (AlmanahA
+ {
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GApplicationClass *gapplication_class = G_APPLICATION_CLASS (klass);
++ GtkApplicationClass *gtkapplication_class = GTK_APPLICATION_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (AlmanahApplicationPrivate));
+
+@@ -70,7 +71,8 @@ almanah_application_class_init (AlmanahA
+ gapplication_class->startup = startup;
+ gapplication_class->activate = activate;
+ gapplication_class->command_line = handle_command_line;
+- gapplication_class->quit_mainloop = quit_main_loop;
++
++ gtkapplication_class->window_removed = window_removed;
+
+ g_object_class_install_property (gobject_class, PROP_DEBUG,
+ g_param_spec_boolean ("debug",
+@@ -293,7 +295,7 @@ handle_command_line (GApplication *appli
+ }
+
+ static void
+-storage_manager_disconnected_cb (AlmanahStorageManager *self, const gchar *gpgme_error_message, const gchar *warning_message, GApplication *application)
++storage_manager_disconnected_cb (AlmanahStorageManager *self, const gchar *gpgme_error_message, const gchar *warning_message, GtkApplication *application)
+ {
+ if (gpgme_error_message != NULL || warning_message != NULL) {
+ GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+@@ -310,21 +312,28 @@ storage_manager_disconnected_cb (Almanah
+ gtk_widget_destroy (dialog);
+ }
+
+- /* Chain up to the parent class */
+- G_APPLICATION_CLASS (almanah_application_parent_class)->quit_mainloop (application);
++ /* Allow the end of the applaction */
++ g_application_release (G_APPLICATION (application));
+ }
+
+ static void
+-quit_main_loop (GApplication *application)
++window_removed (GtkApplication *application, GtkWindow *window)
+ {
++ /* This would normally result in the end of the application, but we need to close the database connection first
++ to prevent an unencrypted database in the filesystem, and we don't want a bug like that.
++ So, we append a reference to the application when the user close the main window. When the application disconnect
++ from the database, allowing the encryption if necessary, we remove this reference with g_application_release.
++ See: https://bugzilla.gnome.org/show_bug.cgi?id=695117 */
++ if (ALMANAH_IS_MAIN_WINDOW (window)) {
+ AlmanahApplicationPrivate *priv = ALMANAH_APPLICATION (application)->priv;
+
+- /* This would normally result in gtk_main_quit() being called, but we need to close the database connection first. */
++ g_application_hold (G_APPLICATION (application));
++
+ g_signal_connect (priv->storage_manager, "disconnected", (GCallback) storage_manager_disconnected_cb, application);
+ almanah_storage_manager_disconnect (priv->storage_manager, NULL);
++ }
+
+- /* Quitting is actually done in storage_manager_disconnected_cb, which is called once
+- * the storage manager has encrypted the DB and disconnected from it. */
++ GTK_APPLICATION_CLASS (almanah_application_parent_class)->window_removed (application, window);
+ }
+
+ AlmanahApplication *
diff -Nru almanah-0.9.0/debian/patches/series almanah-0.9.0/debian/patches/series
--- almanah-0.9.0/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
+++ almanah-0.9.0/debian/patches/series 2013-03-24 13:51:55.000000000 +0100
@@ -0,0 +1 @@
+almanah_encrypt_db_702905.patch
Reply to: