From 58c9cb43e9e83a6f5cc8a13cd84aa67cce8cacd5 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 14 Mar 2017 21:45:50 -0700 Subject: Make socket directory configurable, don't hardcode /tmp/.xrdp Use XRDP_SOCKET_PATH in file_loc.h Don't define any non-socket paths in file_loc.h, they should come from the makefiles. Define all paths unconditionally, they should not be defined elsewhere. Pass XRDP_SOCKET_PATH as environment variable to the backends. --- xrdpapi/Makefile.am | 4 ++++ xrdpapi/xrdpapi.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'xrdpapi') diff --git a/xrdpapi/Makefile.am b/xrdpapi/Makefile.am index fefa03fc..d40109a9 100644 --- a/xrdpapi/Makefile.am +++ b/xrdpapi/Makefile.am @@ -3,6 +3,10 @@ EXTRA_DIST = \ vrplayer.c \ vrplayer.mk +AM_CPPFLAGS = \ + -DXRDP_SOCKET_PATH=\"${socketdir}\" \ + -I$(top_srcdir)/common + module_LTLIBRARIES = \ libxrdpapi.la diff --git a/xrdpapi/xrdpapi.c b/xrdpapi/xrdpapi.c index 07af7091..d5666aa0 100644 --- a/xrdpapi/xrdpapi.c +++ b/xrdpapi/xrdpapi.c @@ -39,6 +39,7 @@ #include #include +#include "file_loc.h" #include "xrdpapi.h" struct wts_obj @@ -148,7 +149,7 @@ WTSVirtualChannelOpenEx(unsigned int SessionId, const char *pVirtualName, memset(&s, 0, sizeof(struct sockaddr_un)); s.sun_family = AF_UNIX; bytes = sizeof(s.sun_path); - snprintf(s.sun_path, bytes - 1, "/tmp/.xrdp/xrdpapi_%d", wts->display_num); + snprintf(s.sun_path, bytes - 1, CHANSRV_API_STR, wts->display_num); s.sun_path[bytes - 1] = 0; bytes = sizeof(struct sockaddr_un); -- cgit v1.2.3