xserver: Branch 'XACE-SELINUX'

Eamon Walsh ewalsh at kemper.freedesktop.org
Thu Mar 22 01:18:45 EET 2007


 dix/dispatch.c      |   16 ++++++++++++----
 include/selection.h |    4 ++++
 2 files changed, 16 insertions(+), 4 deletions(-)

New commits:
diff-tree 4c1fb8069d5dd30a73277698503e9dcc2e9d64c6 (from 4fa482b4be1150bcffeabb64d018c00ac5951e41)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Wed Mar 21 16:17:14 2007 -0400

    dix: add new selection fields supporting redirection.
    This is a minor ABI break.

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 498f18a..b5ed13d 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1074,11 +1074,16 @@ ProcSetSelectionOwner(register ClientPtr
 	    NumCurrentSelections++;
 	    CurrentSelections = newsels;
 	    CurrentSelections[i].selection = stuff->selection;
+	    CurrentSelections[i].devPrivates = NULL;
 	}
+	dixFreePrivates(CurrentSelections[i].devPrivates);
         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);
+	CurrentSelections[i].devPrivates = NULL;
 	if (SelectionCallback)
 	{
 	    SelectionInfoRec	info;
@@ -1115,7 +1120,7 @@ ProcGetSelectionOwner(register ClientPtr
 	reply.sequenceNumber = client->sequence;
         if (i < NumCurrentSelections &&
 	    XaceHook(XACE_SELECTION_ACCESS, client, &CurrentSelections[i]))
-            reply.owner = CurrentSelections[i].window;
+            reply.owner = CurrentSelections[i].destwindow;
         else
             reply.owner = None;
         WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply);
@@ -1158,14 +1163,13 @@ ProcConvertSelection(register ClientPtr 
 	{        
 	    event.u.u.type = SelectionRequest;
 	    event.u.selectionRequest.time = stuff->time;
-	    event.u.selectionRequest.owner = 
-			CurrentSelections[i].window;
+	    event.u.selectionRequest.owner = CurrentSelections[i].window;
 	    event.u.selectionRequest.requestor = stuff->requestor;
 	    event.u.selectionRequest.selection = stuff->selection;
 	    event.u.selectionRequest.target = stuff->target;
 	    event.u.selectionRequest.property = stuff->property;
 	    if (TryClientEvents(
-		CurrentSelections[i].client, &event, 1, NoEventMask,
+		CurrentSelections[i].destclient, &event, 1, NoEventMask,
 		NoEventMask /* CantBeFiltered */, NullGrab))
 		return (client->noClientException);
 	}
@@ -4020,9 +4024,11 @@ DeleteWindowFromAnySelections(WindowPtr 
 		info.kind = SelectionWindowDestroy;
 		CallCallbacks(&SelectionCallback, &info);
 	    }
+	    dixFreePrivates(CurrentSelections[i].devPrivates);
             CurrentSelections[i].pWin = (WindowPtr)NULL;
             CurrentSelections[i].window = None;
 	    CurrentSelections[i].client = NullClient;
+	    CurrentSelections[i].devPrivates = NULL;
 	}
 }
 
@@ -4042,9 +4048,11 @@ DeleteClientFromAnySelections(ClientPtr 
 		info.kind = SelectionWindowDestroy;
 		CallCallbacks(&SelectionCallback, &info);
 	    }
+	    dixFreePrivates(CurrentSelections[i].devPrivates);
             CurrentSelections[i].pWin = (WindowPtr)NULL;
             CurrentSelections[i].window = None;
 	    CurrentSelections[i].client = NullClient;
+	    CurrentSelections[i].devPrivates = NULL;
 	}
 }
 
diff --git a/include/selection.h b/include/selection.h
index fbe7cfc..9347376 100644
--- a/include/selection.h
+++ b/include/selection.h
@@ -50,6 +50,7 @@ SOFTWARE.
 ******************************************************************/
 
 #include "dixstruct.h"
+#include "privates.h"
 /*
  *
  *  Selection data structures 
@@ -61,6 +62,9 @@ typedef struct _Selection {
     Window window;
     WindowPtr pWin;
     ClientPtr client;
+    ClientPtr destclient; /* support for redirection */
+    Window destwindow;    /* support for redirection */
+    PrivateRec *devPrivates;
 } Selection;
 
 #endif /* SELECTION_H */



More information about the xorg-commit mailing list