check for absolute paths

master
Joey Hess 2008-07-22 17:38:31 -04:00
parent 9776bbf853
commit 89b3bb7e38
1 changed files with 3 additions and 2 deletions

View File

@ -47,8 +47,9 @@ sub check_canrename ($$$$$$$) { #{{{
error(gettext("no change to the file name was specified"));
}
# Must be a legal filename.
if (IkiWiki::file_pruned($destfile, $config{srcdir})) {
# Must be a legal filename, and not absolute.
if (IkiWiki::file_pruned($destfile, $config{srcdir}) ||
$destfile=~/^\//) {
error(sprintf(gettext("illegal name")));
}