summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.h
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2018-02-06 13:49:42 +0300
committerAlexander Volkov <a.volkov@rusbitech.ru>2018-02-15 22:15:02 +0000
commit24adaa9a742e6f95ff897d0eb9a2bce0527dd042 (patch)
treebb159c5d6f69cb0ccde7f6555f1a41e88f12c2c3 /src/plugins/platforms/xcb/qxcbconnection.h
parent8db9e33997a8fbe3e13eab1ca62ae2d5ac39abef (diff)
xcb: Fix access to shm for X server running from another user
Use ShmCreateSegment call, that was added in MIT-SHM 1.2, to create shared memory segments on the server side. It returns a POSIX shared memory object that is used to mmap memory. It's in effect a file descriptor that is passed through the X server socket and thus avoids permission checks. On the other hand this scheme is more secure, because the file descriptor, and thus the shared memory, are accessible only by the X server and the application. Task-number: QTBUG-46017 Change-Id: I202eead9d01aee2ab5b65f4f74f4c13da7cb2239 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index b2713b8ac7..dbc1c4561d 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -480,6 +480,7 @@ public:
bool hasXRender() const { return has_render_extension; }
bool hasXInput2() const { return m_xi2Enabled; }
bool hasShm() const { return has_shm; }
+ bool hasShmFd() const { return has_shm_fd; }
bool threadedEventHandling() const { return m_reader->isRunning(); }
@@ -703,6 +704,7 @@ private:
bool has_xkb = false;
bool has_render_extension = false;
bool has_shm = false;
+ bool has_shm_fd = false;
Qt::MouseButtons m_buttonState = 0;
Qt::MouseButton m_button = Qt::NoButton;