summaryrefslogtreecommitdiff
path: root/hw/xwin/winmultiwindowwm.c
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2009-07-13 13:46:45 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2009-11-09 20:33:44 +0000
commit0866322b574b1f3695467535ed5fa8f9e629ad1d (patch)
tree2c8c58a0c48c9eb805c825a3c0eaa8a47ec7ca98 /hw/xwin/winmultiwindowwm.c
parent72f81f4e449defb0654e9bdb2c9ec014475a3977 (diff)
Cygwin/X: Always use an authorization cookie for internal clients
Don't conditionalize use of an authorization cookie for internal client threads on XCSECURITY, always use one (this avoids certain problems with XDMCP setups where the XDMCP host removes localhost from the access list etc.) Conditionalize the use of a XCSECURITY authorization descriptor on XCSECURITY Consolidate the various places where the authorization cookie is set for internal threads into a new function, winSetAuthorization() Use authorization cookie for multiwindow WM X message thread as well Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Diffstat (limited to 'hw/xwin/winmultiwindowwm.c')
-rw-r--r--hw/xwin/winmultiwindowwm.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 7cdac0c10..27f5e3278 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -90,8 +90,6 @@ extern void winUpdateRgnMultiWindow(WindowPtr pWin);
#endif
#define WIN_JMP_OKAY 0
#define WIN_JMP_ERROR_IO 2
-#define AUTH_NAME "MIT-MAGIC-COOKIE-1"
-
/*
* Local structures
@@ -140,11 +138,6 @@ typedef struct _XMsgProcArgRec {
extern char *display;
extern void ErrorF (const char* /*f*/, ...);
-#if defined(XCSECURITY)
-extern unsigned int g_uiAuthDataLen;
-extern char *g_pAuthData;
-#endif
-
/*
* Prototypes for local functions
@@ -948,6 +941,9 @@ winMultiWindowXMsgProc (void *pArg)
/* Print the display connection string */
ErrorF ("winMultiWindowXMsgProc - DISPLAY=%s\n", pszDisplay);
+
+ /* Use our generated cookie for authentication */
+ winSetAuthorization();
/* Initialize retry count */
iRetries = 0;
@@ -1323,14 +1319,9 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
/* Print the display connection string */
ErrorF ("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay);
-#if defined(XCSECURITY)
/* Use our generated cookie for authentication */
- XSetAuthorization (AUTH_NAME,
- strlen (AUTH_NAME),
- g_pAuthData,
- g_uiAuthDataLen);
-#endif
-
+ winSetAuthorization();
+
/* Open the X display */
do
{