[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Environment for the www-data user during post-commit.

From: Jeremy Pereira <jeremy.pereira_at_ntlworld.com>
Date: 2005-01-05 18:41:19 CET

To me that looks like a security feature. When Apache launches a
script, it deliberately gives it a minimal environment.

You need to take steps to source the correct profile from within your
script. I don't know if you can do that directly in Python but you
could wrap your Python script in a shell script that looks something
like this:

#!/bin/sh

# Note the dot and the space at the front in the command below.

. /home/www-data/.profile # or whatever script the env vars are set in

/full/path/name/to/my-python-script.py # add args on as necessary

# end of script

On Jan 5, 2005, at 01:02, Teo Romera wrote:

> Hi all:
>
> We have a little problem with Subversion which is getting quite
> annoying. Maybe anyone has suffered it before and can give us a hand.
>
> The software that we are developing has a web interface that users use
> to upload some documents to the system. This web interface commits the
> uploaded documents to a Subversion repository. We have written a
> post-commit python script from scratch that makes some processing from
> the uploaded documents.
>
> If we go to a shell and su to www-data, we can launch "manually" the
> post-commit script and find that everything works as expected and the
> processing from the documents is done. Everything works fine.
>
> Here comes the problem. Once the post-commit script starts because a
> commit has been done in the web interface, environment variables for
> the
> www-data user do not hold the expected values. It looks like when
> Apache
> launches post-commit www-data user does not have the shame values in
> its
> environment variables.
>
> For example, printing the value of PATH from our python script shows
> something different from what www-data user has in his PATH variable
> when you su to www-data in a shell.
>
> We would like to know if there is a way to configure apache so that we
> can tell exactly what values the environment variables will hold during
> post-commit.
>
> Our Subversion repository is installed in a Debian GNU/Linux Sarge 3.0
> machine. Subversion version is 1.0.6..
>
> Any suggestions?
>
> TIA
> --
> Teo Romera <teo@gsyc.escet.urjc.es>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
>

--
Jeremy Pereira
http://www.jeremyp.net
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jan 5 18:51:07 2005

This is an archived mail posted to the Subversion Users mailing list.