summaryrefslogtreecommitdiff
path: root/xserver/xfixes/select.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-11-02 15:26:35 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-11-02 15:26:35 +0000
commitdbca69c8a4f3e2d1ccb4f89152213b2861b33af6 (patch)
treef8963ef73903a7b4374adc2354dffbaa905112ac /xserver/xfixes/select.c
parent33b2029f322f3c238b7ba528083195ad8dde33e1 (diff)
xserver 1.5.2. tested by ckuethe@, oga@, and others.
Diffstat (limited to 'xserver/xfixes/select.c')
-rw-r--r--xserver/xfixes/select.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/xserver/xfixes/select.c b/xserver/xfixes/select.c
index 69029015c..12a165fd0 100644
--- a/xserver/xfixes/select.c
+++ b/xserver/xfixes/select.c
@@ -1,6 +1,4 @@
/*
- * $Id: select.c,v 1.1 2006/11/26 18:15:08 matthieu Exp $
- *
* Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -27,6 +25,7 @@
#endif
#include "xfixesint.h"
+#include "xace.h"
static RESTYPE SelectionClientType, SelectionWindowType;
static Bool SelectionCallbackRegistered = FALSE;
@@ -78,7 +77,9 @@ XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args)
}
for (e = selectionEvents; e; e = e->next)
{
- if (e->selection == selection->selection && (e->eventMask & eventMask))
+ if (e->selection == selection->selection &&
+ (e->eventMask & eventMask) &&
+ !e->pClient->clientGone)
{
xXFixesSelectionNotifyEvent ev;
@@ -131,8 +132,13 @@ XFixesSelectSelectionInput (ClientPtr pClient,
WindowPtr pWindow,
CARD32 eventMask)
{
+ int rc;
SelectionEventPtr *prev, e;
+ rc = XaceHook(XACE_SELECTION_ACCESS, pClient, selection, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
for (prev = &selectionEvents; (e = *prev); prev = &e->next)
{
if (e->selection == selection &&
@@ -193,12 +199,12 @@ ProcXFixesSelectSelectionInput (ClientPtr client)
{
REQUEST (xXFixesSelectSelectionInputReq);
WindowPtr pWin;
+ int rc;
REQUEST_SIZE_MATCH (xXFixesSelectSelectionInputReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
if (stuff->eventMask & ~SelectionAllEvents)
{
client->errorValue = stuff->eventMask;
@@ -218,7 +224,7 @@ SProcXFixesSelectSelectionInput (ClientPtr client)
swapl(&stuff->window, n);
swapl(&stuff->selection, n);
swapl(&stuff->eventMask, n);
- return ProcXFixesSelectSelectionInput(client);
+ return (*ProcXFixesVector[stuff->xfixesReqType])(client);
}
void