summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2016-05-06 15:28:17 +0000
committerintrigeri <intrigeri@boum.org>2016-05-06 15:28:17 +0000
commite79360206c865e104609116eb78d3d243e8d77dd (patch)
tree0148a60468c745ccdc4680668053cfc5ec949f03
parent002f1eba525d9341cc1da69784acf6a488b7b525 (diff)
Explicitly abort early in unsupported use case.
Some of the $suite mangling is buggy when passed a relative directory as $archive+dir (at least, it does when passed '.').
-rwxr-xr-xfiles/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots6
1 files changed, 6 insertions, 0 deletions
diff --git a/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots b/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots
index 8f7beda..31706ba 100755
--- a/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots
+++ b/files/reprepro/snapshots/time_based/tails-delete-expired-apt-snapshots
@@ -50,6 +50,12 @@ if (! -d $archive_dir) {
usage();
}
+if ($archive_dir !~ m{\A [/]}xms {
+ print "E: specified archive directory ($archive_dir) isn't an absolute path\n";
+ usage();
+}
+
+
if (! -d "$archive_dir/dists" ) {
print "E: specified archive directory has no dists/ subdirectory\n";
usage();