diff options
author | Christopher Baines <mail@cbaines.net> | 2014-06-24 16:02:26 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2017-09-15 20:43:44 +0100 |
commit | 36bb400112b2a0914954b37e76c0a90908de6ff7 (patch) | |
tree | 7e3d5c0c6d822d98e76b555dfa29c491c0cbd95c | |
parent | 0b8ecb14147ef2f5df53eee505d17c16085aede6 (diff) | |
download | ikiwiki-git-annex-album-2.tar ikiwiki-git-annex-album-2.tar.gz |
Make ignoring symlinks configurablegit-annex-album-2
-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 1eda16da1..0d7669397 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -544,6 +544,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" }, @@ -999,7 +1006,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 e8ed627a4..dbc07d817 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -320,7 +320,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); |