Closed nwesoccer closed 8 years ago
Howdy! I'm not sure if it's just fortuitous timing or if you're working together, but #111 just was submitted as a fix for this issue. As soon as we have testing, I'll merge it. Thanks for the report!!
Well, I guess it's just fortuitous timing as we don't work together :grinning:
Nice! Thanks!
Merged in #111.
Seems like the method
port_to_s
causes thenetsh advfirewall firewall
command to be incorrectly formatted.Example:
netsh advfirewall firewall add rule name="The Traffic" description="The Traffic" dir=in service=any protocol=tcp localip=any localport=1000:1500 interfacetype=any remoteip=any remoteport=any action=allow
when it should be
netsh advfirewall firewall add rule name="The Traffic" description="The Traffic" dir=in service=any protocol=tcp localip=any localport=1000-1500 interfacetype=any remoteip=any remoteport=any action=allow
notice the dash between the port range first port and last port instead of the colon. This colon causes this error
STDOUT: A specified port value is not valid.
I would do a Pull-Request, but I'm not sure exactly how to change the code. We could add an
if windows
check in theport_to_s
method, or is there a way to sayif using windows firewall
, or maybe a way to override the method...?