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.
This commit is contained in:
Pavel Roskin
2017-03-14 21:45:50 -07:00
committed by jsorg71
parent fc2572f60b
commit 58c9cb43e9
17 changed files with 41 additions and 57 deletions
+4
View File
@@ -3,6 +3,10 @@ EXTRA_DIST = \
vrplayer.c \
vrplayer.mk
AM_CPPFLAGS = \
-DXRDP_SOCKET_PATH=\"${socketdir}\" \
-I$(top_srcdir)/common
module_LTLIBRARIES = \
libxrdpapi.la
+2 -1
View File
@@ -39,6 +39,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#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);