Create the .gnome2_private directory if it does not exist
authorFridrich Strba <fridrich.strba@bluewin.ch>
Thu, 11 Mar 2010 12:14:51 +0000 (13:14 +0100)
committerFridrich Strba <fridrich.strba@bluewin.ch>
Thu, 11 Mar 2010 12:18:08 +0000 (13:18 +0100)
libedataserverui/e-passwords.c

index e9e5a7e..cc1e2bb 100644 (file)
@@ -175,6 +175,7 @@ ep_key_file_save (void)
 {
        gchar *contents;
        gchar *filename;
+       gchar* pathname;
        gsize length = 0;
        GError *error = NULL;
 
@@ -183,9 +184,14 @@ ep_key_file_save (void)
 
        filename = ep_key_file_get_filename ();
        contents = g_key_file_to_data (key_file, &length, &error);
+       pathname = g_path_get_dirname (filename);
 
-       if (!error)
+       if (!error) {
+               g_mkdir_with_parents (pathname, 0700);
                g_file_set_contents (filename, contents, length, &error);
+       }
+       
+       g_free (pathname);
 
        if (error != NULL) {
                g_warning ("%s: %s", filename, error->message);