1 --- a/dix/main.c 2017-02-01 15:05:08.248943479 -0800
2 +++ b/dix/main.c 2017-02-01 15:07:26.499207921 -0800
4 #include <version-config.h>
10 #include <X11/Xos.h> /* for unistd.h */
11 #include <X11/Xproto.h>
14 extern void Dispatch(void);
17 +extern const char * GetAuthFilename(void);
18 +static char sym_authfile[40];
20 +#define LOCK_PREFIX "/var/xauth/"
23 + * Setup /var/xauth/$DISPLAY, which is a symlink to the
24 + * actually auth file.
27 +SetupXauthFile(char *filename)
31 + snprintf(sym_authfile, 40, LOCK_PREFIX "%s", display);
33 + mkdir(LOCK_PREFIX, S_IRWXU);
35 + remove(sym_authfile);
36 + symlink(filename, sym_authfile);
40 +RemoveXauthSymFile(void)
42 + remove(sym_authfile);
46 CallbackListPtr RootWindowFinalizeCallback = NULL;
52 HWEventQueueType alwaysCheckForInput[2];
54 + char *xauthfile = NULL;
61 ProcessCommandLine(argc, argv);
64 + xauthfile = GetAuthFilename();
66 + SetupXauthFile(xauthfile);
69 alwaysCheckForInput[0] = 0;
70 alwaysCheckForInput[1] = 1;
72 --- a/hw/xfree86/os-support/solaris/sun_init.c 2017-02-01 15:07:50.575551326 -0800
73 +++ b/hw/xfree86/os-support/solaris/sun_init.c 2017-02-01 15:08:25.999117101 -0800
75 #define CONSOLE_VTNO 1
76 #define SOL_CONSOLE_DEV "/dev/console"
78 +/* For use of VT_SETDISPLOGIN in dtlogin.c */
79 +extern int xf86ConsoleFd;
81 static Bool KeepTty = FALSE;
82 static Bool UseConsole = FALSE;
86 if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0)
87 xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n");
89 + xf86ConsoleFd = xf86Info.consoleFd;
93 --- a/os/log.c 2017-02-01 15:08:49.899272429 -0800
94 +++ b/os/log.c 2017-02-01 15:09:43.768274981 -0800
96 void (*OsVendorVErrorFProc) (const char *, va_list args) = NULL;
100 +extern void RemoveXauthSymFile(void);
103 static FILE *logFile = NULL;
104 static int logFileFd = -1;
105 static Bool logFlush = FALSE;
106 @@ -1007,6 +1011,9 @@
107 VErrorFSigSafe(f, args);
111 + RemoveXauthSymFile();
114 OsVendorFatalError(f, args2);