[evolution-data-server/gnome-3-8] [Maildir] Create the 'tmp' directory, if missing



commit 584b3a77589ad96a7db44af8e4b70b8cac125b7a
Author: Milan Crha <mcrha redhat com>
Date:   Mon Aug 12 10:21:08 2013 +0200

    [Maildir] Create the 'tmp' directory, if missing
    
    If a folder's directory is missing 'tmp' sub-directory, but it has
    all the other 'cur' and 'new' directories, then try to create
    the 'tmp' to get all three required directories.
    
    It's because some backup tools can drop the 'tmp' directories.
    
    This was reported as: https://bugzilla.redhat.com/show_bug.cgi?id=995702

 camel/providers/local/camel-maildir-store.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index 53d0230..49395f7 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -506,9 +506,11 @@ scan_fi (CamelStore *store,
        cur = g_build_filename (path, dir_name, "cur", NULL);
        new = g_build_filename (path, dir_name, "new", NULL);
 
-       if (!(g_stat (tmp, &st) == 0 && S_ISDIR (st.st_mode)
-             && g_stat (cur, &st) == 0 && S_ISDIR (st.st_mode)
-             && g_stat (new, &st) == 0 && S_ISDIR (st.st_mode)))
+       if (!(g_stat (cur, &st) == 0 && S_ISDIR (st.st_mode)
+             && g_stat (new, &st) == 0 && S_ISDIR (st.st_mode)
+             /* Create 'tmp' dir on demand, if other directories are there,
+                because some backup tools can drop the 'tmp' directory. */
+             && ((g_stat (tmp, &st) == 0 && S_ISDIR (st.st_mode)) || g_mkdir (tmp, 0700) == 0)))
                fi->flags |= CAMEL_FOLDER_NOSELECT;
 
        g_free (new);


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