[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Open Source file delivery for apache



* Derrick 'dman' Hudson <dman@dman.ddts.net> [2002-11-23 18:22]:
> I don't know of any existing system, but it should be quite trivial to
> code yourself.
> 
This depends.  It's true for the simplest approach.

> For the simplest approach use a .htpasswd file to restrict access to
> the directory containing the files.  Then write a CGI script that
> takes the user's email address, generates a random password string
> (there is some debian package to do the password generation), then
> call 'htpasswd' to add the email address as a user name and the
> password to the end of the .htpasswd file and email the person the
> password.
> 
> I expect the CGI script to be under 50 lines of code at the most.  It
> should be doable in shell (which is suitable due to the extensive use
> of external programs) but could also be done easily in python or perl.
> 
I already have a suite of C based CGI "scripts" that work perfect
together.  Since submitting the initial question, I programed exactly
what you described and tested it.  One question open to me is
concurrency: does htpasswd handle concurrency itself or do I need to
carry out locking schemes?

wbr,
Lukas
PS: When this stuff proved to work reliably for some time, I will put 
    it on <http://software.lpr.ch>.

    The reason why I always prefer C/C++ instead of any scripting
    language is performance.
-- 
Lukas Ruf
http://www.lpr.ch                                 http://www.maremma.ch    
    http://www.{{topsy,nodeos}.net,{promethos,netbeast,rawip}.org}
Wanna know anything about raw ip? Join rawip@rawip.org on www.rawip.org



Reply to: