From 89b3bb7e38ffd78a4e3b3609c685a23a431f1be5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 22 Jul 2008 17:38:31 -0400 Subject: check for absolute paths --- IkiWiki/Plugin/rename.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'IkiWiki') 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"))); } -- cgit v1.2.3