From: Thomas Lamprecht Date: Thu, 3 Nov 2016 13:22:55 +0000 (+0100) Subject: use better regex for remote ip check X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=cca9492eb4e7226142ac36eaf637f3dd76570c45 use better regex for remote ip check 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 --- 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; } });