HomePhabricator

transfer.py: Add the ability to auto-detect free port for netcat to listen

Description

transfer.py: Add the ability to auto-detect free port for netcat to listen

Add automatic free port detection to the transfer framework, which eliminates
the need of a user passed netcat listen port.

open method in Firewall checks for the port number to be open, if port is zero,
it calls the find_available_port function. This function uses netstat utility
to find the available ports in the target machine. It returns one available
port number, open method makes this port open in the iptables and returns this
port to the Transferer class for saving it to options['port'].

Bug: T252171
Change-Id: I839cc6d37a6643bfa4e229572394353442675b27

Details

Provenance
PrivacybatmAuthored on May 10 2020, 3:31 PM
Parents
rOSWB19a914fb8e25: Add comments to Firewall, MariaDB and transfer modules
Branches
Unknown
Tags
Unknown
ChangeId
I839cc6d37a6643bfa4e229572394353442675b27