setfsuid() and python 2.5.4
        Posted  
        
            by user331398
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user331398
        
        
        
        Published on 2010-05-03T12:33:57Z
        Indexed on 
            2010/05/03
            12:38 UTC
        
        
        Read the original article
        Hit count: 174
        
python
|operating-system
Hi,
I'm trying to use setfsuid() with python 2.5.4 and RHEL 5.4. Since it's not included in the os module, I wrapped it in a C module of my own and installed it as a python extension module using distutils.
However when I try to use it I don't get the expected result. setfsuid() returns value indicating success (changing from a superuser), but I can't access files to which only the newly set user should have user access (using open()), indicating that fsuid was not truely changed.
I tried to verify setfsuid() worked, by running it consecutively twice with the same user input The result was as if nothing had changed, and on every call the returned value was of old user id different from the new one. I also called getpid() from the module, and from the python script, both returned the same id. so this is not the problem.
Just in case it's significant, I should note that I'm doing all of this from within an Apache daemon process (WSGI).
Anyone can provide an explanation to that? Thank you
© Stack Overflow or respective owner