real vs effective user id
Hi there, I've got an application which runs as root This application calls seteuid to execute part of its code as a lower priviledged user temporarily. after the seteuid call, the MySQLdb module is imported, which was installed with setuptools 0.6c6. then setuptools tries to play with root's .python-eggs directory instead of ~effective_user/.python-eggs/, because of the way os.path.expanduser() works (line 1039 in pkg_resource.py) is this a bug in setuptools, in Python, or more probably in my own application ? shouldn't Python's os.path.expanduser() call use the effective user id instead of the real one ? thanks in advance for any hint. bye Jerome Alet
At 07:12 PM 6/11/2007 +0200, Jerome Alet wrote:
Hi there,
I've got an application which runs as root
This application calls seteuid to execute part of its code as a lower priviledged user temporarily.
after the seteuid call, the MySQLdb module is imported, which was installed with setuptools 0.6c6.
then setuptools tries to play with root's .python-eggs directory instead of ~effective_user/.python-eggs/, because of the way os.path.expanduser() works (line 1039 in pkg_resource.py)
In these types of situations, it's best to set the PYTHON_EGG_CACHE path explicitly, either via the environment variable or code.
participants (2)
-
Jerome Alet -
Phillip J. Eby