mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-11-03 19:30:54 +00:00 
			
		
		
		
	Fix status checks for ufw when the system doesn't support iptables
This commit is contained in:
		
							parent
							
								
									da5497cd1c
								
							
						
					
					
						commit
						32f441b11b
					
				@ -7,6 +7,7 @@ In Development
 | 
				
			|||||||
Control panel:
 | 
					Control panel:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* Remove recommendations for Certificate Providers
 | 
					* Remove recommendations for Certificate Providers
 | 
				
			||||||
 | 
					* Status checks failed if the system doesn't support iptables
 | 
				
			||||||
 | 
					
 | 
				
			||||||
v0.20 (September 23, 2016)
 | 
					v0.20 (September 23, 2016)
 | 
				
			||||||
--------------------------
 | 
					--------------------------
 | 
				
			||||||
 | 
				
			|||||||
@ -169,8 +169,15 @@ def run_system_checks(rounded_values, env, output):
 | 
				
			|||||||
	check_free_memory(rounded_values, env, output)
 | 
						check_free_memory(rounded_values, env, output)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def check_ufw(env, output):
 | 
					def check_ufw(env, output):
 | 
				
			||||||
	ufw = shell('check_output', ['ufw', 'status']).splitlines()
 | 
						code, ufw = shell('check_output', ['ufw', 'status'], trap=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if code != 0:
 | 
				
			||||||
 | 
							# The command failed, it's safe to say the firewall is disabled
 | 
				
			||||||
 | 
							output.print_warning("""The firewall is probably disabled on this machine. An error was received
 | 
				
			||||||
 | 
										while trying to check the firewall.""")
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ufw = ufw.splitlines()
 | 
				
			||||||
	if ufw[0] == "Status: active":
 | 
						if ufw[0] == "Status: active":
 | 
				
			||||||
		not_allowed_ports = 0
 | 
							not_allowed_ports = 0
 | 
				
			||||||
		for service in get_services():
 | 
							for service in get_services():
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user