diff options
author | Koichiro IWAO <meta@vmeta.jp> | 2017-05-09 14:24:38 +0900 |
---|---|---|
committer | metalefty <meta@vmeta.jp> | 2017-05-16 10:41:06 +0900 |
commit | e1d11a74da97df1bc79e17d8992f3c04fd6c1606 (patch) | |
tree | 8db31ba67547c4866a5099157476a39b8bf6fb05 /sesman/chansrv/pulse/module-xrdp-source.c | |
parent | 1acef2567c08b85cdf21fd708430606a70c28016 (diff) | |
download | xrdp-proprietary-e1d11a74da97df1bc79e17d8992f3c04fd6c1606.tar.gz xrdp-proprietary-e1d11a74da97df1bc79e17d8992f3c04fd6c1606.zip |
pulse: respect XRDP_SOCKET_PATH environment variable
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) { |