Apache::Htpasswd question

S

shawn modersohn

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.
 
A

axel

shawn modersohn said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,836
Latest member
BuyBlissBitesCBD

Latest Threads

Top