diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-07-01 15:53:42 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2019-06-17 18:11:12 +0100 |
commit | d1874b4287a0a09a67f1ff529a95e52a07b2fc29 (patch) | |
tree | bd096ee5d732240efaad058b4ee4867c9e9164f7 | |
parent | 3fae9573a83ac8d7b177ebdf3ae68d6f5e1d6e52 (diff) |
hw/xwin: Remove XSetAuthorization() for helper clients
All helper client code now uses xcb, so calling XSetAuthorization() is
no longer needed.
This is the last reference to libX11 from helper clients, so linking
with libX11 is no longer required.
Also remove unneeded x11-xcb library from XWINMODULES
Also drop installing these prerequistes on AppvVeyor
Also move prototypes for functions in winauth.c from win.h into
winauth.h, and include that where needed
-rw-r--r-- | .appveyor.yml | 2 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | hw/xwin/InitOutput.c | 1 | ||||
-rw-r--r-- | hw/xwin/meson.build | 1 | ||||
-rw-r--r-- | hw/xwin/win.h | 8 | ||||
-rw-r--r-- | hw/xwin/winauth.c | 25 | ||||
-rw-r--r-- | hw/xwin/winauth.h | 26 | ||||
-rw-r--r-- | hw/xwin/winclipboardinit.c | 6 | ||||
-rw-r--r-- | hw/xwin/winmultiwindowwm.c | 2 |
9 files changed, 36 insertions, 37 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 632b78b6e..71d35ae20 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -15,7 +15,7 @@ install: - if "%BUILD%"=="i686-pc-cygwin" set SETUP=setup-x86.exe && set CYGWIN_ROOT=C:\cygwin - curl -fsSL https://gist.githubusercontent.com/jon-turney/0338af595313f598bfab15a0ac0df847/raw/bd0eeca6be899e7846aa988fbcf15e4e12f5f842/zp_libtool_cleanlafiles.sh -o %CYGWIN_ROOT%\etc\postinstall\zp_libtool_cleanlafiles.sh - echo Updating Cygwin and installing build prerequisites -- '%CYGWIN_ROOT%\%SETUP% -qnNdO -R "%CYGWIN_ROOT%" -s "%CYGWIN_MIRROR%" -l "%CACHE%" -g -P "meson,binutils,bison,bzip2,diffutils,fileutils,findutils,flex,gawk,gcc-core,make,patch,pkg-config,python3,sed,tar,xorgproto,windowsdriproto,libdmx-devel,libfontenc-devel,libfreetype-devel,libGL-devel,libpixman1-devel,libX11-devel,libXRes-devel,libXau-devel,libXaw-devel,libXdmcp-devel,libXext-devel,libXfont2-devel,libXi-devel,libXinerama-devel,libXmu-devel,libXpm-devel,libXrender-devel,libXtst-devel,libxcb-ewmh-devel,libxcb-icccm-devel,libxcb-image-devel,libxcb-keysyms-devel,libxcb-randr-devel,libxcb-render-devel,libxcb-render-util-devel,libxcb-shape-devel,libxcb-util-devel,libxcb-xkb-devel,libxkbfile-devel,zlib-devel,font-util,khronos-opengl-registry,python3-lxml,xorg-util-macros,xtrans,xkbcomp-devel,xkeyboard-config,libnettle-devel,libepoxy-devel,libtirpc-devel,libxcb-composite-devel,ImageMagick"' +- '%CYGWIN_ROOT%\%SETUP% -qnNdO -R "%CYGWIN_ROOT%" -s "%CYGWIN_MIRROR%" -l "%CACHE%" -g -P "meson,binutils,bison,bzip2,diffutils,fileutils,findutils,flex,gawk,gcc-core,make,patch,pkg-config,python3,sed,tar,xorgproto,windowsdriproto,libdmx-devel,libfontenc-devel,libfreetype-devel,libGL-devel,libpixman1-devel,libXRes-devel,libXaw-devel,libXdmcp-devel,libXext-devel,libXfont2-devel,libXi-devel,libXinerama-devel,libXmu-devel,libXpm-devel,libXrender-devel,libXtst-devel,libxcb-ewmh-devel,libxcb-icccm-devel,libxcb-image-devel,libxcb-keysyms-devel,libxcb-randr-devel,libxcb-render-devel,libxcb-render-util-devel,libxcb-shape-devel,libxcb-util-devel,libxcb-xkb-devel,libxkbfile-devel,zlib-devel,font-util,khronos-opengl-registry,python3-lxml,xorg-util-macros,xtrans,xkbcomp-devel,xkeyboard-config,libnettle-devel,libepoxy-devel,libtirpc-devel,libxcb-composite-devel,ImageMagick"' - echo Install done cache: - C:\cache diff --git a/configure.ac b/configure.ac index 5494bdf29..4ed23a6f6 100644 --- a/configure.ac +++ b/configure.ac @@ -2146,7 +2146,7 @@ if test "x$XWIN" = xyes; then AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) AC_CHECK_TOOL(WINDRES, windres) - PKG_CHECK_MODULES([XWINMODULES],[x11 xau xdmcp x11-xcb xcb-aux xcb-composite xcb-image xcb-ewmh xcb-icccm xcb-xfixes]) + PKG_CHECK_MODULES([XWINMODULES],[xcb-aux xcb-composite xcb-image xcb-ewmh xcb-icccm xcb-xfixes]) if test "x$WINDOWSDRI" = xauto; then PKG_CHECK_EXISTS([windowsdriproto], [WINDOWSDRI=yes], [WINDOWSDRI=no]) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index ec3144993..53ba658d9 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -66,6 +66,7 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner, #include "glx/glwindows.h" #include "dri/windowsdri.h" #endif +#include "winauth.h" /* * References to external symbols diff --git a/hw/xwin/meson.build b/hw/xwin/meson.build index 34efcb2aa..2f5891191 100644 --- a/hw/xwin/meson.build +++ b/hw/xwin/meson.build @@ -144,7 +144,6 @@ srcs_windows += pfiles xwin_dep = [ common_dep, - dependency('x11-xcb'), dependency('xcb-aux'), dependency('xcb-image'), dependency('xcb-ewmh'), diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 9790cbe7e..d68e56ad7 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -670,14 +670,6 @@ Bool winAllocateCmapPrivates(ColormapPtr pCmap); /* - * winauth.c - */ - -Bool - winGenerateAuthorization(void); -void winSetAuthorization(void); - -/* * winblock.c */ diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c index 14278390f..02a693490 100644 --- a/hw/xwin/winauth.c +++ b/hw/xwin/winauth.c @@ -32,7 +32,8 @@ #include <xwin-config.h> #endif -#include "win.h" +#include "winauth.h" +#include "winmsg.h" /* Includes for authorization */ #include "securitysrv.h" @@ -40,14 +41,6 @@ #include <xcb/xcb.h> -/* Need to get this from Xlib.h */ -extern void XSetAuthorization( - const char * /* name */, - int /* namelen */, - const char * /* data */, - int /* datalen */ -); - /* * Constants */ @@ -68,9 +61,7 @@ static xcb_auth_info_t auth_info; */ #ifndef XCSECURITY - -static - XID +static XID GenerateAuthorization(unsigned name_length, const char *name, unsigned data_length, @@ -89,7 +80,9 @@ GenerateAuthorization(unsigned name_length, Bool winGenerateAuthorization(void) { +#ifdef XCSECURITY SecurityAuthorizationPtr pAuth = NULL; +#endif /* Call OS layer to generate authorization key */ g_authId = GenerateAuthorization(strlen(AUTH_NAME), @@ -141,14 +134,6 @@ winGenerateAuthorization(void) return TRUE; } -/* Use our generated cookie for authentication */ -void -winSetAuthorization(void) -{ - XSetAuthorization(AUTH_NAME, - strlen(AUTH_NAME), g_pAuthData, g_uiAuthDataLen); -} - xcb_auth_info_t * winGetXcbAuthInfo(void) { diff --git a/hw/xwin/winauth.h b/hw/xwin/winauth.h new file mode 100644 index 000000000..68d3ac0cb --- /dev/null +++ b/hw/xwin/winauth.h @@ -0,0 +1,26 @@ +/* + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include <xcb/xcb.h> +#include <X11/Xdefs.h> // for Bool + +Bool winGenerateAuthorization(void); +xcb_auth_info_t * winGetXcbAuthInfo(void); diff --git a/hw/xwin/winclipboardinit.c b/hw/xwin/winclipboardinit.c index 1e920f51f..814899f8e 100644 --- a/hw/xwin/winclipboardinit.c +++ b/hw/xwin/winclipboardinit.c @@ -38,12 +38,11 @@ #include "win.h" #include "winclipboard/winclipboard.h" #include "windisplay.h" +#include "winauth.h" #define WIN_CLIPBOARD_RETRIES 40 #define WIN_CLIPBOARD_DELAY 1 -extern xcb_auth_info_t *winGetXcbAuthInfo(void); - /* * Local variables */ @@ -66,9 +65,6 @@ winClipboardThreadProc(void *arg) ++clipboardRestarts; - /* Use our generated cookie for authentication */ - winSetAuthorization(); - /* Setup the display connection string */ /* * NOTE: Always connect to screen 0 since we require that screen diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index b3cc4bbff..ec7f6707f 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -77,6 +77,7 @@ #include "winglobals.h" #include "windisplay.h" #include "winmultiwindowicons.h" +#include "winauth.h" /* We need the native HWND atom for intWM, so for consistency use the same name as extWM does */ @@ -89,7 +90,6 @@ extern void winDebug(const char *format, ...); extern void winReshapeMultiWindow(WindowPtr pWin); extern void winUpdateRgnMultiWindow(WindowPtr pWin); -extern xcb_auth_info_t *winGetXcbAuthInfo(void); extern void winUpdateWindowPosition(HWND hWnd, HWND * zstyle); #ifndef CYGDEBUG |