From 0dfd9adf2bb6cb843d79680fb8dd78fff9d17fb2 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Thu, 22 Dec 2022 10:15:27 +0100 Subject: [PATCH] make sure absolute package paths start with a slash and are readable files --- mmdebstrap | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mmdebstrap b/mmdebstrap index 9cbc8e3..5c870bb 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -4363,9 +4363,15 @@ sub main() { if (!defined $pkg) { error "cannot resolve absolute path of $pkg: $!"; } + if ($pkg !~ /^\//) { + error "absolute path of $pkg doesn't start with a slash"; + } if (!-f $pkg) { error "$pkg is not an existing file"; } + if (!-r $pkg) { + error "$pkg is not readable"; + } return $pkg; }; if ($opt_value =~ /^[?~!(]/) {