Bug 581604 - Permissions on mail/local folders are too open
authorChenthill Palanisamy <pchenthill@novell.com>
Fri, 29 Jan 2010 19:55:09 +0000 (01:25 +0530)
committerChenthill Palanisamy <pchenthill@novell.com>
Fri, 29 Jan 2010 19:55:09 +0000 (01:25 +0530)
addressbook/backends/file/e-book-backend-file.c
addressbook/backends/groupwise/e-book-backend-groupwise.c
addressbook/backends/vcf/e-book-backend-vcf.c
camel/camel-object.c
camel/camel-uid-cache.c
camel/providers/imap4/camel-imap4-folder.c
camel/providers/local/camel-local-store.c
camel/providers/local/camel-mbox-store.c
camel/providers/local/camel-spool-store.c
camel/providers/nntp/camel-nntp-folder.c

index 06b00ad..af52fc9 100644 (file)
@@ -1186,7 +1186,7 @@ e_book_backend_file_load_source (EBookBackend           *backend,
                        /* the database didn't exist, so we create the
                           directory then the .db */
                        db->close (db, 0);
-                       rv = g_mkdir_with_parents (dirname, 0777);
+                       rv = g_mkdir_with_parents (dirname, 0700);
                        if (rv == -1 && errno != EEXIST) {
                                g_warning ("failed to make directory %s: %s", dirname, g_strerror (errno));
                                g_free (dirname);
index cfa0dfa..185180c 100644 (file)
@@ -3583,7 +3583,7 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
 
                /* the databade didn't exist, so we create the
                   directory then the .db */
-               rv = g_mkdir_with_parents (dirname, 0777);
+               rv = g_mkdir_with_parents (dirname, 0700);
                if (rv == -1 && errno != EEXIST) {
                        g_warning ("failed to make directory %s: %s", dirname, g_strerror (errno));
                        g_free (dirname);
index 940a787..07fb8e5 100644 (file)
@@ -617,7 +617,7 @@ e_book_backend_vcf_load_source (EBookBackend             *backend,
 
                        /* the database didn't exist, so we create the
                           directory then the .vcf file */
-                       rv = g_mkdir_with_parents (dirname, 0777);
+                       rv = g_mkdir_with_parents (dirname, 0700);
                        if (rv == -1 && errno != EEXIST) {
                                g_warning ("failed to make directory %s: %s", dirname, g_strerror (errno));
                                if (errno == EACCES || errno == EPERM)
index 916c02d..c54ae59 100644 (file)
@@ -1831,7 +1831,7 @@ gint camel_object_state_write(gpointer vo)
 
        savename = camel_file_util_savename(file);
        dirname = g_path_get_dirname(savename);
-       g_mkdir_with_parents(dirname, 0777);
+       g_mkdir_with_parents(dirname, 0700);
        g_free(dirname);
        fp = g_fopen(savename, "wb");
        if (fp != NULL) {
index 8973028..ca219d4 100644 (file)
@@ -63,7 +63,7 @@ camel_uid_cache_new (const gchar *filename)
        gint fd, i;
 
        dirname = g_path_get_dirname (filename);
-       if (g_mkdir_with_parents (dirname, 0777) == -1) {
+       if (g_mkdir_with_parents (dirname, 0700) == -1) {
                g_free (dirname);
                return NULL;
        }
index ecfd31c..0e388fb 100644 (file)
@@ -374,7 +374,7 @@ camel_imap4_folder_new (CamelStore *store, const gchar *full_name, CamelExceptio
 
        folder->summary = camel_imap4_summary_new (folder);
        imap4_folder->cachedir = imap4_store_build_filename (store, folder->full_name);
-       g_mkdir_with_parents (imap4_folder->cachedir, 0777);
+       g_mkdir_with_parents (imap4_folder->cachedir, 0700);
 
        imap4_folder->cache = camel_data_cache_new (imap4_folder->cachedir, 0, NULL);
 
index 08ca2e2..3ab2ad2 100644 (file)
@@ -182,7 +182,7 @@ get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, CamelExc
        }
 
        /* need to create the dir heirarchy */
-       if (g_mkdir_with_parents (path, 0777) == -1 && errno != EEXIST) {
+       if (g_mkdir_with_parents (path, 0700) == -1 && errno != EEXIST) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
                                      _("Cannot get folder: %s: %s"),
                                      path, g_strerror (errno));
index a205170..c7a7ef7 100644 (file)
@@ -169,7 +169,7 @@ get_folder(CamelStore *store, const gchar *folder_name, guint32 flags, CamelExce
                g_free (basename);
 
                dirname = g_path_get_dirname(name);
-               if (g_mkdir_with_parents(dirname, 0777) == -1 && errno != EEXIST) {
+               if (g_mkdir_with_parents(dirname, 0700) == -1 && errno != EEXIST) {
                        camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                             _("Cannot create folder '%s': %s"),
                                             folder_name, g_strerror (errno));
@@ -372,7 +372,7 @@ create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_n
        path = camel_local_store_get_full_path(store, name);
 
        dir = g_path_get_dirname(path);
-       if (g_mkdir_with_parents(dir, 0777) == -1 && errno != EEXIST) {
+       if (g_mkdir_with_parents(dir, 0700) == -1 && errno != EEXIST) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot create directory '%s': %s."),
                                     dir, g_strerror(errno));
 
@@ -490,7 +490,7 @@ rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelExcept
        newibex = camel_local_store_get_meta_path(store, new, ".ibex");
 
        newdir = g_path_get_dirname(newibex);
-       if (g_mkdir_with_parents(newdir, 0777) == -1) {
+       if (g_mkdir_with_parents(newdir, 0700) == -1) {
                if (errno != EEXIST) {
                        camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                             _("Could not rename '%s': '%s': %s"),
index 4b34101..cfe033a 100644 (file)
@@ -493,7 +493,7 @@ spool_get_meta_path(CamelLocalStore *ls, const gchar *full_name, const gchar *ex
        if (root == NULL)
                return NULL;
 
-       g_mkdir_with_parents(root, 0777);
+       g_mkdir_with_parents(root, 0700);
        key = camel_file_util_safe_filename(full_name);
        path = g_strdup_printf("%s/%s%s", root, key, ext);
        g_free(key);
index 506ec93..b20ccff 100644 (file)
@@ -536,7 +536,7 @@ camel_nntp_folder_new (CamelStore *parent, const gchar *folder_name, CamelExcept
                return NULL;
 
        /* If this doesn't work, stuff wont save, but let it continue anyway */
-       g_mkdir_with_parents (root, 0777);
+       g_mkdir_with_parents (root, 0700);
 
        folder = (CamelFolder *) camel_object_new (CAMEL_NNTP_FOLDER_TYPE);
        nntp_folder = (CamelNNTPFolder *)folder;