diff -Nurp -x '*~' -x '*.orig' dix/main.c dix/main.c
--- dix/main.c 2010-09-03 16:45:37.986184004 -0700
+++ dix/main.c 2010-09-03 16:45:40.072259890 -0700
@@ -79,6 +79,8 @@ Equipment Corporation.
#include <version-config.h>
#endif
+#include <sys/stat.h>
+#include <stdio.h>
#include <X11/X.h>
#include <X11/Xos.h> /* for unistd.h */
#include <X11/Xproto.h>
@@ -125,6 +127,30 @@ extern void Dispatch(void);
extern void InitProcVectors(void);
+#if defined(sun)
+extern const char * GetAuthFilename(void);
+
+#define LOCK_PREFIX "/var/xauth/"
+
+/*
+ * Setup /var/xauth/$DISPLAY, which is a symlink to the
+ * actually auth file.
+ */
+static void
+SetupXauthFile(char *filename)
+{
+ struct stat buf;
+ char sym_authfile[40];
+
+ snprintf(sym_authfile, 40, LOCK_PREFIX "%s", display);
+
+ mkdir(LOCK_PREFIX, S_IRWXU);
+
+ remove(sym_authfile);
+ symlink(filename, sym_authfile);
+}
+#endif
+
#ifdef XQUARTZ
#include <pthread.h>
@@ -141,6 +167,9 @@ int main(int argc, char *argv[], char *e
{
int i;
HWEventQueueType alwaysCheckForInput[2];
+#if defined(sun)
+ char *xauthfile = NULL;
+#endif
display = "0";
@@ -156,6 +185,12 @@ int main(int argc, char *argv[], char *e
ProcessCommandLine(argc, argv);
+#if defined(sun)
+ xauthfile = GetAuthFilename();
+ if (xauthfile)
+ SetupXauthFile(xauthfile);
+#endif
+
alwaysCheckForInput[0] = 0;
alwaysCheckForInput[1] = 1;
while(1)
diff -Nurp -x '*~' -x '*.orig' hw/xfree86/os-support/solaris/sun_init.c hw/xfree86/os-support/solaris/sun_init.c
--- hw/xfree86/os-support/solaris/sun_init.c 2010-06-05 18:16:52.000000000 -0700
+++ hw/xfree86/os-support/solaris/sun_init.c 2010-09-03 16:45:40.072623997 -0700
@@ -45,6 +45,9 @@
#define CONSOLE_VTNO 1
#define SOL_CONSOLE_DEV "/dev/console"
+/* For use of VT_SETDISPLOGIN in dtlogin.c */
+extern int xf86ConsoleFd;
+
static Bool KeepTty = FALSE;
static Bool Protect0 = FALSE;
static Bool UseConsole = FALSE;
@@ -235,6 +238,8 @@ OPENCONSOLE:
if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0)
xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n");
+
+ xf86ConsoleFd = xf86Info.consoleFd;
}
#endif