Skip Menu |

This queue is for tickets about the PAR CPAN distribution.

Report information
The Basics
Id: 25424
Status: rejected
Priority: 0/
Queue: PAR

People
Owner: Nobody in particular
Requestors: juergen.zahrer [...] gmx.at
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: non root user unpacking into /tmp/par-SYSTEM
Date: Wed, 14 Mar 2007 09:38:10 +0100
To: bug-par [...] rt.cpan.org
From: Juergen Zahrer <juergen.zahrer [...] gmx.at>
hi there, 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... -juergen zahrer salzburg, austria
From: SMUELLER [...] cpan.org
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
I'm marking this bug as rejected since there hasn't been a response from the requestor for a full year.