Parameterise the sockdir with the UID of the user

The top level socket directory is now called XRDP_SOCKET_ROOT_PATH.
Below that are user-specific directories referred to with the
XRDP_SOCKET_PATH macro - this name is hard-coded into xorgxrdp and
the audio modules as an environment variable.

XRDP_SOCKET_PATH now looks like $XRDP_SOCKET_ROOT_PATH/<uid>

XRDP_SOCKET_PATH is only writeable by the user, and readable by the user
and the xrdp process.
This commit is contained in:
matt335672
2023-06-14 13:59:55 +01:00
parent 63235eaafd
commit 675dd77807
28 changed files with 219 additions and 116 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ EXTRA_DIST = \
vrplayer.mk
AM_CPPFLAGS = \
-DXRDP_SOCKET_PATH=\"${socketdir}\" \
-DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \
-I$(top_srcdir)/common
module_LTLIBRARIES = \
+1 -1
View File
@@ -140,7 +140,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, CHANSRV_API_STR, wts->display_num);
snprintf(s.sun_path, bytes - 1, CHANSRV_API_STR, getuid(), wts->display_num);
s.sun_path[bytes - 1] = 0;
bytes = sizeof(struct sockaddr_un);