Re: What to do with the htpasswd program?

Doug MacEachern (dougm@osf.org)
Thu, 29 Aug 1996 08:23:12 -0400 (EDT)

Date: Thu, 29 Aug 1996 08:23:12 -0400 (EDT)
From: Doug MacEachern <dougm@osf.org>
Subject: Re: What to do with the htpasswd program?
To: Michael Smith <mjs@cursci.co.uk>
In-Reply-To: <32255215.4046F801@cursci.co.uk>
Message-Id: <Pine.3.07.9608290810.A21459-b100000@app3.osf.org>

On Thu, 29 Aug 1996, Michael Smith wrote:

> > Actually, invoking a shell like this probably isn't the best way to
> > accomplish this task.  I suggest calling the perl function crypt() to > create your own encrypted passwords and then appending the new "user" > string to an flocked existing .htpasswd file. This seems like it would > work with fcgi.
> 
> I guess it would work, but what I wanted to achieve is a bit more
> complicated; namely I also want to be able to change existing passwords
> too.  I accept that the method you described could be made to work here
> too, but it's easier if I can get away with using existing tried &
> tested code.  Is this possible?

Yes, check out:
http://www.perl.com/cgi-bin/cpan_mod?module=HTTPD::UserAdmin

Looks like so:

my $admin = new HTTPD::UserAdmin 
    DB     => 'database_name',
    DBType => 'DBM';

$admin->add($username, $password);
$admin->update($username, $new_password);
$admin->delete($username);
...

You don't need to worry about things like crypt, salt, seeds, dbm, sql, md5
hashes, etc., it's all taken care of for you underneath.

Cheers,
-Doug

>
> Mike