--- /dev/null
+/*\r
+ * ux_x11.c: fetch local auth data for X forwarding.\r
+ */\r
+\r
+#include <ctype.h>\r
+#include <unistd.h>\r
+#include <assert.h>\r
+#include <stdlib.h>\r
+#include <errno.h>\r
+\r
+#include "putty.h"\r
+#include "ssh.h"\r
+#include "network.h"\r
+\r
+void platform_get_x11_auth(struct X11Display *disp, const Config *cfg)\r
+{\r
+ char *xauthfile;\r
+ int needs_free;\r
+\r
+ /*\r
+ * Find the .Xauthority file.\r
+ */\r
+ needs_free = FALSE;\r
+ xauthfile = getenv("XAUTHORITY");\r
+ if (!xauthfile) {\r
+ xauthfile = getenv("HOME");\r
+ if (xauthfile) {\r
+ xauthfile = dupcat(xauthfile, "/.Xauthority", NULL);\r
+ needs_free = TRUE;\r
+ }\r
+ }\r
+\r
+ if (xauthfile) {\r
+ x11_get_auth_from_authfile(disp, xauthfile);\r
+ if (needs_free)\r
+ sfree(xauthfile);\r
+ }\r
+}\r
+\r
+const int platform_uses_x11_unix_by_default = TRUE;\r