1 If the srcdir is a symlink, Ikiwiki will not render the pages unless the srcdir has a trailing slash.
8 REALSRCDIR=~/tmp/ikiwiki/wikiwc2
9 SRCDIR=~/tmp/ikiwiki/wikiwc
10 DESTDIR=~/tmp/ikiwiki/public_html/wiki/
12 echo "*** Testing without trailing slash."
14 rm -rf $REALSRCDIR $SRCDIR $DESTDIR
16 # Create the real srcdir and link the srcdir to it
18 ln -s $REALSRCDIR $SRCDIR
22 echo Test > $SRCDIR/index.mdwn
24 # No trailing slash after $SRCDIR
25 ikiwiki --verbose $SRCDIR $DESTDIR --url=http://example.org/~you/wiki/ --underlaydir /dev/null
27 echo "*** Testing with trailing slash."
29 rm -rf $REALSRCDIR $SRCDIR $DESTDIR
31 # Create the real srcdir and link the srcdir to it
33 ln -s $REALSRCDIR $SRCDIR
37 echo Test > $SRCDIR/index.mdwn
39 # Trailing slash after $SRCDIR
40 ikiwiki --verbose $SRCDIR/ $DESTDIR --url=http://example.org/~you/wiki/ --underlaydir /dev/null
44 + REALSRCDIR=/home/svend/tmp/ikiwiki/wikiwc2
45 + SRCDIR=/home/svend/tmp/ikiwiki/wikiwc
46 + DESTDIR=/home/svend/tmp/ikiwiki/public_html/wiki/
47 + echo '*** Testing without trailing slash.'
48 *** Testing without trailing slash.
49 + rm -rf /home/svend/tmp/ikiwiki/wikiwc2 /home/svend/tmp/ikiwiki/wikiwc /home/svend/tmp/ikiwiki/public_html/wiki/
50 + mkdir -p /home/svend/tmp/ikiwiki/wikiwc2
51 + ln -s /home/svend/tmp/ikiwiki/wikiwc2 /home/svend/tmp/ikiwiki/wikiwc
52 + mkdir -p /home/svend/tmp/ikiwiki/public_html/wiki/
54 + ikiwiki --verbose /home/svend/tmp/ikiwiki/wikiwc /home/svend/tmp/ikiwiki/public_html/wiki/ --url=http://example.org/~you/wiki/ --underlaydir /dev/null
55 + echo '*** Testing with trailing slash.'
56 *** Testing with trailing slash.
57 + rm -rf /home/svend/tmp/ikiwiki/wikiwc2 /home/svend/tmp/ikiwiki/wikiwc /home/svend/tmp/ikiwiki/public_html/wiki/
58 + mkdir -p /home/svend/tmp/ikiwiki/wikiwc2
59 + ln -s /home/svend/tmp/ikiwiki/wikiwc2 /home/svend/tmp/ikiwiki/wikiwc
60 + mkdir -p /home/svend/tmp/ikiwiki/public_html/wiki/
62 + ikiwiki --verbose /home/svend/tmp/ikiwiki/wikiwc/ /home/svend/tmp/ikiwiki/public_html/wiki/ --url=http://example.org/~you/wiki/ --underlaydir /dev/null
66 Note that index.mdwn was only rendered when srcdir had a trailing slash.
68 > There are potential [[security]] issues with ikiwiki following a symlink,
69 > even if it's just a symlink at the top level of the srcdir.
70 > Consider ikiwiki.info's own setup, where the srcdir is ikiwiki/doc,
71 > checked out of revision control. A malicious committer could convert
72 > ikiwiki/doc into a symlink to /etc, then ikiwiki would happily publish
73 > all of /etc to the web.
75 > This kind of attack is why ikiwiki does not let File::Find follow
76 > symlinks when scanning the srcdir. By appending the slash, you're
77 > actually bypassing that check. Ikiwiki should not let you set
78 > up a potentially insecure configuration like that. More discussion of
79 > this hole [[here|security#index29h2]], and I've had to release
80 > a version of ikiwiki that explicitly checks for that, and fails to work.
81 > Sorry, but security trumps convenience. [[done]] --[[Joey]]