diff options
author | Sitaram Chamarty <sitaram@atc.tcs.com> | 2014-08-18 10:54:13 +0530 |
---|---|---|
committer | Sitaram Chamarty <sitaram@atc.tcs.com> | 2014-08-18 12:18:24 +0530 |
commit | 76127e3a52690b47575f2f66dfc258b73c059d22 (patch) | |
tree | e2033b2cb7d5c9abd0fb2bad9303e069d8b55d2f /install | |
parent | dc8b590a0562ab7dc4bdab9511fe6c31cb422ae8 (diff) |
enforce the full path requirement in 'install'
Diffstat (limited to 'install')
-rwxr-xr-x | install | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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(); } |