diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2019-11-20 09:30:12 +0300 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2019-11-20 09:31:49 +0300 |
commit | 228e9091af79a76819292467f17ad1ad7c6483c3 (patch) | |
tree | 9a865fd8e5264b8d113dc23bf4d8e51389f64f6c | |
parent | 0d876b22ae772ba48f1ed5517769941b33e5479a (diff) |
do not allow randr client to resize screen
-rw-r--r-- | module/rdp.h | 1 | ||||
-rw-r--r-- | module/rdpClientCon.c | 2 | ||||
-rw-r--r-- | module/rdpRandR.c | 5 | ||||
-rw-r--r-- | xrdpdev/xrdpdev.c | 2 |
4 files changed, 10 insertions, 0 deletions
diff --git a/module/rdp.h b/module/rdp.h index c2a7eec..399fc07 100644 --- a/module/rdp.h +++ b/module/rdp.h @@ -270,6 +270,7 @@ struct _rdpRec RROutputGetPropertyProcPtr rrOutputGetProperty; RRGetPanningProcPtr rrGetPanning; RRSetPanningProcPtr rrSetPanning; + int allow_screen_resize; int listen_sck; char uds_data[256]; diff --git a/module/rdpClientCon.c b/module/rdpClientCon.c index 7651492..7950c01 100644 --- a/module/rdpClientCon.c +++ b/module/rdpClientCon.c @@ -746,7 +746,9 @@ rdpClientConProcessScreenSizeMsg(rdpPtr dev, rdpClientCon *clientCon, if ((dev->width != width) || (dev->height != height)) { + dev->allow_screen_resize = 1; ok = RRScreenSizeSet(dev->pScreen, width, height, mmwidth, mmheight); + dev->allow_screen_resize = 0; LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: RRScreenSizeSet ok=[%d]", ok)); RRTellChanged(dev->pScreen); } diff --git a/module/rdpRandR.c b/module/rdpRandR.c index 2ce929c..ffb9783 100644 --- a/module/rdpRandR.c +++ b/module/rdpRandR.c @@ -127,6 +127,11 @@ rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, LLOGLN(0, ("rdpRRScreenSetSize: width %d height %d mmWidth %d mmHeight %d", width, height, (int)mmWidth, (int)mmHeight)); dev = rdpGetDevFromScreen(pScreen); + if (dev->allow_screen_resize == 0) + { + LLOGLN(0, ("rdpRRScreenSetSize: not allowing resize")); + return FALSE; + } root = rdpGetRootWindowPtr(pScreen); if ((width < 1) || (height < 1)) { diff --git a/xrdpdev/xrdpdev.c b/xrdpdev/xrdpdev.c index 6fc73c0..2dcce60 100644 --- a/xrdpdev/xrdpdev.c +++ b/xrdpdev/xrdpdev.c @@ -359,7 +359,9 @@ rdpResizeSession(rdpPtr dev, int width, int height) if ((dev->width != width) || (dev->height != height)) { LLOGLN(0, (" calling RRScreenSizeSet")); + dev->allow_screen_resize = 1; ok = RRScreenSizeSet(dev->pScreen, width, height, mmwidth, mmheight); + dev->allow_screen_resize = 0; LLOGLN(0, (" RRScreenSizeSet ok %d", ok)); } return ok; |