Add basic error checking when creating backup file
It has been a while since I lost 3 years of e-mails because evolution GUI did not mention the disk was full during the backup (so the tar file generated by evolution-backup was incomplete).
Recently I remembered that before linux distro upgrade so I checked the source and guess what:
...
...
txt = _("Backing Evolution data (Mails, Contacts, Calendar, Tasks, Memos)");
quotedfname = g_shell_quote (filename);
use_xz = get_filename_is_xz (filename);
command = g_strdup_printf (
"cd $HOME && tar chf - $STRIPDATADIR "
"$STRIPCONFIGDIR " EVOLUTION_DIR_FILE " | "
"%s > %s", use_xz ? "xz -z" : "gzip", quotedfname);
run_cmd (command);
g_free (command);
g_free (quotedfname);
run_cmd ("rm $HOME/" EVOLUTION_DIR_FILE);
txt = _("Back up complete");
if (restart_arg) {
if (g_cancellable_is_cancelled (cancellable))
return;
txt = _("Restarting Evolution");
run_evolution_no_wait ();
}
}
My eyesight is already a bit worn so maybe I just don't see there is no error checking after run_cmd (command);
(apart from just logging a warning message in #define print_and_run(x)
) but as at least SOME basic error handling any sane programmer usually does it seems this is a (still secret) sabotage!
BEWARE!