> 
> First easiest solution: Have you tried playing with groups?  Have the
> per-user directories owned by the same group that the webserver runs
> as ( I run my apache as apache:apache ) and chmod 664 ... 
> 
> Before doing that - run a test LWP program to see if getstore checks
> permissions on the target directory itself, or relies on the
> underlying filesystem calls to fail?  

Yeah -- I think groups is the easiest way to do it ... here's how I tested.

1)  Create a new user and group to hold the test program 
# useradd -g testuser -c'Test User' .... testuser

2)  Create a directory to simulate the per-user directory
# mkdir -p /tmp/users/homer

3) set permissions and ownership on that test directory
# chown homer:testuser /tmp/users/homer
# chmod 775 /tmp/users/homer 

(Note I made a mistake in my earlier email .. 664 is a Bad Idea for
directories .. my bad))

4) Become testuser
# su testuser 
% whoami
testuser
% groups
testuser
% perl /tmp/getstore.pl
200 at getstore.pl line 11.

5) Celebrate success!

......................... BEGIN PERL PROGRAM ...........................
#!/usr/bin/perl

use strict;
use warnings;
use LWP::Simple;

use constant URL => 'http://cluon.com/lawrence/index.en.html';

use constant FILE => '/tmp/users/homer/index.html'; 

warn getstore( URL, FILE ) || die "Could not get the file"; 


.......................... END PERL PROGRAM ............................

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
        Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g
Computer  software  consists of  only  two  components: ones  and
zeros, in roughly equal proportions.   All that is required is to
sort them into the correct order.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to