Use an umask fo 077 to protect profile storage
[framework/connectivity/connman.git] / src / main.c
index ac62312..9742125 100644 (file)
@@ -112,6 +112,7 @@ int main(int argc, char *argv[])
        DBusConnection *conn;
        DBusError err;
        struct sigaction sa;
+       mode_t old_umask;
 
 #ifdef NEED_THREADS
        if (g_thread_supported() == FALSE)
@@ -156,6 +157,8 @@ int main(int argc, char *argv[])
                        perror("Failed to create storage directory");
        }
 
+       old_umask = umask(077);
+
        main_loop = g_main_loop_new(NULL, FALSE);
 
 #ifdef NEED_THREADS