From 7514b23af482511a88d2ef28914707ad937cf4d3 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 25 Oct 2011 13:35:08 +0200 Subject: [PATCH] use package libstring-shellquote-perl --- data/PVE/Tools.pm | 19 ++----------------- debian/control | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/data/PVE/Tools.pm b/data/PVE/Tools.pm index 1daf1a2..0324943 100644 --- a/data/PVE/Tools.pm +++ b/data/PVE/Tools.pm @@ -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, diff --git a/debian/control b/debian/control index 9d7b695..496b271 100644 --- a/debian/control +++ b/debian/control @@ -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. -- 2.39.2