Rush, Thomas wrote: > Hi, > > I'm struggling with the Apache-Htpasswd 1.5.3 CPAN module. > > I've used the Apache-Htgroup module and it works fine. > > When I attempt to create a new user and password using the following code: > > use strict; > use Apache::Htgroup; > use Apache::Htpasswd; > my($htdir, $htgroup, $htpass); > my($username, $password1, $password2, $name); > $username = 'smith'; > $password1 = 'passin'; > $htpass= new Apache::Htpasswd("passwords"); > $htpass->htpasswd($username, $password1); > > It returns a username and password in the password file as: > > smith:paFRj3ff4n1Vw: > > The above username/password combination can not be used as a valid login. > However all the other entries are created from the command prompt are as > follows: > > guest:$apr1$AE0.....$QA7jSdM61M4Ue.Si5jHUN. > > These entries work fine as expected. > In my mind this implies that the perl based module is not using MD5 > encryption ...or something which I've not yet thought about.
The Win32 Apache used to use crypt and then there were some issues and they switched to MD5. UNIX always used crypt (they might have other options now). Looks like the module is using crypt and you're running on Win32. You could always shell out and use htpasswd.exe (eg: untested) : system "C:/<path>/htpasswd -b $passwd_file $user $passwd"; or maybe capture it: my enc_passwd = `C:/<path>/htpasswd -s -b $passwd_file $user $passwd`; -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (Free site for Perl/Lakers) _______________________________________________ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs