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

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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? Andreas - -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK - ------------------------------------------------------------------------ E-Publishing, Python, Zope & Plone development, Consulting -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkmJv30ACgkQCJIWIbr9KYwFVACbBM1JaanJvokkXLwcyMc6Dc4y FCoAoIfG2qniHaLZbxS3OeGzh2fZkffe =g4Ta -----END PGP SIGNATURE-----

On Feb 4, 2009, at 11:17 AM, Andreas Jung wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
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?
I'll answer the problem, not the question. (I don't think setuptools should ever write to a user's home directory, whatever the user.) The easiest way to solve this problem is to use unzipped eggs, which also import faster in my experience. Buildout now has a global option (unzip = true) that causes all eggs it installs to be unzipped. Jim -- Jim Fulton Zope Corporation

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)
participants (3)
-
Andreas Jung
-
Jim Fulton
-
Marius Gedminas