> Hello,
> 
> I am trying to write a set of scripts that will allow multiple users
> to log in via one generic login url (htaccess) and once they are in
> they can use forms to type in a url of a file on the internet, the
> scripts will get that file and put it into their personal webspace on
> the local server and make it available via http://servername/username.
>  I have the login and the $remote_user variable shows their username
> that they loged in with.  I want them to own their home directory for
> security purposes, but if I use getstore, it will only work if the
> directory it is saving too is owned by 'www' .  I have looked into
> suEXEC, but that doesn't seem to fit my needs being that it must be in
> a virtual host or a public_html directory.  Does anyone have any idea
> how I can do this?
> 

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?  

Second much more complex, sexy, all-singing/all-dancing solution:
Rather than give Apache permission to write all over (even parts of)
the filesystem, delegate that task to some OTHER script.  (This is
just my personal bias: Any time the webserver has to create a file
somewhere in the file system, I feel I have inadequately designed my
data.)

The CGI program creates a file (or database, if that is your nature)
with a list of files awaiting transfer.  Some OTHER (smaller, more
easily provable correct) process, owned by a more powerful user (or
belonging to a more powerful group) actually does the heavy lifting
with getstore().

Doing it with files (and locking) is Educational, but painful to
test/debug.  Doing it with a database is easier, *IF* you already have
climbed the anthill of setting up a database on the machine.

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
        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