[Distutils] [jerome: Re: real vs effective user id]

Jerome Alet alet at librelogiciel.com
Mon Jun 11 22:18:54 CEST 2007

On Mon, Jun 11, 2007 at 04:00:34PM -0400, Phillip J. Eby wrote:
> >
> >Wouldn't it be better to use the effective user id when expanding
> >the user's home directory in setuptools or in Python ?
> That wouldn't fix your problem.  The egg cache location is determined 
> exactly *once* for the life of the process, unless you explicitly 
> create and use ResourceManagers -- and unfortunately the process of 
> importing C code from a zipped egg uses only the default ResourceManager.

So you mean that if for example another (different) module installed 
with setuptools was imported *before* the seteuid() call, then the 
mysqldb module import (done *after* the seteuid() call) would 
succeed ? 

Not sure if it was clear in my previous message, but the 
problem is that the import statement fails, while the very same 
import done when the very same module was installed the 'classic' 
(not through setuptools) way succeeds, because a 'classic' install import
doesn't try to write to an user's home directory.

How do you want developers to plan for this sort of things ?

Then maybe setuptools should continue to work without creating/writing
any file in an user's .python-eggs directory if this is not allowed
to do so because of permissions (or different effective user).

Instead it fails hard. Any plan to improve this ?

NB : I don't know if this is possible or not, I just ask.


Jerome Alet

More information about the Distutils-SIG mailing list