summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_mm.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2012-03-15 21:42:39 -0700
committerJay Sorg <jay.sorg@gmail.com>2012-03-15 21:42:39 -0700
commite9c58226ba20efb6389d976acb9eb8e339b02df7 (patch)
tree6430c30a3353136837542790efcab38f13a91be5 /xrdp/xrdp_mm.c
parentffa5149a8f2e3f4eedb7206ac2cdcd2f104e8d3e (diff)
downloadxrdp-proprietary-e9c58226ba20efb6389d976acb9eb8e339b02df7.tar.gz
xrdp-proprietary-e9c58226ba20efb6389d976acb9eb8e339b02df7.zip
use unix domain socket for xrdp-X11rdp connection
Diffstat (limited to 'xrdp/xrdp_mm.c')
-rw-r--r--xrdp/xrdp_mm.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index d8c9c581..16f31acf 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -373,6 +373,7 @@ xrdp_mm_setup_mod2(struct xrdp_mm* self)
int rv;
int key_flags;
int device_flags;
+ int use_uds;
g_memset(text,0,sizeof(char) * 256);
rv = 1;
@@ -396,7 +397,22 @@ xrdp_mm_setup_mod2(struct xrdp_mm* self)
}
else if (self->code == 10) /* X11rdp */
{
- g_snprintf(text, 255, "%d", 6200 + self->display);
+ use_uds = 1;
+ if (xrdp_mm_get_value(self, "ip", text, 255) == 0)
+ {
+ if (g_strcmp(text, "127.0.0.1") != 0)
+ {
+ use_uds = 0;
+ }
+ }
+ if (use_uds)
+ {
+ g_snprintf(text, 255, "/tmp/.xrdp/xrdp_display_%d", self->display);
+ }
+ else
+ {
+ g_snprintf(text, 255, "%d", 6200 + self->display);
+ }
}
else
{