use DNS compatible regex in upid parser
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 20 Apr 2012 06:33:21 +0000 (08:33 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 20 Apr 2012 06:33:21 +0000 (08:33 +0200)
Makefile
data/PVE/Tools.pm
debian/changelog

index 794cb39..5579b3c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 RELEASE=2.0
 
 VERSION=1.0
-PKGREL=26
+PKGREL=27
 
 PACKAGE=libpve-common-perl
 
index 5438295..403249b 100644 (file)
@@ -652,16 +652,16 @@ sub upid_decode {
     my $filename;
 
     # "UPID:$node:$pid:$pstart:$startime:$dtype:$id:$user"
-    if ($upid =~ m/^UPID:([A-Za-z][[:alnum:]\-]*[[:alnum:]]+):([0-9A-Fa-f]{8}):([0-9A-Fa-f]{8}):([0-9A-Fa-f]{8}):([^:\s]+):([^:\s]*):([^:\s]+):$/) {
+    if ($upid =~ m/^UPID:([a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?):([0-9A-Fa-f]{8}):([0-9A-Fa-f]{8}):([0-9A-Fa-f]{8}):([^:\s]+):([^:\s]*):([^:\s]+):$/) {
        $res->{node} = $1;
-       $res->{pid} = hex($2);
-       $res->{pstart} = hex($3);
-       $res->{starttime} = hex($4);
-       $res->{type} = $5;
-       $res->{id} = $6;
-       $res->{user} = $7;
-
-       my $subdir = substr($4, 7, 8);
+       $res->{pid} = hex($3);
+       $res->{pstart} = hex($4);
+       $res->{starttime} = hex($5);
+       $res->{type} = $6;
+       $res->{id} = $7;
+       $res->{user} = $8;
+
+       my $subdir = substr($5, 7, 8);
        $filename = "$pvetaskdir/$subdir/$upid";
 
     } else {
index 44796a1..504f26a 100644 (file)
@@ -1,3 +1,9 @@
+libpve-common-perl (1.0-27) unstable; urgency=low
+
+  * fix bug #172: use DNS compatible regex in upid parser
+
+ -- Proxmox Support Team <support@proxmox.com>  Fri, 20 Apr 2012 08:31:44 +0200
+
 libpve-common-perl (1.0-26) unstable; urgency=low
 
   * add Turkish keyboard mappings