OSDN Git Service

Add VC++ Project files for PuTTY DLL without exported functions.
[ffftp/ffftp.git] / putty / UNIX / UX_X11.C
1 /*\r
2  * ux_x11.c: fetch local auth data for X forwarding.\r
3  */\r
4 \r
5 #include <ctype.h>\r
6 #include <unistd.h>\r
7 #include <assert.h>\r
8 #include <stdlib.h>\r
9 #include <errno.h>\r
10 \r
11 #include "putty.h"\r
12 #include "ssh.h"\r
13 #include "network.h"\r
14 \r
15 void platform_get_x11_auth(struct X11Display *disp, const Config *cfg)\r
16 {\r
17     char *xauthfile;\r
18     int needs_free;\r
19 \r
20     /*\r
21      * Find the .Xauthority file.\r
22      */\r
23     needs_free = FALSE;\r
24     xauthfile = getenv("XAUTHORITY");\r
25     if (!xauthfile) {\r
26         xauthfile = getenv("HOME");\r
27         if (xauthfile) {\r
28             xauthfile = dupcat(xauthfile, "/.Xauthority", NULL);\r
29             needs_free = TRUE;\r
30         }\r
31     }\r
32 \r
33     if (xauthfile) {\r
34         x11_get_auth_from_authfile(disp, xauthfile);\r
35         if (needs_free)\r
36             sfree(xauthfile);\r
37     }\r
38 }\r
39 \r
40 const int platform_uses_x11_unix_by_default = TRUE;\r