[telepathy-mission-control/master] McdMaster: if umask is available, create dirs/files with 0700/0600 permissions

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Sep 7 08:55:55 PDT 2009


---
 src/mcd-master.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/mcd-master.c b/src/mcd-master.c
index 3549211..4d691ac 100644
--- a/src/mcd-master.c
+++ b/src/mcd-master.c
@@ -50,6 +50,13 @@
 
 #include <config.h>
 
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
 #include <glib/gi18n.h>
 #include <gmodule.h>
 #include <string.h>
@@ -528,6 +535,11 @@ mcd_master_constructor (GType type, guint n_params,
 
     g_return_val_if_fail (master != NULL, NULL);
 
+#ifdef HAVE_UMASK
+    /* mask out group and other rwx bits when creating files */
+    umask (0077);
+#endif
+
     if (!priv->account_manager)
 	priv->account_manager = mcd_account_manager_new (priv->dbus_daemon);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list