~brian-murray/lightdm/bug-967229

« back to all changes in this revision

Viewing changes to src/xsession.c

  • Committer: Sebastien Bacher
  • Date: 2012-01-18 09:21:40 UTC
  • mfrom: (1007.1.355 lightdm)
  • mto: This revision was merged to the branch mainline in revision 1056.
  • Revision ID: seb128@ubuntu.com-20120118092140-fhyj1fmiouth227t
Tags: upstream-1.1.1
ImportĀ upstreamĀ versionĀ 1.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
            g_free (dir);
98
98
        }
99
99
        else
100
 
        {          
101
100
            path = g_build_filename (user_get_home_directory (session_get_user (session)), ".Xauthority", NULL);
102
101
 
103
 
            /* Workaround the case where the authority file might have been
104
 
             * incorrectly written as root in a buggy version of LightDM */
105
 
            if (getuid () == 0)
106
 
            {
107
 
                int result;
108
 
                result = lchown (path, user_get_uid (session_get_user (session)), user_get_gid (session_get_user (session)));
109
 
                if (result < 0 && errno != ENOENT)
110
 
                    g_warning ("Failed to correct ownership of %s: %s", path, strerror (errno));                
111
 
            }
112
 
        }
113
 
 
114
102
        session_set_env (session, "XAUTHORITY", path);
115
103
        xsession->priv->authority_file = g_file_new_for_path (path);
116
104