[Templates] relative path problem

Paul Makepeace tt2.org@paulm.com
Thu, 28 Mar 2002 10:46:25 -0800


I'm sure I'm misunderstanding something basic here,

schedule/index.xml contains,

[% INCLUDE "../contact/location.xml" %]

which fails with,

[Thu Mar 28 10:37:34 2002] [error] access to /home/paulm/html/paulm.com/schedule/index.html failed for host213-123-113-30.in-addr.btopenworld.com, reason: Template error: file error - ../contact/location.xml: No such file or directory for
'index.html' in (
	/home/paulm/html/paulm.com/schedule
	/home/paulm/html/paulm.com
	/var/lib/mailman/archives)

(which are the paths in INCLUDE_PATH)

$ ls -s /home/paulm/html/paulm.com/schedule/../contact/location.xml
   4 /home/paulm/html/paulm.com/schedule/../contact/location.xml
$

i.e. it's there.

I have RELATIVE => 1. This INCLUDE works with an absolute path. So,
where is TT looking for "../contact/location.xml"?

**

Reading back through the archives there was discussion of the dangers of
relative paths with abuses like ../../../etc/passwd. Two suggestions
come to mind: one is setting a JAIL_PATH or something to that effect
beyond which the search will not continue -- while ($search_path =~
/^$JAIL_PATH/). Another one that I don't like as much is putting a
limit on the number of ../ from any given position.

Paul


--
Paul Makepeace ....................................... http://paulm.com/

"If the stars are a projections of a trillion souls, then hold on
 tightly!"
   -- http://paulm.com/toys/surrealism/