Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
3c322ffb
Unverified
Commit
3c322ffb
authored
Feb 20, 2017
by
Mihai Moldovan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sunweaver-pr/security-acl-naming-change' into 3.6.x
Attributes GH PR #329:
https://github.com/ArcticaProject/nx-libs/pull/329
parents
c79f2d28
104a3e9e
Show whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
421 additions
and
425 deletions
+421
-425
panoramiXprocs.c
nx-X11/programs/Xserver/Xext/panoramiXprocs.c
+86
-86
saver.c
nx-X11/programs/Xserver/Xext/saver.c
+5
-5
security.c
nx-X11/programs/Xserver/Xext/security.c
+5
-5
shape.c
nx-X11/programs/Xserver/Xext/shape.c
+11
-11
shm.c
nx-X11/programs/Xserver/Xext/shm.c
+3
-3
sync.c
nx-X11/programs/Xserver/Xext/sync.c
+8
-8
xf86bigfont.c
nx-X11/programs/Xserver/Xext/xf86bigfont.c
+2
-2
xvdisp.c
nx-X11/programs/Xserver/Xext/xvdisp.c
+15
-15
compwindow.c
nx-X11/programs/Xserver/composite/compwindow.c
+1
-1
damageext.c
nx-X11/programs/Xserver/damageext/damageext.c
+5
-5
dbe.c
nx-X11/programs/Xserver/dbe/dbe.c
+6
-6
colormap.c
nx-X11/programs/Xserver/dix/colormap.c
+2
-2
cursor.c
nx-X11/programs/Xserver/dix/cursor.c
+2
-2
dispatch.c
nx-X11/programs/Xserver/dix/dispatch.c
+58
-58
dixfonts.c
nx-X11/programs/Xserver/dix/dixfonts.c
+4
-4
dixutils.c
nx-X11/programs/Xserver/dix/dixutils.c
+3
-3
events.c
nx-X11/programs/Xserver/dix/events.c
+19
-19
gc.c
nx-X11/programs/Xserver/dix/gc.c
+4
-4
property.c
nx-X11/programs/Xserver/dix/property.c
+10
-10
resource.c
nx-X11/programs/Xserver/dix/resource.c
+2
-2
window.c
nx-X11/programs/Xserver/dix/window.c
+5
-5
NXdispatch.c
nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+8
-8
NXevents.c
nx-X11/programs/Xserver/hw/nxagent/NXevents.c
+1
-1
NXproperty.c
nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+5
-5
NXrender.c
nx-X11/programs/Xserver/hw/nxagent/NXrender.c
+24
-24
NXwindow.c
nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
+1
-1
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+5
-5
dix.h
nx-X11/programs/Xserver/include/dix.h
+5
-5
resource.h
nx-X11/programs/Xserver/include/resource.h
+4
-4
randrstr.h
nx-X11/programs/Xserver/randr/randrstr.h
+2
-6
rrdispatch.c
nx-X11/programs/Xserver/randr/rrdispatch.c
+1
-1
rrmode.c
nx-X11/programs/Xserver/randr/rrmode.c
+1
-1
rrmonitor.c
nx-X11/programs/Xserver/randr/rrmonitor.c
+3
-3
rroutput.c
nx-X11/programs/Xserver/randr/rroutput.c
+2
-2
rrprovider.c
nx-X11/programs/Xserver/randr/rrprovider.c
+1
-1
rrscreen.c
nx-X11/programs/Xserver/randr/rrscreen.c
+5
-5
rrxinerama.c
nx-X11/programs/Xserver/randr/rrxinerama.c
+3
-3
picture.c
nx-X11/programs/Xserver/render/picture.c
+2
-2
render.c
nx-X11/programs/Xserver/render/render.c
+61
-61
cursor.c
nx-X11/programs/Xserver/xfixes/cursor.c
+6
-6
region.c
nx-X11/programs/Xserver/xfixes/region.c
+23
-23
saveset.c
nx-X11/programs/Xserver/xfixes/saveset.c
+1
-1
select.c
nx-X11/programs/Xserver/xfixes/select.c
+1
-1
No files found.
nx-X11/programs/Xserver/Xext/panoramiXprocs.c
View file @
3c322ffb
...
@@ -89,7 +89,7 @@ int PanoramiXCreateWindow(ClientPtr client)
...
@@ -89,7 +89,7 @@ int PanoramiXCreateWindow(ClientPtr client)
return
BadLength
;
return
BadLength
;
if
(
!
(
parent
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
parent
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
parent
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
parent
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
if
(
stuff
->
class
==
CopyFromParent
)
if
(
stuff
->
class
==
CopyFromParent
)
...
@@ -103,7 +103,7 @@ int PanoramiXCreateWindow(ClientPtr client)
...
@@ -103,7 +103,7 @@ int PanoramiXCreateWindow(ClientPtr client)
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pback_offset
);
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pback_offset
);
if
((
tmp
!=
None
)
&&
(
tmp
!=
ParentRelative
))
{
if
((
tmp
!=
None
)
&&
(
tmp
!=
ParentRelative
))
{
if
(
!
(
backPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
backPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -112,7 +112,7 @@ int PanoramiXCreateWindow(ClientPtr client)
...
@@ -112,7 +112,7 @@ int PanoramiXCreateWindow(ClientPtr client)
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pbord_offset
);
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pbord_offset
);
if
(
tmp
!=
CopyFromParent
)
{
if
(
tmp
!=
CopyFromParent
)
{
if
(
!
(
bordPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
bordPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -121,7 +121,7 @@ int PanoramiXCreateWindow(ClientPtr client)
...
@@ -121,7 +121,7 @@ int PanoramiXCreateWindow(ClientPtr client)
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
cmap_offset
);
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
cmap_offset
);
if
((
tmp
!=
CopyFromParent
)
&&
(
tmp
!=
None
))
{
if
((
tmp
!=
CopyFromParent
)
&&
(
tmp
!=
None
))
{
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_COLORMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_COLORMAP
,
Dix
ReadAccess
)))
return
BadColor
;
return
BadColor
;
}
}
}
}
...
@@ -190,7 +190,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
...
@@ -190,7 +190,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
return
BadLength
;
return
BadLength
;
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
window
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
window
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
if
((
win
->
u
.
win
.
class
==
InputOnly
)
&&
if
((
win
->
u
.
win
.
class
==
InputOnly
)
&&
...
@@ -202,7 +202,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
...
@@ -202,7 +202,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pback_offset
);
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pback_offset
);
if
((
tmp
!=
None
)
&&
(
tmp
!=
ParentRelative
))
{
if
((
tmp
!=
None
)
&&
(
tmp
!=
ParentRelative
))
{
if
(
!
(
backPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
backPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -211,7 +211,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
...
@@ -211,7 +211,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pbord_offset
);
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pbord_offset
);
if
(
tmp
!=
CopyFromParent
)
{
if
(
tmp
!=
CopyFromParent
)
{
if
(
!
(
bordPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
bordPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -220,7 +220,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
...
@@ -220,7 +220,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
cmap_offset
);
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
cmap_offset
);
if
((
tmp
!=
CopyFromParent
)
&&
(
tmp
!=
None
))
{
if
((
tmp
!=
CopyFromParent
)
&&
(
tmp
!=
None
))
{
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_COLORMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_COLORMAP
,
Dix
ReadAccess
)))
return
BadColor
;
return
BadColor
;
}
}
}
}
...
@@ -249,7 +249,7 @@ int PanoramiXDestroyWindow(ClientPtr client)
...
@@ -249,7 +249,7 @@ int PanoramiXDestroyWindow(ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_WINDOW
,
Security
DestroyAccess
)))
client
,
stuff
->
id
,
XRT_WINDOW
,
Dix
DestroyAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -274,7 +274,7 @@ int PanoramiXDestroySubwindows(ClientPtr client)
...
@@ -274,7 +274,7 @@ int PanoramiXDestroySubwindows(ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_WINDOW
,
Security
DestroyAccess
)))
client
,
stuff
->
id
,
XRT_WINDOW
,
Dix
DestroyAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -299,7 +299,7 @@ int PanoramiXChangeSaveSet(ClientPtr client)
...
@@ -299,7 +299,7 @@ int PanoramiXChangeSaveSet(ClientPtr client)
REQUEST_SIZE_MATCH
(
xChangeSaveSetReq
);
REQUEST_SIZE_MATCH
(
xChangeSaveSetReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
window
,
XRT_WINDOW
,
Security
ReadAccess
)))
client
,
stuff
->
window
,
XRT_WINDOW
,
Dix
ReadAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -323,11 +323,11 @@ int PanoramiXReparentWindow(ClientPtr client)
...
@@ -323,11 +323,11 @@ int PanoramiXReparentWindow(ClientPtr client)
REQUEST_SIZE_MATCH
(
xReparentWindowReq
);
REQUEST_SIZE_MATCH
(
xReparentWindowReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
window
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
window
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
if
(
!
(
parent
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
parent
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
parent
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
parent
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
x
=
stuff
->
x
;
x
=
stuff
->
x
;
...
@@ -358,7 +358,7 @@ int PanoramiXMapWindow(ClientPtr client)
...
@@ -358,7 +358,7 @@ int PanoramiXMapWindow(ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_WINDOW
,
Security
ReadAccess
)))
client
,
stuff
->
id
,
XRT_WINDOW
,
Dix
ReadAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS_FORWARD
(
j
)
{
FOR_NSCREENS_FORWARD
(
j
)
{
...
@@ -380,7 +380,7 @@ int PanoramiXMapSubwindows(ClientPtr client)
...
@@ -380,7 +380,7 @@ int PanoramiXMapSubwindows(ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_WINDOW
,
Security
ReadAccess
)))
client
,
stuff
->
id
,
XRT_WINDOW
,
Dix
ReadAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS_FORWARD
(
j
)
{
FOR_NSCREENS_FORWARD
(
j
)
{
...
@@ -402,7 +402,7 @@ int PanoramiXUnmapWindow(ClientPtr client)
...
@@ -402,7 +402,7 @@ int PanoramiXUnmapWindow(ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_WINDOW
,
Security
ReadAccess
)))
client
,
stuff
->
id
,
XRT_WINDOW
,
Dix
ReadAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS_FORWARD
(
j
)
{
FOR_NSCREENS_FORWARD
(
j
)
{
...
@@ -424,7 +424,7 @@ int PanoramiXUnmapSubwindows(ClientPtr client)
...
@@ -424,7 +424,7 @@ int PanoramiXUnmapSubwindows(ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_WINDOW
,
Security
ReadAccess
)))
client
,
stuff
->
id
,
XRT_WINDOW
,
Dix
ReadAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS_FORWARD
(
j
)
{
FOR_NSCREENS_FORWARD
(
j
)
{
...
@@ -455,11 +455,11 @@ int PanoramiXConfigureWindow(ClientPtr client)
...
@@ -455,11 +455,11 @@ int PanoramiXConfigureWindow(ClientPtr client)
/* because we need the parent */
/* because we need the parent */
if
(
!
(
pWin
=
(
WindowPtr
)
SecurityLookupIDByType
(
if
(
!
(
pWin
=
(
WindowPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
window
,
RT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
window
,
RT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
window
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
window
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
if
((
Mask
)
stuff
->
mask
&
CWSibling
)
{
if
((
Mask
)
stuff
->
mask
&
CWSibling
)
{
...
@@ -467,7 +467,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
...
@@ -467,7 +467,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
sib_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
CWSibling
-
1
));
sib_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
CWSibling
-
1
));
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
sib_offset
)))
{
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
sib_offset
)))
{
if
(
!
(
sib
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
sib
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_WINDOW
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_WINDOW
,
Dix
ReadAccess
)))
return
BadWindow
;
return
BadWindow
;
}
}
}
}
...
@@ -512,7 +512,7 @@ int PanoramiXCirculateWindow(ClientPtr client)
...
@@ -512,7 +512,7 @@ int PanoramiXCirculateWindow(ClientPtr client)
REQUEST_SIZE_MATCH
(
xCirculateWindowReq
);
REQUEST_SIZE_MATCH
(
xCirculateWindowReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
window
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
window
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS_FORWARD
(
j
)
{
FOR_NSCREENS_FORWARD
(
j
)
{
...
@@ -577,11 +577,11 @@ int PanoramiXTranslateCoords(ClientPtr client)
...
@@ -577,11 +577,11 @@ int PanoramiXTranslateCoords(ClientPtr client)
REQUEST_SIZE_MATCH
(
xTranslateCoordsReq
);
REQUEST_SIZE_MATCH
(
xTranslateCoordsReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
srcWid
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
srcWid
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
pDst
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
dstWid
,
client
,
pDst
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
dstWid
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pDst
)
if
(
!
pDst
)
return
(
BadWindow
);
return
(
BadWindow
);
rep
.
type
=
X_Reply
;
rep
.
type
=
X_Reply
;
...
@@ -653,7 +653,7 @@ int PanoramiXCreatePixmap(ClientPtr client)
...
@@ -653,7 +653,7 @@ int PanoramiXCreatePixmap(ClientPtr client)
client
->
errorValue
=
stuff
->
pid
;
client
->
errorValue
=
stuff
->
pid
;
if
(
!
(
refDraw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
refDraw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
ReadAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
ReadAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
!
(
newPix
=
(
PanoramiXRes
*
)
malloc
(
sizeof
(
PanoramiXRes
))))
if
(
!
(
newPix
=
(
PanoramiXRes
*
)
malloc
(
sizeof
(
PanoramiXRes
))))
...
@@ -692,7 +692,7 @@ int PanoramiXFreePixmap(ClientPtr client)
...
@@ -692,7 +692,7 @@ int PanoramiXFreePixmap(ClientPtr client)
client
->
errorValue
=
stuff
->
id
;
client
->
errorValue
=
stuff
->
id
;
if
(
!
(
pix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
pix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_PIXMAP
,
Security
DestroyAccess
)))
client
,
stuff
->
id
,
XRT_PIXMAP
,
Dix
DestroyAccess
)))
return
BadPixmap
;
return
BadPixmap
;
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -728,14 +728,14 @@ int PanoramiXCreateGC(ClientPtr client)
...
@@ -728,14 +728,14 @@ int PanoramiXCreateGC(ClientPtr client)
return
BadLength
;
return
BadLength
;
if
(
!
(
refDraw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
refDraw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
ReadAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
ReadAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
((
Mask
)
stuff
->
mask
&
GCTile
)
{
if
((
Mask
)
stuff
->
mask
&
GCTile
)
{
tile_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCTile
-
1
));
tile_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCTile
-
1
));
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
tile_offset
)))
{
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
tile_offset
)))
{
if
(
!
(
tile
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
tile
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -743,7 +743,7 @@ int PanoramiXCreateGC(ClientPtr client)
...
@@ -743,7 +743,7 @@ int PanoramiXCreateGC(ClientPtr client)
stip_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCStipple
-
1
));
stip_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCStipple
-
1
));
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
stip_offset
)))
{
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
stip_offset
)))
{
if
(
!
(
stip
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
stip
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -751,7 +751,7 @@ int PanoramiXCreateGC(ClientPtr client)
...
@@ -751,7 +751,7 @@ int PanoramiXCreateGC(ClientPtr client)
clip_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCClipMask
-
1
));
clip_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCClipMask
-
1
));
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
clip_offset
)))
{
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
clip_offset
)))
{
if
(
!
(
clip
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
clip
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -803,14 +803,14 @@ int PanoramiXChangeGC(ClientPtr client)
...
@@ -803,14 +803,14 @@ int PanoramiXChangeGC(ClientPtr client)
return
BadLength
;
return
BadLength
;
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
if
((
Mask
)
stuff
->
mask
&
GCTile
)
{
if
((
Mask
)
stuff
->
mask
&
GCTile
)
{
tile_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCTile
-
1
));
tile_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCTile
-
1
));
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
tile_offset
)))
{
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
tile_offset
)))
{
if
(
!
(
tile
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
tile
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -818,7 +818,7 @@ int PanoramiXChangeGC(ClientPtr client)
...
@@ -818,7 +818,7 @@ int PanoramiXChangeGC(ClientPtr client)
stip_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCStipple
-
1
));
stip_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCStipple
-
1
));
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
stip_offset
)))
{
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
stip_offset
)))
{
if
(
!
(
stip
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
stip
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -826,7 +826,7 @@ int PanoramiXChangeGC(ClientPtr client)
...
@@ -826,7 +826,7 @@ int PanoramiXChangeGC(ClientPtr client)
clip_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCClipMask
-
1
));
clip_offset
=
Ones
((
Mask
)
stuff
->
mask
&
(
GCClipMask
-
1
));
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
clip_offset
)))
{
if
((
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
clip_offset
)))
{
if
(
!
(
clip
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
clip
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -857,11 +857,11 @@ int PanoramiXCopyGC(ClientPtr client)
...
@@ -857,11 +857,11 @@ int PanoramiXCopyGC(ClientPtr client)
REQUEST_SIZE_MATCH
(
xCopyGCReq
);
REQUEST_SIZE_MATCH
(
xCopyGCReq
);
if
(
!
(
srcGC
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
srcGC
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
srcGC
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
srcGC
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
if
(
!
(
dstGC
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
dstGC
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
dstGC
,
XRT_GC
,
Security
WriteAccess
)))
client
,
stuff
->
dstGC
,
XRT_GC
,
Dix
WriteAccess
)))
return
BadGC
;
return
BadGC
;
FOR_NSCREENS
(
j
)
{
FOR_NSCREENS
(
j
)
{
...
@@ -884,7 +884,7 @@ int PanoramiXSetDashes(ClientPtr client)
...
@@ -884,7 +884,7 @@ int PanoramiXSetDashes(ClientPtr client)
REQUEST_FIXED_SIZE
(
xSetDashesReq
,
stuff
->
nDashes
);
REQUEST_FIXED_SIZE
(
xSetDashesReq
,
stuff
->
nDashes
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
WriteAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
WriteAccess
)))
return
BadGC
;
return
BadGC
;
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -906,7 +906,7 @@ int PanoramiXSetClipRectangles(ClientPtr client)
...
@@ -906,7 +906,7 @@ int PanoramiXSetClipRectangles(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xSetClipRectanglesReq
);
REQUEST_AT_LEAST_SIZE
(
xSetClipRectanglesReq
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
WriteAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
WriteAccess
)))
return
BadGC
;
return
BadGC
;
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -928,7 +928,7 @@ int PanoramiXFreeGC(ClientPtr client)
...
@@ -928,7 +928,7 @@ int PanoramiXFreeGC(ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_GC
,
Security
DestroyAccess
)))
client
,
stuff
->
id
,
XRT_GC
,
Dix
DestroyAccess
)))
return
BadGC
;
return
BadGC
;
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -954,7 +954,7 @@ int PanoramiXClearToBackground(ClientPtr client)
...
@@ -954,7 +954,7 @@ int PanoramiXClearToBackground(ClientPtr client)
REQUEST_SIZE_MATCH
(
xClearAreaReq
);
REQUEST_SIZE_MATCH
(
xClearAreaReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
window
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
window
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
x
=
stuff
->
x
;
x
=
stuff
->
x
;
...
@@ -996,13 +996,13 @@ int PanoramiXCopyArea(ClientPtr client)
...
@@ -996,13 +996,13 @@ int PanoramiXCopyArea(ClientPtr client)
REQUEST_SIZE_MATCH
(
xCopyAreaReq
);
REQUEST_SIZE_MATCH
(
xCopyAreaReq
);
if
(
!
(
src
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
src
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
srcDrawable
,
XRC_DRAWABLE
,
Security
ReadAccess
)))
client
,
stuff
->
srcDrawable
,
XRC_DRAWABLE
,
Dix
ReadAccess
)))
return
BadDrawable
;
return
BadDrawable
;
srcShared
=
IS_SHARED_PIXMAP
(
src
);
srcShared
=
IS_SHARED_PIXMAP
(
src
);
if
(
!
(
dst
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
dst
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
dstDrawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
dstDrawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
dstShared
=
IS_SHARED_PIXMAP
(
dst
);
dstShared
=
IS_SHARED_PIXMAP
(
dst
);
...
@@ -1011,7 +1011,7 @@ int PanoramiXCopyArea(ClientPtr client)
...
@@ -1011,7 +1011,7 @@ int PanoramiXCopyArea(ClientPtr client)
return
(
*
SavedProcVector
[
X_CopyArea
])(
client
);
return
(
*
SavedProcVector
[
X_CopyArea
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
if
((
dst
->
type
==
XRT_WINDOW
)
&&
dst
->
u
.
win
.
root
)
if
((
dst
->
type
==
XRT_WINDOW
)
&&
dst
->
u
.
win
.
root
)
...
@@ -1080,7 +1080,7 @@ int PanoramiXCopyArea(ClientPtr client)
...
@@ -1080,7 +1080,7 @@ int PanoramiXCopyArea(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC
(
stuff
->
dstDrawable
,
pDst
,
pGC
,
client
);
VALIDATE_DRAWABLE_AND_GC
(
stuff
->
dstDrawable
,
pDst
,
pGC
,
client
);
if
(
stuff
->
dstDrawable
!=
stuff
->
srcDrawable
)
{
if
(
stuff
->
dstDrawable
!=
stuff
->
srcDrawable
)
{
SECURITY_VERIFY_DRAWABLE
(
pSrc
,
stuff
->
srcDrawable
,
client
,
SECURITY_VERIFY_DRAWABLE
(
pSrc
,
stuff
->
srcDrawable
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
((
pDst
->
pScreen
!=
pSrc
->
pScreen
)
||
if
((
pDst
->
pScreen
!=
pSrc
->
pScreen
)
||
(
pDst
->
depth
!=
pSrc
->
depth
))
{
(
pDst
->
depth
!=
pSrc
->
depth
))
{
client
->
errorValue
=
stuff
->
dstDrawable
;
client
->
errorValue
=
stuff
->
dstDrawable
;
...
@@ -1144,13 +1144,13 @@ int PanoramiXCopyPlane(ClientPtr client)
...
@@ -1144,13 +1144,13 @@ int PanoramiXCopyPlane(ClientPtr client)
REQUEST_SIZE_MATCH
(
xCopyPlaneReq
);
REQUEST_SIZE_MATCH
(
xCopyPlaneReq
);
if
(
!
(
src
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
src
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
srcDrawable
,
XRC_DRAWABLE
,
Security
ReadAccess
)))
client
,
stuff
->
srcDrawable
,
XRC_DRAWABLE
,
Dix
ReadAccess
)))
return
BadDrawable
;
return
BadDrawable
;
srcShared
=
IS_SHARED_PIXMAP
(
src
);
srcShared
=
IS_SHARED_PIXMAP
(
src
);
if
(
!
(
dst
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
dst
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
dstDrawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
dstDrawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
dstShared
=
IS_SHARED_PIXMAP
(
dst
);
dstShared
=
IS_SHARED_PIXMAP
(
dst
);
...
@@ -1159,7 +1159,7 @@ int PanoramiXCopyPlane(ClientPtr client)
...
@@ -1159,7 +1159,7 @@ int PanoramiXCopyPlane(ClientPtr client)
return
(
*
SavedProcVector
[
X_CopyPlane
])(
client
);
return
(
*
SavedProcVector
[
X_CopyPlane
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
if
((
dst
->
type
==
XRT_WINDOW
)
&&
dst
->
u
.
win
.
root
)
if
((
dst
->
type
==
XRT_WINDOW
)
&&
dst
->
u
.
win
.
root
)
...
@@ -1186,7 +1186,7 @@ int PanoramiXCopyPlane(ClientPtr client)
...
@@ -1186,7 +1186,7 @@ int PanoramiXCopyPlane(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC
(
stuff
->
dstDrawable
,
pdstDraw
,
pGC
,
client
);
VALIDATE_DRAWABLE_AND_GC
(
stuff
->
dstDrawable
,
pdstDraw
,
pGC
,
client
);
if
(
stuff
->
dstDrawable
!=
stuff
->
srcDrawable
)
{
if
(
stuff
->
dstDrawable
!=
stuff
->
srcDrawable
)
{
SECURITY_VERIFY_DRAWABLE
(
psrcDraw
,
stuff
->
srcDrawable
,
client
,
SECURITY_VERIFY_DRAWABLE
(
psrcDraw
,
stuff
->
srcDrawable
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
pdstDraw
->
pScreen
!=
psrcDraw
->
pScreen
)
{
if
(
pdstDraw
->
pScreen
!=
psrcDraw
->
pScreen
)
{
client
->
errorValue
=
stuff
->
dstDrawable
;
client
->
errorValue
=
stuff
->
dstDrawable
;
return
(
BadMatch
);
return
(
BadMatch
);
...
@@ -1244,14 +1244,14 @@ int PanoramiXPolyPoint(ClientPtr client)
...
@@ -1244,14 +1244,14 @@ int PanoramiXPolyPoint(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xPolyPointReq
);
REQUEST_AT_LEAST_SIZE
(
xPolyPointReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_PolyPoint
])(
client
);
return
(
*
SavedProcVector
[
X_PolyPoint
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1302,14 +1302,14 @@ int PanoramiXPolyLine(ClientPtr client)
...
@@ -1302,14 +1302,14 @@ int PanoramiXPolyLine(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xPolyLineReq
);
REQUEST_AT_LEAST_SIZE
(
xPolyLineReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_PolyLine
])(
client
);
return
(
*
SavedProcVector
[
X_PolyLine
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1360,14 +1360,14 @@ int PanoramiXPolySegment(ClientPtr client)
...
@@ -1360,14 +1360,14 @@ int PanoramiXPolySegment(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xPolySegmentReq
);
REQUEST_AT_LEAST_SIZE
(
xPolySegmentReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_PolySegment
])(
client
);
return
(
*
SavedProcVector
[
X_PolySegment
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1422,14 +1422,14 @@ int PanoramiXPolyRectangle(ClientPtr client)
...
@@ -1422,14 +1422,14 @@ int PanoramiXPolyRectangle(ClientPtr client)
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_PolyRectangle
])(
client
);
return
(
*
SavedProcVector
[
X_PolyRectangle
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1482,14 +1482,14 @@ int PanoramiXPolyArc(ClientPtr client)
...
@@ -1482,14 +1482,14 @@ int PanoramiXPolyArc(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xPolyArcReq
);
REQUEST_AT_LEAST_SIZE
(
xPolyArcReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_PolyArc
])(
client
);
return
(
*
SavedProcVector
[
X_PolyArc
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1540,14 +1540,14 @@ int PanoramiXFillPoly(ClientPtr client)
...
@@ -1540,14 +1540,14 @@ int PanoramiXFillPoly(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xFillPolyReq
);
REQUEST_AT_LEAST_SIZE
(
xFillPolyReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_FillPoly
])(
client
);
return
(
*
SavedProcVector
[
X_FillPoly
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1599,14 +1599,14 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
...
@@ -1599,14 +1599,14 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xPolyFillRectangleReq
);
REQUEST_AT_LEAST_SIZE
(
xPolyFillRectangleReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_PolyFillRectangle
])(
client
);
return
(
*
SavedProcVector
[
X_PolyFillRectangle
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1658,14 +1658,14 @@ int PanoramiXPolyFillArc(ClientPtr client)
...
@@ -1658,14 +1658,14 @@ int PanoramiXPolyFillArc(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xPolyFillArcReq
);
REQUEST_AT_LEAST_SIZE
(
xPolyFillArcReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_PolyFillArc
])(
client
);
return
(
*
SavedProcVector
[
X_PolyFillArc
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1716,14 +1716,14 @@ int PanoramiXPutImage(ClientPtr client)
...
@@ -1716,14 +1716,14 @@ int PanoramiXPutImage(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xPutImageReq
);
REQUEST_AT_LEAST_SIZE
(
xPutImageReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_PutImage
])(
client
);
return
(
*
SavedProcVector
[
X_PutImage
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1767,7 +1767,7 @@ int PanoramiXGetImage(ClientPtr client)
...
@@ -1767,7 +1767,7 @@ int PanoramiXGetImage(ClientPtr client)
}
}
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
draw
->
type
==
XRT_PIXMAP
)
if
(
draw
->
type
==
XRT_PIXMAP
)
...
@@ -1907,14 +1907,14 @@ PanoramiXPolyText8(ClientPtr client)
...
@@ -1907,14 +1907,14 @@ PanoramiXPolyText8(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xPolyTextReq
);
REQUEST_AT_LEAST_SIZE
(
xPolyTextReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_PolyText8
])(
client
);
return
(
*
SavedProcVector
[
X_PolyText8
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1946,14 +1946,14 @@ PanoramiXPolyText16(ClientPtr client)
...
@@ -1946,14 +1946,14 @@ PanoramiXPolyText16(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xPolyTextReq
);
REQUEST_AT_LEAST_SIZE
(
xPolyTextReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_PolyText16
])(
client
);
return
(
*
SavedProcVector
[
X_PolyText16
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1985,14 +1985,14 @@ int PanoramiXImageText8(ClientPtr client)
...
@@ -1985,14 +1985,14 @@ int PanoramiXImageText8(ClientPtr client)
REQUEST_FIXED_SIZE
(
xImageTextReq
,
stuff
->
nChars
);
REQUEST_FIXED_SIZE
(
xImageTextReq
,
stuff
->
nChars
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_ImageText8
])(
client
);
return
(
*
SavedProcVector
[
X_ImageText8
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -2024,14 +2024,14 @@ int PanoramiXImageText16(ClientPtr client)
...
@@ -2024,14 +2024,14 @@ int PanoramiXImageText16(ClientPtr client)
REQUEST_FIXED_SIZE
(
xImageTextReq
,
stuff
->
nChars
<<
1
);
REQUEST_FIXED_SIZE
(
xImageTextReq
,
stuff
->
nChars
<<
1
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
IS_SHARED_PIXMAP
(
draw
))
if
(
IS_SHARED_PIXMAP
(
draw
))
return
(
*
SavedProcVector
[
X_ImageText16
])(
client
);
return
(
*
SavedProcVector
[
X_ImageText16
])(
client
);
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -2062,7 +2062,7 @@ int PanoramiXCreateColormap(ClientPtr client)
...
@@ -2062,7 +2062,7 @@ int PanoramiXCreateColormap(ClientPtr client)
REQUEST_SIZE_MATCH
(
xCreateColormapReq
);
REQUEST_SIZE_MATCH
(
xCreateColormapReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
window
,
XRT_WINDOW
,
Security
ReadAccess
)))
client
,
stuff
->
window
,
XRT_WINDOW
,
Dix
ReadAccess
)))
return
BadWindow
;
return
BadWindow
;
if
(
!
stuff
->
visual
||
(
stuff
->
visual
>
255
))
if
(
!
stuff
->
visual
||
(
stuff
->
visual
>
255
))
...
@@ -2105,7 +2105,7 @@ int PanoramiXFreeColormap(ClientPtr client)
...
@@ -2105,7 +2105,7 @@ int PanoramiXFreeColormap(ClientPtr client)
client
->
errorValue
=
stuff
->
id
;
client
->
errorValue
=
stuff
->
id
;
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_COLORMAP
,
Security
DestroyAccess
)))
client
,
stuff
->
id
,
XRT_COLORMAP
,
Dix
DestroyAccess
)))
return
BadColor
;
return
BadColor
;
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -2134,7 +2134,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
...
@@ -2134,7 +2134,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
srcCmap
,
XRT_COLORMAP
,
client
,
stuff
->
srcCmap
,
XRT_COLORMAP
,
SecurityReadAccess
|
Security
WriteAccess
)))
DixReadAccess
|
Dix
WriteAccess
)))
return
BadColor
;
return
BadColor
;
if
(
!
(
newCmap
=
(
PanoramiXRes
*
)
malloc
(
sizeof
(
PanoramiXRes
))))
if
(
!
(
newCmap
=
(
PanoramiXRes
*
)
malloc
(
sizeof
(
PanoramiXRes
))))
...
@@ -2172,7 +2172,7 @@ int PanoramiXInstallColormap(ClientPtr client)
...
@@ -2172,7 +2172,7 @@ int PanoramiXInstallColormap(ClientPtr client)
client
->
errorValue
=
stuff
->
id
;
client
->
errorValue
=
stuff
->
id
;
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_COLORMAP
,
Security
ReadAccess
)))
client
,
stuff
->
id
,
XRT_COLORMAP
,
Dix
ReadAccess
)))
return
BadColor
;
return
BadColor
;
FOR_NSCREENS_BACKWARD
(
j
){
FOR_NSCREENS_BACKWARD
(
j
){
...
@@ -2195,7 +2195,7 @@ int PanoramiXUninstallColormap(ClientPtr client)
...
@@ -2195,7 +2195,7 @@ int PanoramiXUninstallColormap(ClientPtr client)
client
->
errorValue
=
stuff
->
id
;
client
->
errorValue
=
stuff
->
id
;
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
XRT_COLORMAP
,
Security
ReadAccess
)))
client
,
stuff
->
id
,
XRT_COLORMAP
,
Dix
ReadAccess
)))
return
BadColor
;
return
BadColor
;
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -2218,7 +2218,7 @@ int PanoramiXAllocColor(ClientPtr client)
...
@@ -2218,7 +2218,7 @@ int PanoramiXAllocColor(ClientPtr client)
client
->
errorValue
=
stuff
->
cmap
;
client
->
errorValue
=
stuff
->
cmap
;
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Security
WriteAccess
)))
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Dix
WriteAccess
)))
return
BadColor
;
return
BadColor
;
FOR_NSCREENS_BACKWARD
(
j
){
FOR_NSCREENS_BACKWARD
(
j
){
...
@@ -2241,7 +2241,7 @@ int PanoramiXAllocNamedColor(ClientPtr client)
...
@@ -2241,7 +2241,7 @@ int PanoramiXAllocNamedColor(ClientPtr client)
client
->
errorValue
=
stuff
->
cmap
;
client
->
errorValue
=
stuff
->
cmap
;
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Security
WriteAccess
)))
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Dix
WriteAccess
)))
return
BadColor
;
return
BadColor
;
FOR_NSCREENS_BACKWARD
(
j
){
FOR_NSCREENS_BACKWARD
(
j
){
...
@@ -2264,7 +2264,7 @@ int PanoramiXAllocColorCells(ClientPtr client)
...
@@ -2264,7 +2264,7 @@ int PanoramiXAllocColorCells(ClientPtr client)
client
->
errorValue
=
stuff
->
cmap
;
client
->
errorValue
=
stuff
->
cmap
;
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Security
WriteAccess
)))
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Dix
WriteAccess
)))
return
BadColor
;
return
BadColor
;
FOR_NSCREENS_BACKWARD
(
j
){
FOR_NSCREENS_BACKWARD
(
j
){
...
@@ -2287,7 +2287,7 @@ int PanoramiXAllocColorPlanes(ClientPtr client)
...
@@ -2287,7 +2287,7 @@ int PanoramiXAllocColorPlanes(ClientPtr client)
client
->
errorValue
=
stuff
->
cmap
;
client
->
errorValue
=
stuff
->
cmap
;
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Security
WriteAccess
)))
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Dix
WriteAccess
)))
return
BadColor
;
return
BadColor
;
FOR_NSCREENS_BACKWARD
(
j
){
FOR_NSCREENS_BACKWARD
(
j
){
...
@@ -2311,7 +2311,7 @@ int PanoramiXFreeColors(ClientPtr client)
...
@@ -2311,7 +2311,7 @@ int PanoramiXFreeColors(ClientPtr client)
client
->
errorValue
=
stuff
->
cmap
;
client
->
errorValue
=
stuff
->
cmap
;
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Security
WriteAccess
)))
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Dix
WriteAccess
)))
return
BadColor
;
return
BadColor
;
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -2333,7 +2333,7 @@ int PanoramiXStoreColors(ClientPtr client)
...
@@ -2333,7 +2333,7 @@ int PanoramiXStoreColors(ClientPtr client)
client
->
errorValue
=
stuff
->
cmap
;
client
->
errorValue
=
stuff
->
cmap
;
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Security
WriteAccess
)))
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Dix
WriteAccess
)))
return
BadColor
;
return
BadColor
;
FOR_NSCREENS_BACKWARD
(
j
){
FOR_NSCREENS_BACKWARD
(
j
){
...
@@ -2356,7 +2356,7 @@ int PanoramiXStoreNamedColor(ClientPtr client)
...
@@ -2356,7 +2356,7 @@ int PanoramiXStoreNamedColor(ClientPtr client)
client
->
errorValue
=
stuff
->
cmap
;
client
->
errorValue
=
stuff
->
cmap
;
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Security
WriteAccess
)))
client
,
stuff
->
cmap
,
XRT_COLORMAP
,
Dix
WriteAccess
)))
return
BadColor
;
return
BadColor
;
FOR_NSCREENS_BACKWARD
(
j
){
FOR_NSCREENS_BACKWARD
(
j
){
...
...
nx-X11/programs/Xserver/Xext/saver.c
View file @
3c322ffb
...
@@ -1199,7 +1199,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
...
@@ -1199,7 +1199,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xScreenSaverSetAttributesReq
);
REQUEST_AT_LEAST_SIZE
(
xScreenSaverSetAttributesReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
len
=
stuff
->
length
-
(
sizeof
(
xScreenSaverSetAttributesReq
)
>>
2
);
len
=
stuff
->
length
-
(
sizeof
(
xScreenSaverSetAttributesReq
)
>>
2
);
...
@@ -1211,7 +1211,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
...
@@ -1211,7 +1211,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pback_offset
);
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pback_offset
);
if
((
tmp
!=
None
)
&&
(
tmp
!=
ParentRelative
))
{
if
((
tmp
!=
None
)
&&
(
tmp
!=
ParentRelative
))
{
if
(
!
(
backPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
backPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -1221,7 +1221,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
...
@@ -1221,7 +1221,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pbord_offset
);
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
pbord_offset
);
if
(
tmp
!=
CopyFromParent
)
{
if
(
tmp
!=
CopyFromParent
)
{
if
(
!
(
bordPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
bordPix
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
}
}
}
...
@@ -1231,7 +1231,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
...
@@ -1231,7 +1231,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
cmap_offset
);
tmp
=
*
((
CARD32
*
)
&
stuff
[
1
]
+
cmap_offset
);
if
((
tmp
!=
CopyFromParent
)
&&
(
tmp
!=
None
))
{
if
((
tmp
!=
CopyFromParent
)
&&
(
tmp
!=
None
))
{
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
cmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
tmp
,
XRT_COLORMAP
,
Security
ReadAccess
)))
client
,
tmp
,
XRT_COLORMAP
,
Dix
ReadAccess
)))
return
BadColor
;
return
BadColor
;
}
}
}
}
...
@@ -1271,7 +1271,7 @@ ProcScreenSaverUnsetAttributes (ClientPtr client)
...
@@ -1271,7 +1271,7 @@ ProcScreenSaverUnsetAttributes (ClientPtr client)
int
i
;
int
i
;
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
for
(
i
=
PanoramiXNumScreens
-
1
;
i
>
0
;
i
--
)
{
for
(
i
=
PanoramiXNumScreens
-
1
;
i
>
0
;
i
--
)
{
...
...
nx-X11/programs/Xserver/Xext/security.c
View file @
3c322ffb
...
@@ -750,7 +750,7 @@ ProcSecurityRevokeAuthorization(
...
@@ -750,7 +750,7 @@ ProcSecurityRevokeAuthorization(
REQUEST_SIZE_MATCH
(
xSecurityRevokeAuthorizationReq
);
REQUEST_SIZE_MATCH
(
xSecurityRevokeAuthorizationReq
);
pAuth
=
(
SecurityAuthorizationPtr
)
SecurityLookupIDByType
(
client
,
pAuth
=
(
SecurityAuthorizationPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
authId
,
SecurityAuthorizationResType
,
Security
DestroyAccess
);
stuff
->
authId
,
SecurityAuthorizationResType
,
Dix
DestroyAccess
);
if
(
!
pAuth
)
if
(
!
pAuth
)
return
SecurityErrorBase
+
XSecurityBadAuthorization
;
return
SecurityErrorBase
+
XSecurityBadAuthorization
;
...
@@ -1115,7 +1115,7 @@ SecurityCheckResourceIDAccess(
...
@@ -1115,7 +1115,7 @@ SecurityCheckResourceIDAccess(
int
cid
=
CLIENT_ID
(
id
);
int
cid
=
CLIENT_ID
(
id
);
int
reqtype
=
((
xReq
*
)
client
->
requestBuffer
)
->
reqType
;
int
reqtype
=
((
xReq
*
)
client
->
requestBuffer
)
->
reqType
;
if
(
Security
UnknownAccess
==
access_mode
)
if
(
Dix
UnknownAccess
==
access_mode
)
return
rval
;
/* for compatibility, we have to allow access */
return
rval
;
/* for compatibility, we have to allow access */
switch
(
reqtype
)
switch
(
reqtype
)
...
@@ -2051,11 +2051,11 @@ SecurityCheckPropertyAccess(client, pWin, propertyName, access_mode)
...
@@ -2051,11 +2051,11 @@ SecurityCheckPropertyAccess(client, pWin, propertyName, access_mode)
* executed a continue, which will skip the follwing code.
* executed a continue, which will skip the follwing code.
*/
*/
action
=
SecurityAllowOperation
;
action
=
SecurityAllowOperation
;
if
(
access_mode
&
Security
ReadAccess
)
if
(
access_mode
&
Dix
ReadAccess
)
action
=
max
(
action
,
pacl
->
readAction
);
action
=
max
(
action
,
pacl
->
readAction
);
if
(
access_mode
&
Security
WriteAccess
)
if
(
access_mode
&
Dix
WriteAccess
)
action
=
max
(
action
,
pacl
->
writeAction
);
action
=
max
(
action
,
pacl
->
writeAction
);
if
(
access_mode
&
Security
DestroyAccess
)
if
(
access_mode
&
Dix
DestroyAccess
)
action
=
max
(
action
,
pacl
->
destroyAction
);
action
=
max
(
action
,
pacl
->
destroyAction
);
break
;
break
;
}
/* end for each pacl */
}
/* end for each pacl */
...
...
nx-X11/programs/Xserver/Xext/shape.c
View file @
3c322ffb
...
@@ -385,7 +385,7 @@ ProcPanoramiXShapeRectangles(
...
@@ -385,7 +385,7 @@ ProcPanoramiXShapeRectangles(
REQUEST_AT_LEAST_SIZE
(
xShapeRectanglesReq
);
REQUEST_AT_LEAST_SIZE
(
xShapeRectanglesReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
dest
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
dest
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS
(
j
)
{
FOR_NSCREENS
(
j
)
{
...
@@ -417,7 +417,7 @@ ProcShapeMask (client)
...
@@ -417,7 +417,7 @@ ProcShapeMask (client)
REQUEST_SIZE_MATCH
(
xShapeMaskReq
);
REQUEST_SIZE_MATCH
(
xShapeMaskReq
);
UpdateCurrentTime
();
UpdateCurrentTime
();
pWin
=
SecurityLookupWindow
(
stuff
->
dest
,
client
,
Security
WriteAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
dest
,
client
,
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
switch
(
stuff
->
destKind
)
{
switch
(
stuff
->
destKind
)
{
...
@@ -439,7 +439,7 @@ ProcShapeMask (client)
...
@@ -439,7 +439,7 @@ ProcShapeMask (client)
srcRgn
=
0
;
srcRgn
=
0
;
else
{
else
{
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
src
,
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
src
,
RT_PIXMAP
,
Security
ReadAccess
);
RT_PIXMAP
,
Dix
ReadAccess
);
if
(
!
pPixmap
)
if
(
!
pPixmap
)
return
BadPixmap
;
return
BadPixmap
;
if
(
pPixmap
->
drawable
.
pScreen
!=
pScreen
||
if
(
pPixmap
->
drawable
.
pScreen
!=
pScreen
||
...
@@ -483,12 +483,12 @@ ProcPanoramiXShapeMask(
...
@@ -483,12 +483,12 @@ ProcPanoramiXShapeMask(
REQUEST_SIZE_MATCH
(
xShapeMaskReq
);
REQUEST_SIZE_MATCH
(
xShapeMaskReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
dest
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
dest
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
if
(
stuff
->
src
!=
None
)
{
if
(
stuff
->
src
!=
None
)
{
if
(
!
(
pmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
pmap
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
src
,
XRT_PIXMAP
,
Security
ReadAccess
)))
client
,
stuff
->
src
,
XRT_PIXMAP
,
Dix
ReadAccess
)))
return
BadPixmap
;
return
BadPixmap
;
}
else
}
else
pmap
=
NULL
;
pmap
=
NULL
;
...
@@ -611,11 +611,11 @@ ProcPanoramiXShapeCombine(
...
@@ -611,11 +611,11 @@ ProcPanoramiXShapeCombine(
REQUEST_AT_LEAST_SIZE
(
xShapeCombineReq
);
REQUEST_AT_LEAST_SIZE
(
xShapeCombineReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
dest
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
dest
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
if
(
!
(
win2
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win2
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
src
,
XRT_WINDOW
,
Security
ReadAccess
)))
client
,
stuff
->
src
,
XRT_WINDOW
,
Dix
ReadAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS
(
j
)
{
FOR_NSCREENS
(
j
)
{
...
@@ -683,7 +683,7 @@ ProcPanoramiXShapeOffset(
...
@@ -683,7 +683,7 @@ ProcPanoramiXShapeOffset(
REQUEST_AT_LEAST_SIZE
(
xShapeOffsetReq
);
REQUEST_AT_LEAST_SIZE
(
xShapeOffsetReq
);
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
win
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
dest
,
XRT_WINDOW
,
Security
WriteAccess
)))
client
,
stuff
->
dest
,
XRT_WINDOW
,
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
FOR_NSCREENS
(
j
)
{
FOR_NSCREENS
(
j
)
{
...
@@ -817,11 +817,11 @@ ProcShapeSelectInput (client)
...
@@ -817,11 +817,11 @@ ProcShapeSelectInput (client)
XID
clientResource
;
XID
clientResource
;
REQUEST_SIZE_MATCH
(
xShapeSelectInputReq
);
REQUEST_SIZE_MATCH
(
xShapeSelectInputReq
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
pHead
=
(
ShapeEventPtr
*
)
SecurityLookupIDByType
(
client
,
pHead
=
(
ShapeEventPtr
*
)
SecurityLookupIDByType
(
client
,
pWin
->
drawable
.
id
,
EventType
,
Security
WriteAccess
);
pWin
->
drawable
.
id
,
EventType
,
Dix
WriteAccess
);
switch
(
stuff
->
enable
)
{
switch
(
stuff
->
enable
)
{
case
xTrue
:
case
xTrue
:
if
(
pHead
)
{
if
(
pHead
)
{
...
@@ -988,7 +988,7 @@ ProcShapeInputSelected (client)
...
@@ -988,7 +988,7 @@ ProcShapeInputSelected (client)
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
pHead
=
(
ShapeEventPtr
*
)
SecurityLookupIDByType
(
client
,
pHead
=
(
ShapeEventPtr
*
)
SecurityLookupIDByType
(
client
,
pWin
->
drawable
.
id
,
EventType
,
Security
ReadAccess
);
pWin
->
drawable
.
id
,
EventType
,
Dix
ReadAccess
);
enabled
=
xFalse
;
enabled
=
xFalse
;
if
(
pHead
)
{
if
(
pHead
)
{
for
(
pShapeEvent
=
*
pHead
;
for
(
pShapeEvent
=
*
pHead
;
...
...
nx-X11/programs/Xserver/Xext/shm.c
View file @
3c322ffb
...
@@ -568,11 +568,11 @@ ProcPanoramiXShmPutImage(register ClientPtr client)
...
@@ -568,11 +568,11 @@ ProcPanoramiXShmPutImage(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xShmPutImageReq
);
REQUEST_SIZE_MATCH
(
xShmPutImageReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -618,7 +618,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
...
@@ -618,7 +618,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
}
}
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
draw
->
type
==
XRT_PIXMAP
)
if
(
draw
->
type
==
XRT_PIXMAP
)
...
...
nx-X11/programs/Xserver/Xext/sync.c
View file @
3c322ffb
...
@@ -425,7 +425,7 @@ SyncInitTrigger(client, pTrigger, counter, changes)
...
@@ -425,7 +425,7 @@ SyncInitTrigger(client, pTrigger, counter, changes)
if
(
counter
==
None
)
if
(
counter
==
None
)
pCounter
=
NULL
;
pCounter
=
NULL
;
else
if
(
!
(
pCounter
=
(
SyncCounter
*
)
SecurityLookupIDByType
(
else
if
(
!
(
pCounter
=
(
SyncCounter
*
)
SecurityLookupIDByType
(
client
,
counter
,
RTCounter
,
Security
ReadAccess
)))
client
,
counter
,
RTCounter
,
Dix
ReadAccess
)))
{
{
client
->
errorValue
=
counter
;
client
->
errorValue
=
counter
;
return
SyncErrorBase
+
XSyncBadCounter
;
return
SyncErrorBase
+
XSyncBadCounter
;
...
@@ -1527,7 +1527,7 @@ ProcSyncSetCounter(client)
...
@@ -1527,7 +1527,7 @@ ProcSyncSetCounter(client)
REQUEST_SIZE_MATCH
(
xSyncSetCounterReq
);
REQUEST_SIZE_MATCH
(
xSyncSetCounterReq
);
pCounter
=
(
SyncCounter
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cid
,
pCounter
=
(
SyncCounter
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cid
,
RTCounter
,
Security
WriteAccess
);
RTCounter
,
Dix
WriteAccess
);
if
(
pCounter
==
NULL
)
if
(
pCounter
==
NULL
)
{
{
client
->
errorValue
=
stuff
->
cid
;
client
->
errorValue
=
stuff
->
cid
;
...
@@ -1560,7 +1560,7 @@ ProcSyncChangeCounter(client)
...
@@ -1560,7 +1560,7 @@ ProcSyncChangeCounter(client)
REQUEST_SIZE_MATCH
(
xSyncChangeCounterReq
);
REQUEST_SIZE_MATCH
(
xSyncChangeCounterReq
);
pCounter
=
(
SyncCounter
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cid
,
pCounter
=
(
SyncCounter
*
)
SecurityLookupIDByType
(
client
,
stuff
->
cid
,
RTCounter
,
Security
WriteAccess
);
RTCounter
,
Dix
WriteAccess
);
if
(
pCounter
==
NULL
)
if
(
pCounter
==
NULL
)
{
{
client
->
errorValue
=
stuff
->
cid
;
client
->
errorValue
=
stuff
->
cid
;
...
@@ -1598,7 +1598,7 @@ ProcSyncDestroyCounter(client)
...
@@ -1598,7 +1598,7 @@ ProcSyncDestroyCounter(client)
REQUEST_SIZE_MATCH
(
xSyncDestroyCounterReq
);
REQUEST_SIZE_MATCH
(
xSyncDestroyCounterReq
);
pCounter
=
(
SyncCounter
*
)
SecurityLookupIDByType
(
client
,
stuff
->
counter
,
pCounter
=
(
SyncCounter
*
)
SecurityLookupIDByType
(
client
,
stuff
->
counter
,
RTCounter
,
Security
DestroyAccess
);
RTCounter
,
Dix
DestroyAccess
);
if
(
pCounter
==
NULL
)
if
(
pCounter
==
NULL
)
{
{
client
->
errorValue
=
stuff
->
counter
;
client
->
errorValue
=
stuff
->
counter
;
...
@@ -1744,7 +1744,7 @@ ProcSyncQueryCounter(client)
...
@@ -1744,7 +1744,7 @@ ProcSyncQueryCounter(client)
REQUEST_SIZE_MATCH
(
xSyncQueryCounterReq
);
REQUEST_SIZE_MATCH
(
xSyncQueryCounterReq
);
pCounter
=
(
SyncCounter
*
)
SecurityLookupIDByType
(
client
,
stuff
->
counter
,
pCounter
=
(
SyncCounter
*
)
SecurityLookupIDByType
(
client
,
stuff
->
counter
,
RTCounter
,
Security
ReadAccess
);
RTCounter
,
Dix
ReadAccess
);
if
(
pCounter
==
NULL
)
if
(
pCounter
==
NULL
)
{
{
client
->
errorValue
=
stuff
->
counter
;
client
->
errorValue
=
stuff
->
counter
;
...
@@ -1872,7 +1872,7 @@ ProcSyncChangeAlarm(client)
...
@@ -1872,7 +1872,7 @@ ProcSyncChangeAlarm(client)
REQUEST_AT_LEAST_SIZE
(
xSyncChangeAlarmReq
);
REQUEST_AT_LEAST_SIZE
(
xSyncChangeAlarmReq
);
if
(
!
(
pAlarm
=
(
SyncAlarm
*
)
SecurityLookupIDByType
(
client
,
stuff
->
alarm
,
if
(
!
(
pAlarm
=
(
SyncAlarm
*
)
SecurityLookupIDByType
(
client
,
stuff
->
alarm
,
RTAlarm
,
Security
WriteAccess
)))
RTAlarm
,
Dix
WriteAccess
)))
{
{
client
->
errorValue
=
stuff
->
alarm
;
client
->
errorValue
=
stuff
->
alarm
;
return
SyncErrorBase
+
XSyncBadAlarm
;
return
SyncErrorBase
+
XSyncBadAlarm
;
...
@@ -1913,7 +1913,7 @@ ProcSyncQueryAlarm(client)
...
@@ -1913,7 +1913,7 @@ ProcSyncQueryAlarm(client)
REQUEST_SIZE_MATCH
(
xSyncQueryAlarmReq
);
REQUEST_SIZE_MATCH
(
xSyncQueryAlarmReq
);
pAlarm
=
(
SyncAlarm
*
)
SecurityLookupIDByType
(
client
,
stuff
->
alarm
,
pAlarm
=
(
SyncAlarm
*
)
SecurityLookupIDByType
(
client
,
stuff
->
alarm
,
RTAlarm
,
Security
ReadAccess
);
RTAlarm
,
Dix
ReadAccess
);
if
(
!
pAlarm
)
if
(
!
pAlarm
)
{
{
client
->
errorValue
=
stuff
->
alarm
;
client
->
errorValue
=
stuff
->
alarm
;
...
@@ -1972,7 +1972,7 @@ ProcSyncDestroyAlarm(client)
...
@@ -1972,7 +1972,7 @@ ProcSyncDestroyAlarm(client)
REQUEST_SIZE_MATCH
(
xSyncDestroyAlarmReq
);
REQUEST_SIZE_MATCH
(
xSyncDestroyAlarmReq
);
if
(
!
((
SyncAlarm
*
)
SecurityLookupIDByType
(
client
,
stuff
->
alarm
,
if
(
!
((
SyncAlarm
*
)
SecurityLookupIDByType
(
client
,
stuff
->
alarm
,
RTAlarm
,
Security
DestroyAccess
)))
RTAlarm
,
Dix
DestroyAccess
)))
{
{
client
->
errorValue
=
stuff
->
alarm
;
client
->
errorValue
=
stuff
->
alarm
;
return
SyncErrorBase
+
XSyncBadAlarm
;
return
SyncErrorBase
+
XSyncBadAlarm
;
...
...
nx-X11/programs/Xserver/Xext/xf86bigfont.c
View file @
3c322ffb
...
@@ -443,11 +443,11 @@ ProcXF86BigfontQueryFont(
...
@@ -443,11 +443,11 @@ ProcXF86BigfontQueryFont(
#endif
#endif
client
->
errorValue
=
stuff
->
id
;
/* EITHER font or gc */
client
->
errorValue
=
stuff
->
id
;
/* EITHER font or gc */
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_FONT
,
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_FONT
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFont
)
{
if
(
!
pFont
)
{
/* can't use VERIFY_GC because it might return BadGC */
/* can't use VERIFY_GC because it might return BadGC */
GC
*
pGC
=
(
GC
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_GC
,
GC
*
pGC
=
(
GC
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_GC
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pGC
)
{
if
(
!
pGC
)
{
client
->
errorValue
=
stuff
->
id
;
client
->
errorValue
=
stuff
->
id
;
return
BadFont
;
/* procotol spec says only error is BadFont */
return
BadFont
;
/* procotol spec says only error is BadFont */
...
...
nx-X11/programs/Xserver/Xext/xvdisp.c
View file @
3c322ffb
...
@@ -1854,11 +1854,11 @@ XineramaXvStopVideo(ClientPtr client)
...
@@ -1854,11 +1854,11 @@ XineramaXvStopVideo(ClientPtr client)
REQUEST_SIZE_MATCH
(
xvStopVideoReq
);
REQUEST_SIZE_MATCH
(
xvStopVideoReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
port
,
XvXRTPort
,
Security
ReadAccess
)))
client
,
stuff
->
port
,
XvXRTPort
,
Dix
ReadAccess
)))
return
_XvBadPort
;
return
_XvBadPort
;
FOR_NSCREENS_BACKWARD
(
i
)
{
FOR_NSCREENS_BACKWARD
(
i
)
{
...
@@ -1882,7 +1882,7 @@ XineramaXvSetPortAttribute(ClientPtr client)
...
@@ -1882,7 +1882,7 @@ XineramaXvSetPortAttribute(ClientPtr client)
REQUEST_SIZE_MATCH
(
xvSetPortAttributeReq
);
REQUEST_SIZE_MATCH
(
xvSetPortAttributeReq
);
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
port
,
XvXRTPort
,
Security
ReadAccess
)))
client
,
stuff
->
port
,
XvXRTPort
,
Dix
ReadAccess
)))
return
_XvBadPort
;
return
_XvBadPort
;
FOR_NSCREENS_BACKWARD
(
i
)
{
FOR_NSCREENS_BACKWARD
(
i
)
{
...
@@ -1908,15 +1908,15 @@ XineramaXvShmPutImage(ClientPtr client)
...
@@ -1908,15 +1908,15 @@ XineramaXvShmPutImage(ClientPtr client)
REQUEST_SIZE_MATCH
(
xvShmPutImageReq
);
REQUEST_SIZE_MATCH
(
xvShmPutImageReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
port
,
XvXRTPort
,
Security
ReadAccess
)))
client
,
stuff
->
port
,
XvXRTPort
,
Dix
ReadAccess
)))
return
_XvBadPort
;
return
_XvBadPort
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -1955,15 +1955,15 @@ XineramaXvPutImage(ClientPtr client)
...
@@ -1955,15 +1955,15 @@ XineramaXvPutImage(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xvPutImageReq
);
REQUEST_AT_LEAST_SIZE
(
xvPutImageReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
port
,
XvXRTPort
,
Security
ReadAccess
)))
client
,
stuff
->
port
,
XvXRTPort
,
Dix
ReadAccess
)))
return
_XvBadPort
;
return
_XvBadPort
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -2000,15 +2000,15 @@ XineramaXvPutVideo(ClientPtr client)
...
@@ -2000,15 +2000,15 @@ XineramaXvPutVideo(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xvPutVideoReq
);
REQUEST_AT_LEAST_SIZE
(
xvPutVideoReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
port
,
XvXRTPort
,
Security
ReadAccess
)))
client
,
stuff
->
port
,
XvXRTPort
,
Dix
ReadAccess
)))
return
_XvBadPort
;
return
_XvBadPort
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
@@ -2045,15 +2045,15 @@ XineramaXvPutStill(ClientPtr client)
...
@@ -2045,15 +2045,15 @@ XineramaXvPutStill(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xvPutImageReq
);
REQUEST_AT_LEAST_SIZE
(
xvPutImageReq
);
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
draw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
gc
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
gc
,
XRT_GC
,
Security
ReadAccess
)))
client
,
stuff
->
gc
,
XRT_GC
,
Dix
ReadAccess
)))
return
BadGC
;
return
BadGC
;
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
if
(
!
(
port
=
(
PanoramiXRes
*
)
SecurityLookupIDByType
(
client
,
stuff
->
port
,
XvXRTPort
,
Security
ReadAccess
)))
client
,
stuff
->
port
,
XvXRTPort
,
Dix
ReadAccess
)))
return
_XvBadPort
;
return
_XvBadPort
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
isRoot
=
(
draw
->
type
==
XRT_WINDOW
)
&&
draw
->
u
.
win
.
root
;
...
...
nx-X11/programs/Xserver/composite/compwindow.c
View file @
3c322ffb
...
@@ -83,7 +83,7 @@ compRepaintBorder (ClientPtr pClient, void * closure)
...
@@ -83,7 +83,7 @@ compRepaintBorder (ClientPtr pClient, void * closure)
dixLookupWindow
(
&
pWindow
,
(
XID
)
(
intptr_t
)
closure
,
pClient
,
dixLookupWindow
(
&
pWindow
,
(
XID
)
(
intptr_t
)
closure
,
pClient
,
DixWriteAccess
);
DixWriteAccess
);
#else
#else
pWindow
=
SecurityLookupWindow
((
XID
)
(
intptr_t
)
closure
,
pClient
,
Security
WriteAccess
);
pWindow
=
SecurityLookupWindow
((
XID
)
(
intptr_t
)
closure
,
pClient
,
Dix
WriteAccess
);
int
rc
=
pWindow
?
Success
:
BadWindow
;
int
rc
=
pWindow
?
Success
:
BadWindow
;
#endif
#endif
...
...
nx-X11/programs/Xserver/damageext/damageext.c
View file @
3c322ffb
...
@@ -175,7 +175,7 @@ ProcDamageCreate (ClientPtr client)
...
@@ -175,7 +175,7 @@ ProcDamageCreate (ClientPtr client)
REQUEST_SIZE_MATCH
(
xDamageCreateReq
);
REQUEST_SIZE_MATCH
(
xDamageCreateReq
);
LEGAL_NEW_RESOURCE
(
stuff
->
damage
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
damage
,
client
);
SECURITY_VERIFY_DRAWABLE
(
pDrawable
,
stuff
->
drawable
,
client
,
SECURITY_VERIFY_DRAWABLE
(
pDrawable
,
stuff
->
drawable
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
switch
(
stuff
->
level
)
{
switch
(
stuff
->
level
)
{
case
XDamageReportRawRectangles
:
case
XDamageReportRawRectangles
:
level
=
DamageReportRawRegion
;
level
=
DamageReportRawRegion
;
...
@@ -233,7 +233,7 @@ ProcDamageDestroy (ClientPtr client)
...
@@ -233,7 +233,7 @@ ProcDamageDestroy (ClientPtr client)
DamageExtPtr
pDamageExt
;
DamageExtPtr
pDamageExt
;
REQUEST_SIZE_MATCH
(
xDamageDestroyReq
);
REQUEST_SIZE_MATCH
(
xDamageDestroyReq
);
VERIFY_DAMAGEEXT
(
pDamageExt
,
stuff
->
damage
,
client
,
Security
WriteAccess
);
VERIFY_DAMAGEEXT
(
pDamageExt
,
stuff
->
damage
,
client
,
Dix
WriteAccess
);
FreeResource
(
stuff
->
damage
,
RT_NONE
);
FreeResource
(
stuff
->
damage
,
RT_NONE
);
return
(
client
->
noClientException
);
return
(
client
->
noClientException
);
}
}
...
@@ -247,9 +247,9 @@ ProcDamageSubtract (ClientPtr client)
...
@@ -247,9 +247,9 @@ ProcDamageSubtract (ClientPtr client)
RegionPtr
pParts
;
RegionPtr
pParts
;
REQUEST_SIZE_MATCH
(
xDamageSubtractReq
);
REQUEST_SIZE_MATCH
(
xDamageSubtractReq
);
VERIFY_DAMAGEEXT
(
pDamageExt
,
stuff
->
damage
,
client
,
Security
WriteAccess
);
VERIFY_DAMAGEEXT
(
pDamageExt
,
stuff
->
damage
,
client
,
Dix
WriteAccess
);
VERIFY_REGION_OR_NONE
(
pRepair
,
stuff
->
repair
,
client
,
Security
WriteAccess
);
VERIFY_REGION_OR_NONE
(
pRepair
,
stuff
->
repair
,
client
,
Dix
WriteAccess
);
VERIFY_REGION_OR_NONE
(
pParts
,
stuff
->
parts
,
client
,
Security
WriteAccess
);
VERIFY_REGION_OR_NONE
(
pParts
,
stuff
->
parts
,
client
,
Dix
WriteAccess
);
if
(
pDamageExt
->
level
!=
DamageReportRawRegion
)
if
(
pDamageExt
->
level
!=
DamageReportRawRegion
)
{
{
...
...
nx-X11/programs/Xserver/dbe/dbe.c
View file @
3c322ffb
...
@@ -420,7 +420,7 @@ ProcDbeAllocateBackBufferName(client)
...
@@ -420,7 +420,7 @@ ProcDbeAllocateBackBufferName(client)
/* The window must be valid. */
/* The window must be valid. */
if
(
!
(
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
if
(
!
(
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
)))
Dix
WriteAccess
)))
{
{
return
(
BadWindow
);
return
(
BadWindow
);
}
}
...
@@ -648,9 +648,9 @@ ProcDbeDeallocateBackBufferName(client)
...
@@ -648,9 +648,9 @@ ProcDbeDeallocateBackBufferName(client)
/* Buffer name must be valid */
/* Buffer name must be valid */
if
(
!
(
pDbeWindowPriv
=
(
DbeWindowPrivPtr
)
SecurityLookupIDByType
(
client
,
if
(
!
(
pDbeWindowPriv
=
(
DbeWindowPrivPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
buffer
,
dbeWindowPrivResType
,
Security
DestroyAccess
))
||
stuff
->
buffer
,
dbeWindowPrivResType
,
Dix
DestroyAccess
))
||
!
(
SecurityLookupIDByType
(
client
,
stuff
->
buffer
,
dbeDrawableResType
,
!
(
SecurityLookupIDByType
(
client
,
stuff
->
buffer
,
dbeDrawableResType
,
Security
DestroyAccess
)))
Dix
DestroyAccess
)))
{
{
client
->
errorValue
=
stuff
->
buffer
;
client
->
errorValue
=
stuff
->
buffer
;
return
(
dbeErrorBase
+
DbeBadBuffer
);
return
(
dbeErrorBase
+
DbeBadBuffer
);
...
@@ -751,7 +751,7 @@ ProcDbeSwapBuffers(client)
...
@@ -751,7 +751,7 @@ ProcDbeSwapBuffers(client)
/* Each window must be a valid window - BadWindow. */
/* Each window must be a valid window - BadWindow. */
if
(
!
(
pWin
=
SecurityLookupWindow
(
dbeSwapInfo
[
i
].
window
,
client
,
if
(
!
(
pWin
=
SecurityLookupWindow
(
dbeSwapInfo
[
i
].
window
,
client
,
Security
WriteAccess
)))
Dix
WriteAccess
)))
{
{
free
(
swapInfo
);
free
(
swapInfo
);
return
(
BadWindow
);
return
(
BadWindow
);
...
@@ -916,7 +916,7 @@ ProcDbeGetVisualInfo(client)
...
@@ -916,7 +916,7 @@ ProcDbeGetVisualInfo(client)
for
(
i
=
0
;
i
<
stuff
->
n
;
i
++
)
for
(
i
=
0
;
i
<
stuff
->
n
;
i
++
)
{
{
if
(
!
(
pDrawables
[
i
]
=
(
DrawablePtr
)
SecurityLookupDrawable
(
if
(
!
(
pDrawables
[
i
]
=
(
DrawablePtr
)
SecurityLookupDrawable
(
drawables
[
i
],
client
,
Security
ReadAccess
)))
drawables
[
i
],
client
,
Dix
ReadAccess
)))
{
{
free
(
pDrawables
);
free
(
pDrawables
);
return
(
BadDrawable
);
return
(
BadDrawable
);
...
@@ -1072,7 +1072,7 @@ ProcDbeGetBackBufferAttributes(client)
...
@@ -1072,7 +1072,7 @@ ProcDbeGetBackBufferAttributes(client)
REQUEST_SIZE_MATCH
(
xDbeGetBackBufferAttributesReq
);
REQUEST_SIZE_MATCH
(
xDbeGetBackBufferAttributesReq
);
if
(
!
(
pDbeWindowPriv
=
(
DbeWindowPrivPtr
)
SecurityLookupIDByType
(
client
,
if
(
!
(
pDbeWindowPriv
=
(
DbeWindowPrivPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
buffer
,
dbeWindowPrivResType
,
Security
ReadAccess
)))
stuff
->
buffer
,
dbeWindowPrivResType
,
Dix
ReadAccess
)))
{
{
rep
.
attributes
=
None
;
rep
.
attributes
=
None
;
}
}
...
...
nx-X11/programs/Xserver/dix/colormap.c
View file @
3c322ffb
...
@@ -892,7 +892,7 @@ AllocColor (ColormapPtr pmap,
...
@@ -892,7 +892,7 @@ AllocColor (ColormapPtr pmap,
{
{
ColormapPtr
prootmap
=
(
ColormapPtr
)
ColormapPtr
prootmap
=
(
ColormapPtr
)
SecurityLookupIDByType
(
clients
[
client
],
pmap
->
pScreen
->
defColormap
,
SecurityLookupIDByType
(
clients
[
client
],
pmap
->
pScreen
->
defColormap
,
RT_COLORMAP
,
Security
ReadAccess
);
RT_COLORMAP
,
Dix
ReadAccess
);
if
(
pmap
->
class
==
prootmap
->
class
)
if
(
pmap
->
class
==
prootmap
->
class
)
FindColorInRootCmap
(
prootmap
,
prootmap
->
red
,
entries
,
&
rgb
,
FindColorInRootCmap
(
prootmap
,
prootmap
->
red
,
entries
,
&
rgb
,
...
@@ -909,7 +909,7 @@ AllocColor (ColormapPtr pmap,
...
@@ -909,7 +909,7 @@ AllocColor (ColormapPtr pmap,
{
{
ColormapPtr
prootmap
=
(
ColormapPtr
)
ColormapPtr
prootmap
=
(
ColormapPtr
)
SecurityLookupIDByType
(
clients
[
client
],
pmap
->
pScreen
->
defColormap
,
SecurityLookupIDByType
(
clients
[
client
],
pmap
->
pScreen
->
defColormap
,
RT_COLORMAP
,
Security
ReadAccess
);
RT_COLORMAP
,
Dix
ReadAccess
);
if
(
pmap
->
class
==
prootmap
->
class
)
if
(
pmap
->
class
==
prootmap
->
class
)
{
{
...
...
nx-X11/programs/Xserver/dix/cursor.c
View file @
3c322ffb
...
@@ -262,9 +262,9 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
...
@@ -262,9 +262,9 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
GlyphSharePtr
pShare
;
GlyphSharePtr
pShare
;
sourcefont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
source
,
RT_FONT
,
sourcefont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
source
,
RT_FONT
,
Security
ReadAccess
);
Dix
ReadAccess
);
maskfont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
mask
,
RT_FONT
,
maskfont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
mask
,
RT_FONT
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
sourcefont
)
if
(
!
sourcefont
)
{
{
...
...
nx-X11/programs/Xserver/dix/dispatch.c
View file @
3c322ffb
...
@@ -491,7 +491,7 @@ ProcCreateWindow(ClientPtr client)
...
@@ -491,7 +491,7 @@ ProcCreateWindow(ClientPtr client)
LEGAL_NEW_RESOURCE
(
stuff
->
wid
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
wid
,
client
);
if
(
!
(
pParent
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
parent
,
client
,
if
(
!
(
pParent
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
parent
,
client
,
Security
WriteAccess
)))
Dix
WriteAccess
)))
return
BadWindow
;
return
BadWindow
;
len
=
client
->
req_len
-
(
sizeof
(
xCreateWindowReq
)
>>
2
);
len
=
client
->
req_len
-
(
sizeof
(
xCreateWindowReq
)
>>
2
);
if
(
Ones
(
stuff
->
mask
)
!=
len
)
if
(
Ones
(
stuff
->
mask
)
!=
len
)
...
@@ -532,7 +532,7 @@ ProcChangeWindowAttributes(register ClientPtr client)
...
@@ -532,7 +532,7 @@ ProcChangeWindowAttributes(register ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xChangeWindowAttributesReq
);
REQUEST_AT_LEAST_SIZE
(
xChangeWindowAttributesReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
len
=
client
->
req_len
-
(
sizeof
(
xChangeWindowAttributesReq
)
>>
2
);
len
=
client
->
req_len
-
(
sizeof
(
xChangeWindowAttributesReq
)
>>
2
);
...
@@ -557,7 +557,7 @@ ProcGetWindowAttributes(register ClientPtr client)
...
@@ -557,7 +557,7 @@ ProcGetWindowAttributes(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
memset
(
&
wa
,
0
,
sizeof
(
xGetWindowAttributesReply
));
memset
(
&
wa
,
0
,
sizeof
(
xGetWindowAttributesReply
));
...
@@ -574,7 +574,7 @@ ProcDestroyWindow(register ClientPtr client)
...
@@ -574,7 +574,7 @@ ProcDestroyWindow(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
pWin
->
parent
)
if
(
pWin
->
parent
)
...
@@ -590,7 +590,7 @@ ProcDestroySubwindows(register ClientPtr client)
...
@@ -590,7 +590,7 @@ ProcDestroySubwindows(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
DestroySubwindows
(
pWin
,
client
);
DestroySubwindows
(
pWin
,
client
);
...
@@ -606,7 +606,7 @@ ProcChangeSaveSet(register ClientPtr client)
...
@@ -606,7 +606,7 @@ ProcChangeSaveSet(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xChangeSaveSetReq
);
REQUEST_SIZE_MATCH
(
xChangeSaveSetReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
client
->
clientAsMask
==
(
CLIENT_BITS
(
pWin
->
drawable
.
id
)))
if
(
client
->
clientAsMask
==
(
CLIENT_BITS
(
pWin
->
drawable
.
id
)))
...
@@ -636,11 +636,11 @@ ProcReparentWindow(register ClientPtr client)
...
@@ -636,11 +636,11 @@ ProcReparentWindow(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xReparentWindowReq
);
REQUEST_SIZE_MATCH
(
xReparentWindowReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
pParent
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
parent
,
client
,
pParent
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
parent
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pParent
)
if
(
!
pParent
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
SAME_SCREENS
(
pWin
->
drawable
,
pParent
->
drawable
))
if
(
SAME_SCREENS
(
pWin
->
drawable
,
pParent
->
drawable
))
...
@@ -671,7 +671,7 @@ ProcMapWindow(register ClientPtr client)
...
@@ -671,7 +671,7 @@ ProcMapWindow(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
MapWindow
(
pWin
,
client
);
MapWindow
(
pWin
,
client
);
...
@@ -687,7 +687,7 @@ ProcMapSubwindows(register ClientPtr client)
...
@@ -687,7 +687,7 @@ ProcMapSubwindows(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
MapSubwindows
(
pWin
,
client
);
MapSubwindows
(
pWin
,
client
);
...
@@ -703,7 +703,7 @@ ProcUnmapWindow(register ClientPtr client)
...
@@ -703,7 +703,7 @@ ProcUnmapWindow(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
UnmapWindow
(
pWin
,
FALSE
);
UnmapWindow
(
pWin
,
FALSE
);
...
@@ -719,7 +719,7 @@ ProcUnmapSubwindows(register ClientPtr client)
...
@@ -719,7 +719,7 @@ ProcUnmapSubwindows(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
UnmapSubwindows
(
pWin
);
UnmapSubwindows
(
pWin
);
...
@@ -736,7 +736,7 @@ ProcConfigureWindow(register ClientPtr client)
...
@@ -736,7 +736,7 @@ ProcConfigureWindow(register ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xConfigureWindowReq
);
REQUEST_AT_LEAST_SIZE
(
xConfigureWindowReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
len
=
client
->
req_len
-
(
sizeof
(
xConfigureWindowReq
)
>>
2
);
len
=
client
->
req_len
-
(
sizeof
(
xConfigureWindowReq
)
>>
2
);
...
@@ -764,7 +764,7 @@ ProcCirculateWindow(register ClientPtr client)
...
@@ -764,7 +764,7 @@ ProcCirculateWindow(register ClientPtr client)
return
BadValue
;
return
BadValue
;
}
}
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
CirculateWindow
(
pWin
,
(
int
)
stuff
->
direction
,
client
);
CirculateWindow
(
pWin
,
(
int
)
stuff
->
direction
,
client
);
...
@@ -778,7 +778,7 @@ GetGeometry(register ClientPtr client, xGetGeometryReply *rep)
...
@@ -778,7 +778,7 @@ GetGeometry(register ClientPtr client, xGetGeometryReply *rep)
REQUEST
(
xResourceReq
);
REQUEST
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
SECURITY_VERIFY_GEOMETRABLE
(
pDraw
,
stuff
->
id
,
client
,
Security
ReadAccess
);
SECURITY_VERIFY_GEOMETRABLE
(
pDraw
,
stuff
->
id
,
client
,
Dix
ReadAccess
);
memset
(
rep
,
0
,
sizeof
(
xGetGeometryReply
));
memset
(
rep
,
0
,
sizeof
(
xGetGeometryReply
));
rep
->
type
=
X_Reply
;
rep
->
type
=
X_Reply
;
rep
->
length
=
0
;
rep
->
length
=
0
;
...
@@ -839,7 +839,7 @@ ProcQueryTree(register ClientPtr client)
...
@@ -839,7 +839,7 @@ ProcQueryTree(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
memset
(
&
reply
,
0
,
sizeof
(
xQueryTreeReply
));
memset
(
&
reply
,
0
,
sizeof
(
xQueryTreeReply
));
...
@@ -957,7 +957,7 @@ ProcSetSelectionOwner(register ClientPtr client)
...
@@ -957,7 +957,7 @@ ProcSetSelectionOwner(register ClientPtr client)
if
(
stuff
->
window
!=
None
)
if
(
stuff
->
window
!=
None
)
{
{
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
}
}
...
@@ -1079,7 +1079,7 @@ ProcConvertSelection(register ClientPtr client)
...
@@ -1079,7 +1079,7 @@ ProcConvertSelection(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xConvertSelectionReq
);
REQUEST_SIZE_MATCH
(
xConvertSelectionReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
requestor
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
requestor
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
...
@@ -1098,7 +1098,7 @@ ProcConvertSelection(register ClientPtr client)
...
@@ -1098,7 +1098,7 @@ ProcConvertSelection(register ClientPtr client)
#ifdef XCSECURITY
#ifdef XCSECURITY
&&
(
!
client
->
CheckAccess
||
&&
(
!
client
->
CheckAccess
||
(
*
client
->
CheckAccess
)(
client
,
CurrentSelections
[
i
].
window
,
(
*
client
->
CheckAccess
)(
client
,
CurrentSelections
[
i
].
window
,
RT_WINDOW
,
Security
ReadAccess
,
RT_WINDOW
,
Dix
ReadAccess
,
CurrentSelections
[
i
].
pWin
))
CurrentSelections
[
i
].
pWin
))
#endif
#endif
)
)
...
@@ -1208,11 +1208,11 @@ ProcTranslateCoords(register ClientPtr client)
...
@@ -1208,11 +1208,11 @@ ProcTranslateCoords(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xTranslateCoordsReq
);
REQUEST_SIZE_MATCH
(
xTranslateCoordsReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
srcWid
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
srcWid
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
pDst
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
dstWid
,
client
,
pDst
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
dstWid
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pDst
)
if
(
!
pDst
)
return
(
BadWindow
);
return
(
BadWindow
);
memset
(
&
rep
,
0
,
sizeof
(
xTranslateCoordsReply
));
memset
(
&
rep
,
0
,
sizeof
(
xTranslateCoordsReply
));
...
@@ -1305,7 +1305,7 @@ ProcCloseFont(register ClientPtr client)
...
@@ -1305,7 +1305,7 @@ ProcCloseFont(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_FONT
,
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_FONT
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
pFont
!=
(
FontPtr
)
NULL
)
/* id was valid */
if
(
pFont
!=
(
FontPtr
)
NULL
)
/* id was valid */
{
{
FreeResource
(
stuff
->
id
,
RT_NONE
);
FreeResource
(
stuff
->
id
,
RT_NONE
);
...
@@ -1331,12 +1331,12 @@ ProcQueryFont(register ClientPtr client)
...
@@ -1331,12 +1331,12 @@ ProcQueryFont(register ClientPtr client)
client
->
errorValue
=
stuff
->
id
;
/* EITHER font or gc */
client
->
errorValue
=
stuff
->
id
;
/* EITHER font or gc */
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_FONT
,
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_FONT
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFont
)
if
(
!
pFont
)
{
{
/* can't use VERIFY_GC because it might return BadGC */
/* can't use VERIFY_GC because it might return BadGC */
pGC
=
(
GC
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_GC
,
pGC
=
(
GC
*
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_GC
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pGC
)
if
(
!
pGC
)
{
{
client
->
errorValue
=
stuff
->
id
;
client
->
errorValue
=
stuff
->
id
;
...
@@ -1394,11 +1394,11 @@ ProcQueryTextExtents(register ClientPtr client)
...
@@ -1394,11 +1394,11 @@ ProcQueryTextExtents(register ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xQueryTextExtentsReq
);
REQUEST_AT_LEAST_SIZE
(
xQueryTextExtentsReq
);
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
fid
,
RT_FONT
,
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
fid
,
RT_FONT
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFont
)
if
(
!
pFont
)
{
{
pGC
=
(
GC
*
)
SecurityLookupIDByType
(
client
,
stuff
->
fid
,
RT_GC
,
pGC
=
(
GC
*
)
SecurityLookupIDByType
(
client
,
stuff
->
fid
,
RT_GC
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pGC
)
if
(
!
pGC
)
{
{
client
->
errorValue
=
stuff
->
fid
;
client
->
errorValue
=
stuff
->
fid
;
...
@@ -1479,7 +1479,7 @@ ProcCreatePixmap(register ClientPtr client)
...
@@ -1479,7 +1479,7 @@ ProcCreatePixmap(register ClientPtr client)
client
->
errorValue
=
stuff
->
pid
;
client
->
errorValue
=
stuff
->
pid
;
LEGAL_NEW_RESOURCE
(
stuff
->
pid
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
pid
,
client
);
SECURITY_VERIFY_GEOMETRABLE
(
pDraw
,
stuff
->
drawable
,
client
,
SECURITY_VERIFY_GEOMETRABLE
(
pDraw
,
stuff
->
drawable
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
stuff
->
width
||
!
stuff
->
height
)
if
(
!
stuff
->
width
||
!
stuff
->
height
)
{
{
client
->
errorValue
=
0
;
client
->
errorValue
=
0
;
...
@@ -1535,7 +1535,7 @@ ProcFreePixmap(register ClientPtr client)
...
@@ -1535,7 +1535,7 @@ ProcFreePixmap(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pMap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_PIXMAP
,
pMap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_PIXMAP
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
pMap
)
if
(
pMap
)
{
{
FreeResource
(
stuff
->
id
,
RT_NONE
);
FreeResource
(
stuff
->
id
,
RT_NONE
);
...
@@ -1562,7 +1562,7 @@ ProcCreateGC(register ClientPtr client)
...
@@ -1562,7 +1562,7 @@ ProcCreateGC(register ClientPtr client)
client
->
errorValue
=
stuff
->
gc
;
client
->
errorValue
=
stuff
->
gc
;
LEGAL_NEW_RESOURCE
(
stuff
->
gc
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
gc
,
client
);
SECURITY_VERIFY_DRAWABLE
(
pDraw
,
stuff
->
drawable
,
client
,
SECURITY_VERIFY_DRAWABLE
(
pDraw
,
stuff
->
drawable
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
len
=
client
->
req_len
-
(
sizeof
(
xCreateGCReq
)
>>
2
);
len
=
client
->
req_len
-
(
sizeof
(
xCreateGCReq
)
>>
2
);
if
(
len
!=
Ones
(
stuff
->
mask
))
if
(
len
!=
Ones
(
stuff
->
mask
))
return
BadLength
;
return
BadLength
;
...
@@ -1584,7 +1584,7 @@ ProcChangeGC(register ClientPtr client)
...
@@ -1584,7 +1584,7 @@ ProcChangeGC(register ClientPtr client)
unsigned
len
;
unsigned
len
;
REQUEST_AT_LEAST_SIZE
(
xChangeGCReq
);
REQUEST_AT_LEAST_SIZE
(
xChangeGCReq
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
gc
,
client
,
Security
WriteAccess
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
gc
,
client
,
Dix
WriteAccess
);
len
=
client
->
req_len
-
(
sizeof
(
xChangeGCReq
)
>>
2
);
len
=
client
->
req_len
-
(
sizeof
(
xChangeGCReq
)
>>
2
);
if
(
len
!=
Ones
(
stuff
->
mask
))
if
(
len
!=
Ones
(
stuff
->
mask
))
return
BadLength
;
return
BadLength
;
...
@@ -1608,8 +1608,8 @@ ProcCopyGC(register ClientPtr client)
...
@@ -1608,8 +1608,8 @@ ProcCopyGC(register ClientPtr client)
REQUEST
(
xCopyGCReq
);
REQUEST
(
xCopyGCReq
);
REQUEST_SIZE_MATCH
(
xCopyGCReq
);
REQUEST_SIZE_MATCH
(
xCopyGCReq
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
srcGC
,
client
,
Security
ReadAccess
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
srcGC
,
client
,
Dix
ReadAccess
);
SECURITY_VERIFY_GC
(
dstGC
,
stuff
->
dstGC
,
client
,
Security
WriteAccess
);
SECURITY_VERIFY_GC
(
dstGC
,
stuff
->
dstGC
,
client
,
Dix
WriteAccess
);
if
((
dstGC
->
pScreen
!=
pGC
->
pScreen
)
||
(
dstGC
->
depth
!=
pGC
->
depth
))
if
((
dstGC
->
pScreen
!=
pGC
->
pScreen
)
||
(
dstGC
->
depth
!=
pGC
->
depth
))
return
(
BadMatch
);
return
(
BadMatch
);
result
=
CopyGC
(
pGC
,
dstGC
,
stuff
->
mask
);
result
=
CopyGC
(
pGC
,
dstGC
,
stuff
->
mask
);
...
@@ -1636,7 +1636,7 @@ ProcSetDashes(register ClientPtr client)
...
@@ -1636,7 +1636,7 @@ ProcSetDashes(register ClientPtr client)
return
BadValue
;
return
BadValue
;
}
}
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
gc
,
client
,
Security
WriteAccess
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
gc
,
client
,
Dix
WriteAccess
);
result
=
SetDashes
(
pGC
,
stuff
->
dashOffset
,
stuff
->
nDashes
,
result
=
SetDashes
(
pGC
,
stuff
->
dashOffset
,
stuff
->
nDashes
,
(
unsigned
char
*
)
&
stuff
[
1
]);
(
unsigned
char
*
)
&
stuff
[
1
]);
...
@@ -1664,7 +1664,7 @@ ProcSetClipRectangles(register ClientPtr client)
...
@@ -1664,7 +1664,7 @@ ProcSetClipRectangles(register ClientPtr client)
client
->
errorValue
=
stuff
->
ordering
;
client
->
errorValue
=
stuff
->
ordering
;
return
BadValue
;
return
BadValue
;
}
}
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
gc
,
client
,
Security
WriteAccess
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
gc
,
client
,
Dix
WriteAccess
);
nr
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xSetClipRectanglesReq
);
nr
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xSetClipRectanglesReq
);
if
(
nr
&
4
)
if
(
nr
&
4
)
...
@@ -1685,7 +1685,7 @@ ProcFreeGC(register ClientPtr client)
...
@@ -1685,7 +1685,7 @@ ProcFreeGC(register ClientPtr client)
REQUEST
(
xResourceReq
);
REQUEST
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
id
,
client
,
Security
DestroyAccess
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
id
,
client
,
Dix
DestroyAccess
);
FreeResource
(
stuff
->
id
,
RT_NONE
);
FreeResource
(
stuff
->
id
,
RT_NONE
);
return
(
client
->
noClientException
);
return
(
client
->
noClientException
);
}
}
...
@@ -1698,7 +1698,7 @@ ProcClearToBackground(register ClientPtr client)
...
@@ -1698,7 +1698,7 @@ ProcClearToBackground(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xClearAreaReq
);
REQUEST_SIZE_MATCH
(
xClearAreaReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
pWin
->
drawable
.
class
==
InputOnly
)
if
(
pWin
->
drawable
.
class
==
InputOnly
)
...
@@ -1732,7 +1732,7 @@ ProcCopyArea(register ClientPtr client)
...
@@ -1732,7 +1732,7 @@ ProcCopyArea(register ClientPtr client)
if
(
stuff
->
dstDrawable
!=
stuff
->
srcDrawable
)
if
(
stuff
->
dstDrawable
!=
stuff
->
srcDrawable
)
{
{
SECURITY_VERIFY_DRAWABLE
(
pSrc
,
stuff
->
srcDrawable
,
client
,
SECURITY_VERIFY_DRAWABLE
(
pSrc
,
stuff
->
srcDrawable
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
((
pDst
->
pScreen
!=
pSrc
->
pScreen
)
||
(
pDst
->
depth
!=
pSrc
->
depth
))
if
((
pDst
->
pScreen
!=
pSrc
->
pScreen
)
||
(
pDst
->
depth
!=
pSrc
->
depth
))
{
{
client
->
errorValue
=
stuff
->
dstDrawable
;
client
->
errorValue
=
stuff
->
dstDrawable
;
...
@@ -1772,7 +1772,7 @@ ProcCopyPlane(register ClientPtr client)
...
@@ -1772,7 +1772,7 @@ ProcCopyPlane(register ClientPtr client)
if
(
stuff
->
dstDrawable
!=
stuff
->
srcDrawable
)
if
(
stuff
->
dstDrawable
!=
stuff
->
srcDrawable
)
{
{
SECURITY_VERIFY_DRAWABLE
(
psrcDraw
,
stuff
->
srcDrawable
,
client
,
SECURITY_VERIFY_DRAWABLE
(
psrcDraw
,
stuff
->
srcDrawable
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
pdstDraw
->
pScreen
!=
psrcDraw
->
pScreen
)
if
(
pdstDraw
->
pScreen
!=
psrcDraw
->
pScreen
)
{
{
client
->
errorValue
=
stuff
->
dstDrawable
;
client
->
errorValue
=
stuff
->
dstDrawable
;
...
@@ -2115,7 +2115,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
...
@@ -2115,7 +2115,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
client
->
errorValue
=
format
;
client
->
errorValue
=
format
;
return
(
BadValue
);
return
(
BadValue
);
}
}
SECURITY_VERIFY_DRAWABLE
(
pDraw
,
drawable
,
client
,
Security
ReadAccess
);
SECURITY_VERIFY_DRAWABLE
(
pDraw
,
drawable
,
client
,
Dix
ReadAccess
);
memset
(
&
xgi
,
0
,
sizeof
(
xGetImageReply
));
memset
(
&
xgi
,
0
,
sizeof
(
xGetImageReply
));
if
(
pDraw
->
type
==
DRAWABLE_WINDOW
)
if
(
pDraw
->
type
==
DRAWABLE_WINDOW
)
...
@@ -2447,7 +2447,7 @@ ProcCreateColormap(register ClientPtr client)
...
@@ -2447,7 +2447,7 @@ ProcCreateColormap(register ClientPtr client)
mid
=
stuff
->
mid
;
mid
=
stuff
->
mid
;
LEGAL_NEW_RESOURCE
(
mid
,
client
);
LEGAL_NEW_RESOURCE
(
mid
,
client
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
...
@@ -2477,7 +2477,7 @@ ProcFreeColormap(register ClientPtr client)
...
@@ -2477,7 +2477,7 @@ ProcFreeColormap(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pmap
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_COLORMAP
,
pmap
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_COLORMAP
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
pmap
)
if
(
pmap
)
{
{
/* Freeing a default colormap is a no-op */
/* Freeing a default colormap is a no-op */
...
@@ -2505,7 +2505,7 @@ ProcCopyColormapAndFree(register ClientPtr client)
...
@@ -2505,7 +2505,7 @@ ProcCopyColormapAndFree(register ClientPtr client)
mid
=
stuff
->
mid
;
mid
=
stuff
->
mid
;
LEGAL_NEW_RESOURCE
(
mid
,
client
);
LEGAL_NEW_RESOURCE
(
mid
,
client
);
if
(
(
pSrcMap
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
srcCmap
,
if
(
(
pSrcMap
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
srcCmap
,
RT_COLORMAP
,
SecurityReadAccess
|
Security
WriteAccess
))
)
RT_COLORMAP
,
DixReadAccess
|
Dix
WriteAccess
))
)
{
{
result
=
CopyColormapAndFree
(
mid
,
pSrcMap
,
client
->
index
);
result
=
CopyColormapAndFree
(
mid
,
pSrcMap
,
client
->
index
);
if
(
client
->
noClientException
!=
Success
)
if
(
client
->
noClientException
!=
Success
)
...
@@ -2528,7 +2528,7 @@ ProcInstallColormap(register ClientPtr client)
...
@@ -2528,7 +2528,7 @@ ProcInstallColormap(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_COLORMAP
,
Security
ReadAccess
);
RT_COLORMAP
,
Dix
ReadAccess
);
if
(
pcmp
)
if
(
pcmp
)
{
{
(
*
(
pcmp
->
pScreen
->
InstallColormap
))
(
pcmp
);
(
*
(
pcmp
->
pScreen
->
InstallColormap
))
(
pcmp
);
...
@@ -2549,7 +2549,7 @@ ProcUninstallColormap(register ClientPtr client)
...
@@ -2549,7 +2549,7 @@ ProcUninstallColormap(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_COLORMAP
,
Security
ReadAccess
);
RT_COLORMAP
,
Dix
ReadAccess
);
if
(
pcmp
)
if
(
pcmp
)
{
{
if
(
pcmp
->
mid
!=
pcmp
->
pScreen
->
defColormap
)
if
(
pcmp
->
mid
!=
pcmp
->
pScreen
->
defColormap
)
...
@@ -2573,7 +2573,7 @@ ProcListInstalledColormaps(register ClientPtr client)
...
@@ -2573,7 +2573,7 @@ ProcListInstalledColormaps(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
...
@@ -2608,7 +2608,7 @@ ProcAllocColor (register ClientPtr client)
...
@@ -2608,7 +2608,7 @@ ProcAllocColor (register ClientPtr client)
REQUEST_SIZE_MATCH
(
xAllocColorReq
);
REQUEST_SIZE_MATCH
(
xAllocColorReq
);
pmap
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
pmap
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
RT_COLORMAP
,
Security
WriteAccess
);
RT_COLORMAP
,
Dix
WriteAccess
);
if
(
pmap
)
if
(
pmap
)
{
{
acr
.
type
=
X_Reply
;
acr
.
type
=
X_Reply
;
...
@@ -2648,7 +2648,7 @@ ProcAllocNamedColor (register ClientPtr client)
...
@@ -2648,7 +2648,7 @@ ProcAllocNamedColor (register ClientPtr client)
REQUEST_FIXED_SIZE
(
xAllocNamedColorReq
,
stuff
->
nbytes
);
REQUEST_FIXED_SIZE
(
xAllocNamedColorReq
,
stuff
->
nbytes
);
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
RT_COLORMAP
,
Security
WriteAccess
);
RT_COLORMAP
,
Dix
WriteAccess
);
if
(
pcmp
)
if
(
pcmp
)
{
{
int
retval
;
int
retval
;
...
@@ -2700,7 +2700,7 @@ ProcAllocColorCells (register ClientPtr client)
...
@@ -2700,7 +2700,7 @@ ProcAllocColorCells (register ClientPtr client)
REQUEST_SIZE_MATCH
(
xAllocColorCellsReq
);
REQUEST_SIZE_MATCH
(
xAllocColorCellsReq
);
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
RT_COLORMAP
,
Security
WriteAccess
);
RT_COLORMAP
,
Dix
WriteAccess
);
if
(
pcmp
)
if
(
pcmp
)
{
{
xAllocColorCellsReply
accr
;
xAllocColorCellsReply
accr
;
...
@@ -2766,7 +2766,7 @@ ProcAllocColorPlanes(register ClientPtr client)
...
@@ -2766,7 +2766,7 @@ ProcAllocColorPlanes(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xAllocColorPlanesReq
);
REQUEST_SIZE_MATCH
(
xAllocColorPlanesReq
);
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
RT_COLORMAP
,
Security
WriteAccess
);
RT_COLORMAP
,
Dix
WriteAccess
);
if
(
pcmp
)
if
(
pcmp
)
{
{
xAllocColorPlanesReply
acpr
;
xAllocColorPlanesReply
acpr
;
...
@@ -2830,7 +2830,7 @@ ProcFreeColors(register ClientPtr client)
...
@@ -2830,7 +2830,7 @@ ProcFreeColors(register ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xFreeColorsReq
);
REQUEST_AT_LEAST_SIZE
(
xFreeColorsReq
);
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
RT_COLORMAP
,
Security
WriteAccess
);
RT_COLORMAP
,
Dix
WriteAccess
);
if
(
pcmp
)
if
(
pcmp
)
{
{
int
count
;
int
count
;
...
@@ -2865,7 +2865,7 @@ ProcStoreColors (ClientPtr client)
...
@@ -2865,7 +2865,7 @@ ProcStoreColors (ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xStoreColorsReq
);
REQUEST_AT_LEAST_SIZE
(
xStoreColorsReq
);
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
RT_COLORMAP
,
Security
WriteAccess
);
RT_COLORMAP
,
Dix
WriteAccess
);
if
(
pcmp
)
if
(
pcmp
)
{
{
int
count
;
int
count
;
...
@@ -2899,7 +2899,7 @@ ProcStoreNamedColor (register ClientPtr client)
...
@@ -2899,7 +2899,7 @@ ProcStoreNamedColor (register ClientPtr client)
REQUEST_FIXED_SIZE
(
xStoreNamedColorReq
,
stuff
->
nbytes
);
REQUEST_FIXED_SIZE
(
xStoreNamedColorReq
,
stuff
->
nbytes
);
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
RT_COLORMAP
,
Security
WriteAccess
);
RT_COLORMAP
,
Dix
WriteAccess
);
if
(
pcmp
)
if
(
pcmp
)
{
{
xColorItem
def
;
xColorItem
def
;
...
@@ -2933,7 +2933,7 @@ ProcQueryColors(register ClientPtr client)
...
@@ -2933,7 +2933,7 @@ ProcQueryColors(register ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xQueryColorsReq
);
REQUEST_AT_LEAST_SIZE
(
xQueryColorsReq
);
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
RT_COLORMAP
,
Security
ReadAccess
);
RT_COLORMAP
,
Dix
ReadAccess
);
if
(
pcmp
)
if
(
pcmp
)
{
{
int
count
,
retval
;
int
count
,
retval
;
...
@@ -2987,7 +2987,7 @@ ProcLookupColor(register ClientPtr client)
...
@@ -2987,7 +2987,7 @@ ProcLookupColor(register ClientPtr client)
REQUEST_FIXED_SIZE
(
xLookupColorReq
,
stuff
->
nbytes
);
REQUEST_FIXED_SIZE
(
xLookupColorReq
,
stuff
->
nbytes
);
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
pcmp
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cmap
,
RT_COLORMAP
,
Security
ReadAccess
);
RT_COLORMAP
,
Dix
ReadAccess
);
if
(
pcmp
)
if
(
pcmp
)
{
{
xLookupColorReply
lcr
;
xLookupColorReply
lcr
;
...
@@ -3037,9 +3037,9 @@ ProcCreateCursor (register ClientPtr client)
...
@@ -3037,9 +3037,9 @@ ProcCreateCursor (register ClientPtr client)
LEGAL_NEW_RESOURCE
(
stuff
->
cid
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
cid
,
client
);
src
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
source
,
src
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
source
,
RT_PIXMAP
,
Security
ReadAccess
);
RT_PIXMAP
,
Dix
ReadAccess
);
msk
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
mask
,
msk
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
mask
,
RT_PIXMAP
,
Security
ReadAccess
);
RT_PIXMAP
,
Dix
ReadAccess
);
if
(
src
==
(
PixmapPtr
)
NULL
)
if
(
src
==
(
PixmapPtr
)
NULL
)
{
{
client
->
errorValue
=
stuff
->
source
;
client
->
errorValue
=
stuff
->
source
;
...
@@ -3139,7 +3139,7 @@ ProcFreeCursor (register ClientPtr client)
...
@@ -3139,7 +3139,7 @@ ProcFreeCursor (register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pCursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
pCursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_CURSOR
,
Security
DestroyAccess
);
RT_CURSOR
,
Dix
DestroyAccess
);
if
(
pCursor
)
if
(
pCursor
)
{
{
FreeResource
(
stuff
->
id
,
RT_NONE
);
FreeResource
(
stuff
->
id
,
RT_NONE
);
...
@@ -3169,7 +3169,7 @@ ProcQueryBestSize (register ClientPtr client)
...
@@ -3169,7 +3169,7 @@ ProcQueryBestSize (register ClientPtr client)
return
(
BadValue
);
return
(
BadValue
);
}
}
SECURITY_VERIFY_GEOMETRABLE
(
pDraw
,
stuff
->
drawable
,
client
,
SECURITY_VERIFY_GEOMETRABLE
(
pDraw
,
stuff
->
drawable
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
stuff
->
class
!=
CursorShape
&&
pDraw
->
type
==
UNDRAWABLE_WINDOW
)
if
(
stuff
->
class
!=
CursorShape
&&
pDraw
->
type
==
UNDRAWABLE_WINDOW
)
return
(
BadMatch
);
return
(
BadMatch
);
pScreen
=
pDraw
->
pScreen
;
pScreen
=
pDraw
->
pScreen
;
...
...
nx-X11/programs/Xserver/dix/dixfonts.c
View file @
3c322ffb
...
@@ -1197,7 +1197,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
...
@@ -1197,7 +1197,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
if
(
c
->
slept
&&
if
(
c
->
slept
&&
c
->
pDraw
&&
c
->
pDraw
&&
c
->
pDraw
!=
(
DrawablePtr
)
SecurityLookupIDByClass
(
client
,
c
->
did
,
c
->
pDraw
!=
(
DrawablePtr
)
SecurityLookupIDByClass
(
client
,
c
->
did
,
RC_DRAWABLE
,
Security
WriteAccess
))
RC_DRAWABLE
,
Dix
WriteAccess
))
{
{
/* Our drawable has disappeared. Treat like client died... ask
/* Our drawable has disappeared. Treat like client died... ask
the FPE code to clean up after client and avoid further
the FPE code to clean up after client and avoid further
...
@@ -1227,7 +1227,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
...
@@ -1227,7 +1227,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
|
((
Font
)
*
(
c
->
pElt
+
2
))
<<
16
|
((
Font
)
*
(
c
->
pElt
+
2
))
<<
16
|
((
Font
)
*
(
c
->
pElt
+
1
))
<<
24
;
|
((
Font
)
*
(
c
->
pElt
+
1
))
<<
24
;
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
fid
,
RT_FONT
,
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
fid
,
RT_FONT
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFont
)
if
(
!
pFont
)
{
{
client
->
errorValue
=
fid
;
client
->
errorValue
=
fid
;
...
@@ -1489,7 +1489,7 @@ doImageText(ClientPtr client, register ITclosurePtr c)
...
@@ -1489,7 +1489,7 @@ doImageText(ClientPtr client, register ITclosurePtr c)
if
(
c
->
slept
&&
if
(
c
->
slept
&&
c
->
pDraw
&&
c
->
pDraw
&&
c
->
pDraw
!=
(
DrawablePtr
)
SecurityLookupIDByClass
(
client
,
c
->
did
,
c
->
pDraw
!=
(
DrawablePtr
)
SecurityLookupIDByClass
(
client
,
c
->
did
,
RC_DRAWABLE
,
Security
WriteAccess
))
RC_DRAWABLE
,
Dix
WriteAccess
))
{
{
/* Our drawable has disappeared. Treat like client died... ask
/* Our drawable has disappeared. Treat like client died... ask
the FPE code to clean up after client. */
the FPE code to clean up after client. */
...
@@ -2044,7 +2044,7 @@ FontPtr
...
@@ -2044,7 +2044,7 @@ FontPtr
find_old_font
(
XID
id
)
find_old_font
(
XID
id
)
{
{
return
(
FontPtr
)
SecurityLookupIDByType
(
NullClient
,
id
,
RT_NONE
,
return
(
FontPtr
)
SecurityLookupIDByType
(
NullClient
,
id
,
RT_NONE
,
Security
UnknownAccess
);
Dix
UnknownAccess
);
}
}
Font
Font
...
...
nx-X11/programs/Xserver/dix/dixutils.c
View file @
3c322ffb
...
@@ -260,13 +260,13 @@ SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode)
...
@@ -260,13 +260,13 @@ SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode)
WindowPtr
WindowPtr
LookupWindow
(
XID
rid
,
ClientPtr
client
)
LookupWindow
(
XID
rid
,
ClientPtr
client
)
{
{
return
SecurityLookupWindow
(
rid
,
client
,
Security
UnknownAccess
);
return
SecurityLookupWindow
(
rid
,
client
,
Dix
UnknownAccess
);
}
}
void
*
void
*
LookupDrawable
(
XID
rid
,
ClientPtr
client
)
LookupDrawable
(
XID
rid
,
ClientPtr
client
)
{
{
return
SecurityLookupDrawable
(
rid
,
client
,
Security
UnknownAccess
);
return
SecurityLookupDrawable
(
rid
,
client
,
Dix
UnknownAccess
);
}
}
#else
/* not XCSECURITY */
#else
/* not XCSECURITY */
...
@@ -317,7 +317,7 @@ ClientPtr
...
@@ -317,7 +317,7 @@ ClientPtr
LookupClient
(
XID
rid
,
ClientPtr
client
)
LookupClient
(
XID
rid
,
ClientPtr
client
)
{
{
void
*
pRes
=
(
void
*
)
SecurityLookupIDByClass
(
client
,
rid
,
RC_ANY
,
void
*
pRes
=
(
void
*
)
SecurityLookupIDByClass
(
client
,
rid
,
RC_ANY
,
Security
ReadAccess
);
Dix
ReadAccess
);
int
clientIndex
=
CLIENT_ID
(
rid
);
int
clientIndex
=
CLIENT_ID
(
rid
);
if
(
clientIndex
&&
pRes
&&
clients
[
clientIndex
]
&&
!
(
rid
&
SERVER_BIT
))
if
(
clientIndex
&&
pRes
&&
clients
[
clientIndex
]
&&
!
(
rid
&
SERVER_BIT
))
...
...
nx-X11/programs/Xserver/dix/events.c
View file @
3c322ffb
...
@@ -2201,7 +2201,7 @@ XineramaWarpPointer(ClientPtr client)
...
@@ -2201,7 +2201,7 @@ XineramaWarpPointer(ClientPtr client)
if
(
stuff
->
dstWid
!=
None
)
if
(
stuff
->
dstWid
!=
None
)
{
{
dest
=
SecurityLookupWindow
(
stuff
->
dstWid
,
client
,
Security
ReadAccess
);
dest
=
SecurityLookupWindow
(
stuff
->
dstWid
,
client
,
Dix
ReadAccess
);
if
(
!
dest
)
if
(
!
dest
)
return
BadWindow
;
return
BadWindow
;
}
}
...
@@ -2214,7 +2214,7 @@ XineramaWarpPointer(ClientPtr client)
...
@@ -2214,7 +2214,7 @@ XineramaWarpPointer(ClientPtr client)
XID
winID
=
stuff
->
srcWid
;
XID
winID
=
stuff
->
srcWid
;
WindowPtr
source
;
WindowPtr
source
;
source
=
SecurityLookupWindow
(
winID
,
client
,
Security
ReadAccess
);
source
=
SecurityLookupWindow
(
winID
,
client
,
Dix
ReadAccess
);
if
(
!
source
)
return
BadWindow
;
if
(
!
source
)
return
BadWindow
;
winX
=
source
->
drawable
.
x
;
winX
=
source
->
drawable
.
x
;
...
@@ -2281,7 +2281,7 @@ ProcWarpPointer(ClientPtr client)
...
@@ -2281,7 +2281,7 @@ ProcWarpPointer(ClientPtr client)
if
(
stuff
->
dstWid
!=
None
)
if
(
stuff
->
dstWid
!=
None
)
{
{
dest
=
SecurityLookupWindow
(
stuff
->
dstWid
,
client
,
Security
ReadAccess
);
dest
=
SecurityLookupWindow
(
stuff
->
dstWid
,
client
,
Dix
ReadAccess
);
if
(
!
dest
)
if
(
!
dest
)
return
BadWindow
;
return
BadWindow
;
}
}
...
@@ -2294,7 +2294,7 @@ ProcWarpPointer(ClientPtr client)
...
@@ -2294,7 +2294,7 @@ ProcWarpPointer(ClientPtr client)
XID
winID
=
stuff
->
srcWid
;
XID
winID
=
stuff
->
srcWid
;
WindowPtr
source
;
WindowPtr
source
;
source
=
SecurityLookupWindow
(
winID
,
client
,
Security
ReadAccess
);
source
=
SecurityLookupWindow
(
winID
,
client
,
Dix
ReadAccess
);
if
(
!
source
)
return
BadWindow
;
if
(
!
source
)
return
BadWindow
;
winX
=
source
->
drawable
.
x
;
winX
=
source
->
drawable
.
x
;
...
@@ -3469,7 +3469,7 @@ SetInputFocus(
...
@@ -3469,7 +3469,7 @@ SetInputFocus(
else
if
((
focusID
==
FollowKeyboard
)
&&
followOK
)
else
if
((
focusID
==
FollowKeyboard
)
&&
followOK
)
focusWin
=
inputInfo
.
keyboard
->
focus
->
win
;
focusWin
=
inputInfo
.
keyboard
->
focus
->
win
;
else
if
(
!
(
focusWin
=
SecurityLookupWindow
(
focusID
,
client
,
else
if
(
!
(
focusWin
=
SecurityLookupWindow
(
focusID
,
client
,
Security
ReadAccess
)))
Dix
ReadAccess
)))
return
BadWindow
;
return
BadWindow
;
else
else
{
{
...
@@ -3590,7 +3590,7 @@ ProcGrabPointer(ClientPtr client)
...
@@ -3590,7 +3590,7 @@ ProcGrabPointer(ClientPtr client)
client
->
errorValue
=
stuff
->
eventMask
;
client
->
errorValue
=
stuff
->
eventMask
;
return
BadValue
;
return
BadValue
;
}
}
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
if
(
stuff
->
confineTo
==
None
)
if
(
stuff
->
confineTo
==
None
)
...
@@ -3598,7 +3598,7 @@ ProcGrabPointer(ClientPtr client)
...
@@ -3598,7 +3598,7 @@ ProcGrabPointer(ClientPtr client)
else
else
{
{
confineTo
=
SecurityLookupWindow
(
stuff
->
confineTo
,
client
,
confineTo
=
SecurityLookupWindow
(
stuff
->
confineTo
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
confineTo
)
if
(
!
confineTo
)
return
BadWindow
;
return
BadWindow
;
}
}
...
@@ -3607,7 +3607,7 @@ ProcGrabPointer(ClientPtr client)
...
@@ -3607,7 +3607,7 @@ ProcGrabPointer(ClientPtr client)
else
else
{
{
cursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cursor
,
cursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cursor
,
RT_CURSOR
,
Security
ReadAccess
);
RT_CURSOR
,
Dix
ReadAccess
);
if
(
!
cursor
)
if
(
!
cursor
)
{
{
client
->
errorValue
=
stuff
->
cursor
;
client
->
errorValue
=
stuff
->
cursor
;
...
@@ -3682,7 +3682,7 @@ ProcChangeActivePointerGrab(ClientPtr client)
...
@@ -3682,7 +3682,7 @@ ProcChangeActivePointerGrab(ClientPtr client)
else
else
{
{
newCursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cursor
,
newCursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cursor
,
RT_CURSOR
,
Security
ReadAccess
);
RT_CURSOR
,
Dix
ReadAccess
);
if
(
!
newCursor
)
if
(
!
newCursor
)
{
{
client
->
errorValue
=
stuff
->
cursor
;
client
->
errorValue
=
stuff
->
cursor
;
...
@@ -3752,7 +3752,7 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
...
@@ -3752,7 +3752,7 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
client
->
errorValue
=
ownerEvents
;
client
->
errorValue
=
ownerEvents
;
return
BadValue
;
return
BadValue
;
}
}
pWin
=
SecurityLookupWindow
(
grabWindow
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
grabWindow
,
client
,
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
time
=
ClientTimeToServerTime
(
ctime
);
time
=
ClientTimeToServerTime
(
ctime
);
...
@@ -3842,7 +3842,7 @@ ProcQueryPointer(ClientPtr client)
...
@@ -3842,7 +3842,7 @@ ProcQueryPointer(ClientPtr client)
DeviceIntPtr
mouse
=
inputInfo
.
pointer
;
DeviceIntPtr
mouse
=
inputInfo
.
pointer
;
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
id
,
client
,
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
if
(
mouse
->
valuator
->
motionHintWindow
)
if
(
mouse
->
valuator
->
motionHintWindow
)
...
@@ -4009,7 +4009,7 @@ ProcSendEvent(ClientPtr client)
...
@@ -4009,7 +4009,7 @@ ProcSendEvent(ClientPtr client)
}
}
else
else
pWin
=
SecurityLookupWindow
(
stuff
->
destination
,
client
,
pWin
=
SecurityLookupWindow
(
stuff
->
destination
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
if
((
stuff
->
propagate
!=
xFalse
)
&&
(
stuff
->
propagate
!=
xTrue
))
if
((
stuff
->
propagate
!=
xFalse
)
&&
(
stuff
->
propagate
!=
xTrue
))
...
@@ -4048,7 +4048,7 @@ ProcUngrabKey(ClientPtr client)
...
@@ -4048,7 +4048,7 @@ ProcUngrabKey(ClientPtr client)
DeviceIntPtr
keybd
=
inputInfo
.
keyboard
;
DeviceIntPtr
keybd
=
inputInfo
.
keyboard
;
REQUEST_SIZE_MATCH
(
xUngrabKeyReq
);
REQUEST_SIZE_MATCH
(
xUngrabKeyReq
);
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
...
@@ -4119,7 +4119,7 @@ ProcGrabKey(ClientPtr client)
...
@@ -4119,7 +4119,7 @@ ProcGrabKey(ClientPtr client)
client
->
errorValue
=
stuff
->
modifiers
;
client
->
errorValue
=
stuff
->
modifiers
;
return
BadValue
;
return
BadValue
;
}
}
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
...
@@ -4171,14 +4171,14 @@ ProcGrabButton(ClientPtr client)
...
@@ -4171,14 +4171,14 @@ ProcGrabButton(ClientPtr client)
client
->
errorValue
=
stuff
->
eventMask
;
client
->
errorValue
=
stuff
->
eventMask
;
return
BadValue
;
return
BadValue
;
}
}
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
if
(
stuff
->
confineTo
==
None
)
if
(
stuff
->
confineTo
==
None
)
confineTo
=
NullWindow
;
confineTo
=
NullWindow
;
else
{
else
{
confineTo
=
SecurityLookupWindow
(
stuff
->
confineTo
,
client
,
confineTo
=
SecurityLookupWindow
(
stuff
->
confineTo
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
confineTo
)
if
(
!
confineTo
)
return
BadWindow
;
return
BadWindow
;
}
}
...
@@ -4187,7 +4187,7 @@ ProcGrabButton(ClientPtr client)
...
@@ -4187,7 +4187,7 @@ ProcGrabButton(ClientPtr client)
else
else
{
{
cursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cursor
,
cursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cursor
,
RT_CURSOR
,
Security
ReadAccess
);
RT_CURSOR
,
Dix
ReadAccess
);
if
(
!
cursor
)
if
(
!
cursor
)
{
{
client
->
errorValue
=
stuff
->
cursor
;
client
->
errorValue
=
stuff
->
cursor
;
...
@@ -4222,7 +4222,7 @@ ProcUngrabButton(ClientPtr client)
...
@@ -4222,7 +4222,7 @@ ProcUngrabButton(ClientPtr client)
client
->
errorValue
=
stuff
->
modifiers
;
client
->
errorValue
=
stuff
->
modifiers
;
return
BadValue
;
return
BadValue
;
}
}
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
tempGrab
.
resource
=
client
->
clientAsMask
;
tempGrab
.
resource
=
client
->
clientAsMask
;
...
@@ -4376,7 +4376,7 @@ ProcRecolorCursor(ClientPtr client)
...
@@ -4376,7 +4376,7 @@ ProcRecolorCursor(ClientPtr client)
REQUEST_SIZE_MATCH
(
xRecolorCursorReq
);
REQUEST_SIZE_MATCH
(
xRecolorCursorReq
);
pCursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cursor
,
pCursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
cursor
,
RT_CURSOR
,
Security
WriteAccess
);
RT_CURSOR
,
Dix
WriteAccess
);
if
(
!
pCursor
)
if
(
!
pCursor
)
{
{
client
->
errorValue
=
stuff
->
cursor
;
client
->
errorValue
=
stuff
->
cursor
;
...
...
nx-X11/programs/Xserver/dix/gc.c
View file @
3c322ffb
...
@@ -271,7 +271,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
...
@@ -271,7 +271,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
{
{
NEXTVAL
(
XID
,
newpix
);
NEXTVAL
(
XID
,
newpix
);
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
newpix
,
RT_PIXMAP
,
Security
ReadAccess
);
newpix
,
RT_PIXMAP
,
Dix
ReadAccess
);
}
}
if
(
pPixmap
)
if
(
pPixmap
)
{
{
...
@@ -307,7 +307,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
...
@@ -307,7 +307,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
{
{
NEXTVAL
(
XID
,
newstipple
)
NEXTVAL
(
XID
,
newstipple
)
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
newstipple
,
RT_PIXMAP
,
Security
ReadAccess
);
newstipple
,
RT_PIXMAP
,
Dix
ReadAccess
);
}
}
if
(
pPixmap
)
if
(
pPixmap
)
{
{
...
@@ -349,7 +349,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
...
@@ -349,7 +349,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
{
{
NEXTVAL
(
XID
,
newfont
)
NEXTVAL
(
XID
,
newfont
)
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
newfont
,
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
newfont
,
RT_FONT
,
Security
ReadAccess
);
RT_FONT
,
Dix
ReadAccess
);
}
}
if
(
pFont
)
if
(
pFont
)
{
{
...
@@ -416,7 +416,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
...
@@ -416,7 +416,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
}
}
else
else
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
pid
,
RT_PIXMAP
,
Security
ReadAccess
);
pid
,
RT_PIXMAP
,
Dix
ReadAccess
);
}
}
if
(
pPixmap
)
if
(
pPixmap
)
...
...
nx-X11/programs/Xserver/dix/property.c
View file @
3c322ffb
...
@@ -106,7 +106,7 @@ ProcRotateProperties(ClientPtr client)
...
@@ -106,7 +106,7 @@ ProcRotateProperties(ClientPtr client)
REQUEST_FIXED_SIZE
(
xRotatePropertiesReq
,
stuff
->
nAtoms
<<
2
);
REQUEST_FIXED_SIZE
(
xRotatePropertiesReq
,
stuff
->
nAtoms
<<
2
);
UpdateCurrentTime
();
UpdateCurrentTime
();
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
!
stuff
->
nAtoms
)
if
(
!
stuff
->
nAtoms
)
...
@@ -119,7 +119,7 @@ ProcRotateProperties(ClientPtr client)
...
@@ -119,7 +119,7 @@ ProcRotateProperties(ClientPtr client)
{
{
#ifdef XCSECURITY
#ifdef XCSECURITY
char
action
=
SecurityCheckPropertyAccess
(
client
,
pWin
,
atoms
[
i
],
char
action
=
SecurityCheckPropertyAccess
(
client
,
pWin
,
atoms
[
i
],
SecurityReadAccess
|
Security
WriteAccess
);
DixReadAccess
|
Dix
WriteAccess
);
#endif
#endif
if
(
!
ValidAtom
(
atoms
[
i
])
if
(
!
ValidAtom
(
atoms
[
i
])
#ifdef XCSECURITY
#ifdef XCSECURITY
...
@@ -219,7 +219,7 @@ ProcChangeProperty(ClientPtr client)
...
@@ -219,7 +219,7 @@ ProcChangeProperty(ClientPtr client)
REQUEST_FIXED_SIZE
(
xChangePropertyReq
,
totalSize
);
REQUEST_FIXED_SIZE
(
xChangePropertyReq
,
totalSize
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
!
ValidAtom
(
stuff
->
property
))
if
(
!
ValidAtom
(
stuff
->
property
))
...
@@ -235,7 +235,7 @@ ProcChangeProperty(ClientPtr client)
...
@@ -235,7 +235,7 @@ ProcChangeProperty(ClientPtr client)
#ifdef XCSECURITY
#ifdef XCSECURITY
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
Security
WriteAccess
))
Dix
WriteAccess
))
{
{
case
SecurityErrorOperation
:
case
SecurityErrorOperation
:
client
->
errorValue
=
stuff
->
property
;
client
->
errorValue
=
stuff
->
property
;
...
@@ -469,7 +469,7 @@ ProcGetProperty(ClientPtr client)
...
@@ -469,7 +469,7 @@ ProcGetProperty(ClientPtr client)
if
(
stuff
->
delete
)
if
(
stuff
->
delete
)
UpdateCurrentTime
();
UpdateCurrentTime
();
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
...
@@ -507,10 +507,10 @@ ProcGetProperty(ClientPtr client)
...
@@ -507,10 +507,10 @@ ProcGetProperty(ClientPtr client)
#ifdef XCSECURITY
#ifdef XCSECURITY
{
{
Mask
access_mode
=
Security
ReadAccess
;
Mask
access_mode
=
Dix
ReadAccess
;
if
(
stuff
->
delete
)
if
(
stuff
->
delete
)
access_mode
|=
Security
DestroyAccess
;
access_mode
|=
Dix
DestroyAccess
;
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
access_mode
))
access_mode
))
{
{
...
@@ -614,7 +614,7 @@ ProcListProperties(ClientPtr client)
...
@@ -614,7 +614,7 @@ ProcListProperties(ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
...
@@ -659,7 +659,7 @@ ProcDeleteProperty(register ClientPtr client)
...
@@ -659,7 +659,7 @@ ProcDeleteProperty(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xDeletePropertyReq
);
REQUEST_SIZE_MATCH
(
xDeletePropertyReq
);
UpdateCurrentTime
();
UpdateCurrentTime
();
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
!
ValidAtom
(
stuff
->
property
))
if
(
!
ValidAtom
(
stuff
->
property
))
...
@@ -670,7 +670,7 @@ ProcDeleteProperty(register ClientPtr client)
...
@@ -670,7 +670,7 @@ ProcDeleteProperty(register ClientPtr client)
#ifdef XCSECURITY
#ifdef XCSECURITY
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
Security
DestroyAccess
))
Dix
DestroyAccess
))
{
{
case
SecurityErrorOperation
:
case
SecurityErrorOperation
:
client
->
errorValue
=
stuff
->
property
;
client
->
errorValue
=
stuff
->
property
;
...
...
nx-X11/programs/Xserver/dix/resource.c
View file @
3c322ffb
...
@@ -878,14 +878,14 @@ void *
...
@@ -878,14 +878,14 @@ void *
LookupIDByType
(
XID
id
,
RESTYPE
rtype
)
LookupIDByType
(
XID
id
,
RESTYPE
rtype
)
{
{
return
SecurityLookupIDByType
(
NullClient
,
id
,
rtype
,
return
SecurityLookupIDByType
(
NullClient
,
id
,
rtype
,
Security
UnknownAccess
);
Dix
UnknownAccess
);
}
}
void
*
void
*
LookupIDByClass
(
XID
id
,
RESTYPE
classes
)
LookupIDByClass
(
XID
id
,
RESTYPE
classes
)
{
{
return
SecurityLookupIDByClass
(
NullClient
,
id
,
classes
,
return
SecurityLookupIDByClass
(
NullClient
,
id
,
classes
,
Security
UnknownAccess
);
Dix
UnknownAccess
);
}
}
#else
/* not XCSECURITY */
#else
/* not XCSECURITY */
...
...
nx-X11/programs/Xserver/dix/window.c
View file @
3c322ffb
...
@@ -1028,7 +1028,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
...
@@ -1028,7 +1028,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
else
else
{
{
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
pixID
,
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
pixID
,
RT_PIXMAP
,
Security
ReadAccess
);
RT_PIXMAP
,
Dix
ReadAccess
);
if
(
pPixmap
!=
(
PixmapPtr
)
NULL
)
if
(
pPixmap
!=
(
PixmapPtr
)
NULL
)
{
{
if
((
pPixmap
->
drawable
.
depth
!=
pWin
->
drawable
.
depth
)
||
if
((
pPixmap
->
drawable
.
depth
!=
pWin
->
drawable
.
depth
)
||
...
@@ -1089,7 +1089,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
...
@@ -1089,7 +1089,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
else
else
{
{
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
pixID
,
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
pixID
,
RT_PIXMAP
,
Security
ReadAccess
);
RT_PIXMAP
,
Dix
ReadAccess
);
if
(
pPixmap
)
if
(
pPixmap
)
{
{
if
((
pPixmap
->
drawable
.
depth
!=
pWin
->
drawable
.
depth
)
||
if
((
pPixmap
->
drawable
.
depth
!=
pWin
->
drawable
.
depth
)
||
...
@@ -1302,7 +1302,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
...
@@ -1302,7 +1302,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
goto
PatchUp
;
goto
PatchUp
;
}
}
pCmap
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
cmap
,
pCmap
=
(
ColormapPtr
)
SecurityLookupIDByType
(
client
,
cmap
,
RT_COLORMAP
,
Security
ReadAccess
);
RT_COLORMAP
,
Dix
ReadAccess
);
if
(
!
pCmap
)
if
(
!
pCmap
)
{
{
error
=
BadColor
;
error
=
BadColor
;
...
@@ -1378,7 +1378,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
...
@@ -1378,7 +1378,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
else
else
{
{
pCursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
cursorID
,
pCursor
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
cursorID
,
RT_CURSOR
,
Security
ReadAccess
);
RT_CURSOR
,
Dix
ReadAccess
);
if
(
!
pCursor
)
if
(
!
pCursor
)
{
{
error
=
BadCursor
;
error
=
BadCursor
;
...
@@ -2252,7 +2252,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
...
@@ -2252,7 +2252,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
sibwid
=
(
Window
)
*
pVlist
;
sibwid
=
(
Window
)
*
pVlist
;
pVlist
++
;
pVlist
++
;
pSib
=
(
WindowPtr
)
SecurityLookupIDByType
(
client
,
sibwid
,
pSib
=
(
WindowPtr
)
SecurityLookupIDByType
(
client
,
sibwid
,
RT_WINDOW
,
Security
ReadAccess
);
RT_WINDOW
,
Dix
ReadAccess
);
if
(
!
pSib
)
if
(
!
pSib
)
{
{
client
->
errorValue
=
sibwid
;
client
->
errorValue
=
sibwid
;
...
...
nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
View file @
3c322ffb
...
@@ -586,7 +586,7 @@ ProcReparentWindow(register ClientPtr client)
...
@@ -586,7 +586,7 @@ ProcReparentWindow(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xReparentWindowReq
);
REQUEST_SIZE_MATCH
(
xReparentWindowReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
...
@@ -596,7 +596,7 @@ ProcReparentWindow(register ClientPtr client)
...
@@ -596,7 +596,7 @@ ProcReparentWindow(register ClientPtr client)
}
}
pParent
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
parent
,
client
,
pParent
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
parent
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pParent
)
if
(
!
pParent
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
SAME_SCREENS
(
pWin
->
drawable
,
pParent
->
drawable
))
if
(
SAME_SCREENS
(
pWin
->
drawable
,
pParent
->
drawable
))
...
@@ -630,7 +630,7 @@ ProcQueryTree(register ClientPtr client)
...
@@ -630,7 +630,7 @@ ProcQueryTree(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
id
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
memset
(
&
reply
,
0
,
sizeof
(
xQueryTreeReply
));
memset
(
&
reply
,
0
,
sizeof
(
xQueryTreeReply
));
...
@@ -698,7 +698,7 @@ ProcSetSelectionOwner(register ClientPtr client)
...
@@ -698,7 +698,7 @@ ProcSetSelectionOwner(register ClientPtr client)
if
(
stuff
->
window
!=
None
)
if
(
stuff
->
window
!=
None
)
{
{
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
}
}
...
@@ -797,7 +797,7 @@ ProcConvertSelection(register ClientPtr client)
...
@@ -797,7 +797,7 @@ ProcConvertSelection(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xConvertSelectionReq
);
REQUEST_SIZE_MATCH
(
xConvertSelectionReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
requestor
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
requestor
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
...
@@ -837,7 +837,7 @@ ProcConvertSelection(register ClientPtr client)
...
@@ -837,7 +837,7 @@ ProcConvertSelection(register ClientPtr client)
#ifdef XCSECURITY
#ifdef XCSECURITY
&&
(
!
client
->
CheckAccess
||
&&
(
!
client
->
CheckAccess
||
(
*
client
->
CheckAccess
)(
client
,
CurrentSelections
[
i
].
window
,
(
*
client
->
CheckAccess
)(
client
,
CurrentSelections
[
i
].
window
,
RT_WINDOW
,
Security
ReadAccess
,
RT_WINDOW
,
Dix
ReadAccess
,
CurrentSelections
[
i
].
pWin
))
CurrentSelections
[
i
].
pWin
))
#endif
#endif
)
)
...
@@ -918,7 +918,7 @@ ProcCloseFont(register ClientPtr client)
...
@@ -918,7 +918,7 @@ ProcCloseFont(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_FONT
,
pFont
=
(
FontPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_FONT
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
pFont
!=
(
FontPtr
)
NULL
)
if
(
pFont
!=
(
FontPtr
)
NULL
)
{
{
#ifdef NXAGENT_SERVER
#ifdef NXAGENT_SERVER
...
@@ -1015,7 +1015,7 @@ ProcFreePixmap(register ClientPtr client)
...
@@ -1015,7 +1015,7 @@ ProcFreePixmap(register ClientPtr client)
REQUEST_SIZE_MATCH
(
xResourceReq
);
REQUEST_SIZE_MATCH
(
xResourceReq
);
pMap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_PIXMAP
,
pMap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
id
,
RT_PIXMAP
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
pMap
)
if
(
pMap
)
{
{
#ifdef NXAGENT_SERVER
#ifdef NXAGENT_SERVER
...
...
nx-X11/programs/Xserver/hw/nxagent/NXevents.c
View file @
3c322ffb
...
@@ -583,7 +583,7 @@ ProcSendEvent(ClientPtr client)
...
@@ -583,7 +583,7 @@ ProcSendEvent(ClientPtr client)
}
}
else
else
pWin
=
SecurityLookupWindow
(
stuff
->
destination
,
client
,
pWin
=
SecurityLookupWindow
(
stuff
->
destination
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
if
((
stuff
->
propagate
!=
xFalse
)
&&
(
stuff
->
propagate
!=
xTrue
))
if
((
stuff
->
propagate
!=
xFalse
)
&&
(
stuff
->
propagate
!=
xTrue
))
...
...
nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
View file @
3c322ffb
...
@@ -131,7 +131,7 @@ ProcChangeProperty(ClientPtr client)
...
@@ -131,7 +131,7 @@ ProcChangeProperty(ClientPtr client)
if
(
pWin
==
NULL
)
if
(
pWin
==
NULL
)
#endif
#endif
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
!
ValidAtom
(
stuff
->
property
))
if
(
!
ValidAtom
(
stuff
->
property
))
...
@@ -147,7 +147,7 @@ ProcChangeProperty(ClientPtr client)
...
@@ -147,7 +147,7 @@ ProcChangeProperty(ClientPtr client)
#ifdef XCSECURITY
#ifdef XCSECURITY
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
Security
WriteAccess
))
Dix
WriteAccess
))
{
{
case
SecurityErrorOperation
:
case
SecurityErrorOperation
:
client
->
errorValue
=
stuff
->
property
;
client
->
errorValue
=
stuff
->
property
;
...
@@ -348,7 +348,7 @@ ProcGetProperty(ClientPtr client)
...
@@ -348,7 +348,7 @@ ProcGetProperty(ClientPtr client)
if
(
stuff
->
delete
)
if
(
stuff
->
delete
)
UpdateCurrentTime
();
UpdateCurrentTime
();
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
BadWindow
;
return
BadWindow
;
...
@@ -439,10 +439,10 @@ ProcGetProperty(ClientPtr client)
...
@@ -439,10 +439,10 @@ ProcGetProperty(ClientPtr client)
#ifdef XCSECURITY
#ifdef XCSECURITY
{
{
Mask
access_mode
=
Security
ReadAccess
;
Mask
access_mode
=
Dix
ReadAccess
;
if
(
stuff
->
delete
)
if
(
stuff
->
delete
)
access_mode
|=
Security
DestroyAccess
;
access_mode
|=
Dix
DestroyAccess
;
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
access_mode
))
access_mode
))
{
{
...
...
nx-X11/programs/Xserver/hw/nxagent/NXrender.c
View file @
3c322ffb
...
@@ -385,11 +385,11 @@ ProcRenderCreatePicture (ClientPtr client)
...
@@ -385,11 +385,11 @@ ProcRenderCreatePicture (ClientPtr client)
LEGAL_NEW_RESOURCE
(
stuff
->
pid
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
pid
,
client
);
SECURITY_VERIFY_DRAWABLE
(
pDrawable
,
stuff
->
drawable
,
client
,
SECURITY_VERIFY_DRAWABLE
(
pDrawable
,
stuff
->
drawable
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
format
,
stuff
->
format
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFormat
)
if
(
!
pFormat
)
{
{
client
->
errorValue
=
stuff
->
format
;
client
->
errorValue
=
stuff
->
format
;
...
@@ -426,7 +426,7 @@ ProcRenderChangePicture (ClientPtr client)
...
@@ -426,7 +426,7 @@ ProcRenderChangePicture (ClientPtr client)
int
error
;
int
error
;
REQUEST_AT_LEAST_SIZE
(
xRenderChangePictureReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderChangePictureReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
len
=
client
->
req_len
-
(
sizeof
(
xRenderChangePictureReq
)
>>
2
);
len
=
client
->
req_len
-
(
sizeof
(
xRenderChangePictureReq
)
>>
2
);
...
@@ -450,7 +450,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client)
...
@@ -450,7 +450,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client)
int
result
;
int
result
;
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureClipRectanglesReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureClipRectanglesReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pPicture
->
pDrawable
)
if
(
!
pPicture
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -558,13 +558,13 @@ ProcRenderComposite (ClientPtr client)
...
@@ -558,13 +558,13 @@ ProcRenderComposite (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
SecurityReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_ALPHA
(
pMask
,
stuff
->
mask
,
client
,
SecurityReadAccess
,
VERIFY_ALPHA
(
pMask
,
stuff
->
mask
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
((
pSrc
->
pDrawable
&&
pSrc
->
pDrawable
->
pScreen
!=
pDst
->
pDrawable
->
pScreen
)
||
if
((
pSrc
->
pDrawable
&&
pSrc
->
pDrawable
->
pScreen
!=
pDst
->
pDrawable
->
pScreen
)
||
...
@@ -687,9 +687,9 @@ ProcRenderTrapezoids (ClientPtr client)
...
@@ -687,9 +687,9 @@ ProcRenderTrapezoids (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
SecurityReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
SecurityWriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -700,7 +700,7 @@ ProcRenderTrapezoids (ClientPtr client)
...
@@ -700,7 +700,7 @@ ProcRenderTrapezoids (ClientPtr client)
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
maskFormat
,
stuff
->
maskFormat
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFormat
)
if
(
!
pFormat
)
{
{
client
->
errorValue
=
stuff
->
maskFormat
;
client
->
errorValue
=
stuff
->
maskFormat
;
...
@@ -758,7 +758,7 @@ ProcRenderCreateGlyphSet (ClientPtr client)
...
@@ -758,7 +758,7 @@ ProcRenderCreateGlyphSet (ClientPtr client)
format
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
format
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
format
,
stuff
->
format
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
format
)
if
(
!
format
)
{
{
client
->
errorValue
=
stuff
->
format
;
client
->
errorValue
=
stuff
->
format
;
...
@@ -809,7 +809,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client)
...
@@ -809,7 +809,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
existing
,
stuff
->
existing
,
GlyphSetType
,
GlyphSetType
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
stuff
->
existing
;
client
->
errorValue
=
stuff
->
existing
;
...
@@ -834,7 +834,7 @@ ProcRenderFreeGlyphSet (ClientPtr client)
...
@@ -834,7 +834,7 @@ ProcRenderFreeGlyphSet (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
glyphset
,
stuff
->
glyphset
,
GlyphSetType
,
GlyphSetType
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
stuff
->
glyphset
;
client
->
errorValue
=
stuff
->
glyphset
;
...
@@ -860,7 +860,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
...
@@ -860,7 +860,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
glyphset
,
stuff
->
glyphset
,
GlyphSetType
,
GlyphSetType
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
stuff
->
glyphset
;
client
->
errorValue
=
stuff
->
glyphset
;
...
@@ -928,9 +928,9 @@ ProcRenderCompositeGlyphs (ClientPtr client)
...
@@ -928,9 +928,9 @@ ProcRenderCompositeGlyphs (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
Security
ReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
Dix
ReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -941,7 +941,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
...
@@ -941,7 +941,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
maskFormat
,
stuff
->
maskFormat
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFormat
)
if
(
!
pFormat
)
{
{
client
->
errorValue
=
stuff
->
maskFormat
;
client
->
errorValue
=
stuff
->
maskFormat
;
...
@@ -954,7 +954,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
...
@@ -954,7 +954,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
glyphset
,
stuff
->
glyphset
,
GlyphSetType
,
GlyphSetType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
stuff
->
glyphset
;
client
->
errorValue
=
stuff
->
glyphset
;
...
@@ -1027,7 +1027,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
...
@@ -1027,7 +1027,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
gs
,
gs
,
GlyphSetType
,
GlyphSetType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
gs
;
client
->
errorValue
=
gs
;
...
@@ -1163,7 +1163,7 @@ ProcRenderFillRectangles (ClientPtr client)
...
@@ -1163,7 +1163,7 @@ ProcRenderFillRectangles (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
SecurityWriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -1212,7 +1212,7 @@ ProcRenderCreateCursor (ClientPtr client)
...
@@ -1212,7 +1212,7 @@ ProcRenderCreateCursor (ClientPtr client)
REQUEST_SIZE_MATCH
(
xRenderCreateCursorReq
);
REQUEST_SIZE_MATCH
(
xRenderCreateCursorReq
);
LEGAL_NEW_RESOURCE
(
stuff
->
cid
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
cid
,
client
);
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
SecurityReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pSrc
->
pDrawable
)
if
(
!
pSrc
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -1430,7 +1430,7 @@ ProcRenderSetPictureTransform (ClientPtr client)
...
@@ -1430,7 +1430,7 @@ ProcRenderSetPictureTransform (ClientPtr client)
int
result
;
int
result
;
REQUEST_SIZE_MATCH
(
xRenderSetPictureTransformReq
);
REQUEST_SIZE_MATCH
(
xRenderSetPictureTransformReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
result
=
SetPictureTransform
(
pPicture
,
(
PictTransform
*
)
&
stuff
->
transform
);
result
=
SetPictureTransform
(
pPicture
,
(
PictTransform
*
)
&
stuff
->
transform
);
...
@@ -1453,7 +1453,7 @@ ProcRenderSetPictureFilter (ClientPtr client)
...
@@ -1453,7 +1453,7 @@ ProcRenderSetPictureFilter (ClientPtr client)
char
*
name
;
char
*
name
;
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureFilterReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureFilterReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
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
));
...
@@ -1490,7 +1490,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
...
@@ -1490,7 +1490,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
for
(
i
=
0
;
i
<
ncursor
;
i
++
)
for
(
i
=
0
;
i
<
ncursor
;
i
++
)
{
{
cursors
[
i
]
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
elt
->
cursor
,
cursors
[
i
]
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
elt
->
cursor
,
RT_CURSOR
,
Security
ReadAccess
);
RT_CURSOR
,
Dix
ReadAccess
);
if
(
!
cursors
[
i
])
if
(
!
cursors
[
i
])
{
{
free
(
cursors
);
free
(
cursors
);
...
...
nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
View file @
3c322ffb
...
@@ -503,7 +503,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
...
@@ -503,7 +503,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
sibwid
=
(
Window
)
*
pVlist
;
sibwid
=
(
Window
)
*
pVlist
;
pVlist
++
;
pVlist
++
;
pSib
=
(
WindowPtr
)
SecurityLookupIDByType
(
client
,
sibwid
,
pSib
=
(
WindowPtr
)
SecurityLookupIDByType
(
client
,
sibwid
,
RT_WINDOW
,
Security
ReadAccess
);
RT_WINDOW
,
Dix
ReadAccess
);
if
(
!
pSib
)
if
(
!
pSib
)
{
{
client
->
errorValue
=
sibwid
;
client
->
errorValue
=
sibwid
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
3c322ffb
...
@@ -540,7 +540,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -540,7 +540,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if
((
wmHints
.
flags
&
IconPixmapHint
)
&&
(
wmHints
.
icon_pixmap
!=
None
))
if
((
wmHints
.
flags
&
IconPixmapHint
)
&&
(
wmHints
.
icon_pixmap
!=
None
))
{
{
PixmapPtr
icon
=
(
PixmapPtr
)
SecurityLookupIDByType
(
pClient
,
wmHints
.
icon_pixmap
,
PixmapPtr
icon
=
(
PixmapPtr
)
SecurityLookupIDByType
(
pClient
,
wmHints
.
icon_pixmap
,
RT_PIXMAP
,
Security
DestroyAccess
);
RT_PIXMAP
,
Dix
DestroyAccess
);
if
(
icon
)
if
(
icon
)
{
{
...
@@ -567,7 +567,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -567,7 +567,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if
((
wmHints
.
flags
&
IconWindowHint
)
&&
(
wmHints
.
icon_window
!=
None
))
if
((
wmHints
.
flags
&
IconWindowHint
)
&&
(
wmHints
.
icon_window
!=
None
))
{
{
WindowPtr
icon
=
(
WindowPtr
)
SecurityLookupWindow
(
wmHints
.
icon_window
,
pClient
,
WindowPtr
icon
=
(
WindowPtr
)
SecurityLookupWindow
(
wmHints
.
icon_window
,
pClient
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
icon
)
if
(
icon
)
{
{
...
@@ -589,7 +589,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -589,7 +589,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if
((
wmHints
.
flags
&
IconMaskHint
)
&&
(
wmHints
.
icon_mask
!=
None
))
if
((
wmHints
.
flags
&
IconMaskHint
)
&&
(
wmHints
.
icon_mask
!=
None
))
{
{
PixmapPtr
icon
=
(
PixmapPtr
)
SecurityLookupIDByType
(
pClient
,
wmHints
.
icon_mask
,
PixmapPtr
icon
=
(
PixmapPtr
)
SecurityLookupIDByType
(
pClient
,
wmHints
.
icon_mask
,
RT_PIXMAP
,
Security
DestroyAccess
);
RT_PIXMAP
,
Dix
DestroyAccess
);
if
(
icon
)
if
(
icon
)
{
{
...
@@ -611,7 +611,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -611,7 +611,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if
((
wmHints
.
flags
&
WindowGroupHint
)
&&
(
wmHints
.
window_group
!=
None
))
if
((
wmHints
.
flags
&
WindowGroupHint
)
&&
(
wmHints
.
window_group
!=
None
))
{
{
WindowPtr
window
=
(
WindowPtr
)
SecurityLookupWindow
(
wmHints
.
window_group
,
pClient
,
WindowPtr
window
=
(
WindowPtr
)
SecurityLookupWindow
(
wmHints
.
window_group
,
pClient
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
window
)
if
(
window
)
{
{
...
@@ -695,7 +695,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -695,7 +695,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
for
(
i
=
0
;
i
<
nUnits
;
i
++
)
for
(
i
=
0
;
i
<
nUnits
;
i
++
)
{
{
pWindow
=
(
WindowPtr
)
SecurityLookupWindow
(
input
[
i
],
pClient
,
pWindow
=
(
WindowPtr
)
SecurityLookupWindow
(
input
[
i
],
pClient
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
((
input
[
i
]
!=
None
)
&&
pWindow
)
if
((
input
[
i
]
!=
None
)
&&
pWindow
)
{
{
wind
[
i
]
=
nxagentWindow
(
pWindow
);
wind
[
i
]
=
nxagentWindow
(
pWindow
);
...
...
nx-X11/programs/Xserver/include/dix.h
View file @
3c322ffb
...
@@ -138,13 +138,13 @@ SOFTWARE.
...
@@ -138,13 +138,13 @@ SOFTWARE.
}
}
#define VERIFY_DRAWABLE(pDraw, did, client)\
#define VERIFY_DRAWABLE(pDraw, did, client)\
SECURITY_VERIFY_DRAWABLE(pDraw, did, client,
Security
UnknownAccess)
SECURITY_VERIFY_DRAWABLE(pDraw, did, client,
Dix
UnknownAccess)
#define VERIFY_GEOMETRABLE(pDraw, did, client)\
#define VERIFY_GEOMETRABLE(pDraw, did, client)\
SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client,
Security
UnknownAccess)
SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client,
Dix
UnknownAccess)
#define VERIFY_GC(pGC, rid, client)\
#define VERIFY_GC(pGC, rid, client)\
SECURITY_VERIFY_GC(pGC, rid, client,
Security
UnknownAccess)
SECURITY_VERIFY_GC(pGC, rid, client,
Dix
UnknownAccess)
#else
/* not XCSECURITY */
#else
/* not XCSECURITY */
...
@@ -255,8 +255,8 @@ SOFTWARE.
...
@@ -255,8 +255,8 @@ SOFTWARE.
if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\
if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\
(client->lastDrawableID != drawID))\
(client->lastDrawableID != drawID))\
{\
{\
SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client,
Security
WriteAccess);\
SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client,
Dix
WriteAccess);\
SECURITY_VERIFY_GC(pGC, stuff->gc, client,
Security
ReadAccess);\
SECURITY_VERIFY_GC(pGC, stuff->gc, client,
Dix
ReadAccess);\
if ((pGC->depth != pDraw->depth) ||\
if ((pGC->depth != pDraw->depth) ||\
(pGC->pScreen != pDraw->pScreen))\
(pGC->pScreen != pDraw->pScreen))\
return (BadMatch);\
return (BadMatch);\
...
...
nx-X11/programs/Xserver/include/resource.h
View file @
3c322ffb
...
@@ -220,10 +220,10 @@ extern void * LookupClientResourceComplex(
...
@@ -220,10 +220,10 @@ extern void * LookupClientResourceComplex(
* simultaneously.
* simultaneously.
*/
*/
#define
Security
UnknownAccess 0
/* don't know intentions */
#define
Dix
UnknownAccess 0
/* don't know intentions */
#define
Security
ReadAccess (1<<0)
/* inspecting the object */
#define
Dix
ReadAccess (1<<0)
/* inspecting the object */
#define
Security
WriteAccess (1<<1)
/* changing the object */
#define
Dix
WriteAccess (1<<1)
/* changing the object */
#define
Security
DestroyAccess (1<<2)
/* destroying the object */
#define
Dix
DestroyAccess (1<<2)
/* destroying the object */
#ifdef XCSECURITY
#ifdef XCSECURITY
...
...
nx-X11/programs/Xserver/randr/randrstr.h
View file @
3c322ffb
...
@@ -443,12 +443,8 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType;
...
@@ -443,12 +443,8 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType;
(SecurityLookupIDByType (client, id, \
(SecurityLookupIDByType (client, id, \
RRProviderType, a)))
RRProviderType, a)))
#define DixUnknownAccess SecurityUnknownAccess
#define DixSetAttrAccess DixWriteAccess
#define DixReadAccess SecurityReadAccess
#define DixUseAccess DixWriteAccess
#define DixWriteAccess SecurityWriteAccess
#define DixSetAttrAccess SecurityWriteAccess
#define DixUseAccess SecurityWriteAccess
#define DixDestroyAccess SecurityDestroyAccess
#endif
#endif
...
...
nx-X11/programs/Xserver/randr/rrdispatch.c
View file @
3c322ffb
...
@@ -87,7 +87,7 @@ ProcRRSelectInput(ClientPtr client)
...
@@ -87,7 +87,7 @@ ProcRRSelectInput(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixReceiveAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixReceiveAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
WriteAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
WriteAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
if
(
rc
!=
Success
)
if
(
rc
!=
Success
)
...
...
nx-X11/programs/Xserver/randr/rrmode.c
View file @
3c322ffb
...
@@ -357,7 +357,7 @@ ProcRRCreateMode(ClientPtr client)
...
@@ -357,7 +357,7 @@ ProcRRCreateMode(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
if
(
rc
!=
Success
)
if
(
rc
!=
Success
)
...
...
nx-X11/programs/Xserver/randr/rrmonitor.c
View file @
3c322ffb
...
@@ -636,7 +636,7 @@ ProcRRGetMonitors(ClientPtr client)
...
@@ -636,7 +636,7 @@ ProcRRGetMonitors(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
r
=
dixLookupWindow
(
&
window
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
r
=
dixLookupWindow
(
&
window
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
window
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
window
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
r
=
window
?
Success
:
BadWindow
;
r
=
window
?
Success
:
BadWindow
;
#endif
#endif
...
@@ -723,7 +723,7 @@ ProcRRSetMonitor(ClientPtr client)
...
@@ -723,7 +723,7 @@ ProcRRSetMonitor(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
r
=
dixLookupWindow
(
&
window
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
r
=
dixLookupWindow
(
&
window
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
window
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
window
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
r
=
window
?
Success
:
BadWindow
;
r
=
window
?
Success
:
BadWindow
;
#endif
#endif
...
@@ -772,7 +772,7 @@ ProcRRDeleteMonitor(ClientPtr client)
...
@@ -772,7 +772,7 @@ ProcRRDeleteMonitor(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
r
=
dixLookupWindow
(
&
window
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
r
=
dixLookupWindow
(
&
window
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
window
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
window
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
r
=
window
?
Success
:
BadWindow
;
r
=
window
?
Success
:
BadWindow
;
#endif
#endif
...
...
nx-X11/programs/Xserver/randr/rroutput.c
View file @
3c322ffb
...
@@ -583,7 +583,7 @@ ProcRRSetOutputPrimary(ClientPtr client)
...
@@ -583,7 +583,7 @@ ProcRRSetOutputPrimary(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
ret
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
ret
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
ret
=
pWin
?
Success
:
BadWindow
;
ret
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
...
@@ -641,7 +641,7 @@ ProcRRGetOutputPrimary(ClientPtr client)
...
@@ -641,7 +641,7 @@ ProcRRGetOutputPrimary(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
...
...
nx-X11/programs/Xserver/randr/rrprovider.c
View file @
3c322ffb
...
@@ -69,7 +69,7 @@ ProcRRGetProviders(ClientPtr client)
...
@@ -69,7 +69,7 @@ ProcRRGetProviders(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
...
...
nx-X11/programs/Xserver/randr/rrscreen.c
View file @
3c322ffb
...
@@ -222,7 +222,7 @@ ProcRRGetScreenSizeRange(ClientPtr client)
...
@@ -222,7 +222,7 @@ ProcRRGetScreenSizeRange(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
...
@@ -276,7 +276,7 @@ ProcRRSetScreenSize(ClientPtr client)
...
@@ -276,7 +276,7 @@ ProcRRSetScreenSize(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
if
(
rc
!=
Success
)
if
(
rc
!=
Success
)
...
@@ -532,7 +532,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
...
@@ -532,7 +532,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
if
(
rc
!=
Success
)
if
(
rc
!=
Success
)
...
@@ -806,7 +806,7 @@ ProcRRGetScreenInfo(ClientPtr client)
...
@@ -806,7 +806,7 @@ ProcRRGetScreenInfo(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
...
@@ -980,7 +980,7 @@ ProcRRSetScreenConfig(ClientPtr client)
...
@@ -980,7 +980,7 @@ ProcRRSetScreenConfig(ClientPtr client)
rc
=
dixLookupDrawable
(
&
pDraw
,
stuff
->
drawable
,
client
,
0
,
DixWriteAccess
);
rc
=
dixLookupDrawable
(
&
pDraw
,
stuff
->
drawable
,
client
,
0
,
DixWriteAccess
);
#else
/* !defined(NXAGENT_SERVER) */
#else
/* !defined(NXAGENT_SERVER) */
pDraw
=
pDraw
=
SecurityLookupDrawable
(
stuff
->
drawable
,
client
,
Security
WriteAccess
);
SecurityLookupDrawable
(
stuff
->
drawable
,
client
,
Dix
WriteAccess
);
rc
=
pDraw
?
Success
:
BadDrawable
;
rc
=
pDraw
?
Success
:
BadDrawable
;
#endif
/* !defined(NXAGENT_SERVER) */
#endif
/* !defined(NXAGENT_SERVER) */
...
...
nx-X11/programs/Xserver/randr/rrxinerama.c
View file @
3c322ffb
...
@@ -150,7 +150,7 @@ ProcRRXineramaGetState(ClientPtr client)
...
@@ -150,7 +150,7 @@ ProcRRXineramaGetState(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
...
@@ -205,7 +205,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
...
@@ -205,7 +205,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
if
(
rc
!=
Success
)
if
(
rc
!=
Success
)
...
@@ -240,7 +240,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
...
@@ -240,7 +240,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
#ifndef NXAGENT_SERVER
#ifndef NXAGENT_SERVER
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
rc
=
dixLookupWindow
(
&
pWin
,
stuff
->
window
,
client
,
DixGetAttrAccess
);
#else
#else
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
pWin
=
SecurityLookupWindow
(
stuff
->
window
,
client
,
Dix
ReadAccess
);
rc
=
pWin
?
Success
:
BadWindow
;
rc
=
pWin
?
Success
:
BadWindow
;
#endif
#endif
...
...
nx-X11/programs/Xserver/render/picture.c
View file @
3c322ffb
...
@@ -1210,7 +1210,7 @@ ChangePicture (PicturePtr pPicture,
...
@@ -1210,7 +1210,7 @@ ChangePicture (PicturePtr pPicture,
pAlpha
=
(
PicturePtr
)
SecurityLookupIDByType
(
client
,
pAlpha
=
(
PicturePtr
)
SecurityLookupIDByType
(
client
,
pid
,
pid
,
PictureType
,
PictureType
,
SecurityWriteAccess
|
Security
ReadAccess
);
DixWriteAccess
|
Dix
ReadAccess
);
if
(
!
pAlpha
)
if
(
!
pAlpha
)
{
{
client
->
errorValue
=
pid
;
client
->
errorValue
=
pid
;
...
@@ -1271,7 +1271,7 @@ ChangePicture (PicturePtr pPicture,
...
@@ -1271,7 +1271,7 @@ ChangePicture (PicturePtr pPicture,
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
pid
,
pid
,
RT_PIXMAP
,
RT_PIXMAP
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pPixmap
)
if
(
!
pPixmap
)
{
{
client
->
errorValue
=
pid
;
client
->
errorValue
=
pid
;
...
...
nx-X11/programs/Xserver/render/render.c
View file @
3c322ffb
...
@@ -567,7 +567,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
...
@@ -567,7 +567,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
format
,
stuff
->
format
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFormat
)
if
(
!
pFormat
)
{
{
...
@@ -636,11 +636,11 @@ ProcRenderCreatePicture (ClientPtr client)
...
@@ -636,11 +636,11 @@ ProcRenderCreatePicture (ClientPtr client)
LEGAL_NEW_RESOURCE
(
stuff
->
pid
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
pid
,
client
);
SECURITY_VERIFY_DRAWABLE
(
pDrawable
,
stuff
->
drawable
,
client
,
SECURITY_VERIFY_DRAWABLE
(
pDrawable
,
stuff
->
drawable
,
client
,
Security
WriteAccess
);
Dix
WriteAccess
);
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
format
,
stuff
->
format
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFormat
)
if
(
!
pFormat
)
{
{
client
->
errorValue
=
stuff
->
format
;
client
->
errorValue
=
stuff
->
format
;
...
@@ -674,7 +674,7 @@ ProcRenderChangePicture (ClientPtr client)
...
@@ -674,7 +674,7 @@ ProcRenderChangePicture (ClientPtr client)
int
len
;
int
len
;
REQUEST_AT_LEAST_SIZE
(
xRenderChangePictureReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderChangePictureReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
len
=
client
->
req_len
-
(
sizeof
(
xRenderChangePictureReq
)
>>
2
);
len
=
client
->
req_len
-
(
sizeof
(
xRenderChangePictureReq
)
>>
2
);
...
@@ -694,7 +694,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client)
...
@@ -694,7 +694,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client)
int
result
;
int
result
;
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureClipRectanglesReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureClipRectanglesReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pPicture
->
pDrawable
)
if
(
!
pPicture
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -721,7 +721,7 @@ ProcRenderFreePicture (ClientPtr client)
...
@@ -721,7 +721,7 @@ ProcRenderFreePicture (ClientPtr client)
REQUEST_SIZE_MATCH
(
xRenderFreePictureReq
);
REQUEST_SIZE_MATCH
(
xRenderFreePictureReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
DestroyAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
DestroyAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
FreeResource
(
stuff
->
picture
,
RT_NONE
);
FreeResource
(
stuff
->
picture
,
RT_NONE
);
return
(
client
->
noClientException
);
return
(
client
->
noClientException
);
...
@@ -752,13 +752,13 @@ ProcRenderComposite (ClientPtr client)
...
@@ -752,13 +752,13 @@ ProcRenderComposite (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
SecurityReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_ALPHA
(
pMask
,
stuff
->
mask
,
client
,
SecurityReadAccess
,
VERIFY_ALPHA
(
pMask
,
stuff
->
mask
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
((
pSrc
->
pDrawable
&&
pSrc
->
pDrawable
->
pScreen
!=
pDst
->
pDrawable
->
pScreen
)
||
if
((
pSrc
->
pDrawable
&&
pSrc
->
pDrawable
->
pScreen
!=
pDst
->
pDrawable
->
pScreen
)
||
(
pMask
&&
pMask
->
pDrawable
&&
pSrc
->
pDrawable
->
pScreen
!=
pMask
->
pDrawable
->
pScreen
))
(
pMask
&&
pMask
->
pDrawable
&&
pSrc
->
pDrawable
->
pScreen
!=
pMask
->
pDrawable
->
pScreen
))
...
@@ -800,9 +800,9 @@ ProcRenderTrapezoids (ClientPtr client)
...
@@ -800,9 +800,9 @@ ProcRenderTrapezoids (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
SecurityReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
SecurityWriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -813,7 +813,7 @@ ProcRenderTrapezoids (ClientPtr client)
...
@@ -813,7 +813,7 @@ ProcRenderTrapezoids (ClientPtr client)
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
maskFormat
,
stuff
->
maskFormat
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFormat
)
if
(
!
pFormat
)
{
{
client
->
errorValue
=
stuff
->
maskFormat
;
client
->
errorValue
=
stuff
->
maskFormat
;
...
@@ -848,9 +848,9 @@ ProcRenderTriangles (ClientPtr client)
...
@@ -848,9 +848,9 @@ ProcRenderTriangles (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
SecurityReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
SecurityWriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -861,7 +861,7 @@ ProcRenderTriangles (ClientPtr client)
...
@@ -861,7 +861,7 @@ ProcRenderTriangles (ClientPtr client)
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
maskFormat
,
stuff
->
maskFormat
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFormat
)
if
(
!
pFormat
)
{
{
client
->
errorValue
=
stuff
->
maskFormat
;
client
->
errorValue
=
stuff
->
maskFormat
;
...
@@ -895,9 +895,9 @@ ProcRenderTriStrip (ClientPtr client)
...
@@ -895,9 +895,9 @@ ProcRenderTriStrip (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
SecurityReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
SecurityWriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -908,7 +908,7 @@ ProcRenderTriStrip (ClientPtr client)
...
@@ -908,7 +908,7 @@ ProcRenderTriStrip (ClientPtr client)
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
maskFormat
,
stuff
->
maskFormat
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFormat
)
if
(
!
pFormat
)
{
{
client
->
errorValue
=
stuff
->
maskFormat
;
client
->
errorValue
=
stuff
->
maskFormat
;
...
@@ -942,9 +942,9 @@ ProcRenderTriFan (ClientPtr client)
...
@@ -942,9 +942,9 @@ ProcRenderTriFan (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
SecurityReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
SecurityWriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -955,7 +955,7 @@ ProcRenderTriFan (ClientPtr client)
...
@@ -955,7 +955,7 @@ ProcRenderTriFan (ClientPtr client)
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
maskFormat
,
stuff
->
maskFormat
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFormat
)
if
(
!
pFormat
)
{
{
client
->
errorValue
=
stuff
->
maskFormat
;
client
->
errorValue
=
stuff
->
maskFormat
;
...
@@ -1008,7 +1008,7 @@ ProcRenderCreateGlyphSet (ClientPtr client)
...
@@ -1008,7 +1008,7 @@ ProcRenderCreateGlyphSet (ClientPtr client)
format
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
format
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
format
,
stuff
->
format
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
format
)
if
(
!
format
)
{
{
client
->
errorValue
=
stuff
->
format
;
client
->
errorValue
=
stuff
->
format
;
...
@@ -1056,7 +1056,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client)
...
@@ -1056,7 +1056,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
existing
,
stuff
->
existing
,
GlyphSetType
,
GlyphSetType
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
stuff
->
existing
;
client
->
errorValue
=
stuff
->
existing
;
...
@@ -1083,7 +1083,7 @@ ProcRenderFreeGlyphSet (ClientPtr client)
...
@@ -1083,7 +1083,7 @@ ProcRenderFreeGlyphSet (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
glyphset
,
stuff
->
glyphset
,
GlyphSetType
,
GlyphSetType
,
Security
DestroyAccess
);
Dix
DestroyAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
stuff
->
glyphset
;
client
->
errorValue
=
stuff
->
glyphset
;
...
@@ -1118,7 +1118,7 @@ ProcRenderAddGlyphs (ClientPtr client)
...
@@ -1118,7 +1118,7 @@ ProcRenderAddGlyphs (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
glyphset
,
stuff
->
glyphset
,
GlyphSetType
,
GlyphSetType
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
stuff
->
glyphset
;
client
->
errorValue
=
stuff
->
glyphset
;
...
@@ -1223,7 +1223,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
...
@@ -1223,7 +1223,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
glyphset
,
stuff
->
glyphset
,
GlyphSetType
,
GlyphSetType
,
Security
WriteAccess
);
Dix
WriteAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
stuff
->
glyphset
;
client
->
errorValue
=
stuff
->
glyphset
;
...
@@ -1278,9 +1278,9 @@ ProcRenderCompositeGlyphs (ClientPtr client)
...
@@ -1278,9 +1278,9 @@ ProcRenderCompositeGlyphs (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
Security
ReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
Dix
ReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -1291,7 +1291,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
...
@@ -1291,7 +1291,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
pFormat
=
(
PictFormatPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
maskFormat
,
stuff
->
maskFormat
,
PictFormatType
,
PictFormatType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pFormat
)
if
(
!
pFormat
)
{
{
client
->
errorValue
=
stuff
->
maskFormat
;
client
->
errorValue
=
stuff
->
maskFormat
;
...
@@ -1304,7 +1304,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
...
@@ -1304,7 +1304,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
glyphset
,
stuff
->
glyphset
,
GlyphSetType
,
GlyphSetType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
stuff
->
glyphset
;
client
->
errorValue
=
stuff
->
glyphset
;
...
@@ -1366,7 +1366,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
...
@@ -1366,7 +1366,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
glyphSet
=
(
GlyphSetPtr
)
SecurityLookupIDByType
(
client
,
gs
,
gs
,
GlyphSetType
,
GlyphSetType
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
glyphSet
)
if
(
!
glyphSet
)
{
{
client
->
errorValue
=
gs
;
client
->
errorValue
=
gs
;
...
@@ -1447,7 +1447,7 @@ ProcRenderFillRectangles (ClientPtr client)
...
@@ -1447,7 +1447,7 @@ ProcRenderFillRectangles (ClientPtr client)
client
->
errorValue
=
stuff
->
op
;
client
->
errorValue
=
stuff
->
op
;
return
BadValue
;
return
BadValue
;
}
}
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
SecurityWriteAccess
,
VERIFY_PICTURE
(
pDst
,
stuff
->
dst
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pDst
->
pDrawable
)
if
(
!
pDst
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -1515,7 +1515,7 @@ ProcRenderCreateCursor (ClientPtr client)
...
@@ -1515,7 +1515,7 @@ ProcRenderCreateCursor (ClientPtr client)
REQUEST_SIZE_MATCH
(
xRenderCreateCursorReq
);
REQUEST_SIZE_MATCH
(
xRenderCreateCursorReq
);
LEGAL_NEW_RESOURCE
(
stuff
->
cid
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
cid
,
client
);
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
SecurityReadAccess
,
VERIFY_PICTURE
(
pSrc
,
stuff
->
src
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pSrc
->
pDrawable
)
if
(
!
pSrc
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -1699,7 +1699,7 @@ ProcRenderSetPictureTransform (ClientPtr client)
...
@@ -1699,7 +1699,7 @@ ProcRenderSetPictureTransform (ClientPtr client)
int
result
;
int
result
;
REQUEST_SIZE_MATCH
(
xRenderSetPictureTransformReq
);
REQUEST_SIZE_MATCH
(
xRenderSetPictureTransformReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
result
=
SetPictureTransform
(
pPicture
,
(
PictTransform
*
)
&
stuff
->
transform
);
result
=
SetPictureTransform
(
pPicture
,
(
PictTransform
*
)
&
stuff
->
transform
);
if
(
client
->
noClientException
!=
Success
)
if
(
client
->
noClientException
!=
Success
)
...
@@ -1726,7 +1726,7 @@ ProcRenderQueryFilters (ClientPtr client)
...
@@ -1726,7 +1726,7 @@ ProcRenderQueryFilters (ClientPtr client)
char
*
names
;
char
*
names
;
REQUEST_SIZE_MATCH
(
xRenderQueryFiltersReq
);
REQUEST_SIZE_MATCH
(
xRenderQueryFiltersReq
);
SECURITY_VERIFY_DRAWABLE
(
pDrawable
,
stuff
->
drawable
,
client
,
Security
ReadAccess
);
SECURITY_VERIFY_DRAWABLE
(
pDrawable
,
stuff
->
drawable
,
client
,
Dix
ReadAccess
);
pScreen
=
pDrawable
->
pScreen
;
pScreen
=
pDrawable
->
pScreen
;
nbytesName
=
0
;
nbytesName
=
0
;
...
@@ -1828,7 +1828,7 @@ ProcRenderSetPictureFilter (ClientPtr client)
...
@@ -1828,7 +1828,7 @@ ProcRenderSetPictureFilter (ClientPtr client)
char
*
name
;
char
*
name
;
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureFilterReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureFilterReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
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
));
...
@@ -1862,7 +1862,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
...
@@ -1862,7 +1862,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
for
(
i
=
0
;
i
<
ncursor
;
i
++
)
for
(
i
=
0
;
i
<
ncursor
;
i
++
)
{
{
cursors
[
i
]
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
elt
->
cursor
,
cursors
[
i
]
=
(
CursorPtr
)
SecurityLookupIDByType
(
client
,
elt
->
cursor
,
RT_CURSOR
,
Security
ReadAccess
);
RT_CURSOR
,
Dix
ReadAccess
);
if
(
!
cursors
[
i
])
if
(
!
cursors
[
i
])
{
{
free
(
cursors
);
free
(
cursors
);
...
@@ -1891,7 +1891,7 @@ ProcRenderAddTraps (ClientPtr client)
...
@@ -1891,7 +1891,7 @@ ProcRenderAddTraps (ClientPtr client)
REQUEST
(
xRenderAddTrapsReq
);
REQUEST
(
xRenderAddTrapsReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderAddTrapsReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderAddTrapsReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
SecurityWriteAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
!
pPicture
->
pDrawable
)
if
(
!
pPicture
->
pDrawable
)
return
BadDrawable
;
return
BadDrawable
;
...
@@ -2644,7 +2644,7 @@ PanoramiXRenderCreatePicture (ClientPtr client)
...
@@ -2644,7 +2644,7 @@ PanoramiXRenderCreatePicture (ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xRenderCreatePictureReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderCreatePictureReq
);
if
(
!
(
refDraw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
if
(
!
(
refDraw
=
(
PanoramiXRes
*
)
SecurityLookupIDByClass
(
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Security
WriteAccess
)))
client
,
stuff
->
drawable
,
XRC_DRAWABLE
,
Dix
WriteAccess
)))
return
BadDrawable
;
return
BadDrawable
;
if
(
!
(
newPict
=
(
PanoramiXRes
*
)
malloc
(
sizeof
(
PanoramiXRes
))))
if
(
!
(
newPict
=
(
PanoramiXRes
*
)
malloc
(
sizeof
(
PanoramiXRes
))))
return
BadAlloc
;
return
BadAlloc
;
...
@@ -2686,7 +2686,7 @@ PanoramiXRenderChangePicture (ClientPtr client)
...
@@ -2686,7 +2686,7 @@ PanoramiXRenderChangePicture (ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xChangeWindowAttributesReq
);
REQUEST_AT_LEAST_SIZE
(
xChangeWindowAttributesReq
);
VERIFY_XIN_PICTURE
(
pict
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_XIN_PICTURE
(
pict
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -2707,7 +2707,7 @@ PanoramiXRenderSetPictureClipRectangles (ClientPtr client)
...
@@ -2707,7 +2707,7 @@ PanoramiXRenderSetPictureClipRectangles (ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureClipRectanglesReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureClipRectanglesReq
);
VERIFY_XIN_PICTURE
(
pict
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_XIN_PICTURE
(
pict
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -2728,7 +2728,7 @@ PanoramiXRenderSetPictureTransform (ClientPtr client)
...
@@ -2728,7 +2728,7 @@ PanoramiXRenderSetPictureTransform (ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureTransformReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureTransformReq
);
VERIFY_XIN_PICTURE
(
pict
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_XIN_PICTURE
(
pict
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -2749,7 +2749,7 @@ PanoramiXRenderSetPictureFilter (ClientPtr client)
...
@@ -2749,7 +2749,7 @@ PanoramiXRenderSetPictureFilter (ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureFilterReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderSetPictureFilterReq
);
VERIFY_XIN_PICTURE
(
pict
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_XIN_PICTURE
(
pict
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
FOR_NSCREENS_BACKWARD
(
j
)
{
FOR_NSCREENS_BACKWARD
(
j
)
{
...
@@ -2772,7 +2772,7 @@ PanoramiXRenderFreePicture (ClientPtr client)
...
@@ -2772,7 +2772,7 @@ PanoramiXRenderFreePicture (ClientPtr client)
client
->
errorValue
=
stuff
->
picture
;
client
->
errorValue
=
stuff
->
picture
;
VERIFY_XIN_PICTURE
(
pict
,
stuff
->
picture
,
client
,
Security
DestroyAccess
,
VERIFY_XIN_PICTURE
(
pict
,
stuff
->
picture
,
client
,
Dix
DestroyAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
...
@@ -2798,11 +2798,11 @@ PanoramiXRenderComposite (ClientPtr client)
...
@@ -2798,11 +2798,11 @@ PanoramiXRenderComposite (ClientPtr client)
REQUEST_SIZE_MATCH
(
xRenderCompositeReq
);
REQUEST_SIZE_MATCH
(
xRenderCompositeReq
);
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
SecurityReadAccess
,
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_XIN_ALPHA
(
msk
,
stuff
->
mask
,
client
,
SecurityReadAccess
,
VERIFY_XIN_ALPHA
(
msk
,
stuff
->
mask
,
client
,
DixReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
SecurityWriteAccess
,
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
orig
=
*
stuff
;
orig
=
*
stuff
;
...
@@ -2846,9 +2846,9 @@ PanoramiXRenderCompositeGlyphs (ClientPtr client)
...
@@ -2846,9 +2846,9 @@ PanoramiXRenderCompositeGlyphs (ClientPtr client)
INT16
xSrc
,
ySrc
;
INT16
xSrc
,
ySrc
;
REQUEST_AT_LEAST_SIZE
(
xRenderCompositeGlyphsReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderCompositeGlyphsReq
);
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
Security
ReadAccess
,
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
Dix
ReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
Security
WriteAccess
,
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
if
(
client
->
req_len
<<
2
>=
(
sizeof
(
xRenderCompositeGlyphsReq
)
+
if
(
client
->
req_len
<<
2
>=
(
sizeof
(
xRenderCompositeGlyphsReq
)
+
...
@@ -2889,7 +2889,7 @@ PanoramiXRenderFillRectangles (ClientPtr client)
...
@@ -2889,7 +2889,7 @@ PanoramiXRenderFillRectangles (ClientPtr client)
int
extra_len
;
int
extra_len
;
REQUEST_AT_LEAST_SIZE
(
xRenderFillRectanglesReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderFillRectanglesReq
);
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
SecurityWriteAccess
,
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderFillRectanglesReq
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderFillRectanglesReq
);
if
(
extra_len
&&
if
(
extra_len
&&
...
@@ -2936,9 +2936,9 @@ PanoramiXRenderTrapezoids(ClientPtr client)
...
@@ -2936,9 +2936,9 @@ PanoramiXRenderTrapezoids(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xRenderTrapezoidsReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderTrapezoidsReq
);
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
Security
ReadAccess
,
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
Dix
ReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
Security
WriteAccess
,
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderTrapezoidsReq
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderTrapezoidsReq
);
...
@@ -2998,9 +2998,9 @@ PanoramiXRenderTriangles(ClientPtr client)
...
@@ -2998,9 +2998,9 @@ PanoramiXRenderTriangles(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xRenderTrianglesReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderTrianglesReq
);
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
Security
ReadAccess
,
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
Dix
ReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
Security
WriteAccess
,
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderTrianglesReq
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderTrianglesReq
);
...
@@ -3056,9 +3056,9 @@ PanoramiXRenderTriStrip(ClientPtr client)
...
@@ -3056,9 +3056,9 @@ PanoramiXRenderTriStrip(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xRenderTriStripReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderTriStripReq
);
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
Security
ReadAccess
,
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
Dix
ReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
Security
WriteAccess
,
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderTriStripReq
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderTriStripReq
);
...
@@ -3110,9 +3110,9 @@ PanoramiXRenderTriFan(ClientPtr client)
...
@@ -3110,9 +3110,9 @@ PanoramiXRenderTriFan(ClientPtr client)
REQUEST_AT_LEAST_SIZE
(
xRenderTriFanReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderTriFanReq
);
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
Security
ReadAccess
,
VERIFY_XIN_PICTURE
(
src
,
stuff
->
src
,
client
,
Dix
ReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
Security
WriteAccess
,
VERIFY_XIN_PICTURE
(
dst
,
stuff
->
dst
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderTriFanReq
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderTriFanReq
);
...
@@ -3166,7 +3166,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client)
...
@@ -3166,7 +3166,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client)
REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq);
REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq);
VERIFY_XIN_PICTURE (dst, stuff->dst, client,
Security
WriteAccess,
VERIFY_XIN_PICTURE (dst, stuff->dst, client,
Dix
WriteAccess,
RenderErrBase + BadPicture);
RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq);
extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq);
...
@@ -3210,7 +3210,7 @@ PanoramiXRenderColorTriangles(ClientPtr client)
...
@@ -3210,7 +3210,7 @@ PanoramiXRenderColorTriangles(ClientPtr client)
REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq);
REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq);
VERIFY_XIN_PICTURE (dst, stuff->dst, client,
Security
WriteAccess,
VERIFY_XIN_PICTURE (dst, stuff->dst, client,
Dix
WriteAccess,
RenderErrBase + BadPicture);
RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq);
extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq);
...
@@ -3256,7 +3256,7 @@ PanoramiXRenderAddTraps (ClientPtr client)
...
@@ -3256,7 +3256,7 @@ PanoramiXRenderAddTraps (ClientPtr client)
INT16
x_off
,
y_off
;
INT16
x_off
,
y_off
;
REQUEST_AT_LEAST_SIZE
(
xRenderAddTrapsReq
);
REQUEST_AT_LEAST_SIZE
(
xRenderAddTrapsReq
);
VERIFY_XIN_PICTURE
(
picture
,
stuff
->
picture
,
client
,
SecurityWriteAccess
,
VERIFY_XIN_PICTURE
(
picture
,
stuff
->
picture
,
client
,
DixWriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderAddTrapsReq
);
extra_len
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xRenderAddTrapsReq
);
if
(
extra_len
&&
if
(
extra_len
&&
...
...
nx-X11/programs/Xserver/xfixes/cursor.c
View file @
3c322ffb
...
@@ -193,7 +193,7 @@ ProcXFixesSelectCursorInput (ClientPtr client)
...
@@ -193,7 +193,7 @@ ProcXFixesSelectCursorInput (ClientPtr client)
REQUEST_SIZE_MATCH
(
xXFixesSelectCursorInputReq
);
REQUEST_SIZE_MATCH
(
xXFixesSelectCursorInputReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
stuff
->
eventMask
&
~
CursorAllEvents
)
if
(
stuff
->
eventMask
&
~
CursorAllEvents
)
...
@@ -362,7 +362,7 @@ ProcXFixesSetCursorName (ClientPtr client)
...
@@ -362,7 +362,7 @@ ProcXFixesSetCursorName (ClientPtr client)
Atom
atom
;
Atom
atom
;
REQUEST_AT_LEAST_SIZE
(
xXFixesSetCursorNameReq
);
REQUEST_AT_LEAST_SIZE
(
xXFixesSetCursorNameReq
);
VERIFY_CURSOR
(
pCursor
,
stuff
->
cursor
,
client
,
Security
WriteAccess
);
VERIFY_CURSOR
(
pCursor
,
stuff
->
cursor
,
client
,
Dix
WriteAccess
);
tchar
=
(
char
*
)
&
stuff
[
1
];
tchar
=
(
char
*
)
&
stuff
[
1
];
atom
=
MakeAtom
(
tchar
,
stuff
->
nbytes
,
TRUE
);
atom
=
MakeAtom
(
tchar
,
stuff
->
nbytes
,
TRUE
);
if
(
atom
==
BAD_RESOURCE
)
if
(
atom
==
BAD_RESOURCE
)
...
@@ -394,7 +394,7 @@ ProcXFixesGetCursorName (ClientPtr client)
...
@@ -394,7 +394,7 @@ ProcXFixesGetCursorName (ClientPtr client)
int
len
;
int
len
;
REQUEST_SIZE_MATCH
(
xXFixesGetCursorNameReq
);
REQUEST_SIZE_MATCH
(
xXFixesGetCursorNameReq
);
VERIFY_CURSOR
(
pCursor
,
stuff
->
cursor
,
client
,
Security
ReadAccess
);
VERIFY_CURSOR
(
pCursor
,
stuff
->
cursor
,
client
,
Dix
ReadAccess
);
if
(
pCursor
->
name
)
if
(
pCursor
->
name
)
str
=
NameForAtom
(
pCursor
->
name
);
str
=
NameForAtom
(
pCursor
->
name
);
else
else
...
@@ -619,8 +619,8 @@ ProcXFixesChangeCursor (ClientPtr client)
...
@@ -619,8 +619,8 @@ ProcXFixesChangeCursor (ClientPtr client)
REQUEST
(
xXFixesChangeCursorReq
);
REQUEST
(
xXFixesChangeCursorReq
);
REQUEST_SIZE_MATCH
(
xXFixesChangeCursorReq
);
REQUEST_SIZE_MATCH
(
xXFixesChangeCursorReq
);
VERIFY_CURSOR
(
pSource
,
stuff
->
source
,
client
,
Security
ReadAccess
);
VERIFY_CURSOR
(
pSource
,
stuff
->
source
,
client
,
Dix
ReadAccess
);
VERIFY_CURSOR
(
pDestination
,
stuff
->
destination
,
client
,
Security
WriteAccess
);
VERIFY_CURSOR
(
pDestination
,
stuff
->
destination
,
client
,
Dix
WriteAccess
);
ReplaceCursor
(
pSource
,
TestForCursor
,
(
void
*
)
pDestination
);
ReplaceCursor
(
pSource
,
TestForCursor
,
(
void
*
)
pDestination
);
return
(
client
->
noClientException
);
return
(
client
->
noClientException
);
...
@@ -653,7 +653,7 @@ ProcXFixesChangeCursorByName (ClientPtr client)
...
@@ -653,7 +653,7 @@ ProcXFixesChangeCursorByName (ClientPtr client)
REQUEST
(
xXFixesChangeCursorByNameReq
);
REQUEST
(
xXFixesChangeCursorByNameReq
);
REQUEST_FIXED_SIZE
(
xXFixesChangeCursorByNameReq
,
stuff
->
nbytes
);
REQUEST_FIXED_SIZE
(
xXFixesChangeCursorByNameReq
,
stuff
->
nbytes
);
VERIFY_CURSOR
(
pSource
,
stuff
->
source
,
client
,
Security
ReadAccess
);
VERIFY_CURSOR
(
pSource
,
stuff
->
source
,
client
,
Dix
ReadAccess
);
tchar
=
(
char
*
)
&
stuff
[
1
];
tchar
=
(
char
*
)
&
stuff
[
1
];
name
=
MakeAtom
(
tchar
,
stuff
->
nbytes
,
FALSE
);
name
=
MakeAtom
(
tchar
,
stuff
->
nbytes
,
FALSE
);
if
(
name
)
if
(
name
)
...
...
nx-X11/programs/Xserver/xfixes/region.c
View file @
3c322ffb
...
@@ -117,7 +117,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client)
...
@@ -117,7 +117,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client)
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
bitmap
,
pPixmap
=
(
PixmapPtr
)
SecurityLookupIDByType
(
client
,
stuff
->
bitmap
,
RT_PIXMAP
,
RT_PIXMAP
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pPixmap
)
if
(
!
pPixmap
)
{
{
client
->
errorValue
=
stuff
->
bitmap
;
client
->
errorValue
=
stuff
->
bitmap
;
...
@@ -222,7 +222,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client)
...
@@ -222,7 +222,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client)
REQUEST_SIZE_MATCH
(
xXFixesCreateRegionFromGCReq
);
REQUEST_SIZE_MATCH
(
xXFixesCreateRegionFromGCReq
);
LEGAL_NEW_RESOURCE
(
stuff
->
region
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
region
,
client
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
gc
,
client
,
Security
ReadAccess
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
gc
,
client
,
Dix
ReadAccess
);
switch
(
pGC
->
clientClipType
)
{
switch
(
pGC
->
clientClipType
)
{
case
CT_PIXMAP
:
case
CT_PIXMAP
:
...
@@ -269,7 +269,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client)
...
@@ -269,7 +269,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client)
REQUEST_SIZE_MATCH
(
xXFixesCreateRegionFromPictureReq
);
REQUEST_SIZE_MATCH
(
xXFixesCreateRegionFromPictureReq
);
LEGAL_NEW_RESOURCE
(
stuff
->
region
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
region
,
client
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
ReadAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
ReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
switch
(
pPicture
->
clientClipType
)
{
switch
(
pPicture
->
clientClipType
)
{
...
@@ -316,7 +316,7 @@ ProcXFixesDestroyRegion (ClientPtr client)
...
@@ -316,7 +316,7 @@ ProcXFixesDestroyRegion (ClientPtr client)
RegionPtr
pRegion
;
RegionPtr
pRegion
;
REQUEST_SIZE_MATCH
(
xXFixesDestroyRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesDestroyRegionReq
);
VERIFY_REGION
(
pRegion
,
stuff
->
region
,
client
,
Security
WriteAccess
);
VERIFY_REGION
(
pRegion
,
stuff
->
region
,
client
,
Dix
WriteAccess
);
FreeResource
(
stuff
->
region
,
RT_NONE
);
FreeResource
(
stuff
->
region
,
RT_NONE
);
return
(
client
->
noClientException
);
return
(
client
->
noClientException
);
}
}
...
@@ -340,7 +340,7 @@ ProcXFixesSetRegion (ClientPtr client)
...
@@ -340,7 +340,7 @@ ProcXFixesSetRegion (ClientPtr client)
REQUEST
(
xXFixesSetRegionReq
);
REQUEST
(
xXFixesSetRegionReq
);
REQUEST_AT_LEAST_SIZE
(
xXFixesSetRegionReq
);
REQUEST_AT_LEAST_SIZE
(
xXFixesSetRegionReq
);
VERIFY_REGION
(
pRegion
,
stuff
->
region
,
client
,
Security
WriteAccess
);
VERIFY_REGION
(
pRegion
,
stuff
->
region
,
client
,
Dix
WriteAccess
);
things
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xXFixesCreateRegionReq
);
things
=
(
client
->
req_len
<<
2
)
-
sizeof
(
xXFixesCreateRegionReq
);
if
(
things
&
4
)
if
(
things
&
4
)
...
@@ -377,8 +377,8 @@ ProcXFixesCopyRegion (ClientPtr client)
...
@@ -377,8 +377,8 @@ ProcXFixesCopyRegion (ClientPtr client)
RegionPtr
pSource
,
pDestination
;
RegionPtr
pSource
,
pDestination
;
REQUEST
(
xXFixesCopyRegionReq
);
REQUEST
(
xXFixesCopyRegionReq
);
VERIFY_REGION
(
pSource
,
stuff
->
source
,
client
,
Security
ReadAccess
);
VERIFY_REGION
(
pSource
,
stuff
->
source
,
client
,
Dix
ReadAccess
);
VERIFY_REGION
(
pDestination
,
stuff
->
destination
,
client
,
Security
WriteAccess
);
VERIFY_REGION
(
pDestination
,
stuff
->
destination
,
client
,
Dix
WriteAccess
);
if
(
!
RegionCopy
(
pDestination
,
pSource
))
if
(
!
RegionCopy
(
pDestination
,
pSource
))
return
BadAlloc
;
return
BadAlloc
;
...
@@ -406,9 +406,9 @@ ProcXFixesCombineRegion (ClientPtr client)
...
@@ -406,9 +406,9 @@ ProcXFixesCombineRegion (ClientPtr client)
REQUEST
(
xXFixesCombineRegionReq
);
REQUEST
(
xXFixesCombineRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesCombineRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesCombineRegionReq
);
VERIFY_REGION
(
pSource1
,
stuff
->
source1
,
client
,
Security
ReadAccess
);
VERIFY_REGION
(
pSource1
,
stuff
->
source1
,
client
,
Dix
ReadAccess
);
VERIFY_REGION
(
pSource2
,
stuff
->
source2
,
client
,
Security
ReadAccess
);
VERIFY_REGION
(
pSource2
,
stuff
->
source2
,
client
,
Dix
ReadAccess
);
VERIFY_REGION
(
pDestination
,
stuff
->
destination
,
client
,
Security
WriteAccess
);
VERIFY_REGION
(
pDestination
,
stuff
->
destination
,
client
,
Dix
WriteAccess
);
switch
(
stuff
->
xfixesReqType
)
{
switch
(
stuff
->
xfixesReqType
)
{
case
X_XFixesUnionRegion
:
case
X_XFixesUnionRegion
:
...
@@ -452,8 +452,8 @@ ProcXFixesInvertRegion (ClientPtr client)
...
@@ -452,8 +452,8 @@ ProcXFixesInvertRegion (ClientPtr client)
REQUEST
(
xXFixesInvertRegionReq
);
REQUEST
(
xXFixesInvertRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesInvertRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesInvertRegionReq
);
VERIFY_REGION
(
pSource
,
stuff
->
source
,
client
,
Security
ReadAccess
);
VERIFY_REGION
(
pSource
,
stuff
->
source
,
client
,
Dix
ReadAccess
);
VERIFY_REGION
(
pDestination
,
stuff
->
destination
,
client
,
Security
WriteAccess
);
VERIFY_REGION
(
pDestination
,
stuff
->
destination
,
client
,
Dix
WriteAccess
);
/* Compute bounds, limit to 16 bits */
/* Compute bounds, limit to 16 bits */
bounds
.
x1
=
stuff
->
x
;
bounds
.
x1
=
stuff
->
x
;
...
@@ -499,7 +499,7 @@ ProcXFixesTranslateRegion (ClientPtr client)
...
@@ -499,7 +499,7 @@ ProcXFixesTranslateRegion (ClientPtr client)
REQUEST
(
xXFixesTranslateRegionReq
);
REQUEST
(
xXFixesTranslateRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesTranslateRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesTranslateRegionReq
);
VERIFY_REGION
(
pRegion
,
stuff
->
region
,
client
,
Security
WriteAccess
);
VERIFY_REGION
(
pRegion
,
stuff
->
region
,
client
,
Dix
WriteAccess
);
RegionTranslate
(
pRegion
,
stuff
->
dx
,
stuff
->
dy
);
RegionTranslate
(
pRegion
,
stuff
->
dx
,
stuff
->
dy
);
return
(
client
->
noClientException
);
return
(
client
->
noClientException
);
...
@@ -525,8 +525,8 @@ ProcXFixesRegionExtents (ClientPtr client)
...
@@ -525,8 +525,8 @@ ProcXFixesRegionExtents (ClientPtr client)
REQUEST
(
xXFixesRegionExtentsReq
);
REQUEST
(
xXFixesRegionExtentsReq
);
REQUEST_SIZE_MATCH
(
xXFixesRegionExtentsReq
);
REQUEST_SIZE_MATCH
(
xXFixesRegionExtentsReq
);
VERIFY_REGION
(
pSource
,
stuff
->
source
,
client
,
Security
ReadAccess
);
VERIFY_REGION
(
pSource
,
stuff
->
source
,
client
,
Dix
ReadAccess
);
VERIFY_REGION
(
pDestination
,
stuff
->
destination
,
client
,
Security
WriteAccess
);
VERIFY_REGION
(
pDestination
,
stuff
->
destination
,
client
,
Dix
WriteAccess
);
RegionReset
(
pDestination
,
RegionExtents
(
pSource
));
RegionReset
(
pDestination
,
RegionExtents
(
pSource
));
...
@@ -557,7 +557,7 @@ ProcXFixesFetchRegion (ClientPtr client)
...
@@ -557,7 +557,7 @@ ProcXFixesFetchRegion (ClientPtr client)
REQUEST
(
xXFixesFetchRegionReq
);
REQUEST
(
xXFixesFetchRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesFetchRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesFetchRegionReq
);
VERIFY_REGION
(
pRegion
,
stuff
->
region
,
client
,
Security
ReadAccess
);
VERIFY_REGION
(
pRegion
,
stuff
->
region
,
client
,
Dix
ReadAccess
);
pExtent
=
RegionExtents
(
pRegion
);
pExtent
=
RegionExtents
(
pRegion
);
pBox
=
RegionRects
(
pRegion
);
pBox
=
RegionRects
(
pRegion
);
...
@@ -618,8 +618,8 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
...
@@ -618,8 +618,8 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
REQUEST
(
xXFixesSetGCClipRegionReq
);
REQUEST
(
xXFixesSetGCClipRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesSetGCClipRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesSetGCClipRegionReq
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
gc
,
client
,
Security
WriteAccess
);
SECURITY_VERIFY_GC
(
pGC
,
stuff
->
gc
,
client
,
Dix
WriteAccess
);
VERIFY_REGION_OR_NONE
(
pRegion
,
stuff
->
region
,
client
,
Security
ReadAccess
);
VERIFY_REGION_OR_NONE
(
pRegion
,
stuff
->
region
,
client
,
Dix
ReadAccess
);
if
(
pRegion
)
if
(
pRegion
)
{
{
...
@@ -669,7 +669,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
...
@@ -669,7 +669,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
client
->
errorValue
=
stuff
->
dest
;
client
->
errorValue
=
stuff
->
dest
;
return
BadWindow
;
return
BadWindow
;
}
}
VERIFY_REGION_OR_NONE
(
pRegion
,
stuff
->
region
,
client
,
Security
WriteAccess
);
VERIFY_REGION_OR_NONE
(
pRegion
,
stuff
->
region
,
client
,
Dix
WriteAccess
);
pScreen
=
pWin
->
drawable
.
pScreen
;
pScreen
=
pWin
->
drawable
.
pScreen
;
switch
(
stuff
->
destKind
)
{
switch
(
stuff
->
destKind
)
{
case
ShapeBounding
:
case
ShapeBounding
:
...
@@ -756,9 +756,9 @@ ProcXFixesSetPictureClipRegion (ClientPtr client)
...
@@ -756,9 +756,9 @@ ProcXFixesSetPictureClipRegion (ClientPtr client)
REQUEST
(
xXFixesSetPictureClipRegionReq
);
REQUEST
(
xXFixesSetPictureClipRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesSetPictureClipRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesSetPictureClipRegionReq
);
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Security
WriteAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
Dix
WriteAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_REGION_OR_NONE
(
pRegion
,
stuff
->
region
,
client
,
Security
ReadAccess
);
VERIFY_REGION_OR_NONE
(
pRegion
,
stuff
->
region
,
client
,
Dix
ReadAccess
);
return
SetPictureClipRegion
(
pPicture
,
stuff
->
xOrigin
,
stuff
->
yOrigin
,
return
SetPictureClipRegion
(
pPicture
,
stuff
->
xOrigin
,
stuff
->
yOrigin
,
pRegion
);
pRegion
);
...
@@ -793,8 +793,8 @@ ProcXFixesExpandRegion (ClientPtr client)
...
@@ -793,8 +793,8 @@ ProcXFixesExpandRegion (ClientPtr client)
int
i
;
int
i
;
REQUEST_SIZE_MATCH
(
xXFixesExpandRegionReq
);
REQUEST_SIZE_MATCH
(
xXFixesExpandRegionReq
);
VERIFY_REGION
(
pSource
,
stuff
->
source
,
client
,
Security
ReadAccess
);
VERIFY_REGION
(
pSource
,
stuff
->
source
,
client
,
Dix
ReadAccess
);
VERIFY_REGION
(
pDestination
,
stuff
->
destination
,
client
,
Security
WriteAccess
);
VERIFY_REGION
(
pDestination
,
stuff
->
destination
,
client
,
Dix
WriteAccess
);
nBoxes
=
RegionNumRects
(
pSource
);
nBoxes
=
RegionNumRects
(
pSource
);
pSrc
=
RegionRects
(
pSource
);
pSrc
=
RegionRects
(
pSource
);
...
...
nx-X11/programs/Xserver/xfixes/saveset.c
View file @
3c322ffb
...
@@ -38,7 +38,7 @@ ProcXFixesChangeSaveSet(ClientPtr client)
...
@@ -38,7 +38,7 @@ ProcXFixesChangeSaveSet(ClientPtr client)
REQUEST_SIZE_MATCH
(
xXFixesChangeSaveSetReq
);
REQUEST_SIZE_MATCH
(
xXFixesChangeSaveSetReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
client
->
clientAsMask
==
(
CLIENT_BITS
(
pWin
->
drawable
.
id
)))
if
(
client
->
clientAsMask
==
(
CLIENT_BITS
(
pWin
->
drawable
.
id
)))
...
...
nx-X11/programs/Xserver/xfixes/select.c
View file @
3c322ffb
...
@@ -198,7 +198,7 @@ ProcXFixesSelectSelectionInput (ClientPtr client)
...
@@ -198,7 +198,7 @@ ProcXFixesSelectSelectionInput (ClientPtr client)
REQUEST_SIZE_MATCH
(
xXFixesSelectSelectionInputReq
);
REQUEST_SIZE_MATCH
(
xXFixesSelectSelectionInputReq
);
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
Security
ReadAccess
);
Dix
ReadAccess
);
if
(
!
pWin
)
if
(
!
pWin
)
return
(
BadWindow
);
return
(
BadWindow
);
if
(
stuff
->
eventMask
&
~
SelectionAllEvents
)
if
(
stuff
->
eventMask
&
~
SelectionAllEvents
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment