diff options
Diffstat (limited to 'sesman/chansrv/pulse/module-xrdp-source.c')
-rw-r--r-- | sesman/chansrv/pulse/module-xrdp-source.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sesman/chansrv/pulse/module-xrdp-source.c b/sesman/chansrv/pulse/module-xrdp-source.c index 6aa73ecd..a7dd19c9 100644 --- a/sesman/chansrv/pulse/module-xrdp-source.c +++ b/sesman/chansrv/pulse/module-xrdp-source.c @@ -177,6 +177,7 @@ static int data_get(struct userdata *u, pa_memchunk *chunk) { int read_bytes; struct sockaddr_un s; char *data; + char *socket_dir; char buf[11]; unsigned char ubuf[10]; @@ -186,7 +187,13 @@ static int data_get(struct userdata *u, pa_memchunk *chunk) { memset(&s, 0, sizeof(s)); s.sun_family = AF_UNIX; bytes = sizeof(s.sun_path) - 1; - snprintf(s.sun_path, bytes, CHANSRV_PORT_IN_STR, u->display_num); + socket_dir = getenv("XRDP_SOCKET_PATH"); + if (socket_dir == NULL || socket_dir[0] == '\0') + { + socket_dir = "/tmp/.xrdp"; + } + snprintf(s.sun_path, bytes, "%s/" CHANSRV_PORT_IN_BASE_STR, + socket_dir, u->display_num); pa_log_debug("Trying to connect to %s", s.sun_path); if (connect(fd, (struct sockaddr *) &s, sizeof(struct sockaddr_un)) != 0) { |