]> git.proxmox.com Git - pve-common.git/commitdiff
use better regex for remote ip check
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 3 Nov 2016 13:22:55 +0000 (14:22 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 9 Nov 2016 11:50:32 +0000 (12:50 +0100)
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@proxmox.com>
src/PVE/AbstractMigrate.pm

index b58d45947b7b8455e711ef65b911411ed6943449..140b4796f3a0f1a9291a3ef20fe2b6b74768c731 100644 (file)
@@ -95,8 +95,7 @@ sub get_remote_migration_ip {
     PVE::Tools::run_command($cmd, outfunc => sub {
        my $line = shift;
 
     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;
        }
     });
           $ip = $1;
        }
     });