diff options
Diffstat (limited to 'dix')
-rw-r--r-- | dix/property.c | 10 | ||||
-rw-r--r-- | dix/selection.c | 6 |
2 files changed, 11 insertions, 5 deletions
diff --git a/dix/property.c b/dix/property.c index e74becfa2..8b66ad6a2 100644 --- a/dix/property.c +++ b/dix/property.c @@ -103,7 +103,7 @@ dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName, break; if (pProp) - rc = XaceHookPropertyAccess(client, pWin, pProp, access_mode); + rc = XaceHookPropertyAccess(client, pWin, &pProp, access_mode); *result = pProp; return rc; } @@ -256,12 +256,14 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, PropertyPtr pProp; int sizeInBytes, totalSize, rc; pointer data; + Mask access_mode; sizeInBytes = format>>3; totalSize = len * sizeInBytes; + access_mode = (mode == PropModeReplace) ? DixWriteAccess : DixBlendAccess; /* first see if property already exists */ - rc = dixLookupProperty(&pProp, pWin, property, pClient, DixWriteAccess); + rc = dixLookupProperty(&pProp, pWin, property, pClient, access_mode); if (rc == BadMatch) /* just add to list */ { @@ -284,7 +286,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, memmove((char *)data, (char *)value, totalSize); pProp->size = len; pProp->devPrivates = NULL; - rc = XaceHookPropertyAccess(pClient, pWin, pProp, + rc = XaceHookPropertyAccess(pClient, pWin, &pProp, DixCreateAccess|DixWriteAccess); if (rc != Success) { xfree(data); @@ -588,7 +590,7 @@ ProcListProperties(ClientPtr client) temppAtoms = pAtoms; for (pProp = wUserProps(pWin); pProp; pProp = pProp->next) { realProp = pProp; - rc = XaceHookPropertyAccess(client, pWin, pProp, DixGetAttrAccess); + rc = XaceHookPropertyAccess(client, pWin, &realProp, DixGetAttrAccess); if (rc == Success && realProp == pProp) { *temppAtoms++ = pProp->propertyName; numProps++; diff --git a/dix/selection.c b/dix/selection.c index e2e279a6f..52b1611c5 100644 --- a/dix/selection.c +++ b/dix/selection.c @@ -80,7 +80,7 @@ dixLookupSelection(Selection **result, Atom selectionName, for (i = 0; i < NumCurrentSelections; i++) if (CurrentSelections[i].selection == selectionName) { pSel = CurrentSelections + i; - rc = XaceHookSelectionAccess(client, selectionName, access_mode); + rc = XaceHookSelectionAccess(client, &pSel, access_mode); break; } @@ -206,6 +206,10 @@ ProcSetSelectionOwner(ClientPtr client) pSel = CurrentSelections + NumCurrentSelections; pSel->selection = stuff->selection; pSel->devPrivates = NULL; + + /* security creation/labeling check */ + (void)XaceHookSelectionAccess(client, &pSel, DixCreateAccess); + pSel->next = NULL; if (NumCurrentSelections > 0) CurrentSelections[NumCurrentSelections - 1].next = pSel; |