[telepathy-mission-control/master] fd.o#23778: fix permissions of any existing account storage with _mcd_chmod_private, and don't use 0777 permissions to start with
Simon McVittie
simon.mcvittie at collabora.co.uk
Mon Sep 7 08:59:03 PDT 2009
---
src/mcd-account-manager.c | 4 +++-
src/mcd-account.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index 49cd97b..e5d1a36 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -1035,7 +1035,8 @@ mcd_account_manager_init (McdAccountManager *account_manager)
if (!g_file_test (conf_filename, G_FILE_TEST_EXISTS))
{
gchar *dirname = g_path_get_dirname (conf_filename);
- g_mkdir_with_parents (dirname, 0777);
+ g_mkdir_with_parents (dirname, 0700);
+ _mcd_chmod_private (dirname);
g_free (dirname);
DEBUG ("Creating file");
@@ -1161,6 +1162,7 @@ _mcd_account_manager_store_account_connections (McdAccountManager *manager)
/* make $XDG_CACHE_DIR (or whatever) if it doesn't exist */
g_mkdir_with_parents (priv->account_connections_dir, 0700);
+ _mcd_chmod_private (priv->account_connections_dir);
file = fopen (priv->account_connections_file, "w");
if (G_UNLIKELY (!file)) return;
diff --git a/src/mcd-account.c b/src/mcd-account.c
index 3a4b355..c16fd9d 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -2592,7 +2592,8 @@ _mcd_account_set_avatar (McdAccount *account, const GArray *avatar,
data_dir = get_account_data_path (priv);
filename = g_build_filename (data_dir, MC_AVATAR_FILENAME, NULL);
if (!g_file_test (data_dir, G_FILE_TEST_EXISTS))
- g_mkdir_with_parents (data_dir, 0777);
+ g_mkdir_with_parents (data_dir, 0700);
+ _mcd_chmod_private (data_dir);
g_free (data_dir);
if (G_LIKELY(avatar) && avatar->len > 0)
--
1.5.6.5
More information about the telepathy-commits
mailing list