diff --git a/PVE/Storage/DirPlugin.pm b/PVE/Storage/DirPlugin.pm index 23cb6bb..ab9e4bd 100644 --- a/PVE/Storage/DirPlugin.pm +++ b/PVE/Storage/DirPlugin.pm @@ -62,5 +62,14 @@ sub activate_storage { $class->SUPER::activate_storage($storeid, $scfg, $cache); } +sub check_config { + my ($self, $sectionId, $config, $create, $skipSchemaCheck) = @_; + my $opts = PVE::SectionConfig::check_config($self, $sectionId, $config, $create, $skipSchemaCheck); + return $opts if !$create; + if ($opts->{path} !~ m@^/[-/a-zA-Z0-9_.]+$@) { + die "illegal path for directory storage: $opts->{path}\n"; + } + return $opts; +} 1;