Hallo Jürgen,
On Wed Mar 14 04:38:31 2007, juergen.zahrer@gmx.at wrote:
Show quoted text> i have a redhat el4/centos 4 system running apache as user apache.
> after starting the server it switches from root to user apache; a login
> or su to apache is not possible.
> if a par cgi script is called, it unpacks into /tmp/par-SYSTEM with
> apaches's uid and guid.
> now the problem: if there are other par scripts started the same way
> before (switching user after start), there are permission problems at
> /tmp/par-SYSTEM: first come first serve...
I'm not sure this is 100% a PAR::Packer bug. The logic for determining
the temporary directory is as follows:
- If it's set via an environment variable, that directory is used. (The
PAR::Environment documentation has details on this.)
- If not, it tries to determine the system temp dir from various ENV
vars. In your case this succeeds: /tmp/
- Given a system temp. path, it tries to determine the username.
--> first, it tries getpwuid() if available. (This happens in
myldr/usernamefrompwuid.c for pp'd exes.) I don't know *why* this fails,
but I suspect it's related to the unusual context in which apache runs
CGIs. I lack the expertise to diagnose this.
--> Then, it looks at environment variables: USER and USERNAME. If those
are defined, their value is used (==> /tmp/par-$username)
--> If that fails, the username is set to "SYSTEM".
Would it be possible to set $ENV{USER} as normally done for sessions?
Steffen