xace: add access_mode argument to selection hook.

This commit is contained in:
Eamon Walsh 2007-03-21 17:01:26 -04:00 committed by Eamon Walsh
parent 4c1fb8069d
commit a3296d111d
3 changed files with 6 additions and 2 deletions

View File

@ -151,6 +151,7 @@ int XaceHook(int hook, ...)
XaceSelectionAccessRec rec = { XaceSelectionAccessRec rec = {
va_arg(ap, ClientPtr), va_arg(ap, ClientPtr),
va_arg(ap, Selection*), va_arg(ap, Selection*),
va_arg(ap, Mask),
TRUE /* default allow */ TRUE /* default allow */
}; };
calldata = &rec; calldata = &rec;

View File

@ -98,6 +98,7 @@ typedef struct {
typedef struct { typedef struct {
ClientPtr client; ClientPtr client;
Selection *selection; Selection *selection;
Mask access_mode;
int rval; int rval;
} XaceSelectionAccessRec; } XaceSelectionAccessRec;

View File

@ -1119,7 +1119,8 @@ ProcGetSelectionOwner(register ClientPtr client)
reply.length = 0; reply.length = 0;
reply.sequenceNumber = client->sequence; reply.sequenceNumber = client->sequence;
if (i < NumCurrentSelections && if (i < NumCurrentSelections &&
XaceHook(XACE_SELECTION_ACCESS, client, &CurrentSelections[i])) XaceHook(XACE_SELECTION_ACCESS, client, &CurrentSelections[i],
DixReadAccess))
reply.owner = CurrentSelections[i].destwindow; reply.owner = CurrentSelections[i].destwindow;
else else
reply.owner = None; reply.owner = None;
@ -1159,7 +1160,8 @@ ProcConvertSelection(register ClientPtr client)
CurrentSelections[i].selection != stuff->selection) i++; CurrentSelections[i].selection != stuff->selection) i++;
if ((i < NumCurrentSelections) && if ((i < NumCurrentSelections) &&
(CurrentSelections[i].window != None) && (CurrentSelections[i].window != None) &&
XaceHook(XACE_SELECTION_ACCESS, client, &CurrentSelections[i])) XaceHook(XACE_SELECTION_ACCESS, client, &CurrentSelections[i],
DixReadAccess))
{ {
event.u.u.type = SelectionRequest; event.u.u.type = SelectionRequest;
event.u.selectionRequest.time = stuff->time; event.u.selectionRequest.time = stuff->time;