enable support for passing the ICEAUTHORITY shell variable to define where to create the ice auth file diff -r -u xfce4-session-4.4.3.orig/xfce4-session/main.c xfce4-session-4.4.3/xfce4-session/main.c --- xfce4-session-4.4.3.orig/xfce4-session/main.c 2009-02-23 15:29:11 -0600 +++ xfce4-session-4.4.3/xfce4-session/main.c 2009-02-23 15:41:53 -0600 @@ -68,6 +68,7 @@ const gchar *lang; const gchar *sm; gchar *authfile; + int staticauthfile = TRUE; int fd; /* check that no other session manager is running */ @@ -94,16 +95,24 @@ } /* check access to $HOME/.ICEauthority */ - authfile = xfce_get_homefile (".ICEauthority", NULL); + authfile = g_getenv ("ICEAUTHORITY"); + + if (authfile == NULL){ + authfile = xfce_get_homefile (".ICEauthority", NULL); + staticauthfile = FALSE; + } + fd = open (authfile, O_RDWR | O_CREAT, 0600); if (fd < 0) { fprintf (stderr, "xfce4-session: Unable to access file %s: %s\n", authfile, g_strerror (errno)); + if (staticauthfile == FALSE && authfile != NULL) g_free (authfile); exit (EXIT_FAILURE); } - g_free (authfile); + close (fd); + if (staticauthfile == FALSE && authfile != NULL) g_free (authfile); }