},
maxfiles => {
description => "Deprecated: use 'prune-backups' instead. " .
- "Maximal number of backup files per VM. Use '0' for unlimted.",
+ "Maximal number of backup files per VM. Use '0' for unlimited.",
type => 'integer',
minimum => 0,
optional => 1,
# Storage implementation
# called during addition of storage (before the new storage config got written)
-# die to abort additon if there are (grave) problems
+# die to abort addition if there are (grave) problems
# NOTE: runs in a storage config *locked* context
sub on_add_hook {
my ($class, $storeid, $scfg, %param) = @_;
my $path = $scfg->{path};
- die "storage definintion has no path\n" if !$path;
+ die "storage definition has no path\n" if !$path;
my $subdir = $vtype_subdirs->{$vtype};
my ($class, $scfg, $storeid, $volname, $vmid, $snap) = @_;
# this only works for file based storage types
- die "storage definintion has no path\n" if !$scfg->{path};
+ die "storage definition has no path\n" if !$scfg->{path};
my ($vtype, $basename, $basevmid, undef, undef, $isBase, $format) =
$class->parse_volname($volname);
my ($size, $format, $used, $parent) = $info->@{qw(virtual-size format actual-size backing-filename)};
+ ($size) = ($size =~ /^(\d+)$/); #untaint
+ ($used) = ($used =~ /^(\d+)$/); #untaint
+ ($format) = ($format =~ /^([-\w]+)$/); #untaint
+ if (defined($parent)) {
+ ($parent) = ($parent =~ /^(.*)$/); #untaint
+ }
return wantarray ? ($size, $format, $used, $parent, $st->ctime) : $size;
}
my $path = $scfg->{path};
- die "storage definintion has no path\n" if !$path;
+ die "storage definition has no path\n" if !$path;
my $timeout = 2;
my $res = PVE::Tools::df($path, $timeout);
my $path = $scfg->{path};
- die "storage definintion has no path\n" if !$path;
+ die "storage definition has no path\n" if !$path;
# this path test may hang indefinitely on unresponsive mounts
my $timeout = 2;