in reply to Re^3: How to change the userid of a running external process
in thread How to change the userid of a running external process

Suexec and suphp are the reason I am trying this.

It gives loads of complications since apache keeps running as apache so generated files (like uploaded images) must have permissions in a way that apache kan read it.

And suphp sort of cancels the whole point of php (being fast) and also has many other problems.

So any of the cgi options are not what I am looking for.

And I use embperl for my own sites

I think (but I am not sure) it would all ready be much faster than suphp if I fork a child, change to the userid of the child to what I need and then let the forked child die when it is done, every request. But I still think this solution is a bad idea too.

So I am still looking for a way to have a process with root permissions change other processes userids.

Help?</?>

  • Comment on Re^4: How to change the userid of a running external process

Replies are listed 'Best First'.
Re^5: How to change the userid of a running external process
by afoken (Chancellor) on Jul 24, 2010 at 18:19 UTC
    So I am still looking for a way to have a process with root permissions change other processes userids.

    No sane operating system will let you do that. Rethink your concept.

    So any of the cgi options are not what I am looking for.

    Re-read my previous posting. I mentioned FastCGI servers. FastCGI servers and CGI programs share the three letters C, G, and I, but that's all. The ancient CGI spec and the FastCGI spec are two very different things, sharing barely more than the three letters and the idea of having four communication channels (input stream, output stream, error stream, environment variables). The most obvious difference is that programs running under the ancient CGI spec handle exactly one request and exit, whereas FastCGI servers handle as many request as they like, even in parallel, like mod_perl and other webserver plugins. Searching Google for FastCGI would have told you that.

    FastCGI servers may be started by the webserver, but they can also be managed by the operating system or daemontools. They can run under every user account you like, each server under a different one if needed. The webserver still can communicate with each of them. PHP can also run as a FastCGI server, or as one FastCGI server per needed user account.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re^5: How to change the userid of a running external process
by morgon (Priest) on Jul 22, 2010 at 22:04 UTC
    Is your problem really about the uids of running processes or is all you really need just that one process can acess the files another process has produced?

    Maybe it would suffice to have a suid-script that a process can invoke after it has created a file that does a chown so that another process can read it?