randr: stop clients from deleting immutable output properties
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 <libv@skynet.be> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
This commit is contained in:
		
							parent
							
								
									c841336204
								
							
						
					
					
						commit
						9b26e6bc8d
					
				|  | @ -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; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue