more sanity checks of target directory

This commit is contained in:
Johannes Schauer Marin Rodrigues 2024-09-13 01:19:02 +02:00
parent dbce1ee27b
commit 0f5d935941
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -6615,6 +6615,12 @@ sub main() {
error "stdout is an interactive tty";
}
} else {
if (!-e dirname($options->{target})) {
error "path leading to $options->{target} does not exist";
}
if (!-d dirname($options->{target})) {
error "parent of $options->{target} is not a directory";
}
my $abs_path = abs_path($options->{target});
if (!defined $abs_path) {
error "unable to get absolute path of target directory"