[pve-devel] [PATCH common 1/2] use better regex for remote ip check

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Nov 9 08:28:18 CET 2016


any comments on this series?


On 11/03/2016 02:22 PM, Thomas Lamprecht wrote:
> while the input should be correctly generated by the other site its
> still better to be on the safe side, so check if the IP is really an
> valid one.
>
> Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> ---
>   src/PVE/AbstractMigrate.pm | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/PVE/AbstractMigrate.pm b/src/PVE/AbstractMigrate.pm
> index b58d459..140b479 100644
> --- a/src/PVE/AbstractMigrate.pm
> +++ b/src/PVE/AbstractMigrate.pm
> @@ -95,8 +95,7 @@ sub get_remote_migration_ip {
>       PVE::Tools::run_command($cmd, outfunc => sub {
>   	my $line = shift;
>   
> -	# use non-restrictive regex for ip, its already checked by the remote side
> -	if ($line =~ m/^ip: '(\S+)'$/) {
> +	if ($line =~ m/^ip: '($PVE::Tools::IPRE)'$/) {
>   	   $ip = $1;
>   	}
>       });





More information about the pve-devel mailing list