security: Grant untrusted windows remove access on all windows.
This allows untrusted clients to destroy their own windows when they have been reparented by a trusted window manager.
This commit is contained in:
		
							parent
							
								
									3481b32ab9
								
							
						
					
					
						commit
						4559d2ace6
					
				| 
						 | 
					@ -74,6 +74,7 @@ static char *SecurityTrustedExtensions[] = {
 | 
				
			||||||
static const Mask SecurityResourceMask =
 | 
					static const Mask SecurityResourceMask =
 | 
				
			||||||
    DixGetAttrAccess | DixReceiveAccess | DixListPropAccess |
 | 
					    DixGetAttrAccess | DixReceiveAccess | DixListPropAccess |
 | 
				
			||||||
    DixGetPropAccess | DixListAccess;
 | 
					    DixGetPropAccess | DixListAccess;
 | 
				
			||||||
 | 
					static const Mask SecurityWindowExtraMask = DixRemoveAccess;
 | 
				
			||||||
static const Mask SecurityRootWindowExtraMask =
 | 
					static const Mask SecurityRootWindowExtraMask =
 | 
				
			||||||
    DixReceiveAccess | DixSendAccess | DixAddAccess | DixRemoveAccess;
 | 
					    DixReceiveAccess | DixSendAccess | DixAddAccess | DixRemoveAccess;
 | 
				
			||||||
static const Mask SecurityDeviceMask =
 | 
					static const Mask SecurityDeviceMask =
 | 
				
			||||||
| 
						 | 
					@ -817,6 +818,10 @@ SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 | 
				
			||||||
	if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
 | 
						if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
 | 
				
			||||||
	    ((WindowPtr)rec->res)->forcedBG = TRUE;
 | 
						    ((WindowPtr)rec->res)->forcedBG = TRUE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* additional permissions for specific resource types */
 | 
				
			||||||
 | 
					    if (rec->rtype == RT_WINDOW)
 | 
				
			||||||
 | 
						allowed |= SecurityWindowExtraMask;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* special checks for server-owned resources */
 | 
					    /* special checks for server-owned resources */
 | 
				
			||||||
    if (cid == 0) {
 | 
					    if (cid == 0) {
 | 
				
			||||||
	if (rec->rtype & RC_DRAWABLE)
 | 
						if (rec->rtype & RC_DRAWABLE)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue