check for absolute paths
authorJoey Hess <joey@kodama.kitenet.net>
Tue, 22 Jul 2008 21:38:31 +0000 (17:38 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 22 Jul 2008 21:38:31 +0000 (17:38 -0400)
IkiWiki/Plugin/rename.pm

index fd0bd3ae848b7399053726e8d28e316e772c9197..126c7ba13b96c6262497bfe983dd3fc63a402dc0 100644 (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")));
                }