Apache::Htpasswd question

Discussion in 'Perl Misc' started by shawn modersohn, Sep 21, 2006.

  1. The user name is admin and the pass is John1 generated by htpasswd
    #!/usr/bin/perl
    use strict;
    use Apache::Htpasswd;
    my $foo = Apache::Htpasswd->new({
    passwdFile =>'/tmp/passfile',
    ReadOnly => 1,
    UseMD5 => 1,
    });
    print $foo->htCheckPassword("admin", "none");
    This outputs 0 as expected.

    When I say
    print $foo->htCheckPassword("admin", "John1");
    This outputs 1 as expected

    However, when I say
    print $foo->htCheckPassword("admin", "John");
    I still get 1.

    I don't understand.
    shawn modersohn, Sep 21, 2006
    #1
    1. Advertising

  2. shawn modersohn

    Guest

    shawn modersohn <> wrote:
    > The user name is admin and the pass is John1 generated by htpasswd
    > #!/usr/bin/perl
    > use strict;
    > use Apache::Htpasswd;
    > my $foo = Apache::Htpasswd->new({
    > passwdFile =>'/tmp/passfile',
    > ReadOnly => 1,
    > UseMD5 => 1,
    > });
    > print $foo->htCheckPassword("admin", "none");
    > This outputs 0 as expected.
    >
    > When I say
    > print $foo->htCheckPassword("admin", "John1");
    > This outputs 1 as expected
    >
    > However, when I say
    > print $foo->htCheckPassword("admin", "John");
    > I still get 1.


    > I don't understand.


    Nor do I... I am unable to recreate your results as I get

    # using

    local $\ = "\n";

    Results:

    0
    1
    0


    Axel
    , Sep 21, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christopher Brandsdal

    Htpasswd

    Christopher Brandsdal, Dec 12, 2003, in forum: ASP General
    Replies:
    3
    Views:
    108
    Mark Schupp
    Dec 13, 2003
  2. Christopher Brandsdal

    Htpasswd

    Christopher Brandsdal, Dec 12, 2003, in forum: ASP General
    Replies:
    0
    Views:
    102
    Christopher Brandsdal
    Dec 12, 2003
  3. Anka Anka

    htpasswd

    Anka Anka, May 21, 2008, in forum: Ruby
    Replies:
    6
    Views:
    107
    Phil Thompson
    Mar 2, 2011
  4. Get htpasswd username

    , Aug 6, 2005, in forum: Perl Misc
    Replies:
    1
    Views:
    153
    Paul Lalli
    Aug 6, 2005
  5. PerlFAQ Server
    Replies:
    0
    Views:
    124
    PerlFAQ Server
    Apr 13, 2011
Loading...

Share This Page