[evolution] I#2011 - backup-restore: Verify backup file integrity after backup



commit 4617211a8f6f4c52beaac15532623bf07226c379
Author: Milan Crha <mcrha redhat com>
Date:   Fri Oct 7 10:14:17 2022 +0200

    I#2011 - backup-restore: Verify backup file integrity after backup
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/2011

 src/modules/backup-restore/evolution-backup-tool.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
---
diff --git a/src/modules/backup-restore/evolution-backup-tool.c 
b/src/modules/backup-restore/evolution-backup-tool.c
index 4ae4c366d0..3d1781cb7d 100644
--- a/src/modules/backup-restore/evolution-backup-tool.c
+++ b/src/modules/backup-restore/evolution-backup-tool.c
@@ -553,6 +553,13 @@ backup (const gchar *filename,
 
        run_cmd ("rm $HOME/" EVOLUTION_DIR_FILE);
 
+       txt = _("Checking validity of the archive");
+
+       if (!check (filename, NULL)) {
+               g_message ("Failed to validate content of '%s', the archive is broken", filename);
+               return;
+       }
+
        txt = _("Back up complete");
 
        if (restart_arg) {
@@ -1098,6 +1105,19 @@ pbar_update (gpointer user_data)
 static gboolean
 finish_job (gpointer user_data)
 {
+       if (backup_op && result != 0) {
+               GtkWidget *widget;
+
+               widget = gtk_message_dialog_new (progress_dialog ? GTK_WINDOW (progress_dialog) : NULL,
+                       GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                       GTK_MESSAGE_ERROR,
+                       GTK_BUTTONS_CLOSE,
+                       _("Failed to verify the backup file ā€œ%sā€, the archive is broken."),
+                       bk_file);
+               gtk_dialog_run (GTK_DIALOG (widget));
+               gtk_widget_destroy (widget);
+       }
+
        gtk_main_quit ();
 
        return FALSE;
@@ -1335,6 +1355,7 @@ main (gint argc,
                        "halign", GTK_ALIGN_FILL,
                        "hexpand", TRUE,
                        "valign", GTK_ALIGN_FILL,
+                       "show-text", TRUE,
                        NULL);
 
                g_signal_connect (


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