summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-22 17:38:31 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-22 17:38:31 -0400
commit89b3bb7e38ffd78a4e3b3609c685a23a431f1be5 (patch)
tree38af4e2de3f66b154a15e60167fca336aff97317 /IkiWiki
parent9776bbf8532d0a952e907c160dc31ce27c0d08e5 (diff)
check for absolute paths
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/rename.pm5
1 files changed, 3 insertions, 2 deletions
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")));
}