]> git.proxmox.com Git - pve-common.git/commitdiff
use package libstring-shellquote-perl
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 25 Oct 2011 11:35:08 +0000 (13:35 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 25 Oct 2011 11:35:08 +0000 (13:35 +0200)
data/PVE/Tools.pm
debian/control

index 1daf1a272caefd8da26f86fe82896c097b2fcc33..03249439d72dd7da7a859dacf37ab70138097ae6 100644 (file)
@@ -14,6 +14,7 @@ use URI::Escape;
 use Encode;
 use Digest::SHA1;
 use Text::ParseWords;
+use String::ShellQuote;
 
 our @EXPORT_OK = qw(
 lock_file 
@@ -691,23 +692,7 @@ sub random_ether_addr {
 sub shellquote {
     my $str = shift;
 
-    return "''" if !defined ($str) || ($str eq '');
-    
-    die "unable to quote string containing null (\\000) bytes"
-       if $str =~ m/\x00/;
-
-    # from String::ShellQuote
-    if ($str =~ m|[^\w!%+,\-./:@^]|) {
-
-       # ' -> '\''
-       $str =~ s/'/'\\''/g;
-
-       $str = "'$str'";
-       $str =~ s/^''//;
-       $str =~ s/''$//;
-    }
-
-    return $str;
+    return String::ShellQuote::shell_quote($str);
 }
 
 # split an shell argument string into an array,
index 9d7b69528bac5484af17c46ec62a4c563b13e7cb..496b2712c3f2d592195236e5e40b65a81a863c32 100644 (file)
@@ -7,6 +7,6 @@ Standards-Version: 3.8.4
 
 Package: libpve-common-perl
 Architecture: all
-Depends: ${perl:Depends} ${misc:Depends}, libdevel-cycle-perl, libwww-perl, libjson-perl, liblinux-inotify2-perl, libio-stringy-perl, liburi-perl, libdigest-sha1-perl
+Depends: ${perl:Depends} ${misc:Depends}, libdevel-cycle-perl, libwww-perl, libjson-perl, liblinux-inotify2-perl, libio-stringy-perl, liburi-perl, libdigest-sha1-perl, libstring-shellquote-perl
 Description: Proxmox VE base library
  This package contains the base library used by other Proxmox VE components.