I'm using this module for security purposes. BUT - I wanted to do a little benchmarking on htpasswd to see how much it slows down with a *lot* of users, so I wanted to set up 100,000 user / pwd combinations. So I wrote a wee script with Apache::Htpasswd that does
my $htp = new Apache::Htpasswd;("/home/httpd/conf/.htptestaccess") my $User = 1; while ($User <= 100000) { my $pass = new String::Random; my $PassWord = $pass->randpattern("Cccccnn"); $htp->htpasswd("User_" . $User, $PassWord); $User ++; }
... which works fine for a couple of thousand user / pass combos, but then falls over for no readily-apparent reason.

Then I replaced the $htp->htpasswd call with
system 'htpasswd', '-b', '-m', '/home/httpd/conf/.htptestaccess', +$User, $PassWord;
... and now it's sweet as a nut, still chuntering away as I write this (it's up to 18,214 users, going strong).

Now, I recognise that these are not circumstances that are ever going to arise in real life: but still, this doesn't inspire confidence. I wonder if anyone else has had similar experience of Apache::Htpasswd and can either confirm or deny my uneasiness about it.

Perhaps I'm doing the module an injustice, and it's something else I'm doing wrong that's causing it to fail. But I'd like to have some reason to believe that it's not going to fall over in normal use, one time in two or three thousand calls, as it seems to do in this unusual situation.

§ George Sherston

In reply to Reliability of Apache::Htpasswd by George_Sherston

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.