mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] firewall.py : upnpc.getspecificportmapping expects an int, can't handle port ranges ?
This commit is contained in:
parent
d49ad748a2
commit
ee70dfe52e
1 changed files with 12 additions and 0 deletions
|
@ -399,6 +399,12 @@ def firewall_upnp(action="status", no_refresh=False):
|
||||||
for protocol in ["TCP", "UDP"]:
|
for protocol in ["TCP", "UDP"]:
|
||||||
if protocol + "_TO_CLOSE" in firewall["uPnP"]:
|
if protocol + "_TO_CLOSE" in firewall["uPnP"]:
|
||||||
for port in firewall["uPnP"][protocol + "_TO_CLOSE"]:
|
for port in firewall["uPnP"][protocol + "_TO_CLOSE"]:
|
||||||
|
|
||||||
|
if not isinstance(port, int):
|
||||||
|
# FIXME : how should we handle port ranges ?
|
||||||
|
logger.warning("Can't use UPnP to close '%s'" % port)
|
||||||
|
continue
|
||||||
|
|
||||||
# Clean the mapping of this port
|
# Clean the mapping of this port
|
||||||
if upnpc.getspecificportmapping(port, protocol):
|
if upnpc.getspecificportmapping(port, protocol):
|
||||||
try:
|
try:
|
||||||
|
@ -408,6 +414,12 @@ def firewall_upnp(action="status", no_refresh=False):
|
||||||
firewall["uPnP"][protocol + "_TO_CLOSE"] = []
|
firewall["uPnP"][protocol + "_TO_CLOSE"] = []
|
||||||
|
|
||||||
for port in firewall["uPnP"][protocol]:
|
for port in firewall["uPnP"][protocol]:
|
||||||
|
|
||||||
|
if not isinstance(port, int):
|
||||||
|
# FIXME : how should we handle port ranges ?
|
||||||
|
logger.warning("Can't use UPnP to open '%s'" % port)
|
||||||
|
continue
|
||||||
|
|
||||||
# Clean the mapping of this port
|
# Clean the mapping of this port
|
||||||
if upnpc.getspecificportmapping(port, protocol):
|
if upnpc.getspecificportmapping(port, protocol):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue