diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2014-02-04 14:06:02 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2014-02-04 14:06:02 -0800 |
commit | 41c3a9c6e9499b2df937f88a834774de62b04a62 (patch) | |
tree | 82e396bcb51bfc9b7ecdf35568a55dd4f791521f /xorg/X11R7.6/rdp | |
parent | 7b7debd56a02fc7463ef563b0c0e11300dac8acc (diff) | |
download | xrdp-proprietary-41c3a9c6e9499b2df937f88a834774de62b04a62.tar.gz xrdp-proprietary-41c3a9c6e9499b2df937f88a834774de62b04a62.zip |
X11rdp: turn off abstract unix domain sockets in Xorg are set X sockets rights for only current user
Diffstat (limited to 'xorg/X11R7.6/rdp')
-rw-r--r-- | xorg/X11R7.6/rdp/rdpmain.c | 38 |
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 } /******************************************************************************/ |