summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorSitaram Chamarty <sitaram@atc.tcs.com>2014-08-18 10:54:13 +0530
committerSitaram Chamarty <sitaram@atc.tcs.com>2014-08-18 12:18:24 +0530
commit76127e3a52690b47575f2f66dfc258b73c059d22 (patch)
treee2033b2cb7d5c9abd0fb2bad9303e069d8b55d2f /install
parentdc8b590a0562ab7dc4bdab9511fe6c31cb422ae8 (diff)
enforce the full path requirement in 'install'
Diffstat (limited to 'install')
-rwxr-xr-xinstall7
1 files changed, 6 insertions, 1 deletions
diff --git a/install b/install
index 513dd71..98d8aee 100755
--- a/install
+++ b/install
@@ -54,7 +54,12 @@ GetOptions(
usage() if $to and $ln or $help;
$ln = "$ENV{HOME}/bin" if defined($ln) and not $ln;
for my $d ($ln, $to) {
- if ($d and not -d $d) {
+ next unless $d; # ignore empty values
+ unless ( $d =~ m(^/) ) {
+ print STDERR "FATAL: please use an absolute path, not a relative path\n";
+ usage();
+ }
+ if ( not -d $d ) {
print STDERR "FATAL: '$d' does not exist.\n";
usage();
}