[Catalyst] Cached TT w/mod_perl issue? Or just a Toby-bug?

Wade.Stuart at fallon.com Wade.Stuart at fallon.com
Fri Sep 23 18:08:59 CEST 2005


mkdir /path/to/ttcache
chown apacheusr:apachegrp /path/to/ttcache
chmod 770 /path/to/ttcache
chmod g+s /path/to/ttcache

This will set the stick group bit on the cache dir and  newly created files will gain the paths groupid in the cache dir.

-wade
--------------------------
Sent from my BlackBerry Wireless Handheld



----- Original Message -----
From: catalyst-bounces
Sent: 09/23/2005 11:07 AM
To: The elegant MVC web framework <catalyst at lists.rawmode.org>
Subject: Re: [Catalyst] Cached TT w/mod_perl issue? Or just a Toby-bug?

On Fri, Sep 23, 2005 at 03:46:17PM +0100, Toby Corkindale wrote:
> Hi, I just wondered if anyone had any thoughts on the below problem?
> It basically just comes down to this issue:
> 1) apache w/mod_perl starts up, running as root, and initialises some parts of
> the Catalyst system.
> 2) TT's cache directory is created as root, and a tree is created underneath
> it, also owned by root.
> 3) Apache setuid()s to the apache user
> 4) Catalyst can no-longer write to the TT cache directory, as it has
> insufficient permissions.
> 
> 
> I can work around this by doing a chown apache of the Catalyst cache dir
> during startup, but this seems poor form.. Plus requires to know what the
> apache user's name is in advance, which potentially varies between
> distributions.
> 
> Is there a more sensible way to do this?
> 
> Note that using $> doesn't work, as you have already set the TT cache dir in
> the config during the initialisation as root (euid=0), before the setuid
> occurs.

Delay MyApp->setup until a PerlChildInitHandler?

Or have the TT cache dir set to a *group* apache can write to and setgid
so the permissions propagate so group write sorts the problem.

-- 
     Matt S Trout       Specialists in perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

_______________________________________________
Catalyst mailing list
Catalyst at lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst



More information about the Catalyst mailing list