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

Re: Apache: adding massive amount of users for .htaccess from text file



On Fri, Feb 20, 2004 at 04:05:15PM +0100, Erik D?rnbach wrote:
> Hi again,
> 
> > untested, quick and dirty
> > 
> > #!/usr/bin/perl
> > 
> > while (<>) {
> >    ($username, $password)=split /:/, $_, 2;

	chomp($password);

> >    system("/usr/bin/htpasswd", "-b", "/path/to/htaccess", 
> > $username, $password);
> > }

> Mmmh, I'm not sure why, it looks right, but now I noticed, it doesn't
> work. The output looks okay, if I change the password of one user
> manually in the same htaccess (user:crytpass) it works again for that
> user. Maybe something wrong gets parsed after the split part (which I
> don't understand myself) into the password?

  There's a trailing newline on the end of the "password" variable,
 that makes your hash correspond to something different than what
 you expect.

Steve
--
Edinburgh System Administrator & Debian Developer
Looking for an interesting Job - http://www.steve.org.uk/



Reply to: