diff options
author | Christopher Baines <mail@cbaines.net> | 2014-06-24 16:02:26 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2015-02-28 12:41:30 +0000 |
commit | 2b4ab4548c80e608d08602ca4c60cb41e71ff3b2 (patch) | |
tree | 62d9cf8fcf8ddc5ab97c5bd8dd77bf8b07598064 | |
parent | d41d958ec2ebd504c82452594110bc11698f71e1 (diff) | |
download | ikiwiki-git-annex-album.tar ikiwiki-git-annex-album.tar.gz |
Make ignoring symlinks configurablegit-annex-album
-rw-r--r-- | IkiWiki.pm | 9 | ||||
-rw-r--r-- | IkiWiki/Render.pm | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index be3dfce39..69aeba93d 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -520,6 +520,13 @@ sub getsetup () { safe => 0, rebuild => 0, }, + allow_symlinks => { + type => "boolean", + default => 0, + description => "allow symlinks in the repository", + safe => 0, + rebuild => 0, + }, cookiejar => { type => "string", default => { file => "$ENV{HOME}/.ikiwiki/cookies" }, @@ -912,7 +919,7 @@ sub readfile ($;$$) { my $binary=shift; my $wantfd=shift; - if (-l $file) { + if (!$config{allow_symlinks} and -l $file) { error("cannot read a symlink ($file)"); } diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index fa2940b01..0e6491e32 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -317,7 +317,8 @@ sub find_src_files (;$$$) { my $helper=sub { my $file=decode_utf8($_); - return if -l $file || -d _; + return if -d $file; + return if !$config{allow_symlinks} and -l $file; $file=~s/^\.\///; return if ! length $file; $page = pagename($file); |