summaryrefslogtreecommitdiff
path: root/hw/xwin/winauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xwin/winauth.c')
-rw-r--r--hw/xwin/winauth.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c
index 7efa1c00f..fcad49e9f 100644
--- a/hw/xwin/winauth.c
+++ b/hw/xwin/winauth.c
@@ -38,6 +38,16 @@
#include "securitysrv.h"
#include "os/osdep.h"
+#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
*/
@@ -51,6 +61,7 @@
static XID g_authId = 0;
static unsigned int g_uiAuthDataLen = 0;
static char *g_pAuthData = NULL;
+static xcb_auth_info_t auth_info;
/*
* Code to generate a MIT-MAGIC-COOKIE-1, copied from under XCSECURITY
@@ -132,6 +143,11 @@ winGenerateAuthorization(void)
g_uiAuthDataLen, g_pAuthData);
}
+ auth_info.name = AUTH_NAME;
+ auth_info.namelen = strlen(AUTH_NAME);
+ auth_info.data = g_pAuthData;
+ auth_info.datalen = g_uiAuthDataLen;
+
#ifdef XCSECURITY
/* Allocate structure for additional auth information */
pAuth = (SecurityAuthorizationPtr)
@@ -179,3 +195,12 @@ winSetAuthorization(void)
XSetAuthorization(AUTH_NAME,
strlen(AUTH_NAME), g_pAuthData, g_uiAuthDataLen);
}
+
+xcb_auth_info_t *
+winGetXcbAuthInfo(void)
+{
+ if (g_pAuthData)
+ return &auth_info;
+
+ return NULL;
+}