Allow a dot as long as its not followed by another dot and enforce
max component and (a reduced) max path length checking already at
schema level.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
sub verify_dir_override {
my ($value, $noerr) = @_;
- if ($value =~ m/^([a-z]+)=[^.]+$/ && verify_content($1, $noerr)) {
- return $value;
+ if ($value =~ m/^([a-z]+)=([^.]*(?:\.?[^.]+)+)$/) {
+ my ($content_type, $relative_path) = ($1, $2);
+ if (verify_content($content_type, $noerr)) {
+ # linux has 4k max-path, but limit total length to lower as its concat'd for full path
+ if (length($relative_path) < 1023 && !(grep { length($_) >= 255 } split('/', $relative_path))) {
+ return $value;
+ }
+ }
}
return undef if $noerr;