mirror of https://github.com/digint/btrbk
btrbk: disallow newline in files
While most functionality works fine, raw backups fail to write correct "FILE=" information in info sidecar. Disallowing newlines in files is a good idea in general.pull/504/merge
parent
87ed9ffeb5
commit
7a4a54db97
5
btrbk
5
btrbk
|
@ -3768,7 +3768,10 @@ sub check_file($$;@)
|
|||
die("accept_type must contain either 'relative' or 'absolute'");
|
||||
}
|
||||
|
||||
# check directory traversal
|
||||
if($file =~ /\n/) {
|
||||
ERROR "Unsupported newline in file ${error_statement}: " . ($file =~ s/\n/\\n/gr) if(defined($error_statement));
|
||||
return undef;
|
||||
}
|
||||
if(($file =~ /^\.\.$/) || ($file =~ /^\.\.\//) || ($file =~ /\/\.\.\//) || ($file =~ /\/\.\.$/)) {
|
||||
ERROR "Illegal directory traversal ${error_statement}: $file" if(defined($error_statement));
|
||||
return undef;
|
||||
|
|
Loading…
Reference in New Issue