xserver: Branch 'XACE-SELINUX' - 2 commits
Eamon Walsh
ewalsh at kemper.freedesktop.org
Fri Oct 19 16:40:18 PDT 2007
Xext/xselinux.c | 2 ++
dix/dispatch.c | 25 ++++++++++++-------------
include/selection.h | 4 ++--
3 files changed, 16 insertions(+), 15 deletions(-)
New commits:
commit ce7f6fe1268fef4f89aa21c7b44d73ecd98efe24
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date: Fri Oct 19 19:40:04 2007 -0400
xselinux: properly update sizes when dynamic arrays are resized...
diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index 8b1898d..14a2270 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -143,6 +143,7 @@ SELinuxEventToSID(int type, SELinuxStateRec *sid_return)
return BadAlloc;
memset(knownEvents + numKnownEvents, 0,
(type - numKnownEvents + 1) * size);
+ numKnownEvents = type + 1;
}
if (!knownEvents[type]) {
@@ -180,6 +181,7 @@ SELinuxTypeToClass(RESTYPE type)
return 0;
memset(knownTypes + numKnownTypes, 0,
(type - numKnownTypes + 1) * size);
+ numKnownTypes = type + 1;
}
if (!knownTypes[type]) {
commit 12e889d202ac9849f534c51167cbfed91c32027a
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date: Fri Oct 19 18:43:38 2007 -0400
xace: Bug fixes, name changes to selection access hooks and fields.
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 50384db..2cfeb2d 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1024,7 +1024,7 @@ ProcSetSelectionOwner(ClientPtr client)
return Success;
rc = XaceHook(XACE_SELECTION_ACCESS, client, stuff->selection,
- CurrentSelections[i], DixSetAttrAccess);
+ CurrentSelections + i, DixSetAttrAccess);
if (rc != Success)
return rc;
@@ -1058,17 +1058,15 @@ ProcSetSelectionOwner(ClientPtr client)
CurrentSelections = newsels;
CurrentSelections[i].selection = stuff->selection;
CurrentSelections[i].devPrivates = NULL;
- rc = XaceHook(XACE_SELECTION_ACCESS, stuff->selection,
- CurrentSelections[i], DixSetAttrAccess);
+ rc = XaceHook(XACE_SELECTION_ACCESS, client, stuff->selection,
+ CurrentSelections + i, DixSetAttrAccess);
if (rc != Success)
return rc;
}
CurrentSelections[i].lastTimeChanged = time;
CurrentSelections[i].window = stuff->window;
- CurrentSelections[i].destwindow = stuff->window;
CurrentSelections[i].pWin = pWin;
CurrentSelections[i].client = (pWin ? client : NullClient);
- CurrentSelections[i].destclient = (pWin ? client : NullClient);
if (SelectionCallback)
{
SelectionInfoRec info;
@@ -1100,19 +1098,20 @@ ProcGetSelectionOwner(ClientPtr client)
i = 0;
while ((i < NumCurrentSelections) &&
CurrentSelections[i].selection != stuff->id) i++;
+
+ rc = XaceHook(XACE_SELECTION_ACCESS, client, stuff->id,
+ CurrentSelections + i, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
reply.type = X_Reply;
reply.length = 0;
reply.sequenceNumber = client->sequence;
if (i < NumCurrentSelections)
- reply.owner = CurrentSelections[i].destwindow;
+ reply.owner = CurrentSelections[i].window;
else
reply.owner = None;
- rc = XaceHook(XACE_SELECTION_ACCESS, client, stuff->id, NULL,
- DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply);
return(client->noClientException);
}
@@ -1150,7 +1149,7 @@ ProcConvertSelection(ClientPtr client)
if ((i < NumCurrentSelections) &&
(CurrentSelections[i].window != None) &&
XaceHook(XACE_SELECTION_ACCESS, client, stuff->selection,
- &CurrentSelections[i], DixReadAccess) == Success)
+ CurrentSelections + i, DixReadAccess) == Success)
{
event.u.u.type = SelectionRequest;
event.u.selectionRequest.time = stuff->time;
@@ -1160,7 +1159,7 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionRequest.target = stuff->target;
event.u.selectionRequest.property = stuff->property;
if (TryClientEvents(
- CurrentSelections[i].destclient, &event, 1, NoEventMask,
+ CurrentSelections[i].client, &event, 1, NoEventMask,
NoEventMask /* CantBeFiltered */, NullGrab))
return (client->noClientException);
}
diff --git a/include/selection.h b/include/selection.h
index 9347376..859b6a3 100644
--- a/include/selection.h
+++ b/include/selection.h
@@ -62,8 +62,8 @@ typedef struct _Selection {
Window window;
WindowPtr pWin;
ClientPtr client;
- ClientPtr destclient; /* support for redirection */
- Window destwindow; /* support for redirection */
+ ClientPtr alt_client; /* support for redirection */
+ Window alt_window; /* support for redirection */
PrivateRec *devPrivates;
} Selection;
More information about the xorg-commit
mailing list