gitweb_config.perl: prevent gitweb from having a stale cwd
commit9e2fa5633c19bdb9f900e5bb3e94688d8be7f43a
authorKyle J. McKay <mackyle@gmail.com>
Sat, 26 Nov 2016 22:56:25 +0000 (26 14:56 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 26 Nov 2016 22:56:25 +0000 (26 14:56 -0800)
tree05964d4117ed7f455638ebba60e7d04d494b7205
parent3c69b21e26b646b2f4727a245c4c49f6d66db960
gitweb_config.perl: prevent gitweb from having a stale cwd

The web server starts up gitweb with the current working directory
(cwd) set to the directory the gitweb.cgi script is located in.
Gitweb itself has no requirement for any particular cwd and so it
leaves it unchanged.

However, if gitweb is running in fast CGI mode, the gitweb process
could persist for some time potentially holding on to a cwd that has
become invalid as a result of a subsequent update install.

To prevent this from happening, do a "cd /" at the end of the gitweb
configuration script.

Note that it's not really appropriate for gitweb itself to do the
"cd /" as the config script may depend on the cwd being the directory
the script is located in.  So the proper place to do "cd /" really is
in the config script.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
gitweb/gitweb_config.perl