summaryrefslogtreecommitdiffstats
path: root/xorg/X11R7.6/rdp/rdpmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg/X11R7.6/rdp/rdpmain.c')
-rw-r--r--xorg/X11R7.6/rdp/rdpmain.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/xorg/X11R7.6/rdp/rdpmain.c b/xorg/X11R7.6/rdp/rdpmain.c
index c68700fc..884b8a3a 100644
--- a/xorg/X11R7.6/rdp/rdpmain.c
+++ b/xorg/X11R7.6/rdp/rdpmain.c
@@ -32,6 +32,27 @@ Sets up the functions
#define DEBUG_OUT(arg) ErrorF arg
#endif
+#ifndef XRDP_DISABLE_LINUX_ABSTRACT
+#ifdef __linux__
+#define XRDP_DISABLE_LINUX_ABSTRACT 1
+#else
+#define XRDP_DISABLE_LINUX_ABSTRACT 0
+#endif
+#endif
+
+#if XRDP_DISABLE_LINUX_ABSTRACT
+/* because including <X11/Xtrans/Xtransint.h> in problematic
+ * we dup a small struct
+ * we need to set flags to zero to turn off abstract sockets */
+struct _MyXtransport
+{
+ char *TransName;
+ int flags;
+};
+/* in xtrans-1.2.6/Xtranssock.c */
+extern struct _MyXtransport _XSERVTransSocketLocalFuncs;
+#endif
+
rdpScreenInfoRec g_rdpScreen; /* the one screen */
ScreenPtr g_pScreen = 0;
@@ -234,6 +255,16 @@ rdpDestroyColormap(ColormapPtr pColormap)
#endif
/******************************************************************************/
+void
+rdpSetUDSRights(void)
+{
+ char unixSocketName[128];
+
+ sprintf(unixSocketName, "/tmp/.X11-unix/X%s", display);
+ chmod(unixSocketName, 0700);
+}
+
+/******************************************************************************/
/* returns boolean, true if everything is ok */
static Bool
rdpScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
@@ -548,6 +579,8 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
rdpGlyphInit();
//rdpXvInit(pScreen);
+
+ rdpSetUDSRights();
ErrorF("rdpScreenInit: ret %d\n", ret);
@@ -620,6 +653,11 @@ ddxProcessArgument(int argc, char **argv, int i)
void
OsVendorInit(void)
{
+#if XRDP_DISABLE_LINUX_ABSTRACT
+ /* turn off the Linux abstract unix doamin sockets TRANS_ABSTRACT */
+ /* TRANS_NOLISTEN = 1 << 3 */
+ _XSERVTransSocketLocalFuncs.flags = 0;
+#endif
}
/******************************************************************************/