]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Change session directory once user permissions are set so it works on NFS filesystems...
authorRobert Ancell <robert.ancell@canonical.com>
Wed, 29 Feb 2012 06:58:03 +0000 (17:58 +1100)
committerRobert Ancell <robert.ancell@canonical.com>
Wed, 29 Feb 2012 06:58:03 +0000 (17:58 +1100)
NEWS
src/session.c

diff --git a/NEWS b/NEWS
index df1c9aabc54b3a63b1a616d4569e72ebfa73d7e8..db86688b8329f33982a78f219c0ae25c2d70347a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+Overview of changes in lightdm 1.1.4
+
+    * Change session directory once user permissions are set so it works
+      on NFS filesystems that don't allow root to access files.
+
 Overview of changes in lightdm 1.1.3
 
     * Actually return the system default keyboard layout, not just 'us'
index e1c9818e6f3ba03f7c9b7b7fe4767ec14af7840f..a4bfd2b7348ed9eba98ad9882c22464db74c3fdf 100644 (file)
@@ -411,13 +411,6 @@ session_run (Process *process)
 
     user = pam_session_get_user (session->priv->authentication);
 
-    /* Change working directory */
-    if (chdir (user_get_home_directory (user)) != 0)
-    {
-        g_warning ("Failed to change to home directory %s: %s", user_get_home_directory (user), strerror (errno));
-        _exit (EXIT_FAILURE);
-    }
-
     /* Change to this user */
     if (getuid () == 0)
     {
@@ -440,6 +433,16 @@ session_run (Process *process)
         }
     }
 
+    /* Change working directory */
+    /* NOTE: This must be done after the permissions are changed because NFS filesystems can
+     * be setup so the local root user accesses the NFS files as 'nobody'.  If the home directories
+     * are not system readable then the chdir can fail */
+    if (chdir (user_get_home_directory (user)) != 0)
+    {
+        g_warning ("Failed to change to home directory %s: %s", user_get_home_directory (user), strerror (errno));
+        _exit (EXIT_FAILURE);
+    }
+
     /* Redirect output to logfile */
     if (session->priv->log_file_as_user)
         setup_log_file (session);