aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2014-06-24 16:02:26 +0100
committerChristopher Baines <mail@cbaines.net>2015-02-28 12:38:12 +0000
commit3957bbab17874d60f2597cebcc02cda5c212067a (patch)
tree8204ac2bba4a21fe4653026716922188272a5d62
parent164d27edb5b174e9954d44006cbcdd4d5daf6c7a (diff)
downloadikiwiki-git-annex.tar
ikiwiki-git-annex.tar.gz
Make ignoring symlinks configurablegit-annex
-rw-r--r--IkiWiki.pm9
-rw-r--r--IkiWiki/Render.pm3
2 files changed, 10 insertions, 2 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 7afd57993..4f298d673 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" },
@@ -981,7 +988,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 c1a3dcbf2..4bf9f0601 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);