]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/ikiwiki_ignores_PATH_environment.mdwn
(no commit message)
[ikiwiki.git] / doc / bugs / ikiwiki_ignores_PATH_environment.mdwn
1 At the very top of the main ikiwiki executable script the `PATH` environment is set like this:
2
3     $ENV{PATH}="/usr/local/bin:/usr/bin:/bin:/opt/local/bin";
4
5 This makes it a little hard to specify which specific binaries should be used, especially if there is more than one of them available (see c.f. <http://trac.macports.org/ticket/26333> where the MacPorts-supplied, up-to-date subversion should be used and not an arcane one from the base distro / OS). Is there a specific reason why ikiwiki wipes out `$PATH` like this or could that line be improved to
6
7     $ENV{PATH}="$ENV{PATH}:/usr/local/bin:/usr/bin:/bin:/opt/local/bin";
8
9 ? The alternative is of course to patch ikiwiki as suggested in the bug, but I wanted to ask here first :)
10
11 > You can use the ENV setting in your setup file to set any environment
12 > variables you like. Since ikiwiki.cgi is run by the web browser, that
13 > is the best way to ensure ikiwiki always runs with a given variable set.
14
15 > As a suid program, the ikiwiki wrappers have to sanitize the environment.
16 > The ikiwiki script's own sanitization of PATH was done to make perl taint
17 > checking happy, but as taint checking is disabled anyway, I have removed
18 > that. [[done]] --[[Joey]] 
19
20 Question: Do ikiwiki.cgi and the RCS post-commit script sanitize the $PATH separately from bin/ikiwiki?  If not, then bin/ikiwiki is probably right to sanitize the $PATH; otherwise you've created a security hole with access to the account that ikiwiki is SUID to. It'd be nice if /opt/local/bin were earlier in the $PATH, but that can be changed (as noted) in the setup file. [[Glenn|geychaner@mac.com]] (Also the person who started this by filing an issue with MacPorts; I'm experimenting with ikiwiki for collaborative documentation.)
21
22 > The suid wrappers remove all environment variables except for a few used
23 > for CGI. PATH is not propigated by them, so when they run ikiwiki it will
24 > get the system's default path now. --[[Joey]]