[Distutils] [buildout] setuptools/buildout trying to use /root/.python-eggs after setuid()ing with Zope

Marius Gedminas marius at pov.lt
Tue Feb 10 10:09:31 CET 2009


On Wed, Feb 04, 2009 at 05:17:01PM +0100, Andreas Jung wrote:
> Hi there,
> 
> I am not sure which component is in charge for the following issue:
> 
>  - standard Plone 3.1 installation installed with paster/Zopeskel
>    with a 'zope' account without special privileges
>  - in the instance is started from through /etc/init.d as root
>    but immediately setuid to effective-user 'zope'
> 
>  - after setuid(), setuptools is trying to write to /root/.python-eggs
>    during the startup-phase for (my own) module zopyx.textindexng3
> 
> - it creates inside:
> 
> new:~/.python-eggs # ls -la
> total 1
> drwxrwxrwx  3 root root   144 Feb  4 13:17 .
> drwxr-xr-x 24 root root  1200 Feb  4 17:10 ..
> -rw-r--r--  1 zope users    0 Feb  4 13:17 a
> drwxr-xr-x  3 zope users   72 Feb  4 13:17
> zopyx.textindexng3-4.0.1-py2.4-linux-x86_64.egg-tmp
> 
> Why is setuptools using /root/.python-eggs only for this particular
> module and isn't it using something like /home/zope/.python-eggs
> instead - especially having changed the UID already?

It doesn't look at UID, it looks at $HOME.  Actually, it looks at
$PYTHON_EGG_CACHE first, so you can set that.

I had the same problem with trac and matplotlib (which doesn't have a
sane separate environment variable), and in the end had to resort to an
ugly hack in my /etc/init.d/script:

  sudo -u $NONPRIVILEGED_USER env HOME=/path/writable/to/that/user \
    start-stop-daemon --start --exec /path/to/executable -- $options

Marius Gedminas
-- 
HOST SYSTEM NOT RESPONDING, PROBABLY DOWN. DO YOU WANT TO WAIT? (Y/N)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20090210/504fdd30/attachment.pgp>


More information about the Distutils-SIG mailing list