[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: Teo Romera <teo_at_gsyc.escet.urjc.es>
Date: 2005-01-07 02:09:03 CET

El mié, 05-01-2005 a las 17:41 +0000, Jeremy Pereira escribió:
> To me that looks like a security feature. When Apache launches a
> script, it deliberately gives it a minimal environment.

Ok. I did not know that, but now we have checked it. You are right, the
environment for the script is minimal.

> 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

Thanks for the idea!! We have already tried something like your script.
That leads us to think that the problem of our script does not reside in
exporting environment variables.

When we launch the hook script from a shell it works flawlessly. But it
does not work as expected when a client commits a file. There must be
something else that is different in each situation. But i don't know
what.

Thanks for your help!

Greetings.

> 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
>

-- 
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
Received on Fri Jan 7 02:11:53 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.