[et-mgmt-tools] [PATCH] Strengthen port number validation

Cole Robinson crobinso at redhat.com
Wed Nov 7 21:44:29 UTC 2007


Masayuki Sunou wrote:
> Hi
> 
> Installation fails when port number used by other processes is set 
> to --vncport of virt-install, because graphical console is not displayed.
> The same problem occurs when port number exceeds upper bound. 
> 
> One of patches fixes to request re-input when port number used is set.
>  --> check_vncport_used.patch
> Other fixes to output error message when port number exceeds upper bound. 
>  --> check_vncport_upperbound.patch
> 
> Signed-off-by: Masayuki Sunou <fj1826dm at aa.jp.fujitsu.com>
> 
> Thanks,
> Masayuki Sunou.


Hi,

The upperbound check looks good, I just applied it.

The vncport collision detection though I'm a bit worried about. Parsing
'netstat' doesn't seem like a nice solution: its a lot of output to parse
for little gain and requires an external utility to do it.

I think the nice way to check the port would be to have a function that
actually attempts to bind the port, to test that it is empty. You would
understandably have to release it if you succeeded so the install can use
it in the future. I'm not sure if this would carry any residual effects,
maybe someone else has a better idea?

- Cole

-- 
Cole Robinson
crobinso at redhat.com




More information about the et-mgmt-tools mailing list