[gnome-vfs] Fix so that gnome-vfs works even if the user does not have a writable $HOME directory. Fixes bug #5



commit d1354bb700f028162ace0bb908f391804ae4b40a
Author: Brian Cameron <Brian Cameron sun com>
Date:   Wed May 12 23:00:39 2010 -0500

    Fix so that gnome-vfs works even if the user does not have a writable $HOME
    directory.  Fixes bug #553505.

 libgnomevfs/gnome-vfs-init.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libgnomevfs/gnome-vfs-init.c b/libgnomevfs/gnome-vfs-init.c
index f34cb66..e3fd5d9 100644
--- a/libgnomevfs/gnome-vfs-init.c
+++ b/libgnomevfs/gnome-vfs-init.c
@@ -61,8 +61,16 @@ static gboolean
 ensure_dot_gnome_exists (void)
 {
 	gboolean retval = TRUE;
+	gboolean create_dirs;
 	gchar *dirname;
 
+	/* If the user does not have a writable HOME directory, then
+	   avoid creating the directory. */
+	create_dirs = (g_access (g_get_home_dir(), W_OK) == 0);
+
+        if (create_dirs != TRUE)
+		return TRUE;
+
 	dirname = g_build_filename (g_get_home_dir (), ".gnome2", NULL);
 
 	if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]