[pve-devel] applied: [PATCH RFC storage 2/2] extract_vzdump_config: handle RE consistently
Wolfgang Bumiller
w.bumiller at proxmox.com
Fri Jan 20 11:21:53 CET 2017
applied
On Fri, Jan 20, 2017 at 10:03:34AM +0100, Fabian Grünbichler wrote:
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> ---
> RFC because I am not 100% sure about the first hunk - I checked all the callers,
> the pass in quoted REs so it should be correct?
Should work either way, =~ should promote strings to REs anyway.
> PVE/Storage.pm | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/PVE/Storage.pm b/PVE/Storage.pm
> index b9ea42a..eb7000f 100755
> --- a/PVE/Storage.pm
> +++ b/PVE/Storage.pm
> @@ -1327,7 +1327,7 @@ sub extract_vzdump_config_tar {
>
> my $file;
> while (defined($file = <$fh>)) {
> - if ($file =~ m!$conf_re!) {
> + if ($file =~ $conf_re) {
> $file = $1; # untaint
> last;
> }
> @@ -1414,7 +1414,7 @@ sub extract_vzdump_config {
> my $archive = abs_filesystem_path($cfg, $volid);
>
> if ($volid =~ /vzdump-(lxc|openvz)-\d+-(\d{4})_(\d{2})_(\d{2})-(\d{2})_(\d{2})_(\d{2})\.(tgz|(tar(\.(gz|lzo))?))$/) {
> - return extract_vzdump_config_tar($archive,'^(\./etc/vzdump/(pct|vps)\.conf)$');
> + return extract_vzdump_config_tar($archive, qr!^(\./etc/vzdump/(pct|vps)\.conf)$!);
> } elsif ($volid =~ /vzdump-qemu-\d+-(\d{4})_(\d{2})_(\d{2})-(\d{2})_(\d{2})_(\d{2})\.(tgz|((tar|vma)(\.(gz|lzo))?))$/) {
> my $format;
> my $comp;
> --
> 2.1.4
More information about the pve-devel
mailing list