From: Joey Hess Date: Tue, 22 Jul 2008 21:38:31 +0000 (-0400) Subject: check for absolute paths X-Git-Tag: 2.55~69 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=89b3bb7e38ffd78a4e3b3609c685a23a431f1be5;p=ikiwiki.git check for absolute paths --- diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index fd0bd3ae8..126c7ba13 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -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"))); }