From 9b26e6bc8d2cdf5bac3025796855ccf05972358f Mon Sep 17 00:00:00 2001 From: Luc Verhaegen Date: Tue, 23 Aug 2011 15:19:59 -0700 Subject: randr: stop clients from deleting immutable output properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Immutable in randr means that clients are not able to alter the property itself, they are only allowed to alter the property value. This logically means that the property then should not be deleted by the client either. Signed-off-by: Luc Verhaegen Reviewed-by: Rami Ylimäki Reviewed-by: Aaron Plattner Signed-off-by: Aaron Plattner --- randr/rrproperty.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'randr/rrproperty.c') diff --git a/randr/rrproperty.c b/randr/rrproperty.c index 6ed24d3aa..d0a90203b 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -549,18 +549,31 @@ int ProcRRDeleteOutputProperty (ClientPtr client) { REQUEST(xRRDeleteOutputPropertyReq); - RROutputPtr output; - + RROutputPtr output; + RRPropertyPtr prop; + REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq); UpdateCurrentTime(); VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); - + if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; return BadAtom; } + prop = RRQueryOutputProperty(output, stuff->property); + if (!prop) + { + client->errorValue = stuff->property; + return BadName; + } + + if (prop->immutable) + { + client->errorValue = stuff->property; + return BadAccess; + } RRDeleteOutputProperty(output, stuff->property); return Success; -- cgit v1.2.3