Explorar o código

Handle UnicodeError in firewall when resolving hostname

icequbes1 %!s(int64=3) %!d(string=hai) anos
pai
achega
ed33374f67
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      qubesagent/firewall.py

+ 3 - 0
qubesagent/firewall.py

@@ -619,6 +619,9 @@ class NftablesWorker(FirewallWorker):
                 except socket.gaierror as e:
                     raise RuleParseError('Failed to resolve {}: {}'.format(
                         rule['dsthost'], str(e)))
+                except UnicodeError as e:
+                    raise RuleParseError('Invalid destination {}: {}'.format(
+                        rule['dsthost'], str(e)))
                 nft_rule += ' {} daddr {{ {} }}'.format(ip_match,
                     ', '.join(set(item[4][0] + fullmask for item in addrinfo)))