mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 08:57:25 +01:00 
			
		
		
		
	SECURITY: normalize account names before checking network / oper filters
(cherry picked from commit a6c1beaad0f715a28495edab8b4ae0f53a8968a7)
This commit is contained in:
		
							parent
							
								
									22efe1384c
								
							
						
					
					
						commit
						310ad345a3
					
				@ -15,12 +15,15 @@ from pylinkirc.log import log
 | 
			
		||||
 | 
			
		||||
def _login(irc, source, username):
 | 
			
		||||
    """Internal function to process logins."""
 | 
			
		||||
    # Mangle case before we start checking for login data.
 | 
			
		||||
    accounts = {k.lower(): v for k, v in conf.conf['login'].get('accounts', {}).items()}
 | 
			
		||||
 | 
			
		||||
    if irc.is_internal_client(source):
 | 
			
		||||
        irc.error("Cannot use 'identify' via a command proxy.")
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
    logindata = conf.conf['login'].get('accounts', {}).get(username, {})
 | 
			
		||||
    logindata = accounts.get(username.lower(), {})
 | 
			
		||||
 | 
			
		||||
    network_filter = logindata.get('networks')
 | 
			
		||||
    require_oper = logindata.get('require_oper', False)
 | 
			
		||||
    hosts_filter = logindata.get('hosts', [])
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user