security: Revert behavior of extension access for compatibility.
Previously, three extensions were defined as "trusted" by the extension:
BIG-REQUESTS, XC-MISC, and XPrint.  No other extensions were permitted
to be used by untrusted clients.
In commit 8b5d21cc1d this was changed for
some reason.  Return to the old, compatible behavior.
			
			
This commit is contained in:
		
							parent
							
								
									56a5955c8c
								
							
						
					
					
						commit
						6045506be0
					
				| 
						 | 
					@ -61,10 +61,10 @@ typedef struct {
 | 
				
			||||||
} SecurityStateRec;
 | 
					} SecurityStateRec;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Extensions that untrusted clients shouldn't have access to */
 | 
					/* Extensions that untrusted clients shouldn't have access to */
 | 
				
			||||||
static char *SecurityUntrustedExtensions[] = {
 | 
					static char *SecurityTrustedExtensions[] = {
 | 
				
			||||||
    "RandR",
 | 
					    "XC-MISC",
 | 
				
			||||||
    "SECURITY",
 | 
					    "BIG-REQUESTS",
 | 
				
			||||||
    "XFree86-DGA",
 | 
					    "XpExtension",
 | 
				
			||||||
    NULL
 | 
					    NULL
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -852,16 +852,18 @@ SecurityExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
 | 
					    subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
 | 
					    if (subj->haveState && subj->trustLevel == XSecurityClientTrusted)
 | 
				
			||||||
	while (SecurityUntrustedExtensions[i])
 | 
						return;
 | 
				
			||||||
	    if (!strcmp(SecurityUntrustedExtensions[i++], rec->ext->name)) {
 | 
					
 | 
				
			||||||
		SecurityAudit("Security: denied client %d access to extension "
 | 
					    while (SecurityTrustedExtensions[i])
 | 
				
			||||||
			      "%s on request %s\n",
 | 
						if (!strcmp(SecurityTrustedExtensions[i++], rec->ext->name))
 | 
				
			||||||
			      rec->client->index, rec->ext->name,
 | 
						    return;
 | 
				
			||||||
			      SecurityLookupRequestName(rec->client));
 | 
					
 | 
				
			||||||
		rec->status = BadAccess;
 | 
					    SecurityAudit("Security: denied client %d access to extension "
 | 
				
			||||||
		return;
 | 
							  "%s on request %s\n",
 | 
				
			||||||
	    }
 | 
							  rec->client->index, rec->ext->name,
 | 
				
			||||||
 | 
							  SecurityLookupRequestName(rec->client));
 | 
				
			||||||
 | 
					    rec->status = BadAccess;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue