xace: add hooks + new access codes: Render extension
This commit is contained in:
parent
1005b29cc6
commit
fd04b983db
|
@ -44,6 +44,7 @@
|
||||||
#include "dixfontstr.h"
|
#include "dixfontstr.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include "picturestr.h"
|
#include "picturestr.h"
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
typedef struct _AnimCurElt {
|
typedef struct _AnimCurElt {
|
||||||
CursorPtr pCursor; /* cursor to show */
|
CursorPtr pCursor; /* cursor to show */
|
||||||
|
@ -346,10 +347,10 @@ AnimCurInit (ScreenPtr pScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor)
|
AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor, ClientPtr client, XID cid)
|
||||||
{
|
{
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
int i;
|
int rc, i;
|
||||||
AnimCurPtr ac;
|
AnimCurPtr ac;
|
||||||
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
for (i = 0; i < screenInfo.numScreens; i++)
|
||||||
|
@ -366,7 +367,6 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp
|
||||||
if (!pCursor)
|
if (!pCursor)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
pCursor->bits = &animCursorBits;
|
pCursor->bits = &animCursorBits;
|
||||||
animCursorBits.refcnt++;
|
|
||||||
pCursor->refcnt = 1;
|
pCursor->refcnt = 1;
|
||||||
|
|
||||||
pCursor->foreRed = cursors[0]->foreRed;
|
pCursor->foreRed = cursors[0]->foreRed;
|
||||||
|
@ -377,9 +377,22 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp
|
||||||
pCursor->backGreen = cursors[0]->backGreen;
|
pCursor->backGreen = cursors[0]->backGreen;
|
||||||
pCursor->backBlue = cursors[0]->backBlue;
|
pCursor->backBlue = cursors[0]->backBlue;
|
||||||
|
|
||||||
|
pCursor->devPrivates = NULL;
|
||||||
|
pCursor->id = cid;
|
||||||
|
|
||||||
|
/* security creation/labeling check */
|
||||||
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR,
|
||||||
|
DixCreateAccess, pCursor);
|
||||||
|
if (rc != Success) {
|
||||||
|
dixFreePrivates(pCursor->devPrivates);
|
||||||
|
xfree(pCursor);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill in the AnimCurRec
|
* Fill in the AnimCurRec
|
||||||
*/
|
*/
|
||||||
|
animCursorBits.refcnt++;
|
||||||
ac = GetAnimCur (pCursor);
|
ac = GetAnimCur (pCursor);
|
||||||
ac->nelt = ncursor;
|
ac->nelt = ncursor;
|
||||||
ac->elts = (AnimCurElt *) (ac + 1);
|
ac->elts = (AnimCurElt *) (ac + 1);
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
#include "picturestr.h"
|
#include "picturestr.h"
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
_X_EXPORT DevPrivateKey PictureScreenPrivateKey = &PictureScreenPrivateKey;
|
_X_EXPORT DevPrivateKey PictureScreenPrivateKey = &PictureScreenPrivateKey;
|
||||||
DevPrivateKey PictureWindowPrivateKey = &PictureWindowPrivateKey;
|
DevPrivateKey PictureWindowPrivateKey = &PictureWindowPrivateKey;
|
||||||
|
@ -724,6 +725,13 @@ CreatePicture (Picture pid,
|
||||||
pPicture->pFormat = pFormat;
|
pPicture->pFormat = pFormat;
|
||||||
pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24);
|
pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24);
|
||||||
pPicture->devPrivates = NULL;
|
pPicture->devPrivates = NULL;
|
||||||
|
|
||||||
|
/* security creation/labeling check */
|
||||||
|
*error = XaceHook(XACE_RESOURCE_ACCESS, client, pid, PictureType,
|
||||||
|
DixCreateAccess|DixSetAttrAccess, pPicture);
|
||||||
|
if (*error != Success)
|
||||||
|
goto out;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
++((PixmapPtr)pDrawable)->refcnt;
|
++((PixmapPtr)pDrawable)->refcnt;
|
||||||
|
@ -743,6 +751,7 @@ CreatePicture (Picture pid,
|
||||||
*error = Success;
|
*error = Success;
|
||||||
if (*error == Success)
|
if (*error == Success)
|
||||||
*error = (*ps->CreatePicture) (pPicture);
|
*error = (*ps->CreatePicture) (pPicture);
|
||||||
|
out:
|
||||||
if (*error != Success)
|
if (*error != Success)
|
||||||
{
|
{
|
||||||
FreePicture (pPicture, (XID) 0);
|
FreePicture (pPicture, (XID) 0);
|
||||||
|
@ -1060,14 +1069,13 @@ ChangePicture (PicturePtr pPicture,
|
||||||
pAlpha = 0;
|
pAlpha = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pAlpha = (PicturePtr) SecurityLookupIDByType(client,
|
error = dixLookupResource((pointer *)&pAlpha, pid,
|
||||||
pid,
|
PictureType, client,
|
||||||
PictureType,
|
DixReadAccess);
|
||||||
DixWriteAccess|DixReadAccess);
|
if (error != Success)
|
||||||
if (!pAlpha)
|
|
||||||
{
|
{
|
||||||
client->errorValue = pid;
|
client->errorValue = pid;
|
||||||
error = BadPixmap;
|
error = (error == BadValue) ? BadPixmap : error;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (pAlpha->pDrawable == NULL ||
|
if (pAlpha->pDrawable == NULL ||
|
||||||
|
@ -1122,14 +1130,13 @@ ChangePicture (PicturePtr pPicture,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
clipType = CT_PIXMAP;
|
clipType = CT_PIXMAP;
|
||||||
pPixmap = (PixmapPtr)SecurityLookupIDByType(client,
|
error = dixLookupResource((pointer *)&pPixmap, pid,
|
||||||
pid,
|
RT_PIXMAP, client,
|
||||||
RT_PIXMAP,
|
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
if (!pPixmap)
|
if (error != Success)
|
||||||
{
|
{
|
||||||
client->errorValue = pid;
|
client->errorValue = pid;
|
||||||
error = BadPixmap;
|
error = (error == BadValue) ? BadPixmap : error;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -630,7 +630,7 @@ Bool
|
||||||
AnimCurInit (ScreenPtr pScreen);
|
AnimCurInit (ScreenPtr pScreen);
|
||||||
|
|
||||||
int
|
int
|
||||||
AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor);
|
AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor, ClientPtr client, XID cid);
|
||||||
|
|
||||||
void
|
void
|
||||||
AddTraps (PicturePtr pPicture,
|
AddTraps (PicturePtr pPicture,
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include "glyphstr.h"
|
#include "glyphstr.h"
|
||||||
#include <X11/Xfuncproto.h>
|
#include <X11/Xfuncproto.h>
|
||||||
#include "cursorstr.h"
|
#include "cursorstr.h"
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
#if HAVE_STDINT_H
|
#if HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -623,7 +624,7 @@ ProcRenderCreatePicture (ClientPtr client)
|
||||||
|
|
||||||
LEGAL_NEW_RESOURCE(stuff->pid, client);
|
LEGAL_NEW_RESOURCE(stuff->pid, client);
|
||||||
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
|
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
|
||||||
DixWriteAccess);
|
DixReadAccess|DixAddAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@ -664,7 +665,7 @@ ProcRenderChangePicture (ClientPtr client)
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
|
REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
|
||||||
VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
|
VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess,
|
||||||
RenderErrBase + BadPicture);
|
RenderErrBase + BadPicture);
|
||||||
|
|
||||||
len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2);
|
len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2);
|
||||||
|
@ -684,7 +685,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client)
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
|
REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
|
||||||
VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
|
VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess,
|
||||||
RenderErrBase + BadPicture);
|
RenderErrBase + BadPicture);
|
||||||
if (!pPicture->pDrawable)
|
if (!pPicture->pDrawable)
|
||||||
return BadDrawable;
|
return BadDrawable;
|
||||||
|
@ -983,7 +984,7 @@ ProcRenderCreateGlyphSet (ClientPtr client)
|
||||||
{
|
{
|
||||||
GlyphSetPtr glyphSet;
|
GlyphSetPtr glyphSet;
|
||||||
PictFormatPtr format;
|
PictFormatPtr format;
|
||||||
int f;
|
int rc, f;
|
||||||
REQUEST(xRenderCreateGlyphSetReq);
|
REQUEST(xRenderCreateGlyphSetReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq);
|
REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq);
|
||||||
|
@ -1022,6 +1023,11 @@ ProcRenderCreateGlyphSet (ClientPtr client)
|
||||||
glyphSet = AllocateGlyphSet (f, format);
|
glyphSet = AllocateGlyphSet (f, format);
|
||||||
if (!glyphSet)
|
if (!glyphSet)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
/* security creation/labeling check */
|
||||||
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->gsid, GlyphSetType,
|
||||||
|
DixCreateAccess, glyphSet);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
|
if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -1031,20 +1037,19 @@ static int
|
||||||
ProcRenderReferenceGlyphSet (ClientPtr client)
|
ProcRenderReferenceGlyphSet (ClientPtr client)
|
||||||
{
|
{
|
||||||
GlyphSetPtr glyphSet;
|
GlyphSetPtr glyphSet;
|
||||||
|
int rc;
|
||||||
REQUEST(xRenderReferenceGlyphSetReq);
|
REQUEST(xRenderReferenceGlyphSetReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq);
|
REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq);
|
||||||
|
|
||||||
LEGAL_NEW_RESOURCE(stuff->gsid, client);
|
LEGAL_NEW_RESOURCE(stuff->gsid, client);
|
||||||
|
|
||||||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
rc = dixLookupResource((pointer *)&glyphSet, stuff->existing, GlyphSetType,
|
||||||
stuff->existing,
|
client, DixGetAttrAccess);
|
||||||
GlyphSetType,
|
if (rc != Success)
|
||||||
DixWriteAccess);
|
|
||||||
if (!glyphSet)
|
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->existing;
|
client->errorValue = stuff->existing;
|
||||||
return RenderErrBase + BadGlyphSet;
|
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
|
||||||
}
|
}
|
||||||
glyphSet->refcnt++;
|
glyphSet->refcnt++;
|
||||||
if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
|
if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
|
||||||
|
@ -1059,17 +1064,16 @@ static int
|
||||||
ProcRenderFreeGlyphSet (ClientPtr client)
|
ProcRenderFreeGlyphSet (ClientPtr client)
|
||||||
{
|
{
|
||||||
GlyphSetPtr glyphSet;
|
GlyphSetPtr glyphSet;
|
||||||
|
int rc;
|
||||||
REQUEST(xRenderFreeGlyphSetReq);
|
REQUEST(xRenderFreeGlyphSetReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
|
REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
|
||||||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
rc = dixLookupResource((pointer *)&glyphSet, stuff->glyphset, GlyphSetType,
|
||||||
stuff->glyphset,
|
client, DixDestroyAccess);
|
||||||
GlyphSetType,
|
if (rc != Success)
|
||||||
DixDestroyAccess);
|
|
||||||
if (!glyphSet)
|
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->glyphset;
|
client->errorValue = stuff->glyphset;
|
||||||
return RenderErrBase + BadGlyphSet;
|
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
|
||||||
}
|
}
|
||||||
FreeResource (stuff->glyphset, RT_NONE);
|
FreeResource (stuff->glyphset, RT_NONE);
|
||||||
return client->noClientException;
|
return client->noClientException;
|
||||||
|
@ -1093,19 +1097,18 @@ ProcRenderAddGlyphs (ClientPtr client)
|
||||||
xGlyphInfo *gi;
|
xGlyphInfo *gi;
|
||||||
CARD8 *bits;
|
CARD8 *bits;
|
||||||
int size;
|
int size;
|
||||||
int err = BadAlloc;
|
int err;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq);
|
REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq);
|
||||||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
err = dixLookupResource((pointer *)&glyphSet, stuff->glyphset, GlyphSetType,
|
||||||
stuff->glyphset,
|
client, DixAddAccess);
|
||||||
GlyphSetType,
|
if (err != Success)
|
||||||
DixWriteAccess);
|
|
||||||
if (!glyphSet)
|
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->glyphset;
|
client->errorValue = stuff->glyphset;
|
||||||
return RenderErrBase + BadGlyphSet;
|
return (err == BadValue) ? RenderErrBase + BadGlyphSet : err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = BadAlloc;
|
||||||
nglyphs = stuff->nglyphs;
|
nglyphs = stuff->nglyphs;
|
||||||
if (nglyphs > UINT32_MAX / sizeof(GlyphNewRec))
|
if (nglyphs > UINT32_MAX / sizeof(GlyphNewRec))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
@ -1195,19 +1198,17 @@ ProcRenderFreeGlyphs (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRenderFreeGlyphsReq);
|
REQUEST(xRenderFreeGlyphsReq);
|
||||||
GlyphSetPtr glyphSet;
|
GlyphSetPtr glyphSet;
|
||||||
int nglyph;
|
int rc, nglyph;
|
||||||
CARD32 *gids;
|
CARD32 *gids;
|
||||||
CARD32 glyph;
|
CARD32 glyph;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
|
REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
|
||||||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
rc = dixLookupResource((pointer *)&glyphSet, stuff->glyphset, GlyphSetType,
|
||||||
stuff->glyphset,
|
client, DixRemoveAccess);
|
||||||
GlyphSetType,
|
if (rc != Success)
|
||||||
DixWriteAccess);
|
|
||||||
if (!glyphSet)
|
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->glyphset;
|
client->errorValue = stuff->glyphset;
|
||||||
return RenderErrBase + BadGlyphSet;
|
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
|
||||||
}
|
}
|
||||||
nglyph = ((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq)) >> 2;
|
nglyph = ((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq)) >> 2;
|
||||||
gids = (CARD32 *) (stuff + 1);
|
gids = (CARD32 *) (stuff + 1);
|
||||||
|
@ -1284,7 +1285,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
|
||||||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
||||||
stuff->glyphset,
|
stuff->glyphset,
|
||||||
GlyphSetType,
|
GlyphSetType,
|
||||||
DixReadAccess);
|
DixUseAccess);
|
||||||
if (!glyphSet)
|
if (!glyphSet)
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->glyphset;
|
client->errorValue = stuff->glyphset;
|
||||||
|
@ -1346,7 +1347,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
|
||||||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
||||||
gs,
|
gs,
|
||||||
GlyphSetType,
|
GlyphSetType,
|
||||||
DixReadAccess);
|
DixUseAccess);
|
||||||
if (!glyphSet)
|
if (!glyphSet)
|
||||||
{
|
{
|
||||||
client->errorValue = gs;
|
client->errorValue = gs;
|
||||||
|
@ -1679,7 +1680,7 @@ ProcRenderSetPictureTransform (ClientPtr client)
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
|
REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
|
||||||
VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
|
VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess,
|
||||||
RenderErrBase + BadPicture);
|
RenderErrBase + BadPicture);
|
||||||
result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform);
|
result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform);
|
||||||
if (client->noClientException != Success)
|
if (client->noClientException != Success)
|
||||||
|
@ -1704,7 +1705,7 @@ ProcRenderQueryFilters (ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRenderQueryFiltersReq);
|
REQUEST_SIZE_MATCH(xRenderQueryFiltersReq);
|
||||||
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
|
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
|
||||||
DixReadAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@ -1809,7 +1810,7 @@ ProcRenderSetPictureFilter (ClientPtr client)
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
|
REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
|
||||||
VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
|
VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess,
|
||||||
RenderErrBase + BadPicture);
|
RenderErrBase + BadPicture);
|
||||||
name = (char *) (stuff + 1);
|
name = (char *) (stuff + 1);
|
||||||
params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3));
|
params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3));
|
||||||
|
@ -1853,7 +1854,8 @@ ProcRenderCreateAnimCursor (ClientPtr client)
|
||||||
deltas[i] = elt->delay;
|
deltas[i] = elt->delay;
|
||||||
elt++;
|
elt++;
|
||||||
}
|
}
|
||||||
ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor);
|
ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor, client,
|
||||||
|
stuff->cid);
|
||||||
xfree (cursors);
|
xfree (cursors);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1899,6 +1901,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client)
|
||||||
pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error);
|
pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error);
|
||||||
if (!pPicture)
|
if (!pPicture)
|
||||||
return error;
|
return error;
|
||||||
|
/* security creation/labeling check */
|
||||||
|
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
||||||
|
DixCreateAccess, pPicture);
|
||||||
|
if (error != Success)
|
||||||
|
return error;
|
||||||
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
|
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -1928,6 +1935,11 @@ static int ProcRenderCreateLinearGradient (ClientPtr client)
|
||||||
stuff->nStops, stops, colors, &error);
|
stuff->nStops, stops, colors, &error);
|
||||||
if (!pPicture)
|
if (!pPicture)
|
||||||
return error;
|
return error;
|
||||||
|
/* security creation/labeling check */
|
||||||
|
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
||||||
|
DixCreateAccess, pPicture);
|
||||||
|
if (error != Success)
|
||||||
|
return error;
|
||||||
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
|
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -1958,6 +1970,11 @@ static int ProcRenderCreateRadialGradient (ClientPtr client)
|
||||||
stuff->nStops, stops, colors, &error);
|
stuff->nStops, stops, colors, &error);
|
||||||
if (!pPicture)
|
if (!pPicture)
|
||||||
return error;
|
return error;
|
||||||
|
/* security creation/labeling check */
|
||||||
|
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
||||||
|
DixCreateAccess, pPicture);
|
||||||
|
if (error != Success)
|
||||||
|
return error;
|
||||||
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
|
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -1987,6 +2004,11 @@ static int ProcRenderCreateConicalGradient (ClientPtr client)
|
||||||
stuff->nStops, stops, colors, &error);
|
stuff->nStops, stops, colors, &error);
|
||||||
if (!pPicture)
|
if (!pPicture)
|
||||||
return error;
|
return error;
|
||||||
|
/* security creation/labeling check */
|
||||||
|
error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
|
||||||
|
DixCreateAccess, pPicture);
|
||||||
|
if (error != Success)
|
||||||
|
return error;
|
||||||
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
|
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
return Success;
|
return Success;
|
||||||
|
|
Loading…
Reference in New Issue